2019-02-01 13:56:08 +01:00
|
|
|
import { Type } from '@angular/core';
|
|
|
|
|
2019-01-31 13:40:27 +01:00
|
|
|
import { ModelConstructor, BaseModel } from '../shared/models/base/base-model';
|
|
|
|
import { MainMenuEntry } from './core-services/main-menu.service';
|
2019-02-01 13:56:08 +01:00
|
|
|
import { Searchable } from '../site/base/searchable';
|
2019-01-31 13:40:27 +01:00
|
|
|
import { BaseRepository } from './repositories/base-repository';
|
2019-02-01 13:56:08 +01:00
|
|
|
import { BaseViewModel, ViewModelConstructor } from 'app/site/base/base-view-model';
|
2019-01-31 13:40:27 +01:00
|
|
|
|
|
|
|
interface BaseModelEntry {
|
|
|
|
collectionString: string;
|
|
|
|
repository: Type<BaseRepository<any, any>>;
|
2019-02-01 13:56:08 +01:00
|
|
|
model: ModelConstructor<BaseModel>;
|
2019-01-31 13:40:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModelEntry extends BaseModelEntry {
|
2019-02-01 13:56:08 +01:00
|
|
|
viewModel: ViewModelConstructor<BaseViewModel>;
|
2019-01-31 13:40:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SearchableModelEntry extends BaseModelEntry {
|
2019-02-01 13:56:08 +01:00
|
|
|
viewModel: new (...args: any[]) => BaseViewModel & Searchable;
|
2019-01-31 13:40:27 +01:00
|
|
|
searchOrder: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The configuration of an app.
|
|
|
|
*/
|
|
|
|
export interface AppConfig {
|
|
|
|
/**
|
|
|
|
* The name.
|
|
|
|
*/
|
|
|
|
name: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* All models, that should be registered.
|
|
|
|
*/
|
|
|
|
models?: (ModelEntry | SearchableModelEntry)[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main menu entries.
|
|
|
|
*/
|
|
|
|
mainMenuEntries?: MainMenuEntry[];
|
|
|
|
}
|