@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
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const isUIWebsiteCSSValue: z.ZodString;
|
|
3
|
+
export declare type UIWebsiteCSSValue = z.infer<typeof isUIWebsiteCSSValue>;
|
|
4
|
+
export declare const isUIWebsiteMargin: z.ZodObject<{
|
|
5
|
+
top: z.ZodOptional<z.ZodString>;
|
|
6
|
+
bottom: z.ZodOptional<z.ZodString>;
|
|
7
|
+
left: z.ZodOptional<z.ZodString>;
|
|
8
|
+
right: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
right?: string | undefined;
|
|
11
|
+
left?: string | undefined;
|
|
12
|
+
top?: string | undefined;
|
|
13
|
+
bottom?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
right?: string | undefined;
|
|
16
|
+
left?: string | undefined;
|
|
17
|
+
top?: string | undefined;
|
|
18
|
+
bottom?: string | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export declare type UIWebsiteMargin = z.infer<typeof isUIWebsiteMargin>;
|
|
21
|
+
export declare const isViewportPositionVertical: z.ZodEnum<["top", "middle", "bottom"]>;
|
|
22
|
+
export declare type ViewportPositionVertical = z.infer<typeof isViewportPositionVertical>;
|
|
23
|
+
export declare const isViewportPositionHorizontal: z.ZodEnum<["left", "middle", "right"]>;
|
|
24
|
+
export declare type ViewportPositionHorizontal = z.infer<typeof isViewportPositionHorizontal>;
|
|
25
|
+
export declare const isUIWebsitePosition: z.ZodObject<{
|
|
26
|
+
vertical: z.ZodEnum<["top", "middle", "bottom"]>;
|
|
27
|
+
horizontal: z.ZodEnum<["left", "middle", "right"]>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
vertical: "top" | "middle" | "bottom";
|
|
30
|
+
horizontal: "right" | "left" | "middle";
|
|
31
|
+
}, {
|
|
32
|
+
vertical: "top" | "middle" | "bottom";
|
|
33
|
+
horizontal: "right" | "left" | "middle";
|
|
34
|
+
}>;
|
|
35
|
+
export declare type UIWebsitePosition = z.infer<typeof isUIWebsitePosition>;
|
|
36
|
+
export declare const isUIWebsiteSize: z.ZodObject<{
|
|
37
|
+
height: z.ZodString;
|
|
38
|
+
width: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
width: string;
|
|
41
|
+
height: string;
|
|
42
|
+
}, {
|
|
43
|
+
width: string;
|
|
44
|
+
height: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare type UIWebsiteSize = z.infer<typeof isUIWebsiteSize>;
|
|
47
|
+
export declare const isCreateUIWebsiteEvent: z.ZodObject<{
|
|
48
|
+
url: z.ZodString;
|
|
49
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
allowApi: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
allowPolicy: z.ZodOptional<z.ZodString>;
|
|
52
|
+
position: z.ZodObject<{
|
|
53
|
+
vertical: z.ZodEnum<["top", "middle", "bottom"]>;
|
|
54
|
+
horizontal: z.ZodEnum<["left", "middle", "right"]>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
vertical: "top" | "middle" | "bottom";
|
|
57
|
+
horizontal: "right" | "left" | "middle";
|
|
58
|
+
}, {
|
|
59
|
+
vertical: "top" | "middle" | "bottom";
|
|
60
|
+
horizontal: "right" | "left" | "middle";
|
|
61
|
+
}>;
|
|
62
|
+
size: z.ZodObject<{
|
|
63
|
+
height: z.ZodString;
|
|
64
|
+
width: z.ZodString;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
width: string;
|
|
67
|
+
height: string;
|
|
68
|
+
}, {
|
|
69
|
+
width: string;
|
|
70
|
+
height: string;
|
|
71
|
+
}>;
|
|
72
|
+
margin: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
top: z.ZodOptional<z.ZodString>;
|
|
74
|
+
bottom: z.ZodOptional<z.ZodString>;
|
|
75
|
+
left: z.ZodOptional<z.ZodString>;
|
|
76
|
+
right: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
right?: string | undefined;
|
|
79
|
+
left?: string | undefined;
|
|
80
|
+
top?: string | undefined;
|
|
81
|
+
bottom?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
right?: string | undefined;
|
|
84
|
+
left?: string | undefined;
|
|
85
|
+
top?: string | undefined;
|
|
86
|
+
bottom?: string | undefined;
|
|
87
|
+
}>>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
allowApi?: boolean | undefined;
|
|
90
|
+
allowPolicy?: string | undefined;
|
|
91
|
+
visible?: boolean | undefined;
|
|
92
|
+
margin?: {
|
|
93
|
+
right?: string | undefined;
|
|
94
|
+
left?: string | undefined;
|
|
95
|
+
top?: string | undefined;
|
|
96
|
+
bottom?: string | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
url: string;
|
|
99
|
+
position: {
|
|
100
|
+
vertical: "top" | "middle" | "bottom";
|
|
101
|
+
horizontal: "right" | "left" | "middle";
|
|
102
|
+
};
|
|
103
|
+
size: {
|
|
104
|
+
width: string;
|
|
105
|
+
height: string;
|
|
106
|
+
};
|
|
107
|
+
}, {
|
|
108
|
+
allowApi?: boolean | undefined;
|
|
109
|
+
allowPolicy?: string | undefined;
|
|
110
|
+
visible?: boolean | undefined;
|
|
111
|
+
margin?: {
|
|
112
|
+
right?: string | undefined;
|
|
113
|
+
left?: string | undefined;
|
|
114
|
+
top?: string | undefined;
|
|
115
|
+
bottom?: string | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
url: string;
|
|
118
|
+
position: {
|
|
119
|
+
vertical: "top" | "middle" | "bottom";
|
|
120
|
+
horizontal: "right" | "left" | "middle";
|
|
121
|
+
};
|
|
122
|
+
size: {
|
|
123
|
+
width: string;
|
|
124
|
+
height: string;
|
|
125
|
+
};
|
|
126
|
+
}>;
|
|
127
|
+
export declare type CreateUIWebsiteEvent = z.infer<typeof isCreateUIWebsiteEvent>;
|
|
128
|
+
export declare const isModifyUIWebsiteEvent: z.ZodObject<{
|
|
129
|
+
id: z.ZodString;
|
|
130
|
+
url: z.ZodOptional<z.ZodString>;
|
|
131
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
vertical: z.ZodEnum<["top", "middle", "bottom"]>;
|
|
134
|
+
horizontal: z.ZodEnum<["left", "middle", "right"]>;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
vertical: "top" | "middle" | "bottom";
|
|
137
|
+
horizontal: "right" | "left" | "middle";
|
|
138
|
+
}, {
|
|
139
|
+
vertical: "top" | "middle" | "bottom";
|
|
140
|
+
horizontal: "right" | "left" | "middle";
|
|
141
|
+
}>>;
|
|
142
|
+
size: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
height: z.ZodString;
|
|
144
|
+
width: z.ZodString;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
width: string;
|
|
147
|
+
height: string;
|
|
148
|
+
}, {
|
|
149
|
+
width: string;
|
|
150
|
+
height: string;
|
|
151
|
+
}>>;
|
|
152
|
+
margin: z.ZodOptional<z.ZodObject<{
|
|
153
|
+
top: z.ZodOptional<z.ZodString>;
|
|
154
|
+
bottom: z.ZodOptional<z.ZodString>;
|
|
155
|
+
left: z.ZodOptional<z.ZodString>;
|
|
156
|
+
right: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
right?: string | undefined;
|
|
159
|
+
left?: string | undefined;
|
|
160
|
+
top?: string | undefined;
|
|
161
|
+
bottom?: string | undefined;
|
|
162
|
+
}, {
|
|
163
|
+
right?: string | undefined;
|
|
164
|
+
left?: string | undefined;
|
|
165
|
+
top?: string | undefined;
|
|
166
|
+
bottom?: string | undefined;
|
|
167
|
+
}>>;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
url?: string | undefined;
|
|
170
|
+
position?: {
|
|
171
|
+
vertical: "top" | "middle" | "bottom";
|
|
172
|
+
horizontal: "right" | "left" | "middle";
|
|
173
|
+
} | undefined;
|
|
174
|
+
visible?: boolean | undefined;
|
|
175
|
+
size?: {
|
|
176
|
+
width: string;
|
|
177
|
+
height: string;
|
|
178
|
+
} | undefined;
|
|
179
|
+
margin?: {
|
|
180
|
+
right?: string | undefined;
|
|
181
|
+
left?: string | undefined;
|
|
182
|
+
top?: string | undefined;
|
|
183
|
+
bottom?: string | undefined;
|
|
184
|
+
} | undefined;
|
|
185
|
+
id: string;
|
|
186
|
+
}, {
|
|
187
|
+
url?: string | undefined;
|
|
188
|
+
position?: {
|
|
189
|
+
vertical: "top" | "middle" | "bottom";
|
|
190
|
+
horizontal: "right" | "left" | "middle";
|
|
191
|
+
} | undefined;
|
|
192
|
+
visible?: boolean | undefined;
|
|
193
|
+
size?: {
|
|
194
|
+
width: string;
|
|
195
|
+
height: string;
|
|
196
|
+
} | undefined;
|
|
197
|
+
margin?: {
|
|
198
|
+
right?: string | undefined;
|
|
199
|
+
left?: string | undefined;
|
|
200
|
+
top?: string | undefined;
|
|
201
|
+
bottom?: string | undefined;
|
|
202
|
+
} | undefined;
|
|
203
|
+
id: string;
|
|
204
|
+
}>;
|
|
205
|
+
export declare type ModifyUIWebsiteEvent = z.infer<typeof isModifyUIWebsiteEvent>;
|
|
206
|
+
export declare const isUIWebsite: z.ZodObject<{
|
|
207
|
+
id: z.ZodString;
|
|
208
|
+
url: z.ZodString;
|
|
209
|
+
visible: z.ZodBoolean;
|
|
210
|
+
allowApi: z.ZodBoolean;
|
|
211
|
+
allowPolicy: z.ZodString;
|
|
212
|
+
position: z.ZodObject<{
|
|
213
|
+
vertical: z.ZodEnum<["top", "middle", "bottom"]>;
|
|
214
|
+
horizontal: z.ZodEnum<["left", "middle", "right"]>;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
vertical: "top" | "middle" | "bottom";
|
|
217
|
+
horizontal: "right" | "left" | "middle";
|
|
218
|
+
}, {
|
|
219
|
+
vertical: "top" | "middle" | "bottom";
|
|
220
|
+
horizontal: "right" | "left" | "middle";
|
|
221
|
+
}>;
|
|
222
|
+
size: z.ZodObject<{
|
|
223
|
+
height: z.ZodString;
|
|
224
|
+
width: z.ZodString;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
width: string;
|
|
227
|
+
height: string;
|
|
228
|
+
}, {
|
|
229
|
+
width: string;
|
|
230
|
+
height: string;
|
|
231
|
+
}>;
|
|
232
|
+
margin: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
top: z.ZodOptional<z.ZodString>;
|
|
234
|
+
bottom: z.ZodOptional<z.ZodString>;
|
|
235
|
+
left: z.ZodOptional<z.ZodString>;
|
|
236
|
+
right: z.ZodOptional<z.ZodString>;
|
|
237
|
+
}, "strip", z.ZodTypeAny, {
|
|
238
|
+
right?: string | undefined;
|
|
239
|
+
left?: string | undefined;
|
|
240
|
+
top?: string | undefined;
|
|
241
|
+
bottom?: string | undefined;
|
|
242
|
+
}, {
|
|
243
|
+
right?: string | undefined;
|
|
244
|
+
left?: string | undefined;
|
|
245
|
+
top?: string | undefined;
|
|
246
|
+
bottom?: string | undefined;
|
|
247
|
+
}>>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
margin?: {
|
|
250
|
+
right?: string | undefined;
|
|
251
|
+
left?: string | undefined;
|
|
252
|
+
top?: string | undefined;
|
|
253
|
+
bottom?: string | undefined;
|
|
254
|
+
} | undefined;
|
|
255
|
+
url: string;
|
|
256
|
+
allowApi: boolean;
|
|
257
|
+
allowPolicy: string;
|
|
258
|
+
position: {
|
|
259
|
+
vertical: "top" | "middle" | "bottom";
|
|
260
|
+
horizontal: "right" | "left" | "middle";
|
|
261
|
+
};
|
|
262
|
+
id: string;
|
|
263
|
+
visible: boolean;
|
|
264
|
+
size: {
|
|
265
|
+
width: string;
|
|
266
|
+
height: string;
|
|
267
|
+
};
|
|
268
|
+
}, {
|
|
269
|
+
margin?: {
|
|
270
|
+
right?: string | undefined;
|
|
271
|
+
left?: string | undefined;
|
|
272
|
+
top?: string | undefined;
|
|
273
|
+
bottom?: string | undefined;
|
|
274
|
+
} | undefined;
|
|
275
|
+
url: string;
|
|
276
|
+
allowApi: boolean;
|
|
277
|
+
allowPolicy: string;
|
|
278
|
+
position: {
|
|
279
|
+
vertical: "top" | "middle" | "bottom";
|
|
280
|
+
horizontal: "right" | "left" | "middle";
|
|
281
|
+
};
|
|
282
|
+
id: string;
|
|
283
|
+
visible: boolean;
|
|
284
|
+
size: {
|
|
285
|
+
width: string;
|
|
286
|
+
height: string;
|
|
287
|
+
};
|
|
288
|
+
}>;
|
|
289
|
+
export declare type UIWebsite = z.infer<typeof isUIWebsite>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { IframeEvent,
|
|
3
|
-
export declare function sendToWorkadventure(content: IframeEvent
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { IframeEvent, IframeQuery, IframeQueryMap, IframeResponseEventMap } from "../Events/IframeEvent";
|
|
3
|
+
export declare function sendToWorkadventure(content: IframeEvent): void;
|
|
4
4
|
export declare const answerPromises: Map<number, {
|
|
5
5
|
resolve: (value: IframeQueryMap[keyof IframeQueryMap]["answer"] | PromiseLike<IframeQueryMap[keyof IframeQueryMap]["answer"]>) => void;
|
|
6
6
|
reject: (reason?: any) => void;
|
|
7
7
|
}>;
|
|
8
8
|
export declare function queryWorkadventure<T extends keyof IframeQueryMap>(content: IframeQuery<T>): Promise<IframeQueryMap[T]["answer"]>;
|
|
9
|
-
export interface IframeCallback<Key extends keyof IframeResponseEventMap, T = IframeResponseEventMap[Key], Guard =
|
|
9
|
+
export interface IframeCallback<Key extends keyof IframeResponseEventMap, T = IframeResponseEventMap[Key], Guard = z.ZodType<T>> {
|
|
10
10
|
typeChecker: Guard;
|
|
11
11
|
callback: (payloadData: T) => void;
|
|
12
12
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CreateUIWebsiteEvent, UIWebsiteMargin, UIWebsitePosition, UIWebsiteSize, UIWebsite as UIWebsiteCore } from "../../Events/ui/UIWebsite";
|
|
2
|
+
import { IframeApiContribution } from "../IframeApiContribution";
|
|
3
|
+
export declare class UIWebsite {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
private _url;
|
|
6
|
+
private _visible;
|
|
7
|
+
private readonly _allowPolicy;
|
|
8
|
+
private readonly _allowApi;
|
|
9
|
+
private _position;
|
|
10
|
+
private _size;
|
|
11
|
+
private _margin;
|
|
12
|
+
constructor(config: UIWebsiteCore);
|
|
13
|
+
get url(): string;
|
|
14
|
+
set url(url: string);
|
|
15
|
+
get visible(): boolean;
|
|
16
|
+
set visible(visible: boolean);
|
|
17
|
+
get allowPolicy(): string;
|
|
18
|
+
get allowApi(): boolean;
|
|
19
|
+
get position(): UIWebsitePosition;
|
|
20
|
+
set position(position: UIWebsitePosition);
|
|
21
|
+
get size(): UIWebsiteSize;
|
|
22
|
+
set size(size: UIWebsiteSize);
|
|
23
|
+
get margin(): UIWebsiteMargin;
|
|
24
|
+
set margin(margin: UIWebsiteMargin);
|
|
25
|
+
close(): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export declare class UIWebsiteCommands extends IframeApiContribution<UIWebsiteCommands> {
|
|
28
|
+
callbacks: never[];
|
|
29
|
+
open(createUIWebsite: CreateUIWebsiteEvent): Promise<UIWebsite>;
|
|
30
|
+
getAll(): Promise<UIWebsite[]>;
|
|
31
|
+
}
|
|
32
|
+
declare const _default: UIWebsiteCommands;
|
|
33
|
+
export default _default;
|
|
File without changes
|
|
File without changes
|
|
@@ -3,6 +3,8 @@ export declare class WorkadventureControlsCommands extends IframeApiContribution
|
|
|
3
3
|
callbacks: never[];
|
|
4
4
|
disablePlayerControls(): void;
|
|
5
5
|
restorePlayerControls(): void;
|
|
6
|
+
disablePlayerProximityMeeting(): void;
|
|
7
|
+
restorePlayerProximityMeeting(): void;
|
|
6
8
|
}
|
|
7
9
|
declare const _default: WorkadventureControlsCommands;
|
|
8
10
|
export default _default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,6 +5,7 @@ import { ActionMessage } from "./Ui/ActionMessage";
|
|
|
5
5
|
import { Menu } from "./Ui/Menu";
|
|
6
6
|
import type { RequireOnlyOne } from "../types";
|
|
7
7
|
import { Observable, Subject } from "rxjs";
|
|
8
|
+
import type { UIWebsiteCommands } from "./Ui/UIWebsite";
|
|
8
9
|
interface MenuDescriptor {
|
|
9
10
|
callback?: (commandDescriptor: string) => void;
|
|
10
11
|
iframe?: string;
|
|
@@ -48,6 +49,7 @@ export declare class WorkAdventureUiCommands extends IframeApiContribution<WorkA
|
|
|
48
49
|
displayBubble(): void;
|
|
49
50
|
removeBubble(): void;
|
|
50
51
|
displayActionMessage(actionMessageOptions: ActionMessageOptions): ActionMessage;
|
|
52
|
+
get website(): UIWebsiteCommands;
|
|
51
53
|
}
|
|
52
54
|
declare const _default: WorkAdventureUiCommands;
|
|
53
55
|
export default _default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workadventure/iframe-api-typings",
|
|
3
|
-
"version": "v1.
|
|
3
|
+
"version": "v1.10.0",
|
|
4
4
|
"description": "Typescript typings for WorkAdventure iFrame API",
|
|
5
5
|
"main": "iframe_api.js",
|
|
6
6
|
"types": "iframe_api.d.ts",
|
|
@@ -9,5 +9,8 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"rxjs": "^6.6.3"
|
|
12
15
|
}
|
|
13
16
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare type WorkAdventureDesktopApi = {
|
|
2
|
-
desktop: boolean;
|
|
3
|
-
isDevelopment: () => Promise<boolean>;
|
|
4
|
-
getVersion: () => Promise<string>;
|
|
5
|
-
notify: (txt: string) => void;
|
|
6
|
-
onMuteToggle: (callback: () => void) => void;
|
|
7
|
-
onCameraToggle: (callback: () => void) => void;
|
|
8
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isActionsMenuActionClickedEvent: tg.TypeGuard<object & {
|
|
3
|
-
id: number;
|
|
4
|
-
actionName: string;
|
|
5
|
-
}>;
|
|
6
|
-
export declare type ActionsMenuActionClickedEvent = tg.GuardedType<typeof isActionsMenuActionClickedEvent>;
|
|
7
|
-
export declare type ActionsMenuActionClickedEventCallback = (event: ActionsMenuActionClickedEvent) => void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isAddActionsMenuKeyToRemotePlayerEvent: tg.TypeGuard<object & {
|
|
3
|
-
id: number;
|
|
4
|
-
actionKey: string;
|
|
5
|
-
}>;
|
|
6
|
-
export declare type AddActionsMenuKeyToRemotePlayerEvent = tg.GuardedType<typeof isAddActionsMenuKeyToRemotePlayerEvent>;
|
|
7
|
-
export declare type AddActionsMenuKeyToRemotePlayerEventCallback = (event: AddActionsMenuKeyToRemotePlayerEvent) => void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isButtonClickedEvent: tg.TypeGuard<object & {
|
|
3
|
-
popupId: number;
|
|
4
|
-
buttonId: number;
|
|
5
|
-
}>;
|
|
6
|
-
/**
|
|
7
|
-
* A message sent from the game to the iFrame when a user enters or leaves a zone marked with the "zone" property.
|
|
8
|
-
*/
|
|
9
|
-
export declare type ButtonClickedEvent = tg.GuardedType<typeof isButtonClickedEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isCameraFollowPlayerEvent: tg.TypeGuard<object & {
|
|
3
|
-
smooth: boolean;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the iFrame to the game to make the camera follow player.
|
|
7
|
-
*/
|
|
8
|
-
export declare type CameraFollowPlayerEvent = tg.GuardedType<typeof isCameraFollowPlayerEvent>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isCameraSetEvent: tg.TypeGuard<object & {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
width: number | undefined;
|
|
6
|
-
height: number | undefined;
|
|
7
|
-
lock: boolean;
|
|
8
|
-
smooth: boolean;
|
|
9
|
-
}>;
|
|
10
|
-
/**
|
|
11
|
-
* A message sent from the iFrame to the game to change the camera position.
|
|
12
|
-
*/
|
|
13
|
-
export declare type CameraSetEvent = tg.GuardedType<typeof isCameraSetEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isChangeLayerEvent: tg.TypeGuard<object & {
|
|
3
|
-
name: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the game to the iFrame when a user enters or leaves a layer.
|
|
7
|
-
*/
|
|
8
|
-
export declare type ChangeLayerEvent = tg.GuardedType<typeof isChangeLayerEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isChangeZoneEvent: tg.TypeGuard<object & {
|
|
3
|
-
name: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the game to the iFrame when a user enters or leaves a zone.
|
|
7
|
-
*/
|
|
8
|
-
export declare type ChangeZoneEvent = tg.GuardedType<typeof isChangeZoneEvent>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isChatEvent: tg.TypeGuard<object & {
|
|
3
|
-
message: string;
|
|
4
|
-
author: string;
|
|
5
|
-
}>;
|
|
6
|
-
/**
|
|
7
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
8
|
-
*/
|
|
9
|
-
export declare type ChatEvent = tg.GuardedType<typeof isChatEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isClosePopupEvent: tg.TypeGuard<object & {
|
|
3
|
-
popupId: number;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the iFrame to the game to add a message in the chat.
|
|
7
|
-
*/
|
|
8
|
-
export declare type ClosePopupEvent = tg.GuardedType<typeof isClosePopupEvent>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isColorEvent: tg.TypeGuard<object & {
|
|
3
|
-
red: number;
|
|
4
|
-
green: number;
|
|
5
|
-
blue: number;
|
|
6
|
-
}>;
|
|
7
|
-
/**
|
|
8
|
-
* A message sent from the iFrame to the game to dynamically set the outline of the player.
|
|
9
|
-
*/
|
|
10
|
-
export declare type ColorEvent = tg.GuardedType<typeof isColorEvent>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isRectangle: tg.TypeGuard<object & {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const isEmbeddedWebsiteEvent: tg.TypeGuard<object & {
|
|
9
|
-
name: string;
|
|
10
|
-
} & Partial<{
|
|
11
|
-
url: string;
|
|
12
|
-
visible: boolean;
|
|
13
|
-
allowApi: boolean;
|
|
14
|
-
allow: string;
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
origin: "player" | "map";
|
|
20
|
-
scale: number;
|
|
21
|
-
}>>;
|
|
22
|
-
export declare const isCreateEmbeddedWebsiteEvent: tg.TypeGuard<object & {
|
|
23
|
-
name: string;
|
|
24
|
-
url: string;
|
|
25
|
-
position: object & {
|
|
26
|
-
x: number;
|
|
27
|
-
y: number;
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
};
|
|
31
|
-
} & Partial<{
|
|
32
|
-
visible: boolean;
|
|
33
|
-
allowApi: boolean;
|
|
34
|
-
allow: string;
|
|
35
|
-
origin: "player" | "map";
|
|
36
|
-
scale: number;
|
|
37
|
-
}>>;
|
|
38
|
-
/**
|
|
39
|
-
* A message sent from the iFrame to the game to modify an embedded website
|
|
40
|
-
*/
|
|
41
|
-
export declare type ModifyEmbeddedWebsiteEvent = tg.GuardedType<typeof isEmbeddedWebsiteEvent>;
|
|
42
|
-
export declare type CreateEmbeddedWebsiteEvent = tg.GuardedType<typeof isCreateEmbeddedWebsiteEvent>;
|
|
43
|
-
export declare type Rectangle = tg.GuardedType<typeof isRectangle>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isEnterLeaveEvent: tg.TypeGuard<object & {
|
|
3
|
-
name: string;
|
|
4
|
-
}>;
|
|
5
|
-
/**
|
|
6
|
-
* A message sent from the game to the iFrame when a user enters or leaves a zone marked with the "zone" property.
|
|
7
|
-
*/
|
|
8
|
-
export declare type EnterLeaveEvent = tg.GuardedType<typeof isEnterLeaveEvent>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isGameStateEvent: tg.TypeGuard<object & {
|
|
3
|
-
roomId: string;
|
|
4
|
-
mapUrl: string;
|
|
5
|
-
nickname: string;
|
|
6
|
-
language: string | undefined;
|
|
7
|
-
uuid: string | undefined;
|
|
8
|
-
startLayerName: string | null;
|
|
9
|
-
tags: string[];
|
|
10
|
-
variables: object;
|
|
11
|
-
playerVariables: object;
|
|
12
|
-
userRoomToken: string | undefined;
|
|
13
|
-
}>;
|
|
14
|
-
/**
|
|
15
|
-
* A message sent from the game to the iFrame when the gameState is received by the script
|
|
16
|
-
*/
|
|
17
|
-
export declare type GameStateEvent = tg.GuardedType<typeof isGameStateEvent>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isGoToPageEvent: 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 GoToPageEvent = tg.GuardedType<typeof isGoToPageEvent>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as tg from "generic-type-guard";
|
|
2
|
-
export declare const isHasPlayerMovedEvent: tg.TypeGuard<object & {
|
|
3
|
-
direction: string;
|
|
4
|
-
moving: boolean;
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
oldX: number | undefined;
|
|
8
|
-
oldY: number | undefined;
|
|
9
|
-
}>;
|
|
10
|
-
/**
|
|
11
|
-
* A message sent from the game to the iFrame to notify a movement from the current player.
|
|
12
|
-
*/
|
|
13
|
-
export declare type HasPlayerMovedEvent = tg.GuardedType<typeof isHasPlayerMovedEvent>;
|
|
14
|
-
export declare type HasPlayerMovedEventCallback = (event: HasPlayerMovedEvent) => void;
|