OpenSlides/client/src/app/site/base/base-view-model-with-list-of-speakers.ts
FinnStutzenstein 7af74fb07a Use Proxies for ViewModels
Also reworked creation of assignments, motions and users.
2019-10-16 09:11:02 +02:00

28 lines
1.1 KiB
TypeScript

import { BaseModelWithListOfSpeakers } from 'app/shared/models/base/base-model-with-list-of-speakers';
import { DetailNavigable, isDetailNavigable } from 'app/shared/models/base/detail-navigable';
import { BaseProjectableViewModel } from './base-projectable-view-model';
export function isBaseViewModelWithListOfSpeakers(obj: any): obj is BaseViewModelWithListOfSpeakers {
const model = <BaseViewModelWithListOfSpeakers>obj;
return (
!!obj &&
isDetailNavigable(model) &&
model.getListOfSpeakersTitle !== undefined &&
model.listOfSpeakers !== undefined &&
model.getModel !== undefined &&
model.getModel().list_of_speakers_id !== undefined
);
}
export interface BaseViewModelWithListOfSpeakers<M extends BaseModelWithListOfSpeakers = any> extends DetailNavigable {
listOfSpeakers: any | null;
getListOfSpeakersTitle: () => string;
getListOfSpeakersSlideTitle: () => string;
}
export abstract class BaseViewModelWithListOfSpeakers<
M extends BaseModelWithListOfSpeakers = any
> extends BaseProjectableViewModel<M> {
public abstract getDetailStateURL(): string;
}