@workadventure/iframe-api-typings 1.9.3 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Api/Events/ActionsMenuActionClickedEvent.d.ts +13 -0
- package/Api/Events/AddActionsMenuKeyToRemotePlayerEvent.d.ts +13 -0
- package/Api/Events/ButtonClickedEvent.d.ts +15 -0
- package/Api/Events/CameraFollowPlayerEvent.d.ts +12 -0
- package/Api/Events/CameraSetEvent.d.ts +27 -0
- package/Api/Events/ChangeAreaEvent.d.ts +12 -0
- package/Api/Events/ChangeLayerEvent.d.ts +12 -0
- package/Api/Events/ChatEvent.d.ts +15 -0
- package/Api/Events/ClosePopupEvent.d.ts +12 -0
- package/Api/Events/ColorEvent.d.ts +18 -0
- package/Api/Events/EmbeddedWebsiteEvent.d.ts +113 -0
- package/Api/Events/EnterLeaveEvent.d.ts +12 -0
- package/Api/Events/GameStateEvent.d.ts +39 -0
- package/Api/Events/GoToPageEvent.d.ts +12 -0
- package/Api/Events/HasPlayerMovedEvent.d.ts +28 -0
- package/Api/Events/IframeEvent.d.ts +1492 -0
- package/Api/Events/LayerEvent.d.ts +12 -0
- package/Api/Events/LoadPageEvent.d.ts +12 -0
- package/Api/Events/LoadSoundEvent.d.ts +12 -0
- package/Api/Events/LoadTilesetEvent.d.ts +12 -0
- package/Api/Events/MapDataEvent.d.ts +12 -0
- package/Api/Events/MovePlayerToEvent.d.ts +15 -0
- package/Api/Events/MovePlayerToEventAnswer.d.ts +15 -0
- package/Api/Events/OpenCoWebsiteEvent.d.ts +37 -0
- package/Api/Events/OpenPopupEvent.d.ts +46 -0
- package/Api/Events/OpenTabEvent.d.ts +12 -0
- package/Api/Events/PlaySoundEvent.d.ts +80 -0
- package/Api/Events/PlayerPosition.d.ts +12 -0
- package/Api/Events/RemotePlayerClickedEvent.d.ts +13 -0
- package/{front/src/Api → Api}/Events/RemoveActionsMenuKeyFromRemotePlayerEvent.d.ts +9 -3
- package/Api/Events/SetTilesEvent.d.ts +21 -0
- package/Api/Events/SetVariableEvent.d.ts +48 -0
- package/Api/Events/StopSoundEvent.d.ts +12 -0
- package/Api/Events/UserInputChatEvent.d.ts +12 -0
- package/Api/Events/WasCameraUpdatedEvent.d.ts +25 -0
- package/Api/Events/setPropertyEvent.d.ts +18 -0
- package/Api/Events/ui/MenuItemClickedEvent.d.ts +12 -0
- package/Api/Events/ui/MenuRegisterEvent.d.ts +46 -0
- package/Api/Events/ui/TriggerActionMessageEvent.d.ts +27 -0
- package/Api/Events/ui/UIWebsite.d.ts +289 -0
- package/{front/src/Api → Api}/iframe/IframeApiContribution.d.ts +4 -4
- package/{front/src/Api → Api}/iframe/Room/EmbeddedWebsite.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/Sound/Sound.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/Ui/ActionMessage.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/Ui/ButtonDescriptor.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/Ui/Menu.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/Ui/Popup.d.ts +0 -0
- package/Api/iframe/Ui/UIWebsite.d.ts +33 -0
- package/{front/src/Api → Api}/iframe/camera.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/chat.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/controls.d.ts +2 -0
- package/{front/src/Api → Api}/iframe/nav.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/player.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/registeredCallbacks.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/room.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/sound.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/state.d.ts +0 -0
- package/{front/src/Api → Api}/iframe/ui.d.ts +2 -0
- package/{front/src/Api → Api}/iframe/website.d.ts +0 -0
- package/{front/src/Api → Api}/types.d.ts +0 -0
- package/{front/src/Phaser → Phaser}/Map/ITiledMap.d.ts +0 -0
- package/{front/src/iframe_api.d.ts → iframe_api.d.ts} +6 -0
- package/package.json +4 -1
- package/desktop/electron/src/preload-app/types.d.ts +0 -8
- package/front/src/Api/Events/ActionsMenuActionClickedEvent.d.ts +0 -7
- package/front/src/Api/Events/AddActionsMenuKeyToRemotePlayerEvent.d.ts +0 -7
- package/front/src/Api/Events/ButtonClickedEvent.d.ts +0 -9
- package/front/src/Api/Events/CameraFollowPlayerEvent.d.ts +0 -8
- package/front/src/Api/Events/CameraSetEvent.d.ts +0 -13
- package/front/src/Api/Events/ChangeLayerEvent.d.ts +0 -8
- package/front/src/Api/Events/ChangeZoneEvent.d.ts +0 -8
- package/front/src/Api/Events/ChatEvent.d.ts +0 -9
- package/front/src/Api/Events/ClosePopupEvent.d.ts +0 -8
- package/front/src/Api/Events/ColorEvent.d.ts +0 -10
- package/front/src/Api/Events/EmbeddedWebsiteEvent.d.ts +0 -43
- package/front/src/Api/Events/EnterLeaveEvent.d.ts +0 -8
- package/front/src/Api/Events/GameStateEvent.d.ts +0 -17
- package/front/src/Api/Events/GoToPageEvent.d.ts +0 -8
- package/front/src/Api/Events/HasPlayerMovedEvent.d.ts +0 -14
- package/front/src/Api/Events/IframeEvent.d.ts +0 -293
- package/front/src/Api/Events/LayerEvent.d.ts +0 -8
- package/front/src/Api/Events/LoadPageEvent.d.ts +0 -8
- package/front/src/Api/Events/LoadSoundEvent.d.ts +0 -8
- package/front/src/Api/Events/LoadTilesetEvent.d.ts +0 -8
- package/front/src/Api/Events/MapDataEvent.d.ts +0 -8
- package/front/src/Api/Events/MovePlayerToEvent.d.ts +0 -7
- package/front/src/Api/Events/MovePlayerToEventAnswer.d.ts +0 -7
- package/front/src/Api/Events/OpenCoWebsiteEvent.d.ts +0 -17
- package/front/src/Api/Events/OpenPopupEvent.d.ts +0 -14
- package/front/src/Api/Events/OpenTabEvent.d.ts +0 -8
- package/front/src/Api/Events/PlaySoundEvent.d.ts +0 -17
- package/front/src/Api/Events/PlayerPosition.d.ts +0 -6
- package/front/src/Api/Events/RemotePlayerClickedEvent.d.ts +0 -9
- package/front/src/Api/Events/SetTilesEvent.d.ts +0 -11
- package/front/src/Api/Events/SetVariableEvent.d.ts +0 -18
- package/front/src/Api/Events/StopSoundEvent.d.ts +0 -8
- package/front/src/Api/Events/UserInputChatEvent.d.ts +0 -8
- package/front/src/Api/Events/WasCameraUpdatedEvent.d.ts +0 -13
- package/front/src/Api/Events/setPropertyEvent.d.ts +0 -10
- package/front/src/Api/Events/ui/MenuItemClickedEvent.d.ts +0 -8
- package/front/src/Api/Events/ui/MenuRegisterEvent.d.ts +0 -22
- package/front/src/Api/Events/ui/TriggerActionMessageEvent.d.ts +0 -15
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
import type { ButtonClickedEvent } from "./ButtonClickedEvent";
|
|
3
|
-
import type { ChatEvent } from "./ChatEvent";
|
|
4
|
-
import type { ClosePopupEvent } from "./ClosePopupEvent";
|
|
5
|
-
import type { EnterLeaveEvent } from "./EnterLeaveEvent";
|
|
6
|
-
import type { GoToPageEvent } from "./GoToPageEvent";
|
|
7
|
-
import type { LoadPageEvent } from "./LoadPageEvent";
|
|
8
|
-
import type { OpenPopupEvent } from "./OpenPopupEvent";
|
|
9
|
-
import type { OpenTabEvent } from "./OpenTabEvent";
|
|
10
|
-
import type { UserInputChatEvent } from "./UserInputChatEvent";
|
|
11
|
-
import type { LayerEvent } from "./LayerEvent";
|
|
12
|
-
import type { SetPropertyEvent } from "./setPropertyEvent";
|
|
13
|
-
import type { LoadSoundEvent } from "./LoadSoundEvent";
|
|
14
|
-
import type { PlaySoundEvent } from "./PlaySoundEvent";
|
|
15
|
-
import type { MenuItemClickedEvent } from "./ui/MenuItemClickedEvent";
|
|
16
|
-
import type { HasPlayerMovedEvent } from "./HasPlayerMovedEvent";
|
|
17
|
-
import type { SetTilesEvent } from "./SetTilesEvent";
|
|
18
|
-
import type { SetVariableEvent } from "./SetVariableEvent";
|
|
19
|
-
import type { EmbeddedWebsite } from "../iframe/Room/EmbeddedWebsite";
|
|
20
|
-
import type { LoadTilesetEvent } from "./LoadTilesetEvent";
|
|
21
|
-
import type { MessageReferenceEvent } from "./ui/TriggerActionMessageEvent";
|
|
22
|
-
import type { MenuRegisterEvent, UnregisterMenuEvent } from "./ui/MenuRegisterEvent";
|
|
23
|
-
import type { ChangeLayerEvent } from "./ChangeLayerEvent";
|
|
24
|
-
import type { WasCameraUpdatedEvent } from "./WasCameraUpdatedEvent";
|
|
25
|
-
import type { ChangeZoneEvent } from "./ChangeZoneEvent";
|
|
26
|
-
import type { CameraSetEvent } from "./CameraSetEvent";
|
|
27
|
-
import type { CameraFollowPlayerEvent } from "./CameraFollowPlayerEvent";
|
|
28
|
-
import type { RemotePlayerClickedEvent } from "./RemotePlayerClickedEvent";
|
|
29
|
-
import type { AddActionsMenuKeyToRemotePlayerEvent } from "./AddActionsMenuKeyToRemotePlayerEvent";
|
|
30
|
-
import type { ActionsMenuActionClickedEvent } from "./ActionsMenuActionClickedEvent";
|
|
31
|
-
import type { RemoveActionsMenuKeyFromRemotePlayerEvent } from "./RemoveActionsMenuKeyFromRemotePlayerEvent";
|
|
32
|
-
export interface TypedMessageEvent<T> extends MessageEvent {
|
|
33
|
-
data: T;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* List event types sent from an iFrame to WorkAdventure
|
|
37
|
-
*/
|
|
38
|
-
export declare type IframeEventMap = {
|
|
39
|
-
addActionsMenuKeyToRemotePlayer: AddActionsMenuKeyToRemotePlayerEvent;
|
|
40
|
-
removeActionsMenuKeyFromRemotePlayer: RemoveActionsMenuKeyFromRemotePlayerEvent;
|
|
41
|
-
loadPage: LoadPageEvent;
|
|
42
|
-
chat: ChatEvent;
|
|
43
|
-
cameraFollowPlayer: CameraFollowPlayerEvent;
|
|
44
|
-
cameraSet: CameraSetEvent;
|
|
45
|
-
openPopup: OpenPopupEvent;
|
|
46
|
-
closePopup: ClosePopupEvent;
|
|
47
|
-
openTab: OpenTabEvent;
|
|
48
|
-
goToPage: GoToPageEvent;
|
|
49
|
-
disablePlayerControls: null;
|
|
50
|
-
restorePlayerControls: null;
|
|
51
|
-
displayBubble: null;
|
|
52
|
-
removeBubble: null;
|
|
53
|
-
onPlayerMove: undefined;
|
|
54
|
-
onOpenActionMenu: undefined;
|
|
55
|
-
onCameraUpdate: undefined;
|
|
56
|
-
showLayer: LayerEvent;
|
|
57
|
-
hideLayer: LayerEvent;
|
|
58
|
-
setProperty: SetPropertyEvent;
|
|
59
|
-
loadSound: LoadSoundEvent;
|
|
60
|
-
playSound: PlaySoundEvent;
|
|
61
|
-
stopSound: null;
|
|
62
|
-
getState: undefined;
|
|
63
|
-
loadTileset: LoadTilesetEvent;
|
|
64
|
-
registerMenu: MenuRegisterEvent;
|
|
65
|
-
unregisterMenu: UnregisterMenuEvent;
|
|
66
|
-
setTiles: SetTilesEvent;
|
|
67
|
-
modifyEmbeddedWebsite: Partial<EmbeddedWebsite>;
|
|
68
|
-
};
|
|
69
|
-
export interface IframeEvent<T extends keyof IframeEventMap> {
|
|
70
|
-
type: T;
|
|
71
|
-
data: IframeEventMap[T];
|
|
72
|
-
}
|
|
73
|
-
export declare const isIframeEventWrapper: (event: any) => event is IframeEvent<keyof IframeEventMap>;
|
|
74
|
-
export interface IframeResponseEventMap {
|
|
75
|
-
userInputChat: UserInputChatEvent;
|
|
76
|
-
enterEvent: EnterLeaveEvent;
|
|
77
|
-
leaveEvent: EnterLeaveEvent;
|
|
78
|
-
enterLayerEvent: ChangeLayerEvent;
|
|
79
|
-
leaveLayerEvent: ChangeLayerEvent;
|
|
80
|
-
enterZoneEvent: ChangeZoneEvent;
|
|
81
|
-
leaveZoneEvent: ChangeZoneEvent;
|
|
82
|
-
buttonClickedEvent: ButtonClickedEvent;
|
|
83
|
-
remotePlayerClickedEvent: RemotePlayerClickedEvent;
|
|
84
|
-
actionsMenuActionClickedEvent: ActionsMenuActionClickedEvent;
|
|
85
|
-
hasPlayerMoved: HasPlayerMovedEvent;
|
|
86
|
-
wasCameraUpdated: WasCameraUpdatedEvent;
|
|
87
|
-
menuItemClicked: MenuItemClickedEvent;
|
|
88
|
-
setVariable: SetVariableEvent;
|
|
89
|
-
messageTriggered: MessageReferenceEvent;
|
|
90
|
-
}
|
|
91
|
-
export interface IframeResponseEvent<T extends keyof IframeResponseEventMap> {
|
|
92
|
-
type: T;
|
|
93
|
-
data: IframeResponseEventMap[T];
|
|
94
|
-
}
|
|
95
|
-
export declare const isIframeResponseEventWrapper: (event: {
|
|
96
|
-
type?: string;
|
|
97
|
-
}) => event is IframeResponseEvent<keyof IframeResponseEventMap>;
|
|
98
|
-
/**
|
|
99
|
-
* List event types sent from an iFrame to WorkAdventure that expect a unique answer from WorkAdventure along the type for the answer from WorkAdventure to the iFrame.
|
|
100
|
-
* Types are defined using Type guards that will actually bused to enforce and check types.
|
|
101
|
-
*/
|
|
102
|
-
export declare const iframeQueryMapTypeGuards: {
|
|
103
|
-
getState: {
|
|
104
|
-
query: tg.TypeGuard<undefined>;
|
|
105
|
-
answer: tg.TypeGuard<object & {
|
|
106
|
-
roomId: string;
|
|
107
|
-
mapUrl: string;
|
|
108
|
-
nickname: string;
|
|
109
|
-
language: string | undefined;
|
|
110
|
-
uuid: string | undefined;
|
|
111
|
-
startLayerName: string | null;
|
|
112
|
-
tags: string[];
|
|
113
|
-
variables: object;
|
|
114
|
-
playerVariables: object;
|
|
115
|
-
userRoomToken: string | undefined;
|
|
116
|
-
}>;
|
|
117
|
-
};
|
|
118
|
-
getMapData: {
|
|
119
|
-
query: tg.TypeGuard<undefined>;
|
|
120
|
-
answer: tg.TypeGuard<object & {
|
|
121
|
-
data: object;
|
|
122
|
-
}>;
|
|
123
|
-
};
|
|
124
|
-
setVariable: {
|
|
125
|
-
query: tg.TypeGuard<object & {
|
|
126
|
-
key: string;
|
|
127
|
-
value: unknown;
|
|
128
|
-
target: "global" | "player";
|
|
129
|
-
}>;
|
|
130
|
-
answer: tg.TypeGuard<undefined>;
|
|
131
|
-
};
|
|
132
|
-
loadTileset: {
|
|
133
|
-
query: tg.TypeGuard<object & {
|
|
134
|
-
url: string;
|
|
135
|
-
}>;
|
|
136
|
-
answer: tg.TypeGuard<number>;
|
|
137
|
-
};
|
|
138
|
-
openCoWebsite: {
|
|
139
|
-
query: tg.TypeGuard<object & {
|
|
140
|
-
url: string;
|
|
141
|
-
allowApi: boolean | undefined;
|
|
142
|
-
allowPolicy: string | undefined;
|
|
143
|
-
widthPercent: number | undefined;
|
|
144
|
-
position: number | undefined;
|
|
145
|
-
closable: boolean | undefined;
|
|
146
|
-
lazy: boolean | undefined;
|
|
147
|
-
}>;
|
|
148
|
-
answer: tg.TypeGuard<object & {
|
|
149
|
-
id: string;
|
|
150
|
-
}>;
|
|
151
|
-
};
|
|
152
|
-
getCoWebsites: {
|
|
153
|
-
query: tg.TypeGuard<undefined>;
|
|
154
|
-
answer: tg.TypeGuard<(object & {
|
|
155
|
-
id: string;
|
|
156
|
-
})[]>;
|
|
157
|
-
};
|
|
158
|
-
closeCoWebsite: {
|
|
159
|
-
query: tg.TypeGuard<string>;
|
|
160
|
-
answer: tg.TypeGuard<undefined>;
|
|
161
|
-
};
|
|
162
|
-
closeCoWebsites: {
|
|
163
|
-
query: tg.TypeGuard<undefined>;
|
|
164
|
-
answer: tg.TypeGuard<undefined>;
|
|
165
|
-
};
|
|
166
|
-
triggerActionMessage: {
|
|
167
|
-
query: tg.TypeGuard<object & {
|
|
168
|
-
message: string;
|
|
169
|
-
uuid: string;
|
|
170
|
-
type: "message" | "warning";
|
|
171
|
-
}>;
|
|
172
|
-
answer: tg.TypeGuard<undefined>;
|
|
173
|
-
};
|
|
174
|
-
removeActionMessage: {
|
|
175
|
-
query: tg.TypeGuard<object & {
|
|
176
|
-
uuid: string;
|
|
177
|
-
}>;
|
|
178
|
-
answer: tg.TypeGuard<undefined>;
|
|
179
|
-
};
|
|
180
|
-
getEmbeddedWebsite: {
|
|
181
|
-
query: tg.TypeGuard<string>;
|
|
182
|
-
answer: tg.TypeGuard<object & {
|
|
183
|
-
name: string;
|
|
184
|
-
url: string;
|
|
185
|
-
position: object & {
|
|
186
|
-
x: number;
|
|
187
|
-
y: number;
|
|
188
|
-
width: number;
|
|
189
|
-
height: number;
|
|
190
|
-
};
|
|
191
|
-
} & Partial<{
|
|
192
|
-
visible: boolean;
|
|
193
|
-
allowApi: boolean;
|
|
194
|
-
allow: string;
|
|
195
|
-
origin: "player" | "map";
|
|
196
|
-
scale: number;
|
|
197
|
-
}>>;
|
|
198
|
-
};
|
|
199
|
-
deleteEmbeddedWebsite: {
|
|
200
|
-
query: tg.TypeGuard<string>;
|
|
201
|
-
answer: tg.TypeGuard<undefined>;
|
|
202
|
-
};
|
|
203
|
-
createEmbeddedWebsite: {
|
|
204
|
-
query: tg.TypeGuard<object & {
|
|
205
|
-
name: string;
|
|
206
|
-
url: string;
|
|
207
|
-
position: object & {
|
|
208
|
-
x: number;
|
|
209
|
-
y: number;
|
|
210
|
-
width: number;
|
|
211
|
-
height: number;
|
|
212
|
-
};
|
|
213
|
-
} & Partial<{
|
|
214
|
-
visible: boolean;
|
|
215
|
-
allowApi: boolean;
|
|
216
|
-
allow: string;
|
|
217
|
-
origin: "player" | "map";
|
|
218
|
-
scale: number;
|
|
219
|
-
}>>;
|
|
220
|
-
answer: tg.TypeGuard<undefined>;
|
|
221
|
-
};
|
|
222
|
-
setPlayerOutline: {
|
|
223
|
-
query: tg.TypeGuard<object & {
|
|
224
|
-
red: number;
|
|
225
|
-
green: number;
|
|
226
|
-
blue: number;
|
|
227
|
-
}>;
|
|
228
|
-
answer: tg.TypeGuard<undefined>;
|
|
229
|
-
};
|
|
230
|
-
removePlayerOutline: {
|
|
231
|
-
query: tg.TypeGuard<undefined>;
|
|
232
|
-
answer: tg.TypeGuard<undefined>;
|
|
233
|
-
};
|
|
234
|
-
getPlayerPosition: {
|
|
235
|
-
query: tg.TypeGuard<undefined>;
|
|
236
|
-
answer: tg.TypeGuard<object & {
|
|
237
|
-
x: number;
|
|
238
|
-
y: number;
|
|
239
|
-
}>;
|
|
240
|
-
};
|
|
241
|
-
movePlayerTo: {
|
|
242
|
-
query: tg.TypeGuard<object & {
|
|
243
|
-
x: number;
|
|
244
|
-
y: number;
|
|
245
|
-
speed: number | undefined;
|
|
246
|
-
}>;
|
|
247
|
-
answer: tg.TypeGuard<object & {
|
|
248
|
-
x: number;
|
|
249
|
-
y: number;
|
|
250
|
-
cancelled: boolean;
|
|
251
|
-
}>;
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
declare type GuardedType<T> = T extends (x: unknown) => x is infer T ? T : never;
|
|
255
|
-
declare type IframeQueryMapTypeGuardsType = typeof iframeQueryMapTypeGuards;
|
|
256
|
-
declare type UnknownToVoid<T> = undefined extends T ? void : T;
|
|
257
|
-
export declare type IframeQueryMap = {
|
|
258
|
-
[key in keyof IframeQueryMapTypeGuardsType]: {
|
|
259
|
-
query: GuardedType<IframeQueryMapTypeGuardsType[key]["query"]>;
|
|
260
|
-
answer: UnknownToVoid<GuardedType<IframeQueryMapTypeGuardsType[key]["answer"]>>;
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
export interface IframeQuery<T extends keyof IframeQueryMap> {
|
|
264
|
-
type: T;
|
|
265
|
-
data: IframeQueryMap[T]["query"];
|
|
266
|
-
}
|
|
267
|
-
export interface IframeQueryWrapper<T extends keyof IframeQueryMap> {
|
|
268
|
-
id: number;
|
|
269
|
-
query: IframeQuery<T>;
|
|
270
|
-
}
|
|
271
|
-
export declare const isIframeQueryKey: (type: string) => type is "setVariable" | "getState" | "loadTileset" | "getMapData" | "openCoWebsite" | "getCoWebsites" | "closeCoWebsite" | "closeCoWebsites" | "triggerActionMessage" | "removeActionMessage" | "getEmbeddedWebsite" | "deleteEmbeddedWebsite" | "createEmbeddedWebsite" | "setPlayerOutline" | "removePlayerOutline" | "getPlayerPosition" | "movePlayerTo";
|
|
272
|
-
export declare const isIframeQuery: (event: any) => event is IframeQuery<"setVariable" | "getState" | "loadTileset" | "getMapData" | "openCoWebsite" | "getCoWebsites" | "closeCoWebsite" | "closeCoWebsites" | "triggerActionMessage" | "removeActionMessage" | "getEmbeddedWebsite" | "deleteEmbeddedWebsite" | "createEmbeddedWebsite" | "setPlayerOutline" | "removePlayerOutline" | "getPlayerPosition" | "movePlayerTo">;
|
|
273
|
-
export declare const isIframeQueryWrapper: (event: any) => event is IframeQueryWrapper<"setVariable" | "getState" | "loadTileset" | "getMapData" | "openCoWebsite" | "getCoWebsites" | "closeCoWebsite" | "closeCoWebsites" | "triggerActionMessage" | "removeActionMessage" | "getEmbeddedWebsite" | "deleteEmbeddedWebsite" | "createEmbeddedWebsite" | "setPlayerOutline" | "removePlayerOutline" | "getPlayerPosition" | "movePlayerTo">;
|
|
274
|
-
export interface IframeAnswerEvent<T extends keyof IframeQueryMap> {
|
|
275
|
-
id: number;
|
|
276
|
-
type: T;
|
|
277
|
-
data: IframeQueryMap[T]["answer"];
|
|
278
|
-
}
|
|
279
|
-
export declare const isIframeAnswerEvent: (event: {
|
|
280
|
-
type?: string;
|
|
281
|
-
id?: number;
|
|
282
|
-
}) => event is IframeAnswerEvent<"setVariable" | "getState" | "loadTileset" | "getMapData" | "openCoWebsite" | "getCoWebsites" | "closeCoWebsite" | "closeCoWebsites" | "triggerActionMessage" | "removeActionMessage" | "getEmbeddedWebsite" | "deleteEmbeddedWebsite" | "createEmbeddedWebsite" | "setPlayerOutline" | "removePlayerOutline" | "getPlayerPosition" | "movePlayerTo">;
|
|
283
|
-
export interface IframeErrorAnswerEvent {
|
|
284
|
-
id: number;
|
|
285
|
-
type: keyof IframeQueryMap;
|
|
286
|
-
error: string;
|
|
287
|
-
}
|
|
288
|
-
export declare const isIframeErrorAnswerEvent: (event: {
|
|
289
|
-
type?: string;
|
|
290
|
-
id?: number;
|
|
291
|
-
error?: string;
|
|
292
|
-
}) => event is IframeErrorAnswerEvent;
|
|
293
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isLayerEvent: tg.TypeGuard<object & {
|
|
3
|
-
name: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the iFrame to the game to show/hide a layer.
|
|
7
|
-
*/
|
|
8
|
-
export declare type LayerEvent = tg.GuardedType<typeof isLayerEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isLoadPageEvent: tg.TypeGuard<object & {
|
|
3
|
-
url: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
7
|
-
*/
|
|
8
|
-
export declare type LoadPageEvent = tg.GuardedType<typeof isLoadPageEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isLoadSoundEvent: tg.TypeGuard<object & {
|
|
3
|
-
url: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
7
|
-
*/
|
|
8
|
-
export declare type LoadSoundEvent = tg.GuardedType<typeof isLoadSoundEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isLoadTilesetEvent: tg.TypeGuard<object & {
|
|
3
|
-
url: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
7
|
-
*/
|
|
8
|
-
export declare type LoadTilesetEvent = tg.GuardedType<typeof isLoadTilesetEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isMapDataEvent: tg.TypeGuard<object & {
|
|
3
|
-
data: object;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the game to the iFrame when the data of the layers change after the iFrame send a message to the game that it want to listen to the data of the layers
|
|
7
|
-
*/
|
|
8
|
-
export declare type MapDataEvent = tg.GuardedType<typeof isMapDataEvent>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isMovePlayerToEventConfig: tg.TypeGuard<object & {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
speed: number | undefined;
|
|
6
|
-
}>;
|
|
7
|
-
export declare type MovePlayerToEvent = tg.GuardedType<typeof isMovePlayerToEventConfig>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isOpenCoWebsiteEvent: tg.TypeGuard<object & {
|
|
3
|
-
url: string;
|
|
4
|
-
allowApi: boolean | undefined;
|
|
5
|
-
allowPolicy: string | undefined;
|
|
6
|
-
widthPercent: number | undefined;
|
|
7
|
-
position: number | undefined;
|
|
8
|
-
closable: boolean | undefined;
|
|
9
|
-
lazy: boolean | undefined;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const isCoWebsite: tg.TypeGuard<object & {
|
|
12
|
-
id: string;
|
|
13
|
-
}>;
|
|
14
|
-
/**
|
|
15
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
16
|
-
*/
|
|
17
|
-
export declare type OpenCoWebsiteEvent = tg.GuardedType<typeof isOpenCoWebsiteEvent>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isOpenPopupEvent: tg.TypeGuard<object & {
|
|
3
|
-
popupId: number;
|
|
4
|
-
targetObject: string;
|
|
5
|
-
message: string;
|
|
6
|
-
buttons: (object & {
|
|
7
|
-
label: string;
|
|
8
|
-
className: string | undefined;
|
|
9
|
-
})[];
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
13
|
-
*/
|
|
14
|
-
export declare type OpenPopupEvent = tg.GuardedType<typeof isOpenPopupEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isOpenTabEvent: tg.TypeGuard<object & {
|
|
3
|
-
url: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
7
|
-
*/
|
|
8
|
-
export declare type OpenTabEvent = tg.GuardedType<typeof isOpenTabEvent>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isPlaySoundEvent: tg.TypeGuard<object & {
|
|
3
|
-
url: string;
|
|
4
|
-
config: (object & {
|
|
5
|
-
volume: number | undefined;
|
|
6
|
-
loop: boolean | undefined;
|
|
7
|
-
mute: boolean | undefined;
|
|
8
|
-
rate: number | undefined;
|
|
9
|
-
detune: number | undefined;
|
|
10
|
-
seek: number | undefined;
|
|
11
|
-
delay: number | undefined;
|
|
12
|
-
}) | undefined;
|
|
13
|
-
}>;
|
|
14
|
-
/**
|
|
15
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
16
|
-
*/
|
|
17
|
-
export declare type PlaySoundEvent = tg.GuardedType<typeof isPlaySoundEvent>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isRemotePlayerClickedEvent: tg.TypeGuard<object & {
|
|
3
|
-
id: number;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the game to the iFrame when RemotePlayer is clicked.
|
|
7
|
-
*/
|
|
8
|
-
export declare type RemotePlayerClickedEvent = tg.GuardedType<typeof isRemotePlayerClickedEvent>;
|
|
9
|
-
export declare type RemotePlayerClickedEventCallback = (event: RemotePlayerClickedEvent) => void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isSetTilesEvent: tg.TypeGuard<(object & {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
tile: string | number | null;
|
|
6
|
-
layer: string;
|
|
7
|
-
})[]>;
|
|
8
|
-
/**
|
|
9
|
-
* A message sent from the iFrame to the game to set one or many tiles.
|
|
10
|
-
*/
|
|
11
|
-
export declare type SetTilesEvent = tg.GuardedType<typeof isSetTilesEvent>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isSetVariableEvent: tg.TypeGuard<object & {
|
|
3
|
-
key: string;
|
|
4
|
-
value: unknown;
|
|
5
|
-
target: "global" | "player";
|
|
6
|
-
}>;
|
|
7
|
-
/**
|
|
8
|
-
* A message sent from the iFrame to the game to change the value of the property of the layer
|
|
9
|
-
*/
|
|
10
|
-
export declare type SetVariableEvent = tg.GuardedType<typeof isSetVariableEvent>;
|
|
11
|
-
export declare const isSetVariableIframeEvent: tg.TypeGuard<object & {
|
|
12
|
-
type: "setVariable";
|
|
13
|
-
data: object & {
|
|
14
|
-
key: string;
|
|
15
|
-
value: unknown;
|
|
16
|
-
target: "global" | "player";
|
|
17
|
-
};
|
|
18
|
-
}>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isStopSoundEvent: tg.TypeGuard<object & {
|
|
3
|
-
url: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
7
|
-
*/
|
|
8
|
-
export declare type StopSoundEvent = tg.GuardedType<typeof isStopSoundEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isUserInputChatEvent: tg.TypeGuard<object & {
|
|
3
|
-
message: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the game to the iFrame when a user types a message in the chat.
|
|
7
|
-
*/
|
|
8
|
-
export declare type UserInputChatEvent = tg.GuardedType<typeof isUserInputChatEvent>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isWasCameraUpdatedEvent: tg.TypeGuard<object & {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
zoom: number;
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* A message sent from the game to the iFrame to notify a movement from the camera.
|
|
11
|
-
*/
|
|
12
|
-
export declare type WasCameraUpdatedEvent = tg.GuardedType<typeof isWasCameraUpdatedEvent>;
|
|
13
|
-
export declare type WasCameraUpdatedEventCallback = (event: WasCameraUpdatedEvent) => void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isSetPropertyEvent: tg.TypeGuard<object & {
|
|
3
|
-
layerName: string;
|
|
4
|
-
propertyName: string;
|
|
5
|
-
propertyValue: string | number | boolean | undefined;
|
|
6
|
-
}>;
|
|
7
|
-
/**
|
|
8
|
-
* A message sent from the iFrame to the game to change the value of the property of the layer
|
|
9
|
-
*/
|
|
10
|
-
export declare type SetPropertyEvent = tg.GuardedType<typeof isSetPropertyEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isMenuItemClickedEvent: tg.TypeGuard<object & {
|
|
3
|
-
menuItem: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the game to the iFrame when a menu item is clicked.
|
|
7
|
-
*/
|
|
8
|
-
export declare type MenuItemClickedEvent = tg.GuardedType<typeof isMenuItemClickedEvent>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
/**
|
|
3
|
-
* A message sent from a script to the game to remove a custom menu from the menu
|
|
4
|
-
*/
|
|
5
|
-
export declare const isUnregisterMenuEvent: tg.TypeGuard<object & {
|
|
6
|
-
name: string;
|
|
7
|
-
}>;
|
|
8
|
-
export declare type UnregisterMenuEvent = tg.GuardedType<typeof isUnregisterMenuEvent>;
|
|
9
|
-
export declare const isMenuRegisterOptions: tg.TypeGuard<object & {
|
|
10
|
-
allowApi: boolean;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* A message sent from a script to the game to add a custom menu from the menu
|
|
14
|
-
*/
|
|
15
|
-
export declare const isMenuRegisterEvent: tg.TypeGuard<object & {
|
|
16
|
-
name: string;
|
|
17
|
-
iframe: string | undefined;
|
|
18
|
-
options: object & {
|
|
19
|
-
allowApi: boolean;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
22
|
-
export declare type MenuRegisterEvent = tg.GuardedType<typeof isMenuRegisterEvent>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const triggerActionMessage = "triggerActionMessage";
|
|
3
|
-
export declare const removeActionMessage = "removeActionMessage";
|
|
4
|
-
export declare const isActionMessageType: tg.TypeGuard<"message" | "warning">;
|
|
5
|
-
export declare type ActionMessageType = tg.GuardedType<typeof isActionMessageType>;
|
|
6
|
-
export declare const isTriggerActionMessageEvent: tg.TypeGuard<object & {
|
|
7
|
-
message: string;
|
|
8
|
-
uuid: string;
|
|
9
|
-
type: "message" | "warning";
|
|
10
|
-
}>;
|
|
11
|
-
export declare type TriggerActionMessageEvent = tg.GuardedType<typeof isTriggerActionMessageEvent>;
|
|
12
|
-
export declare const isMessageReferenceEvent: tg.TypeGuard<object & {
|
|
13
|
-
uuid: string;
|
|
14
|
-
}>;
|
|
15
|
-
export declare type MessageReferenceEvent = tg.GuardedType<typeof isMessageReferenceEvent>;
|