OpenSlides/client/src/app/site/base/slide-options.ts
FinnStutzenstein 965d23be50 more work on projector, countdowns, clos
- splitted clos-slide and clos-overlay.
- Synchronize to server, more little changes
2019-01-29 16:10:21 +01:00

33 lines
976 B
TypeScript

export interface SlideDecisionOption {
key: string;
displayName: string;
default: string;
}
export interface SlideChoiceOption extends SlideDecisionOption {
choices: { value: string; displayName: string }[];
}
export type SlideOption = SlideDecisionOption | SlideChoiceOption;
export type SlideOptions = SlideOption[];
export function isSlideDecisionOption(object: any): object is SlideDecisionOption {
const option = <SlideDecisionOption>object;
return (
option.key !== undefined &&
option.displayName !== undefined &&
option.default !== undefined &&
(<SlideChoiceOption>object).choices === undefined
);
}
export function isSlideChoiceOption(object: any): object is SlideChoiceOption {
const option = <SlideChoiceOption>object;
return (
option.key !== undefined &&
option.displayName !== undefined &&
option.default !== undefined &&
option.choices !== undefined
);
}