OpenSlides/client/src/app/slides/slide-manifest.ts

50 lines
1.4 KiB
TypeScript
Raw Normal View History

import { InjectionToken } from '@angular/core';
import { LoadChildrenCallback } from '@angular/router';
2019-02-15 12:17:08 +01:00
import { TranslateService } from '@ngx-translate/core';
import { ProjectorTitle } from 'app/core/core-services/projector.service';
2019-02-15 12:17:08 +01:00
import { ViewModelStoreService } from 'app/core/core-services/view-model-store.service';
import { IdentifiableProjectorElement, ProjectorElement } from 'app/shared/models/core/projector';
2019-02-14 16:02:18 +01:00
type BooleanOrFunction = boolean | ((element: ProjectorElement) => boolean);
export interface Slide {
slide: string;
}
/**
* Slides can have these options.
*/
2019-02-14 16:02:18 +01:00
export interface SlideDynamicConfiguration {
/**
* Should this slide be scrollable?
*/
2019-02-14 16:02:18 +01:00
scrollable: BooleanOrFunction;
/**
* Should this slide be scaleable?
*/
2019-02-14 16:02:18 +01:00
scaleable: BooleanOrFunction;
2019-02-15 12:17:08 +01:00
getSlideTitle?: (
element: ProjectorElement,
translate: TranslateService,
viewModelStore: ViewModelStoreService
) => ProjectorTitle;
}
/**
* Is similar to router entries, so we can trick the router. Keep slideName and
* path in sync.
*/
2019-02-14 16:02:18 +01:00
export interface SlideManifest extends Slide {
path: string;
loadChildren: LoadChildrenCallback;
verboseName: string;
elementIdentifiers: (keyof IdentifiableProjectorElement)[];
canBeMappedToModel: boolean;
}
export const SLIDE_MANIFESTS = new InjectionToken<SlideManifest[]>('SLIDE_MANIFEST');