This repository has been archived by the owner on Jul 31, 2020. It is now read-only.
/
IState.ts
80 lines (69 loc) · 2.65 KB
/
IState.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { EventEmitter } from 'events';
import { IClient } from '../IClient';
import { IRawValues } from '../interfaces';
import { Method, Reply } from '../wire/packets';
import { Group } from './Group';
import { IScene, ISceneData, ISceneDataArray } from './interfaces';
import { IControl } from './interfaces/controls/IControl';
import { IGroup, IGroupDataArray } from './interfaces/IGroup';
import { IParticipant } from './interfaces/IParticipant';
export interface IState extends EventEmitter {
setClient(client: IClient): void;
processMethod(method: Method<any>): void | Reply;
synchronizeLocalTime(time?: Date | number): Date;
synchronizeRemoteTime(time?: Date | number): Date;
reset(): void;
getGroups(): Map<string, IGroup>;
getGroup(id: string): IGroup;
getScenes(): Map<string, IScene>;
getScene(id: string): IScene;
onSceneCreate(data: ISceneData): IScene;
synchronizeScenes(data: ISceneDataArray): IScene[];
synchronizeGroups(data: IGroupDataArray): IGroup[];
onWorldUpdate(data: IRawValues): void;
getControl(id: string): IControl;
getParticipants(): Map<string, IParticipant>;
getParticipantByUserID(id: number): IParticipant;
getParticipantByUsername(name: string): IParticipant;
getParticipantBySessionID(id: string): IParticipant;
/**
* Fired when the ready state of the interactive session changes.
*/
on(event: 'ready', listener: (ready: boolean) => void): this;
/**
* Fired when the connected participant's state is updated
*/
on(event: 'selfUpdate', listener: (self: IParticipant) => void): this;
/**
* Fired when a participant joins.
*/
on(event: 'participantJoin', listener: (participant: IParticipant) => void): this;
/**
* Fired when a participant leaves.
*/
on(
event: 'participantLeave',
listener: (participantSessionID: string, participant: IParticipant) => void,
): this;
/**
* Fired when a scene is deleted.
*/
on(event: 'sceneDeleted', listener: (sceneID: string, reassignSceneID: string) => void): this;
/**
* Fired when a scene is created.
*/
on(event: 'sceneCreated', listener: (scene: IScene) => void): this;
/**
* Fired when a group is deleted.
*/
on(event: 'groupDeleted', listener: (groupID: string, reassignGroupID: string) => void): this;
/**
* Fired when a group is created.
*/
on(event: 'groupCreated', listener: (group: Group) => void): this;
/**
* Fired when the world is updated.
*/
on(event: 'worldUpdated', listener: (world: IRawValues) => void): this;
on(event: string, listener: Function): this;
}