@workadventure/iframe-api-typings 1.20.2 → 1.21.1
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/libs/shared-utils/src/Events/ChatEvent.d.ts +20 -17
- package/package.json +2 -2
- package/play/src/front/Api/Events/AddPlayerEvent.d.ts +23 -17
- package/play/src/front/Api/Events/AskPositionEvent.d.ts +2 -2
- package/play/src/front/Api/Events/CameraFollowPlayerEvent.d.ts +2 -2
- package/play/src/front/Api/Events/CameraSetEvent.d.ts +4 -4
- package/play/src/front/Api/Events/CreateDynamicAreaEvent.d.ts +4 -4
- package/play/src/front/Api/Events/EmbeddedWebsiteEvent.d.ts +10 -10
- package/play/src/front/Api/Events/GameStateEvent.d.ts +16 -16
- package/play/src/front/Api/Events/HasPlayerMovedEvent.d.ts +3 -3
- package/play/src/front/Api/Events/IframeEvent.d.ts +625 -640
- package/play/src/front/Api/Events/ModalEvent.d.ts +4 -4
- package/play/src/front/Api/Events/MovePlayerToEvent.d.ts +2 -2
- package/play/src/front/Api/Events/OpenCoWebsiteEvent.d.ts +4 -4
- package/play/src/front/Api/Events/OpenPopupEvent.d.ts +6 -6
- package/play/src/front/Api/Events/PlaySoundEvent.d.ts +2 -2
- package/play/src/front/Api/Events/ProximityMeeting/JoinProximityMeetingEvent.d.ts +21 -16
- package/play/src/front/Api/Events/ProximityMeeting/ParticipantProximityMeetingEvent.d.ts +21 -16
- package/play/src/front/Api/Events/ReceiveEventEvent.d.ts +6 -6
- package/play/src/front/Api/Events/SendEventEvent.d.ts +6 -6
- package/play/src/front/Api/Events/SetAreaPropertyEvent.d.ts +2 -2
- package/play/src/front/Api/Events/SetPlayerVariableEvent.d.ts +5 -5
- package/play/src/front/Api/Events/SetPropertyEvent.d.ts +2 -2
- package/play/src/front/Api/Events/SetSharedPlayerVariableEvent.d.ts +4 -4
- package/play/src/front/Api/Events/SetVariableEvent.d.ts +6 -6
- package/play/src/front/Api/Events/SettingsEvent.d.ts +3 -3
- package/play/src/front/Api/Events/Ui/BannerEvent.d.ts +3 -3
- package/play/src/front/Api/Events/Ui/ButtonActionBarEvent.d.ts +2 -2
- package/play/src/front/Api/Events/Ui/MenuEvents.d.ts +4 -4
- package/play/src/front/Api/Events/Ui/UIWebsiteEvent.d.ts +35 -35
- package/play/src/front/Api/Events/UserInputChatEvent.d.ts +2 -2
- package/play/src/front/Api/Iframe/AbstractEvent.d.ts +2 -2
- package/play/src/front/Api/Iframe/AbstractState.d.ts +1 -1
- package/play/src/front/Api/Iframe/Player/ProximityMeeting.d.ts +25 -20
- package/play/src/front/Api/Iframe/Ui/Modal.d.ts +2 -2
- package/play/src/front/Api/Iframe/chat.d.ts +1 -1
- package/play/src/front/Api/Iframe/event.d.ts +1 -1
- package/play/src/front/Api/Iframe/mapEditor.d.ts +37 -0
- package/play/src/front/Api/Iframe/player.d.ts +2 -2
- package/play/src/front/Api/Iframe/playerState.d.ts +1 -1
- package/play/src/front/Api/Iframe/players.d.ts +11 -9
- package/play/src/front/Api/Iframe/state.d.ts +1 -1
- package/play/src/front/Api/Iframe/ui.d.ts +5 -4
- package/play/src/iframe_api.d.ts +1 -0
- package/play/src/front/Api/Events/NotificationEvent.d.ts +0 -18
|
@@ -9,13 +9,13 @@ export declare const isUIWebsiteMargin: z.ZodObject<{
|
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
10
|
left?: string | undefined;
|
|
11
11
|
top?: string | undefined;
|
|
12
|
-
right?: string | undefined;
|
|
13
12
|
bottom?: string | undefined;
|
|
13
|
+
right?: string | undefined;
|
|
14
14
|
}, {
|
|
15
15
|
left?: string | undefined;
|
|
16
16
|
top?: string | undefined;
|
|
17
|
-
right?: string | undefined;
|
|
18
17
|
bottom?: string | undefined;
|
|
18
|
+
right?: string | undefined;
|
|
19
19
|
}>;
|
|
20
20
|
export type UIWebsiteMargin = z.infer<typeof isUIWebsiteMargin>;
|
|
21
21
|
export declare const isViewportPositionVertical: z.ZodEnum<["top", "middle", "bottom"]>;
|
|
@@ -77,24 +77,15 @@ export declare const isCreateUIWebsiteEvent: z.ZodObject<{
|
|
|
77
77
|
}, "strip", z.ZodTypeAny, {
|
|
78
78
|
left?: string | undefined;
|
|
79
79
|
top?: string | undefined;
|
|
80
|
-
right?: string | undefined;
|
|
81
80
|
bottom?: string | undefined;
|
|
81
|
+
right?: string | undefined;
|
|
82
82
|
}, {
|
|
83
83
|
left?: string | undefined;
|
|
84
84
|
top?: string | undefined;
|
|
85
|
-
right?: string | undefined;
|
|
86
85
|
bottom?: string | undefined;
|
|
86
|
+
right?: string | undefined;
|
|
87
87
|
}>>;
|
|
88
88
|
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
allowApi?: boolean | undefined;
|
|
90
|
-
allowPolicy?: string | undefined;
|
|
91
|
-
visible?: boolean | undefined;
|
|
92
|
-
margin?: {
|
|
93
|
-
left?: string | undefined;
|
|
94
|
-
top?: string | undefined;
|
|
95
|
-
right?: string | undefined;
|
|
96
|
-
bottom?: string | undefined;
|
|
97
|
-
} | undefined;
|
|
98
89
|
url: string;
|
|
99
90
|
position: {
|
|
100
91
|
vertical: "top" | "bottom" | "middle";
|
|
@@ -104,16 +95,16 @@ export declare const isCreateUIWebsiteEvent: z.ZodObject<{
|
|
|
104
95
|
height: string;
|
|
105
96
|
width: string;
|
|
106
97
|
};
|
|
107
|
-
}, {
|
|
108
98
|
allowApi?: boolean | undefined;
|
|
109
99
|
allowPolicy?: string | undefined;
|
|
110
100
|
visible?: boolean | undefined;
|
|
111
101
|
margin?: {
|
|
112
102
|
left?: string | undefined;
|
|
113
103
|
top?: string | undefined;
|
|
114
|
-
right?: string | undefined;
|
|
115
104
|
bottom?: string | undefined;
|
|
105
|
+
right?: string | undefined;
|
|
116
106
|
} | undefined;
|
|
107
|
+
}, {
|
|
117
108
|
url: string;
|
|
118
109
|
position: {
|
|
119
110
|
vertical: "top" | "bottom" | "middle";
|
|
@@ -123,6 +114,15 @@ export declare const isCreateUIWebsiteEvent: z.ZodObject<{
|
|
|
123
114
|
height: string;
|
|
124
115
|
width: string;
|
|
125
116
|
};
|
|
117
|
+
allowApi?: boolean | undefined;
|
|
118
|
+
allowPolicy?: string | undefined;
|
|
119
|
+
visible?: boolean | undefined;
|
|
120
|
+
margin?: {
|
|
121
|
+
left?: string | undefined;
|
|
122
|
+
top?: string | undefined;
|
|
123
|
+
bottom?: string | undefined;
|
|
124
|
+
right?: string | undefined;
|
|
125
|
+
} | undefined;
|
|
126
126
|
}>;
|
|
127
127
|
export type CreateUIWebsiteEvent = z.infer<typeof isCreateUIWebsiteEvent>;
|
|
128
128
|
export declare const isModifyUIWebsiteEvent: z.ZodObject<{
|
|
@@ -157,15 +157,16 @@ export declare const isModifyUIWebsiteEvent: z.ZodObject<{
|
|
|
157
157
|
}, "strip", z.ZodTypeAny, {
|
|
158
158
|
left?: string | undefined;
|
|
159
159
|
top?: string | undefined;
|
|
160
|
-
right?: string | undefined;
|
|
161
160
|
bottom?: string | undefined;
|
|
161
|
+
right?: string | undefined;
|
|
162
162
|
}, {
|
|
163
163
|
left?: string | undefined;
|
|
164
164
|
top?: string | undefined;
|
|
165
|
-
right?: string | undefined;
|
|
166
165
|
bottom?: string | undefined;
|
|
166
|
+
right?: string | undefined;
|
|
167
167
|
}>>;
|
|
168
168
|
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
id: string;
|
|
169
170
|
url?: string | undefined;
|
|
170
171
|
position?: {
|
|
171
172
|
vertical: "top" | "bottom" | "middle";
|
|
@@ -179,11 +180,11 @@ export declare const isModifyUIWebsiteEvent: z.ZodObject<{
|
|
|
179
180
|
margin?: {
|
|
180
181
|
left?: string | undefined;
|
|
181
182
|
top?: string | undefined;
|
|
182
|
-
right?: string | undefined;
|
|
183
183
|
bottom?: string | undefined;
|
|
184
|
+
right?: string | undefined;
|
|
184
185
|
} | undefined;
|
|
185
|
-
id: string;
|
|
186
186
|
}, {
|
|
187
|
+
id: string;
|
|
187
188
|
url?: string | undefined;
|
|
188
189
|
position?: {
|
|
189
190
|
vertical: "top" | "bottom" | "middle";
|
|
@@ -197,10 +198,9 @@ export declare const isModifyUIWebsiteEvent: z.ZodObject<{
|
|
|
197
198
|
margin?: {
|
|
198
199
|
left?: string | undefined;
|
|
199
200
|
top?: string | undefined;
|
|
200
|
-
right?: string | undefined;
|
|
201
201
|
bottom?: string | undefined;
|
|
202
|
+
right?: string | undefined;
|
|
202
203
|
} | undefined;
|
|
203
|
-
id: string;
|
|
204
204
|
}>;
|
|
205
205
|
export type ModifyUIWebsiteEvent = z.infer<typeof isModifyUIWebsiteEvent>;
|
|
206
206
|
export declare const isUIWebsiteEvent: z.ZodObject<{
|
|
@@ -237,53 +237,53 @@ export declare const isUIWebsiteEvent: z.ZodObject<{
|
|
|
237
237
|
}, "strip", z.ZodTypeAny, {
|
|
238
238
|
left?: string | undefined;
|
|
239
239
|
top?: string | undefined;
|
|
240
|
-
right?: string | undefined;
|
|
241
240
|
bottom?: string | undefined;
|
|
241
|
+
right?: string | undefined;
|
|
242
242
|
}, {
|
|
243
243
|
left?: string | undefined;
|
|
244
244
|
top?: string | undefined;
|
|
245
|
-
right?: string | undefined;
|
|
246
245
|
bottom?: string | undefined;
|
|
246
|
+
right?: string | undefined;
|
|
247
247
|
}>>;
|
|
248
248
|
}, "strip", z.ZodTypeAny, {
|
|
249
|
-
margin?: {
|
|
250
|
-
left?: string | undefined;
|
|
251
|
-
top?: string | undefined;
|
|
252
|
-
right?: string | undefined;
|
|
253
|
-
bottom?: string | undefined;
|
|
254
|
-
} | undefined;
|
|
255
249
|
url: string;
|
|
256
250
|
id: string;
|
|
251
|
+
allowApi: boolean;
|
|
252
|
+
allowPolicy: string;
|
|
257
253
|
position: {
|
|
258
254
|
vertical: "top" | "bottom" | "middle";
|
|
259
255
|
horizontal: "left" | "right" | "middle";
|
|
260
256
|
};
|
|
261
|
-
allowApi: boolean;
|
|
262
|
-
allowPolicy: string;
|
|
263
257
|
visible: boolean;
|
|
264
258
|
size: {
|
|
265
259
|
height: string;
|
|
266
260
|
width: string;
|
|
267
261
|
};
|
|
268
|
-
}, {
|
|
269
262
|
margin?: {
|
|
270
263
|
left?: string | undefined;
|
|
271
264
|
top?: string | undefined;
|
|
272
|
-
right?: string | undefined;
|
|
273
265
|
bottom?: string | undefined;
|
|
266
|
+
right?: string | undefined;
|
|
274
267
|
} | undefined;
|
|
268
|
+
}, {
|
|
275
269
|
url: string;
|
|
276
270
|
id: string;
|
|
271
|
+
allowApi: boolean;
|
|
272
|
+
allowPolicy: string;
|
|
277
273
|
position: {
|
|
278
274
|
vertical: "top" | "bottom" | "middle";
|
|
279
275
|
horizontal: "left" | "right" | "middle";
|
|
280
276
|
};
|
|
281
|
-
allowApi: boolean;
|
|
282
|
-
allowPolicy: string;
|
|
283
277
|
visible: boolean;
|
|
284
278
|
size: {
|
|
285
279
|
height: string;
|
|
286
280
|
width: string;
|
|
287
281
|
};
|
|
282
|
+
margin?: {
|
|
283
|
+
left?: string | undefined;
|
|
284
|
+
top?: string | undefined;
|
|
285
|
+
bottom?: string | undefined;
|
|
286
|
+
right?: string | undefined;
|
|
287
|
+
} | undefined;
|
|
288
288
|
}>;
|
|
289
289
|
export type UIWebsiteEvent = z.infer<typeof isUIWebsiteEvent>;
|
|
@@ -3,11 +3,11 @@ export declare const isUserInputChatEvent: z.ZodObject<{
|
|
|
3
3
|
message: z.ZodString;
|
|
4
4
|
senderId: z.ZodOptional<z.ZodNumber>;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
senderId?: number | undefined;
|
|
7
6
|
message: string;
|
|
8
|
-
}, {
|
|
9
7
|
senderId?: number | undefined;
|
|
8
|
+
}, {
|
|
10
9
|
message: string;
|
|
10
|
+
senderId?: number | undefined;
|
|
11
11
|
}>;
|
|
12
12
|
/**
|
|
13
13
|
* A message sent from the game to the iFrame when a user types a message in the chat.
|
|
@@ -4,14 +4,14 @@ import { ReceiveEventEvent } from "../Events/ReceiveEventEvent";
|
|
|
4
4
|
export type ScriptingEvent = ReceiveEventEvent;
|
|
5
5
|
export declare abstract class AbstractWorkadventureEventCommands {
|
|
6
6
|
protected receivedEventResolvers: Subject<{
|
|
7
|
+
name: string;
|
|
7
8
|
data?: unknown;
|
|
8
9
|
senderId?: number | undefined;
|
|
9
|
-
name: string;
|
|
10
10
|
}>;
|
|
11
11
|
protected eventSubscribers: Map<string, Subject<{
|
|
12
|
+
name: string;
|
|
12
13
|
data?: unknown;
|
|
13
14
|
senderId?: number | undefined;
|
|
14
|
-
name: string;
|
|
15
15
|
}>>;
|
|
16
16
|
protected constructor();
|
|
17
17
|
on(key: string): Observable<ScriptingEvent>;
|
|
@@ -4,8 +4,8 @@ export declare abstract class AbstractWorkadventureStateCommands<State extends {
|
|
|
4
4
|
[key: string]: unknown;
|
|
5
5
|
}> {
|
|
6
6
|
protected setVariableResolvers: Subject<{
|
|
7
|
-
value?: unknown;
|
|
8
7
|
key: string;
|
|
8
|
+
value?: unknown;
|
|
9
9
|
}>;
|
|
10
10
|
protected variables: Partial<State>;
|
|
11
11
|
protected variableSubscribers: Partial<{
|
|
@@ -12,48 +12,51 @@ export declare class WorkadventureProximityMeetingCommands extends IframeApiCont
|
|
|
12
12
|
type: "joinProximityMeetingEvent";
|
|
13
13
|
callback: (event: {
|
|
14
14
|
users: {
|
|
15
|
-
outlineColor?: number | undefined;
|
|
16
15
|
name: string;
|
|
17
|
-
availabilityStatus: string;
|
|
18
16
|
position: {
|
|
19
17
|
x: number;
|
|
20
18
|
y: number;
|
|
21
19
|
};
|
|
22
|
-
userUuid: string;
|
|
23
|
-
variables: Map<string, unknown>;
|
|
24
20
|
playerId: number;
|
|
21
|
+
variables: Map<string, unknown>;
|
|
22
|
+
userUuid: string;
|
|
23
|
+
availabilityStatus: string;
|
|
24
|
+
outlineColor?: number | undefined;
|
|
25
|
+
chatID?: string | null | undefined;
|
|
25
26
|
}[];
|
|
26
27
|
}) => void;
|
|
27
28
|
} | {
|
|
28
29
|
type: "participantJoinProximityMeetingEvent";
|
|
29
30
|
callback: (event: {
|
|
30
31
|
user: {
|
|
31
|
-
outlineColor?: number | undefined;
|
|
32
32
|
name: string;
|
|
33
|
-
availabilityStatus: string;
|
|
34
33
|
position: {
|
|
35
34
|
x: number;
|
|
36
35
|
y: number;
|
|
37
36
|
};
|
|
38
|
-
userUuid: string;
|
|
39
|
-
variables: Map<string, unknown>;
|
|
40
37
|
playerId: number;
|
|
38
|
+
variables: Map<string, unknown>;
|
|
39
|
+
userUuid: string;
|
|
40
|
+
availabilityStatus: string;
|
|
41
|
+
outlineColor?: number | undefined;
|
|
42
|
+
chatID?: string | null | undefined;
|
|
41
43
|
};
|
|
42
44
|
}) => void;
|
|
43
45
|
} | {
|
|
44
46
|
type: "participantLeaveProximityMeetingEvent";
|
|
45
47
|
callback: (event: {
|
|
46
48
|
user: {
|
|
47
|
-
outlineColor?: number | undefined;
|
|
48
49
|
name: string;
|
|
49
|
-
availabilityStatus: string;
|
|
50
50
|
position: {
|
|
51
51
|
x: number;
|
|
52
52
|
y: number;
|
|
53
53
|
};
|
|
54
|
-
userUuid: string;
|
|
55
|
-
variables: Map<string, unknown>;
|
|
56
54
|
playerId: number;
|
|
55
|
+
variables: Map<string, unknown>;
|
|
56
|
+
userUuid: string;
|
|
57
|
+
availabilityStatus: string;
|
|
58
|
+
outlineColor?: number | undefined;
|
|
59
|
+
chatID?: string | null | undefined;
|
|
57
60
|
};
|
|
58
61
|
}) => void;
|
|
59
62
|
} | {
|
|
@@ -63,32 +66,34 @@ export declare class WorkadventureProximityMeetingCommands extends IframeApiCont
|
|
|
63
66
|
type: "onFollowed";
|
|
64
67
|
callback: (event: {
|
|
65
68
|
user: {
|
|
66
|
-
outlineColor?: number | undefined;
|
|
67
69
|
name: string;
|
|
68
|
-
availabilityStatus: string;
|
|
69
70
|
position: {
|
|
70
71
|
x: number;
|
|
71
72
|
y: number;
|
|
72
73
|
};
|
|
73
|
-
userUuid: string;
|
|
74
|
-
variables: Map<string, unknown>;
|
|
75
74
|
playerId: number;
|
|
75
|
+
variables: Map<string, unknown>;
|
|
76
|
+
userUuid: string;
|
|
77
|
+
availabilityStatus: string;
|
|
78
|
+
outlineColor?: number | undefined;
|
|
79
|
+
chatID?: string | null | undefined;
|
|
76
80
|
};
|
|
77
81
|
}) => void;
|
|
78
82
|
} | {
|
|
79
83
|
type: "onUnfollowed";
|
|
80
84
|
callback: (event: {
|
|
81
85
|
user: {
|
|
82
|
-
outlineColor?: number | undefined;
|
|
83
86
|
name: string;
|
|
84
|
-
availabilityStatus: string;
|
|
85
87
|
position: {
|
|
86
88
|
x: number;
|
|
87
89
|
y: number;
|
|
88
90
|
};
|
|
89
|
-
userUuid: string;
|
|
90
|
-
variables: Map<string, unknown>;
|
|
91
91
|
playerId: number;
|
|
92
|
+
variables: Map<string, unknown>;
|
|
93
|
+
userUuid: string;
|
|
94
|
+
availabilityStatus: string;
|
|
95
|
+
outlineColor?: number | undefined;
|
|
96
|
+
chatID?: string | null | undefined;
|
|
92
97
|
};
|
|
93
98
|
}) => void;
|
|
94
99
|
})[];
|
|
@@ -6,10 +6,10 @@ export declare class WorkadventureModalCommands extends IframeApiContribution<Wo
|
|
|
6
6
|
type: "modalCloseTrigger";
|
|
7
7
|
callback: (event: {
|
|
8
8
|
title: string;
|
|
9
|
-
position: "left" | "right" | "center";
|
|
10
|
-
src: string;
|
|
11
9
|
allowApi: boolean;
|
|
10
|
+
position: "left" | "right" | "center";
|
|
12
11
|
allow: string | null;
|
|
12
|
+
src: string;
|
|
13
13
|
}) => void;
|
|
14
14
|
}[];
|
|
15
15
|
/**
|
|
@@ -4,9 +4,9 @@ export declare class WorkadventureEventCommands extends AbstractWorkadventureEve
|
|
|
4
4
|
callbacks: {
|
|
5
5
|
type: "receiveEvent";
|
|
6
6
|
callback: (event: {
|
|
7
|
+
name: string;
|
|
7
8
|
data?: unknown;
|
|
8
9
|
senderId?: number | undefined;
|
|
9
|
-
name: string;
|
|
10
10
|
}) => void;
|
|
11
11
|
}[];
|
|
12
12
|
broadcast(name: string, data: unknown): Promise<void>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Observable } from "rxjs";
|
|
2
|
+
import { IframeApiContribution } from "./IframeApiContribution";
|
|
3
|
+
declare class WorkadventureMapEditorAreaCommands extends IframeApiContribution<WorkadventureMapEditorAreaCommands> {
|
|
4
|
+
callbacks: ({
|
|
5
|
+
type: "enterMapEditorAreaEvent";
|
|
6
|
+
callback: (event: {
|
|
7
|
+
name: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
} | {
|
|
10
|
+
type: "leaveMapEditorAreaEvent";
|
|
11
|
+
callback: (event: {
|
|
12
|
+
name: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
})[];
|
|
15
|
+
/**
|
|
16
|
+
* Listens to the position of the current user. The event is triggered when the user enters a given area.
|
|
17
|
+
* {@link https://workadventu.re/map-building/api-mapeditor.md#detecting-when-the-user-entersleaves-an-area | Website documentation}
|
|
18
|
+
*
|
|
19
|
+
* @param {string} areaName Area name
|
|
20
|
+
* @returns {Subject<void>} An observable fired when someone enters the area
|
|
21
|
+
*/
|
|
22
|
+
onEnter(areaName: string): Observable<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Listens to the position of the current user. The event is triggered when the user leaves a given area.
|
|
25
|
+
* {@link https://workadventu.re/map-building/api-mapeditor.md#detecting-when-the-user-entersleaves-an-area | Website documentation}
|
|
26
|
+
*
|
|
27
|
+
* @param {string} areaName Area name
|
|
28
|
+
* @returns {Subject<void>} An observable fired when someone leaves the area
|
|
29
|
+
*/
|
|
30
|
+
onLeave(areaName: string): Observable<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare class WorkadventureMapEditorCommands extends IframeApiContribution<WorkadventureMapEditorCommands> {
|
|
33
|
+
callbacks: never[];
|
|
34
|
+
get area(): WorkadventureMapEditorAreaCommands;
|
|
35
|
+
}
|
|
36
|
+
declare const _default: WorkadventureMapEditorCommands;
|
|
37
|
+
export default _default;
|
|
@@ -15,12 +15,12 @@ export declare class WorkadventurePlayerCommands extends IframeApiContribution<W
|
|
|
15
15
|
callbacks: {
|
|
16
16
|
type: "hasPlayerMoved";
|
|
17
17
|
callback: (event: {
|
|
18
|
-
oldX?: number | undefined;
|
|
19
|
-
oldY?: number | undefined;
|
|
20
18
|
x: number;
|
|
21
19
|
y: number;
|
|
22
20
|
direction: "left" | "right" | "up" | "down";
|
|
23
21
|
moving: boolean;
|
|
22
|
+
oldX?: number | undefined;
|
|
23
|
+
oldY?: number | undefined;
|
|
24
24
|
}) => void;
|
|
25
25
|
}[];
|
|
26
26
|
/**
|
|
@@ -7,8 +7,8 @@ export declare class WorkadventurePlayerStateCommands extends AbstractWorkadvent
|
|
|
7
7
|
callbacks: {
|
|
8
8
|
type: "setPlayerVariable";
|
|
9
9
|
callback: (event: {
|
|
10
|
-
value?: unknown;
|
|
11
10
|
key: string;
|
|
11
|
+
value?: unknown;
|
|
12
12
|
}) => void;
|
|
13
13
|
}[];
|
|
14
14
|
saveVariable<K extends keyof PlayerState & string>(key: K, value: PlayerState[K], options?: {
|
|
@@ -21,23 +21,24 @@ export declare class WorkadventurePlayersCommands extends IframeApiContribution<
|
|
|
21
21
|
callbacks: ({
|
|
22
22
|
type: "setSharedPlayerVariable";
|
|
23
23
|
callback: (event: {
|
|
24
|
-
value?: unknown;
|
|
25
|
-
key: string;
|
|
26
24
|
playerId: number;
|
|
25
|
+
key: string;
|
|
26
|
+
value?: unknown;
|
|
27
27
|
}) => void;
|
|
28
28
|
} | {
|
|
29
29
|
type: "addRemotePlayer";
|
|
30
30
|
callback: (event: {
|
|
31
|
-
outlineColor?: number | undefined;
|
|
32
31
|
name: string;
|
|
33
|
-
availabilityStatus: string;
|
|
34
32
|
position: {
|
|
35
33
|
x: number;
|
|
36
34
|
y: number;
|
|
37
35
|
};
|
|
38
|
-
userUuid: string;
|
|
39
|
-
variables: Map<string, unknown>;
|
|
40
36
|
playerId: number;
|
|
37
|
+
variables: Map<string, unknown>;
|
|
38
|
+
userUuid: string;
|
|
39
|
+
availabilityStatus: string;
|
|
40
|
+
outlineColor?: number | undefined;
|
|
41
|
+
chatID?: string | null | undefined;
|
|
41
42
|
}) => void;
|
|
42
43
|
} | {
|
|
43
44
|
type: "removeRemotePlayer";
|
|
@@ -45,15 +46,16 @@ export declare class WorkadventurePlayersCommands extends IframeApiContribution<
|
|
|
45
46
|
} | {
|
|
46
47
|
type: "remotePlayerChanged";
|
|
47
48
|
callback: (event: {
|
|
49
|
+
playerId: number;
|
|
48
50
|
name?: string | undefined;
|
|
49
|
-
outlineColor?: number | undefined;
|
|
50
|
-
availabilityStatus?: string | undefined;
|
|
51
51
|
position?: {
|
|
52
52
|
x: number;
|
|
53
53
|
y: number;
|
|
54
54
|
} | undefined;
|
|
55
55
|
variables?: Map<string, unknown> | undefined;
|
|
56
|
-
|
|
56
|
+
availabilityStatus?: string | undefined;
|
|
57
|
+
outlineColor?: number | undefined;
|
|
58
|
+
chatID?: string | null | undefined;
|
|
57
59
|
}) => void;
|
|
58
60
|
})[];
|
|
59
61
|
private registerRemotePlayer;
|
|
@@ -5,8 +5,8 @@ export declare class WorkadventureStateCommands extends AbstractWorkadventureSta
|
|
|
5
5
|
callbacks: {
|
|
6
6
|
type: "setVariable";
|
|
7
7
|
callback: (event: {
|
|
8
|
-
value?: unknown;
|
|
9
8
|
key: string;
|
|
9
|
+
value?: unknown;
|
|
10
10
|
}) => void;
|
|
11
11
|
}[];
|
|
12
12
|
saveVariable<K extends keyof RoomState & string>(key: K, value: RoomState[K]): Promise<void>;
|
|
@@ -64,16 +64,17 @@ export declare class WorkAdventureUiCommands extends IframeApiContribution<WorkA
|
|
|
64
64
|
} | {
|
|
65
65
|
type: "remotePlayerClickedEvent";
|
|
66
66
|
callback: (event: {
|
|
67
|
-
outlineColor?: number | undefined;
|
|
68
67
|
name: string;
|
|
69
|
-
availabilityStatus: string;
|
|
70
68
|
position: {
|
|
71
69
|
x: number;
|
|
72
70
|
y: number;
|
|
73
71
|
};
|
|
74
|
-
userUuid: string;
|
|
75
|
-
variables: Map<string, unknown>;
|
|
76
72
|
playerId: number;
|
|
73
|
+
variables: Map<string, unknown>;
|
|
74
|
+
userUuid: string;
|
|
75
|
+
availabilityStatus: string;
|
|
76
|
+
outlineColor?: number | undefined;
|
|
77
|
+
chatID?: string | null | undefined;
|
|
77
78
|
}) => void;
|
|
78
79
|
} | {
|
|
79
80
|
type: "actionsMenuActionClickedEvent";
|
package/play/src/iframe_api.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare const wa: {
|
|
|
31
31
|
camera: import("./front/Api/Iframe/camera").WorkAdventureCameraCommands;
|
|
32
32
|
state: import("./front/Api/Iframe/state").WorkadventureStateCommands & import("./front/Api/Iframe/RoomState").RoomState;
|
|
33
33
|
event: import("./front/Api/Iframe/event").WorkadventureEventCommands;
|
|
34
|
+
mapEditor: import("./front/Api/Iframe/mapEditor").WorkadventureMapEditorCommands;
|
|
34
35
|
/**
|
|
35
36
|
* When your script / iFrame loads WorkAdventure, it takes a few milliseconds for your
|
|
36
37
|
* script / iFrame to exchange data with WorkAdventure. You should wait for the WorkAdventure
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const isNotificationEvent: z.ZodObject<{
|
|
3
|
-
userName: z.ZodString;
|
|
4
|
-
notificationType: z.ZodNumber;
|
|
5
|
-
forum: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
-
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
forum?: string | null | undefined;
|
|
8
|
-
userName: string;
|
|
9
|
-
notificationType: number;
|
|
10
|
-
}, {
|
|
11
|
-
forum?: string | null | undefined;
|
|
12
|
-
userName: string;
|
|
13
|
-
notificationType: number;
|
|
14
|
-
}>;
|
|
15
|
-
/**
|
|
16
|
-
* A message sent from the iFrame to the game to emit a notification.
|
|
17
|
-
*/
|
|
18
|
-
export type NotificationEvent = z.infer<typeof isNotificationEvent>;
|