Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const CrewMember = Record({
name: String,
age: NonNegative,
rank: Rank,
home: Planet,
});
type CrewMember = Static<
typeof CrewMember
>; /* = {
name: string;
age: NonNegative;
rank: Rank;
home: Planet;
}*/
const Ship = Record({
type: Literal('ship'),
location: Vector,
mass: NonNegative,
name: String,
crew: Array(CrewMember),
});
type Ship = Static<
typeof Ship
>; /* = {
type: 'ship';
location: Vector;
mass: NonNegative;
name: string;
crew: CrewMember[];
}*/
trendingDaily: Number,
trendingWeekly: Number,
trendingMonthly: Number,
}).And(
// Optional properties.
Partial({
displayName: String.Or(Null),
shortDescription: String.Or(Null),
repositoryUrl: String.Or(Null),
}),
)
export const PackageJSONRuntime = Record({
contributes: Record({
themes: Array(
Record({
path: String,
}).And(
Partial({
label: String,
uiTheme: String,
}),
),
),
}),
})
export const ThemeTypeRuntime = Union(
Literal('light'),
Literal('dark'),
Literal('hc'),
)
export const TodoItemType = rt.Union(
rt.Literal('housekeeping'),
rt.Literal('work'),
rt.Literal('shopping')
);
export const TodoItem = rt.Record({
title: rt.String,
done: rt.Boolean,
type: TodoItemType
});
export const SavedTodoItem = rt.Intersect(
TodoItem,
rt.Record({
id: rt.String
})
);
export const SimpleMessage = rt.Record({
message: rt.String
});
export const PathData = rt.Record({
path: rt.String,
kind: rt.String,
id: rt.String
});
export class ClassBasedRequest {
constructor(
export const TodoItem = rt.Record({
title: rt.String,
done: rt.Boolean,
type: TodoItemType
});
export const SavedTodoItem = rt.Intersect(
TodoItem,
rt.Record({
id: rt.String
})
);
export const SimpleMessage = rt.Record({
message: rt.String
});
export const PathData = rt.Record({
path: rt.String,
kind: rt.String,
id: rt.String
});
export class ClassBasedRequest {
constructor(
public message: string,
public kind: 'person' | 'cat') {
}
}
genre: String,
trackNumber: String,
track: String,
trackLength: Number,
state: PlaybackState
})
export type TrackInfo = Static
export const Muted = Record({
type: Literal('muted')
})
export type Muted = Static
export const Audible = Record({
type: Literal('audible'),
volume: Number
})
export type Audible = Static
export const Volume = Union(Muted, Audible)
export type Volume = Static
export const InfoMessage = Record({
type: Literal('info'),
data: String
})
export type InfoMessage = Static
export const InfoMessage = Record({
type: Literal('info'),
data: String
})
export type InfoMessage = Static
export const PlaybackMessage = Record({
type: Literal('playback'),
data: TrackInfo
})
export type PlaybackMessage = Static
export const VolumeMessage = Record({
type: Literal('volume'),
data: Volume
})
export type VolumeMessage = Static
export const Message = Union(InfoMessage, PlaybackMessage, VolumeMessage)
export type Message = Static
fontWeight: String,
fontStyle: String,
textDecoration: String,
}),
})
export const LineTokensRuntime = Array(LineTokenRuntime)
export const LanguageTokensRuntime = Record({
javascript: Array(LineTokensRuntime),
html: Array(LineTokensRuntime),
css: Array(LineTokensRuntime),
})
export const SaveThemePayloadRuntime = ExtractThemesPayloadRuntime.And(
Record({
themeId: String,
themeName: String,
themeType: ThemeTypeRuntime,
colors: ColorsRuntime,
languageTokens: LanguageTokensRuntime,
}),
)