@workadventure/iframe-api-typings 1.25.6 → 1.25.7
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/iframe_api.d.ts +1 -111
- package/libs/shared-utils/src/Events/ChatEvent.d.ts +168 -0
- package/package.json +2 -2
- package/{Api → play/src/front/Api}/Events/ActionsMenuActionClickedEvent.d.ts +2 -2
- package/{Api → play/src/front/Api}/Events/AddActionsMenuKeyToRemotePlayerEvent.d.ts +2 -2
- package/{Api → play/src/front/Api}/Events/AddPlayerEvent.d.ts +17 -11
- package/{Api → play/src/front/Api}/Events/AskPositionEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/ButtonClickedEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/CameraFollowPlayerEvent.d.ts +4 -1
- package/{Api → play/src/front/Api}/Events/CameraSetEvent.d.ts +8 -5
- package/{Api → play/src/front/Api}/Events/ChangeAreaEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/ChangeLayerEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/ChatVisibilityEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/ClosePopupEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/ColorEvent.d.ts +1 -1
- package/{Api/Events/CreateAreaEvent.d.ts → play/src/front/Api/Events/CreateDynamicAreaEvent.d.ts} +14 -14
- package/{Api → play/src/front/Api}/Events/EmbeddedWebsiteEvent.d.ts +32 -32
- package/{Api → play/src/front/Api}/Events/EnablePlayersTrackingEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/EnterLeaveEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/GameStateEvent.d.ts +17 -8
- package/{Api → play/src/front/Api}/Events/GoToPageEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/HasPlayerMovedEvent.d.ts +5 -5
- package/{Api → play/src/front/Api}/Events/IframeEvent.d.ts +1849 -486
- package/{Api → play/src/front/Api}/Events/JoinMucEvent.d.ts +3 -3
- package/{Api → play/src/front/Api}/Events/LayerEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/LeaveMucEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/LoadPageEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/LoadSoundEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/LoadTilesetEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/MapDataEvent.d.ts +1 -1
- package/play/src/front/Api/Events/ModalEvent.d.ts +27 -0
- package/{Api → play/src/front/Api}/Events/MovePlayerToEvent.d.ts +3 -3
- package/{Api → play/src/front/Api}/Events/MovePlayerToEventAnswer.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/OpenCoWebsiteEvent.d.ts +3 -3
- package/{Api → play/src/front/Api}/Events/OpenPopupEvent.d.ts +7 -7
- package/{Api → play/src/front/Api}/Events/OpenTabEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/PlaySoundEvent.d.ts +3 -3
- package/{Api → play/src/front/Api}/Events/PlayerPosition.d.ts +1 -1
- package/play/src/front/Api/Events/ProximityMeeting/AppendPCMDataEvent.d.ts +14 -0
- package/{Api → play/src/front/Api}/Events/ProximityMeeting/JoinProximityMeetingEvent.d.ts +14 -9
- package/{Api → play/src/front/Api}/Events/ProximityMeeting/ParticipantProximityMeetingEvent.d.ts +14 -9
- package/play/src/front/Api/Events/ProximityMeeting/PlaySoundInBubbleEvent.d.ts +12 -0
- package/play/src/front/Api/Events/ProximityMeeting/StartStreamInBubbleEvent.d.ts +13 -0
- package/play/src/front/Api/Events/ReceiveEventEvent.d.ts +48 -0
- package/{Api → play/src/front/Api}/Events/RemoveActionsMenuKeyFromRemotePlayerEvent.d.ts +2 -2
- package/play/src/front/Api/Events/SendEventEvent.d.ts +48 -0
- package/{Api → play/src/front/Api}/Events/SetAreaPropertyEvent.d.ts +3 -3
- package/{Api → play/src/front/Api}/Events/SetPlayerVariableEvent.d.ts +6 -6
- package/{Api → play/src/front/Api}/Events/SetPropertyEvent.d.ts +3 -3
- package/{Api → play/src/front/Api}/Events/SetSharedPlayerVariableEvent.d.ts +4 -4
- package/{Api → play/src/front/Api}/Events/SetTilesEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/SetVariableEvent.d.ts +7 -7
- package/play/src/front/Api/Events/SettingsEvent.d.ts +24 -0
- package/{Api → play/src/front/Api}/Events/ShowBusinessCardEvent.d.ts +1 -1
- package/{Api → play/src/front/Api}/Events/StopSoundEvent.d.ts +1 -1
- package/play/src/front/Api/Events/TeleportPlayerToEvent.d.ts +12 -0
- package/play/src/front/Api/Events/Ui/BannerEvent.d.ts +42 -0
- package/play/src/front/Api/Events/Ui/ButtonActionBarEvent.d.ts +38 -0
- package/{Api/Events/Ui/MenuRegisterEvent.d.ts → play/src/front/Api/Events/Ui/MenuEvents.d.ts} +29 -7
- package/{Api → play/src/front/Api}/Events/Ui/MenuItemClickedEvent.d.ts +1 -1
- package/play/src/front/Api/Events/Ui/PlayVideoEvent.d.ts +67 -0
- package/{Api → play/src/front/Api}/Events/Ui/TriggerActionMessageEvent.d.ts +3 -3
- package/play/src/front/Api/Events/Ui/TriggerPlayerMessageEvent.d.ts +27 -0
- package/{Api/Events/Ui/UIWebsite.d.ts → play/src/front/Api/Events/Ui/UIWebsiteEvent.d.ts} +95 -95
- package/{Api → play/src/front/Api}/Events/UserInputChatEvent.d.ts +4 -1
- package/play/src/front/Api/Events/WamMapDataEvent.d.ts +12 -0
- package/{Api → play/src/front/Api}/Events/WasCameraUpdatedEvent.d.ts +6 -6
- package/play/src/front/Api/Iframe/AbstractEvent.d.ts +18 -0
- package/play/src/front/Api/Iframe/AbstractState.d.ts +19 -0
- package/{Api → play/src/front/Api}/Iframe/Area/Area.d.ts +5 -4
- package/{Api → play/src/front/Api}/Iframe/IframeApiContribution.d.ts +2 -2
- package/play/src/front/Api/Iframe/MapEditor/MapEditorArea.d.ts +12 -0
- package/play/src/front/Api/Iframe/Player/AudioStream.d.ts +5 -0
- package/play/src/front/Api/Iframe/Player/ProximityMeeting.d.ts +164 -0
- package/{Api → play/src/front/Api}/Iframe/Players/RemotePlayer.d.ts +14 -12
- package/play/src/front/Api/Iframe/PrivatePlayerState.d.ts +7 -0
- package/play/src/front/Api/Iframe/PublicPlayerState.d.ts +11 -0
- package/{Api → play/src/front/Api}/Iframe/Room/EmbeddedWebsite.d.ts +0 -3
- package/play/src/front/Api/Iframe/RoomState.d.ts +7 -0
- package/{Api → play/src/front/Api}/Iframe/Sound/Sound.d.ts +1 -1
- package/play/src/front/Api/Iframe/Ui/Banner.d.ts +21 -0
- package/play/src/front/Api/Iframe/Ui/ButtonActionBar.d.ts +25 -0
- package/{Api → play/src/front/Api}/Iframe/Ui/ButtonDescriptor.d.ts +1 -1
- package/play/src/front/Api/Iframe/Ui/Menu.d.ts +12 -0
- package/play/src/front/Api/Iframe/Ui/Modal.d.ts +28 -0
- package/play/src/front/Api/Iframe/Ui/PlayerMessage.d.ts +12 -0
- package/{Api → play/src/front/Api}/Iframe/Ui/UIWebsite.d.ts +11 -4
- package/play/src/front/Api/Iframe/Ui/Video.d.ts +5 -0
- package/{Api → play/src/front/Api}/Iframe/area.d.ts +9 -9
- package/{Api → play/src/front/Api}/Iframe/camera.d.ts +9 -9
- package/play/src/front/Api/Iframe/chat.d.ts +69 -0
- package/play/src/front/Api/Iframe/controls.d.ts +116 -0
- package/play/src/front/Api/Iframe/event.d.ts +15 -0
- package/play/src/front/Api/Iframe/mapEditor.d.ts +52 -0
- package/{Api → play/src/front/Api}/Iframe/nav.d.ts +9 -5
- package/{Api → play/src/front/Api}/Iframe/player.d.ts +41 -21
- package/{Api → play/src/front/Api}/Iframe/playerState.d.ts +8 -6
- package/{Api → play/src/front/Api}/Iframe/players.d.ts +30 -18
- package/{Api → play/src/front/Api}/Iframe/registeredCallbacks.d.ts +1 -1
- package/{Api → play/src/front/Api}/Iframe/room.d.ts +23 -16
- package/{Api → play/src/front/Api}/Iframe/sound.d.ts +1 -1
- package/{Api → play/src/front/Api}/Iframe/state.d.ts +5 -6
- package/{Api → play/src/front/Api}/Iframe/ui.d.ts +50 -8
- package/{Api → play/src/front/Api}/Iframe/website.d.ts +4 -4
- package/play/src/front/Api/types.d.ts +3 -0
- package/play/src/iframe_api.d.ts +130 -0
- package/Api/Events/ChatEvent.d.ts +0 -44
- package/Api/Events/NotificationEvent.d.ts +0 -18
- package/Api/Events/SettingsEvent.d.ts +0 -12
- package/Api/Iframe/AbstractState.d.ts +0 -14
- package/Api/Iframe/Player/ProximityMeeting.d.ts +0 -85
- package/Api/Iframe/Ui/Menu.d.ts +0 -8
- package/Api/Iframe/chat.d.ts +0 -36
- package/Api/Iframe/controls.d.ts +0 -56
- package/Api/types.d.ts +0 -3
- /package/{Api → play/src/front/Api}/Iframe/Ui/ActionMessage.d.ts +0 -0
- /package/{Api → play/src/front/Api}/Iframe/Ui/Popup.d.ts +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { Observable, Subject } from "rxjs";
|
|
2
|
+
import { IframeApiContribution } from "../IframeApiContribution";
|
|
3
|
+
import { RemotePlayer } from "../Players/RemotePlayer";
|
|
4
|
+
import { AudioStream } from "./AudioStream";
|
|
5
|
+
export declare class WorkadventureProximityMeetingCommands extends IframeApiContribution<WorkadventureProximityMeetingCommands> {
|
|
6
|
+
private joinStream;
|
|
7
|
+
private participantJoinStream;
|
|
8
|
+
private participantLeaveStream;
|
|
9
|
+
private followedStream;
|
|
10
|
+
private unfollowedStream;
|
|
11
|
+
private leaveStream;
|
|
12
|
+
private pcmDataStream;
|
|
13
|
+
callbacks: ({
|
|
14
|
+
type: "joinProximityMeetingEvent";
|
|
15
|
+
callback: (event: {
|
|
16
|
+
users: {
|
|
17
|
+
name: string;
|
|
18
|
+
position: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
playerId: number;
|
|
23
|
+
variables: Map<string, unknown>;
|
|
24
|
+
userUuid: string;
|
|
25
|
+
availabilityStatus: string;
|
|
26
|
+
outlineColor?: number | undefined;
|
|
27
|
+
chatID?: string | null | undefined;
|
|
28
|
+
}[];
|
|
29
|
+
}) => void;
|
|
30
|
+
} | {
|
|
31
|
+
type: "participantJoinProximityMeetingEvent";
|
|
32
|
+
callback: (event: {
|
|
33
|
+
user: {
|
|
34
|
+
name: string;
|
|
35
|
+
position: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
};
|
|
39
|
+
playerId: number;
|
|
40
|
+
variables: Map<string, unknown>;
|
|
41
|
+
userUuid: string;
|
|
42
|
+
availabilityStatus: string;
|
|
43
|
+
outlineColor?: number | undefined;
|
|
44
|
+
chatID?: string | null | undefined;
|
|
45
|
+
};
|
|
46
|
+
}) => void;
|
|
47
|
+
} | {
|
|
48
|
+
type: "participantLeaveProximityMeetingEvent";
|
|
49
|
+
callback: (event: {
|
|
50
|
+
user: {
|
|
51
|
+
name: string;
|
|
52
|
+
position: {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
};
|
|
56
|
+
playerId: number;
|
|
57
|
+
variables: Map<string, unknown>;
|
|
58
|
+
userUuid: string;
|
|
59
|
+
availabilityStatus: string;
|
|
60
|
+
outlineColor?: number | undefined;
|
|
61
|
+
chatID?: string | null | undefined;
|
|
62
|
+
};
|
|
63
|
+
}) => void;
|
|
64
|
+
} | {
|
|
65
|
+
type: "leaveProximityMeetingEvent";
|
|
66
|
+
callback: (event: undefined) => void;
|
|
67
|
+
} | {
|
|
68
|
+
type: "onFollowed";
|
|
69
|
+
callback: (event: {
|
|
70
|
+
user: {
|
|
71
|
+
name: string;
|
|
72
|
+
position: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
playerId: number;
|
|
77
|
+
variables: Map<string, unknown>;
|
|
78
|
+
userUuid: string;
|
|
79
|
+
availabilityStatus: string;
|
|
80
|
+
outlineColor?: number | undefined;
|
|
81
|
+
chatID?: string | null | undefined;
|
|
82
|
+
};
|
|
83
|
+
}) => void;
|
|
84
|
+
} | {
|
|
85
|
+
type: "onUnfollowed";
|
|
86
|
+
callback: (event: {
|
|
87
|
+
user: {
|
|
88
|
+
name: string;
|
|
89
|
+
position: {
|
|
90
|
+
x: number;
|
|
91
|
+
y: number;
|
|
92
|
+
};
|
|
93
|
+
playerId: number;
|
|
94
|
+
variables: Map<string, unknown>;
|
|
95
|
+
userUuid: string;
|
|
96
|
+
availabilityStatus: string;
|
|
97
|
+
outlineColor?: number | undefined;
|
|
98
|
+
chatID?: string | null | undefined;
|
|
99
|
+
};
|
|
100
|
+
}) => void;
|
|
101
|
+
} | {
|
|
102
|
+
type: "appendPCMData";
|
|
103
|
+
callback: (event: {
|
|
104
|
+
data: Float32Array<ArrayBuffer>;
|
|
105
|
+
}) => void;
|
|
106
|
+
})[];
|
|
107
|
+
/**
|
|
108
|
+
* Detecting when the user enter on a meeting.
|
|
109
|
+
* {@link https://docs.workadventu.re/map-building/api-player.md#detecting-when-the-user-entersleaves-a-meeting | Website documentation}
|
|
110
|
+
*
|
|
111
|
+
* @returns {Subject<RemotePlayer[]>} Observable who return the joined users
|
|
112
|
+
*/
|
|
113
|
+
onJoin(): Subject<RemotePlayer[]>;
|
|
114
|
+
/**
|
|
115
|
+
* Detecting when a participant joined on the current meeting.
|
|
116
|
+
* {@link https://docs.workadventu.re/map-building/api-player.md#detecting-when-a-participant-entersleaves-the-current-meeting | Website documentation}
|
|
117
|
+
*
|
|
118
|
+
* @returns {Subject<RemotePlayer>} Observable who return the joined user
|
|
119
|
+
*/
|
|
120
|
+
onParticipantJoin(): Subject<RemotePlayer>;
|
|
121
|
+
/**
|
|
122
|
+
* Detecting when a participant left on the current meeting.
|
|
123
|
+
* {@link https://docs.workadventu.re/map-building/api-player.md#detecting-when-a-participant-entersleaves-the-current-meeting | Website documentation}
|
|
124
|
+
*
|
|
125
|
+
* @returns {Subject<RemotePlayer>} Observable who return the left user
|
|
126
|
+
*/
|
|
127
|
+
onParticipantLeave(): Subject<RemotePlayer>;
|
|
128
|
+
/**
|
|
129
|
+
* Detecting when the user leave on a meeting.
|
|
130
|
+
* {@link https://docs.workadventu.re/developer/map-scripting/references/api-player/#detecting-when-the-user-entersleaves-a-meeting | Website documentation}
|
|
131
|
+
*/
|
|
132
|
+
onLeave(): Subject<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Play a sound to all players in the current meeting.
|
|
135
|
+
* {@link https://docs.workadventu.re/developer/map-scripting/references/api-player/#playing-a-sound-to-players-in-the-same-meeting | Website documentation}
|
|
136
|
+
*/
|
|
137
|
+
playSound(url: string): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Starts an audio stream played to all players in the current meeting.
|
|
140
|
+
* {@link https://docs.workadventu.re/developer/map-scripting/references/api-player/#audio-streams | Website documentation}
|
|
141
|
+
* @param {number} sampleRate - The sample rate of the audio stream expressed in Hertz.
|
|
142
|
+
*/
|
|
143
|
+
startAudioStream(sampleRate: number): Promise<AudioStream>;
|
|
144
|
+
/**
|
|
145
|
+
* Listen to the audio stream played sent by all players.
|
|
146
|
+
* The voice of all players in the bubble is merged in a single stream that is regularly sent to the callback.
|
|
147
|
+
* @param {number} sampleRate - The sample rate of the audio stream expressed in Hertz.
|
|
148
|
+
*/
|
|
149
|
+
listenToAudioStream(sampleRate: number): Observable<Float32Array>;
|
|
150
|
+
/**
|
|
151
|
+
* Ask all players in the current meeting to follow the player.
|
|
152
|
+
* Note that unlike with the "follow" mode in the UI, the other players will automatically follow the player.
|
|
153
|
+
*/
|
|
154
|
+
followMe(): Promise<void>;
|
|
155
|
+
stopLeading(): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Triggered when a player starts following us.
|
|
158
|
+
*/
|
|
159
|
+
onFollowed(): Subject<RemotePlayer>;
|
|
160
|
+
/**
|
|
161
|
+
* Triggered when a player stops following us.
|
|
162
|
+
*/
|
|
163
|
+
onUnfollowed(): Subject<RemotePlayer>;
|
|
164
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Observable } from "rxjs";
|
|
2
|
+
import { Subject } from "rxjs";
|
|
3
|
+
import type { AddPlayerEvent } from "../../Events/AddPlayerEvent";
|
|
4
|
+
import type { PlayerPosition } from "../../Events/PlayerPosition";
|
|
4
5
|
import { ActionsMenuAction } from "../ui";
|
|
5
|
-
|
|
6
|
+
import { PublicPlayerState, ReadOnlyPublicPlayerState } from "../PublicPlayerState";
|
|
6
7
|
export interface RemotePlayerInterface {
|
|
7
8
|
/**
|
|
8
9
|
* A unique ID for this player. Each character on the map has a unique ID
|
|
@@ -32,13 +33,13 @@ export interface RemotePlayerInterface {
|
|
|
32
33
|
/**
|
|
33
34
|
* An object storing players variables
|
|
34
35
|
*/
|
|
35
|
-
readonly state:
|
|
36
|
+
readonly state: ReadOnlyPublicPlayerState;
|
|
37
|
+
/**
|
|
38
|
+
* Send an event to the player.
|
|
39
|
+
* Remote player can listen to this event using `WA.event.on(key).subscribe((event) => { ... })`.
|
|
40
|
+
*/
|
|
41
|
+
sendEvent(key: string, value: unknown): Promise<void>;
|
|
36
42
|
}
|
|
37
|
-
export declare type ReadOnlyState = {
|
|
38
|
-
onVariableChange(key: string): Observable<unknown>;
|
|
39
|
-
} & {
|
|
40
|
-
readonly [key: string]: unknown;
|
|
41
|
-
};
|
|
42
43
|
export declare class RemotePlayer implements RemotePlayerInterface {
|
|
43
44
|
private _playerId;
|
|
44
45
|
private _name;
|
|
@@ -48,7 +49,7 @@ export declare class RemotePlayer implements RemotePlayerInterface {
|
|
|
48
49
|
private _position;
|
|
49
50
|
private _variables;
|
|
50
51
|
private _variablesSubjects;
|
|
51
|
-
readonly state:
|
|
52
|
+
readonly state: ReadOnlyPublicPlayerState;
|
|
52
53
|
private actions;
|
|
53
54
|
constructor(addPlayerEvent: AddPlayerEvent);
|
|
54
55
|
get playerId(): number;
|
|
@@ -69,10 +70,11 @@ export declare class RemotePlayer implements RemotePlayerInterface {
|
|
|
69
70
|
y: number;
|
|
70
71
|
}>;
|
|
71
72
|
destroy(): void;
|
|
72
|
-
setVariable(name:
|
|
73
|
+
setVariable<K extends keyof PublicPlayerState>(name: K, value: PublicPlayerState[K]): void;
|
|
73
74
|
addAction(key: string, callback: () => void): ActionsMenuAction;
|
|
74
75
|
callAction(key: string): void;
|
|
75
76
|
removeAction(key: string): void;
|
|
77
|
+
sendEvent(name: string, data: unknown): Promise<void>;
|
|
76
78
|
}
|
|
77
79
|
export interface RemotePlayerMoved {
|
|
78
80
|
player: RemotePlayerInterface;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PrivatePlayerState is the part of the state of a player that is secret (not shared with other players).
|
|
3
|
+
* The interface is empty. It is meant to be extended by the ScriptingAPI developers to add custom properties.
|
|
4
|
+
*/
|
|
5
|
+
export interface PrivatePlayerState {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
/**
|
|
3
|
+
* PublicPlayerState is the part of the state of a player that is shared with other players.
|
|
4
|
+
* The interface is empty. It is meant to be extended by the ScriptingAPI developers to add custom properties.
|
|
5
|
+
*/
|
|
6
|
+
export interface PublicPlayerState {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export type ReadOnlyPublicPlayerState = Readonly<PublicPlayerState> & {
|
|
10
|
+
onVariableChange<K extends keyof PublicPlayerState>(key: K): Observable<PublicPlayerState[K]>;
|
|
11
|
+
};
|
|
@@ -4,10 +4,7 @@ export declare class EmbeddedWebsite {
|
|
|
4
4
|
readonly name: string;
|
|
5
5
|
private _url;
|
|
6
6
|
private _visible;
|
|
7
|
-
private _allow;
|
|
8
|
-
private _allowApi;
|
|
9
7
|
private _position;
|
|
10
|
-
private readonly origin;
|
|
11
8
|
private _scale;
|
|
12
9
|
constructor(config: CreateEmbeddedWebsiteEvent);
|
|
13
10
|
get url(): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RoomState is the state of a room (i.e. the type associated with the room variables).
|
|
3
|
+
* The interface is empty. It is meant to be extended by the ScriptingAPI developers to add custom properties.
|
|
4
|
+
*/
|
|
5
|
+
export interface RoomState {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IframeApiContribution } from "../IframeApiContribution";
|
|
2
|
+
import { BannerEvent } from "./../../Events/Ui/BannerEvent";
|
|
3
|
+
export declare class WorkadventureBannerCommands extends IframeApiContribution<WorkadventureBannerCommands> {
|
|
4
|
+
callbacks: never[];
|
|
5
|
+
/**
|
|
6
|
+
* Open banner message with link
|
|
7
|
+
*
|
|
8
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#open-banner | Website documentation}
|
|
9
|
+
* @param bannerEvent
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
openBanner(bannerEvent: BannerEvent): void;
|
|
13
|
+
/**
|
|
14
|
+
* Close banner message
|
|
15
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#close-banner | Website documentation}
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
closeBanner(): void;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: WorkadventureBannerCommands;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AddButtonActionBarEvent } from "../../Events/Ui/ButtonActionBarEvent";
|
|
2
|
+
import { IframeApiContribution } from "../IframeApiContribution";
|
|
3
|
+
export type ButtonActionBarClickedCallback = (buttonActionBar: AddButtonActionBarEvent) => void;
|
|
4
|
+
export type ActionBarButtonDescriptor = AddButtonActionBarEvent & {
|
|
5
|
+
callback?: ButtonActionBarClickedCallback;
|
|
6
|
+
};
|
|
7
|
+
export declare class WorkAdventureButtonActionBarCommands extends IframeApiContribution<WorkAdventureButtonActionBarCommands> {
|
|
8
|
+
private _callbacks;
|
|
9
|
+
callbacks: {
|
|
10
|
+
type: "buttonActionBarTriggered";
|
|
11
|
+
callback: (event: string) => void;
|
|
12
|
+
}[];
|
|
13
|
+
/**
|
|
14
|
+
* Add action bar button
|
|
15
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#add-action-bar | Website documentation}
|
|
16
|
+
*/
|
|
17
|
+
addButton(descriptor: ActionBarButtonDescriptor): void;
|
|
18
|
+
/**
|
|
19
|
+
* Remove action bar button
|
|
20
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#remove-action-bar | Website documentation}
|
|
21
|
+
*/
|
|
22
|
+
removeButton(id: string): void;
|
|
23
|
+
}
|
|
24
|
+
declare const _default: WorkAdventureButtonActionBarCommands;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class Menu {
|
|
2
|
+
private key;
|
|
3
|
+
constructor(key: string);
|
|
4
|
+
/**
|
|
5
|
+
* remove the menu
|
|
6
|
+
*/
|
|
7
|
+
remove(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Programmatically open the menu (only works if the menu has been defined with the "iframe" property)
|
|
10
|
+
*/
|
|
11
|
+
open(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IframeApiContribution } from "../IframeApiContribution";
|
|
2
|
+
import type { ModalEvent } from "../../Events/ModalEvent";
|
|
3
|
+
export declare class WorkadventureModalCommands extends IframeApiContribution<WorkadventureModalCommands> {
|
|
4
|
+
private _closeCallback?;
|
|
5
|
+
callbacks: {
|
|
6
|
+
type: "modalCloseTrigger";
|
|
7
|
+
callback: (event: {
|
|
8
|
+
title: string;
|
|
9
|
+
allowApi: boolean;
|
|
10
|
+
position: "left" | "right" | "center";
|
|
11
|
+
allow: string | null;
|
|
12
|
+
src: string;
|
|
13
|
+
allowFullScreen: boolean;
|
|
14
|
+
}) => void;
|
|
15
|
+
}[];
|
|
16
|
+
/**
|
|
17
|
+
* Open instantly the modal window.
|
|
18
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#open-the-modal-iframe | Website documentation}
|
|
19
|
+
*/
|
|
20
|
+
openModal(modalEvent: ModalEvent, closeCallback?: (arg: ModalEvent) => void): void;
|
|
21
|
+
/**
|
|
22
|
+
* Close instantly the modal window.
|
|
23
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#close-the-chat-window | Website documentation}
|
|
24
|
+
*/
|
|
25
|
+
closeModal(): void;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: WorkadventureModalCommands;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PlayerMessageOptions } from "../ui";
|
|
2
|
+
export declare class PlayerMessage {
|
|
3
|
+
private onRemove;
|
|
4
|
+
readonly uuid: string;
|
|
5
|
+
private readonly type;
|
|
6
|
+
private readonly message;
|
|
7
|
+
private readonly callback;
|
|
8
|
+
constructor(playerMessageOptions: PlayerMessageOptions, onRemove: () => void);
|
|
9
|
+
private create;
|
|
10
|
+
remove(): Promise<void>;
|
|
11
|
+
triggerCallback(): void;
|
|
12
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateUIWebsiteEvent, UIWebsiteMargin, UIWebsitePosition, UIWebsiteSize,
|
|
1
|
+
import type { CreateUIWebsiteEvent, UIWebsiteMargin, UIWebsitePosition, UIWebsiteSize, UIWebsiteEvent } from "../../Events/Ui/UIWebsiteEvent";
|
|
2
2
|
import { IframeApiContribution } from "../IframeApiContribution";
|
|
3
3
|
export declare class UIWebsite {
|
|
4
4
|
readonly id: string;
|
|
@@ -9,7 +9,7 @@ export declare class UIWebsite {
|
|
|
9
9
|
private _position;
|
|
10
10
|
private _size;
|
|
11
11
|
private _margin;
|
|
12
|
-
constructor(config:
|
|
12
|
+
constructor(config: UIWebsiteEvent);
|
|
13
13
|
get url(): string;
|
|
14
14
|
set url(url: string);
|
|
15
15
|
get visible(): boolean;
|
|
@@ -28,7 +28,7 @@ export declare class UIWebsiteCommands extends IframeApiContribution<UIWebsiteCo
|
|
|
28
28
|
callbacks: never[];
|
|
29
29
|
/**
|
|
30
30
|
* Open an iFrame that is fixed in the viewport. Use this for advanced popups, additional buttons in the UI, HUD, etc... Returns a promise of a UIWebsite instance.
|
|
31
|
-
* {@link https://workadventu.re/map-building/api-ui.md#display-a-ui-website | Website documentation}
|
|
31
|
+
* {@link https://docs.workadventu.re/map-building/api-ui.md#display-a-ui-website | Website documentation}
|
|
32
32
|
*
|
|
33
33
|
* @param {CreateUIWebsiteEvent} createUIWebsite The details of the UIWebsite to create
|
|
34
34
|
* @returns {Promise<UIWebsite>} Promise to return a UIWebsite
|
|
@@ -36,11 +36,18 @@ export declare class UIWebsiteCommands extends IframeApiContribution<UIWebsiteCo
|
|
|
36
36
|
open(createUIWebsite: CreateUIWebsiteEvent): Promise<UIWebsite>;
|
|
37
37
|
/**
|
|
38
38
|
* Returns all UI websites (iframes positionned on the viewport)
|
|
39
|
-
* {@link https://workadventu.re/map-building/api-ui.md#get-all-ui-websites | Website documentation}
|
|
39
|
+
* {@link https://docs.workadventu.re/map-building/api-ui.md#get-all-ui-websites | Website documentation}
|
|
40
40
|
*
|
|
41
41
|
* @returns {Promise<UIWebsite[]>} Promise to return all UI websites
|
|
42
42
|
*/
|
|
43
43
|
getAll(): Promise<UIWebsite[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns one UI website (iframe positionned on the viewport) by ID.
|
|
46
|
+
* {@link https://docs.workadventu.re/map-building/api-ui.md#get-all-ui-websites | Website documentation}
|
|
47
|
+
* @param {string} id The id of the UIWebsite
|
|
48
|
+
* @returns {Promise<UIWebsite | undefined>} Promise to return UI website
|
|
49
|
+
*/
|
|
50
|
+
getById(id: string): Promise<UIWebsite | undefined>;
|
|
44
51
|
}
|
|
45
52
|
declare const _default: UIWebsiteCommands;
|
|
46
53
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import {
|
|
1
|
+
import type { Observable } from "rxjs";
|
|
2
|
+
import type { CreateDynamicAreaEvent } from "../Events/CreateDynamicAreaEvent";
|
|
3
3
|
import { Area } from "./Area/Area";
|
|
4
4
|
import { IframeApiContribution } from "./IframeApiContribution";
|
|
5
5
|
export declare class WorkadventureAreaCommands extends IframeApiContribution<WorkadventureAreaCommands> {
|
|
@@ -16,23 +16,23 @@ export declare class WorkadventureAreaCommands extends IframeApiContribution<Wor
|
|
|
16
16
|
})[];
|
|
17
17
|
/**
|
|
18
18
|
* Create a new Area object (currently limited to rectangular shapes).
|
|
19
|
-
* {@link https://workadventu.re/map-building/api-room.md#create-area | Website documentation}
|
|
19
|
+
* {@link https://docs.workadventu.re/map-building/api-room.md#create-area | Website documentation}
|
|
20
20
|
*
|
|
21
21
|
* @param {{name: string, x: number, y: number, width: number, height: number}} createAreaEvent Define the name, position and size of the area
|
|
22
22
|
* @returns {Area} Area object
|
|
23
23
|
*/
|
|
24
|
-
create(createAreaEvent:
|
|
24
|
+
create(createAreaEvent: CreateDynamicAreaEvent): Area;
|
|
25
25
|
/**
|
|
26
26
|
* Get an existing Area object.
|
|
27
|
-
* {@link https://workadventu.re/map-building/api-room.md#get-an-area | Website documentation}
|
|
27
|
+
* {@link https://docs.workadventu.re/map-building/api-room.md#get-an-area | Website documentation}
|
|
28
28
|
*
|
|
29
29
|
* @param {string} name Name of the area searched
|
|
30
30
|
* @returns {Area} Area found
|
|
31
31
|
*/
|
|
32
32
|
get(name: string): Promise<Area>;
|
|
33
33
|
/**
|
|
34
|
-
* Delete Area by
|
|
35
|
-
* {@link https://workadventu.re/map-building/api-room.md#delete-area | Website documentation}
|
|
34
|
+
* Delete Area by its name.
|
|
35
|
+
* {@link https://docs.workadventu.re/map-building/api-room.md#delete-area | Website documentation}
|
|
36
36
|
*
|
|
37
37
|
* @param {string} name Area name
|
|
38
38
|
* @returns {Promise<void>} Promise resolved when the removing is finished
|
|
@@ -40,7 +40,7 @@ export declare class WorkadventureAreaCommands extends IframeApiContribution<Wor
|
|
|
40
40
|
delete(name: string): Promise<void>;
|
|
41
41
|
/**
|
|
42
42
|
* Listens to the position of the current user. The event is triggered when the user enters a given area.
|
|
43
|
-
* {@link https://workadventu.re/map-building/api-room.md#detecting-when-the-user-entersleaves-an-area | Website documentation}
|
|
43
|
+
* {@link https://docs.workadventu.re/map-building/api-room.md#detecting-when-the-user-entersleaves-an-area | Website documentation}
|
|
44
44
|
*
|
|
45
45
|
* @param {string} areaName Area name
|
|
46
46
|
* @returns {Subject<void>} An observable fired when someone enters the area
|
|
@@ -48,7 +48,7 @@ export declare class WorkadventureAreaCommands extends IframeApiContribution<Wor
|
|
|
48
48
|
onEnter(areaName: string): Observable<void>;
|
|
49
49
|
/**
|
|
50
50
|
* Listens to the position of the current user. The event is triggered when the user leaves a given area.
|
|
51
|
-
* {@link https://workadventu.re/map-building/api-room.md#detecting-when-the-user-entersleaves-an-area | Website documentation}
|
|
51
|
+
* {@link https://docs.workadventu.re/map-building/api-room.md#detecting-when-the-user-entersleaves-an-area | Website documentation}
|
|
52
52
|
*
|
|
53
53
|
* @param {string} areaName Area name
|
|
54
54
|
* @returns {Subject<void>} An observable fired when someone leaves the area
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Observable } from "rxjs";
|
|
1
|
+
import type { Observable } from "rxjs";
|
|
3
2
|
import type { WasCameraUpdatedEvent } from "../Events/WasCameraUpdatedEvent";
|
|
3
|
+
import { IframeApiContribution } from "./IframeApiContribution";
|
|
4
4
|
export declare class WorkAdventureCameraCommands extends IframeApiContribution<WorkAdventureCameraCommands> {
|
|
5
5
|
callbacks: {
|
|
6
6
|
type: "wasCameraUpdated";
|
|
7
7
|
callback: (event: {
|
|
8
|
+
height: number;
|
|
9
|
+
width: number;
|
|
8
10
|
x: number;
|
|
9
11
|
y: number;
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
12
|
zoom: number;
|
|
13
13
|
}) => void;
|
|
14
14
|
}[];
|
|
15
15
|
/**
|
|
16
16
|
* Set camera to follow the player.
|
|
17
|
-
* {@link https://workadventu.re/map-building/api-camera.md#start-following-player | Website documentation}
|
|
17
|
+
* {@link https://docs.workadventu.re/map-building/api-camera.md#start-following-player | Website documentation}
|
|
18
18
|
*
|
|
19
19
|
* @param smooth Smooth transition
|
|
20
20
|
*/
|
|
21
|
-
followPlayer(smooth?: boolean): void;
|
|
21
|
+
followPlayer(smooth?: boolean, duration?: number): void;
|
|
22
22
|
/**
|
|
23
23
|
* Set camera to look at given spot. Setting width and height will adjust zoom.
|
|
24
24
|
* Set lock to true to lock camera in this position.
|
|
25
25
|
* Set smooth to true for smooth transition.
|
|
26
|
-
* {@link https://workadventu.re/map-building/api-camera.md#set-spot-for-camera-to-look-at | Website documentation}
|
|
26
|
+
* {@link https://docs.workadventu.re/map-building/api-camera.md#set-spot-for-camera-to-look-at | Website documentation}
|
|
27
27
|
*
|
|
28
28
|
* @param {number} x Horizontal position
|
|
29
29
|
* @param {number} y Vertical position
|
|
@@ -32,11 +32,11 @@ export declare class WorkAdventureCameraCommands extends IframeApiContribution<W
|
|
|
32
32
|
* @param {boolean} lock Zoom locked
|
|
33
33
|
* @param {boolean} smooth Smooth transition
|
|
34
34
|
*/
|
|
35
|
-
set(x: number, y: number, width?: number, height?: number, lock?: boolean, smooth?: boolean): void;
|
|
35
|
+
set(x: number, y: number, width?: number, height?: number, lock?: boolean, smooth?: boolean, duration?: number): void;
|
|
36
36
|
/**
|
|
37
37
|
* Listens to updates of the camera viewport.
|
|
38
38
|
* It will trigger for every update of the camera's properties (position or scale for instance).
|
|
39
|
-
* {@link https://workadventu.re/map-building/api-camera.md#listen-to-camera-updates | Website documentation}
|
|
39
|
+
* {@link https://docs.workadventu.re/map-building/api-camera.md#listen-to-camera-updates | Website documentation}
|
|
40
40
|
*
|
|
41
41
|
* @returns {Subject<WasCameraUpdatedEvent>} An observable firing event when the camera is updated
|
|
42
42
|
*/
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Subscription } from "rxjs";
|
|
2
|
+
import { SendChatMessageOptions } from "@workadventure/shared-utils";
|
|
3
|
+
import { IframeApiContribution } from "./IframeApiContribution";
|
|
4
|
+
import { RemotePlayerInterface } from "./Players/RemotePlayer";
|
|
5
|
+
import { PublicPlayerState } from "./PublicPlayerState";
|
|
6
|
+
export interface OnChatMessageOptions {
|
|
7
|
+
scope: "local" | "bubble";
|
|
8
|
+
}
|
|
9
|
+
export declare class WorkadventureChatCommands<PublicState extends {
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}> extends IframeApiContribution<WorkadventureChatCommands<PublicState>> {
|
|
12
|
+
callbacks: {
|
|
13
|
+
type: "userInputChat";
|
|
14
|
+
callback: (event: {
|
|
15
|
+
message: string;
|
|
16
|
+
senderId?: string | undefined;
|
|
17
|
+
}) => void;
|
|
18
|
+
}[];
|
|
19
|
+
/**
|
|
20
|
+
* Open instantly the chat window.
|
|
21
|
+
* {@link https://docs.workadventu.re/map-building/api-chat.md#open-the-chat-window | Website documentation}
|
|
22
|
+
*/
|
|
23
|
+
open(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Close instantly the chat window.
|
|
26
|
+
* {@link https://docs.workadventu.re/map-building/api-chat.md#close-the-chat-window | Website documentation}
|
|
27
|
+
*/
|
|
28
|
+
close(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Sends a message in the chat.
|
|
31
|
+
* {@link https://docs.workadventu.re/developer/map-scripting/references/api-chat#sending-a-message-in-the-chat | Website documentation}
|
|
32
|
+
*
|
|
33
|
+
* @param {string} message Message to be displayed in the chat
|
|
34
|
+
* @param {SendChatMessageOptions|string|undefined} options Decides if the message is sent only to the local users or to all users in the bubble. In undefined, the message is sent to the local user only. If the message is sent locally, you can decide an "author" name to be displayed in the chat. It does not have to be a real user. If a string is passed instead of an object, it will be used as the Name displayed for the author of the message (and the message type will automatically by "local"). Using a string instead of an object is deprecated.
|
|
35
|
+
*/
|
|
36
|
+
sendChatMessage(message: string, options?: string | SendChatMessageOptions): void;
|
|
37
|
+
/**
|
|
38
|
+
* Simulates a user is currently typing a message in the chat.
|
|
39
|
+
*
|
|
40
|
+
* If the scope is "bubble", the typing indicator will be displayed in the chat of all users in the bubble (except the current user)
|
|
41
|
+
* If the scope is "local", the typing indicator will be displayed in the chat of the current user only (and will appear to come from the user whose name is "author")
|
|
42
|
+
*
|
|
43
|
+
* @param options
|
|
44
|
+
*/
|
|
45
|
+
startTyping(options: SendChatMessageOptions): void;
|
|
46
|
+
/**
|
|
47
|
+
* Simulates a user has stopped typing a message in the chat.
|
|
48
|
+
*
|
|
49
|
+
* If the scope is "bubble", the typing indicator will be removed in the chat of all users in the bubble (except the current user)
|
|
50
|
+
* If the scope is "local", the typing indicator will be removed in the chat of the current user only (and will appear to come from the user whose name is "author")
|
|
51
|
+
*
|
|
52
|
+
* @param options
|
|
53
|
+
*/
|
|
54
|
+
stopTyping(options: SendChatMessageOptions): void;
|
|
55
|
+
/**
|
|
56
|
+
* Listens to messages typed in the chat history.
|
|
57
|
+
* {@link https://docs.workadventu.re/map-building/api-chat.md#listening-to-messages-from-the-chat | Website documentation}
|
|
58
|
+
*
|
|
59
|
+
* @param {function(message: string, event: { authorId: number|undefined, author: RemotePlayerInterface|undefined }): void} callback Function that will be called when a message is received. It contains the message typed by the user
|
|
60
|
+
* @param {OnChatMessageOptions} options Options to decide if we listen only to messages from the local user (default) or from all users in the bubble.
|
|
61
|
+
* @return {Subscription} Subscription to the chat message. Call ".unsubscribe()" to stop listening to the chat.
|
|
62
|
+
*/
|
|
63
|
+
onChatMessage(callback: (message: string, event: {
|
|
64
|
+
authorId: number | undefined;
|
|
65
|
+
author: RemotePlayerInterface | undefined;
|
|
66
|
+
}) => void, options?: OnChatMessageOptions): Subscription;
|
|
67
|
+
}
|
|
68
|
+
declare const _default: WorkadventureChatCommands<PublicPlayerState>;
|
|
69
|
+
export default _default;
|