-
Notifications
You must be signed in to change notification settings - Fork 0
/
IContext.ts
60 lines (35 loc) · 2.08 KB
/
IContext.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import {ICommandMapper, ICommandMapperImmutable} from "../command/ICommandMapper";
import {IMessage} from "../message/IMessageDispatcher";
import {IHierarchyObject, IHierarchyObjectImmutable} from "../hierarchy/IHierarchyObject";
import {IHierarchyObjectContainer} from "../hierarchy/IHierarchyObjectContainer";
export interface IContextImmutable extends IHierarchyObjectImmutable, ICommandMapperImmutable
{
get modelsImmutable(): ReadonlyArray<IHierarchyObjectImmutable>;
get mediatorsImmutable(): ReadonlyArray<IHierarchyObjectImmutable>;
getModelImmutable(id: string): IHierarchyObjectImmutable | undefined;
getMediatorImmutable(id: string): IHierarchyObjectImmutable | undefined;
isModel(child: IHierarchyObject): boolean;
isMediator(child: IHierarchyObject): boolean;
isIContext(): void;
}
export interface IContext extends IContextImmutable, IHierarchyObjectContainer, ICommandMapper
{
dispatchMessageToMediators<DataType>(message: IMessage, data?: DataType, filter?: (child: IHierarchyObject) => boolean): IContext;
dispatchMessageToModels<DataType>(message: IMessage, data?: DataType, filter?: (child: IHierarchyObject) => boolean): IContext;
addModel(value: IHierarchyObject): IContext;
addModel(value: IHierarchyObject): IContext;
addModel(value: IHierarchyObject, id: string): IContext;
addMediator(value: IHierarchyObject): IContext;
addMediator(value: IHierarchyObject): IContext;
addMediator(value: IHierarchyObject, id: string): IContext;
removeModel(value: IHierarchyObject, dispose?: boolean): IContext;
removeModel(id: string, dispose?: boolean): IContext;
removeMediator(value: IHierarchyObject, dispose?: boolean): IContext;
removeMediator(id: string, dispose?: boolean): IContext;
getModel(id: string): IHierarchyObject | undefined;
getMediator(id: string): IHierarchyObject | undefined;
get models(): ReadonlyArray<IHierarchyObject>;
get mediators(): ReadonlyArray<IHierarchyObject>;
removeAllModels(dispose?: boolean): IContext;
removeAllMediators(dispose?: boolean): IContext;
}