@workadventure/iframe-api-typings 1.11.4 → 1.12.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/Api/Events/AddPlayerEvent.d.ts +86 -0
- package/Api/Events/AskPositionEvent.d.ts +15 -0
- package/Api/Events/ChatEvent.d.ts +29 -0
- package/Api/Events/ChatVisibilityEvent.d.ts +9 -0
- package/Api/Events/EnablePlayersTrackingEvent.d.ts +15 -0
- package/Api/Events/GameStateEvent.d.ts +6 -0
- package/Api/Events/IframeEvent.d.ts +1120 -93
- package/Api/Events/JoinMucEvent.d.ts +21 -0
- package/Api/Events/LeaveMucEvent.d.ts +12 -0
- package/Api/Events/NotificationEvent.d.ts +18 -0
- package/Api/Events/ProximityMeeting/JoinProximityMeetingEvent.d.ts +70 -0
- package/Api/Events/ProximityMeeting/ParticipantProximityMeetingEvent.d.ts +70 -0
- package/Api/Events/SetPlayerVariableEvent.d.ts +27 -0
- package/Api/Events/SetSharedPlayerVariableEvent.d.ts +18 -0
- package/Api/Events/SetVariableEvent.d.ts +1 -9
- package/Api/Events/SettingsEvent.d.ts +12 -0
- package/Api/Events/ShowBusinessCardEvent.d.ts +12 -0
- package/Api/Events/{ui → Ui}/MenuItemClickedEvent.d.ts +0 -0
- package/Api/Events/{ui → Ui}/MenuRegisterEvent.d.ts +0 -0
- package/Api/Events/{ui → Ui}/TriggerActionMessageEvent.d.ts +0 -0
- package/Api/Events/{ui → Ui}/UIWebsite.d.ts +0 -0
- package/Api/Iframe/AbstractState.d.ts +14 -0
- package/Api/{iframe → Iframe}/Area/Area.d.ts +1 -1
- package/Api/{iframe → Iframe}/IframeApiContribution.d.ts +0 -0
- package/Api/Iframe/Player/ProximityMeeting.d.ts +85 -0
- package/Api/Iframe/Players/RemotePlayer.d.ts +81 -0
- package/Api/{iframe → Iframe}/Room/EmbeddedWebsite.d.ts +0 -0
- package/Api/Iframe/Sound/Sound.d.ts +43 -0
- package/Api/{iframe → Iframe}/Ui/ActionMessage.d.ts +0 -0
- package/Api/{iframe → Iframe}/Ui/ButtonDescriptor.d.ts +0 -0
- package/Api/{iframe → Iframe}/Ui/Menu.d.ts +0 -0
- package/Api/{iframe → Iframe}/Ui/Popup.d.ts +0 -0
- package/Api/{iframe → Iframe}/Ui/UIWebsite.d.ts +14 -1
- package/Api/Iframe/area.d.ts +59 -0
- package/Api/Iframe/camera.d.ts +46 -0
- package/Api/Iframe/chat.d.ts +36 -0
- package/Api/Iframe/controls.d.ts +56 -0
- package/Api/Iframe/nav.d.ts +58 -0
- package/Api/Iframe/player.d.ts +141 -0
- package/Api/Iframe/playerState.d.ts +20 -0
- package/Api/Iframe/players.d.ts +135 -0
- package/Api/{iframe → Iframe}/registeredCallbacks.d.ts +2 -2
- package/Api/Iframe/room.d.ts +128 -0
- package/Api/Iframe/sound.d.ts +21 -0
- package/Api/Iframe/state.d.ts +15 -0
- package/Api/{iframe → Iframe}/ui.d.ts +44 -15
- package/Api/Iframe/website.d.ts +32 -0
- package/iframe_api.d.ts +38 -19
- package/package.json +3 -2
- package/Api/Events/RemotePlayerClickedEvent.d.ts +0 -19
- package/Api/iframe/Sound/Sound.d.ts +0 -8
- package/Api/iframe/area.d.ts +0 -25
- package/Api/iframe/camera.d.ts +0 -20
- package/Api/iframe/chat.d.ts +0 -16
- package/Api/iframe/controls.d.ts +0 -10
- package/Api/iframe/nav.d.ts +0 -20
- package/Api/iframe/player.d.ts +0 -43
- package/Api/iframe/room.d.ts +0 -58
- package/Api/iframe/sound.d.ts +0 -8
- package/Api/iframe/state.d.ts +0 -25
- package/Api/iframe/website.d.ts +0 -11
- package/Phaser/Map/ITiledMap.d.ts +0 -170
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AbstractWorkadventureStateCommands } from "./AbstractState";
|
|
2
|
+
export declare class WorkadventureStateCommands extends AbstractWorkadventureStateCommands {
|
|
3
|
+
constructor();
|
|
4
|
+
callbacks: {
|
|
5
|
+
type: "setVariable";
|
|
6
|
+
callback: (event: {
|
|
7
|
+
value?: unknown;
|
|
8
|
+
key: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
}[];
|
|
11
|
+
saveVariable(key: string, value: unknown): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare function createState(): WorkadventureStateCommands & {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
};
|
|
@@ -4,9 +4,9 @@ import { Popup } from "./Ui/Popup";
|
|
|
4
4
|
import { ActionMessage } from "./Ui/ActionMessage";
|
|
5
5
|
import { Menu } from "./Ui/Menu";
|
|
6
6
|
import type { RequireOnlyOne } from "../types";
|
|
7
|
-
import { RemotePlayerClickedEvent } from "../Events/RemotePlayerClickedEvent";
|
|
8
7
|
import { Observable, Subject } from "rxjs";
|
|
9
8
|
import type { UIWebsiteCommands } from "./Ui/UIWebsite";
|
|
9
|
+
import { RemotePlayer } from "./Players/RemotePlayer";
|
|
10
10
|
interface MenuDescriptor {
|
|
11
11
|
callback?: (commandDescriptor: string) => void;
|
|
12
12
|
iframe?: string;
|
|
@@ -18,16 +18,6 @@ export interface ActionMessageOptions {
|
|
|
18
18
|
type?: "message" | "warning";
|
|
19
19
|
callback: () => void;
|
|
20
20
|
}
|
|
21
|
-
export declare class RemotePlayer {
|
|
22
|
-
readonly id: number;
|
|
23
|
-
readonly uuid: string;
|
|
24
|
-
readonly name: string;
|
|
25
|
-
private actions;
|
|
26
|
-
constructor(remotePlayer: RemotePlayerClickedEvent);
|
|
27
|
-
addAction(key: string, callback: () => void): ActionsMenuAction;
|
|
28
|
-
callAction(key: string): void;
|
|
29
|
-
removeAction(key: string): void;
|
|
30
|
-
}
|
|
31
21
|
export declare class ActionsMenuAction {
|
|
32
22
|
private remotePlayer;
|
|
33
23
|
private key;
|
|
@@ -60,9 +50,16 @@ export declare class WorkAdventureUiCommands extends IframeApiContribution<WorkA
|
|
|
60
50
|
} | {
|
|
61
51
|
type: "remotePlayerClickedEvent";
|
|
62
52
|
callback: (event: {
|
|
63
|
-
|
|
53
|
+
outlineColor?: number | undefined;
|
|
54
|
+
position: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
};
|
|
64
58
|
name: string;
|
|
65
|
-
|
|
59
|
+
playerId: number;
|
|
60
|
+
variables: Map<string, unknown>;
|
|
61
|
+
userUuid: string;
|
|
62
|
+
availabilityStatus: string;
|
|
66
63
|
}) => void;
|
|
67
64
|
} | {
|
|
68
65
|
type: "actionsMenuActionClickedEvent";
|
|
@@ -71,12 +68,44 @@ export declare class WorkAdventureUiCommands extends IframeApiContribution<WorkA
|
|
|
71
68
|
actionName: string;
|
|
72
69
|
}) => void;
|
|
73
70
|
})[];
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Open a popup in front of the game.
|
|
73
|
+
* {@link https://workadventu.re/map-building/api-ui.md#opening-a-popup | Website documentation}
|
|
74
|
+
*
|
|
75
|
+
* @param {string} targetObject Targeted object name
|
|
76
|
+
* @param {string} message Message to display
|
|
77
|
+
* @param {ButtonDescriptor[]} buttons Buttons displayed below popup
|
|
78
|
+
* @returns {Popup} Popup created
|
|
79
|
+
*/
|
|
76
80
|
openPopup(targetObject: string, message: string, buttons: ButtonDescriptor[]): Popup;
|
|
81
|
+
/**
|
|
82
|
+
* Add a custom menu item containing the text commandDescriptor in the navbar of the menu. options attribute accepts an object.
|
|
83
|
+
* {@link https://workadventu.re/map-building/api-ui.md#add-custom-menu | Website documentation}
|
|
84
|
+
*
|
|
85
|
+
* @param {string} commandDescriptor Command description
|
|
86
|
+
* @param {MenuOptions | ((commandDescriptor: string) => void)} options Manu options
|
|
87
|
+
* @returns {Menu} Menu created
|
|
88
|
+
*/
|
|
77
89
|
registerMenuCommand(commandDescriptor: string, options: MenuOptions | ((commandDescriptor: string) => void)): Menu;
|
|
90
|
+
addActionsMenuKeyToRemotePlayer(id: number, actionKey: string): void;
|
|
91
|
+
removeActionsMenuKeyFromRemotePlayer(id: number, actionKey: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* Display a bubble like in proximity meeting (Draft function).
|
|
94
|
+
* Todo: enhanced bubble functions behaviors
|
|
95
|
+
*/
|
|
78
96
|
displayBubble(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Remove a bubble like in proximity meeting.
|
|
99
|
+
* Todo: enhanced bubble functions behaviors
|
|
100
|
+
*/
|
|
79
101
|
removeBubble(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Displays a message at the bottom of the screen (that will disappear when space bar is pressed).
|
|
104
|
+
* {@link https://workadventu.re/map-building/api-ui.md#awaiting-user-confirmation-with-space-bar | Website documentation}
|
|
105
|
+
*
|
|
106
|
+
* @param {ActionMessageOptions} actionMessageOptions Action options
|
|
107
|
+
* @returns {ActionMessage} Trigger action message
|
|
108
|
+
*/
|
|
80
109
|
displayActionMessage(actionMessageOptions: ActionMessageOptions): ActionMessage;
|
|
81
110
|
get website(): UIWebsiteCommands;
|
|
82
111
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IframeApiContribution } from "./IframeApiContribution";
|
|
2
|
+
import { EmbeddedWebsite } from "./Room/EmbeddedWebsite";
|
|
3
|
+
import type { CreateEmbeddedWebsiteEvent } from "../Events/EmbeddedWebsiteEvent";
|
|
4
|
+
export declare class WorkadventureRoomWebsiteCommands extends IframeApiContribution<WorkadventureRoomWebsiteCommands> {
|
|
5
|
+
callbacks: never[];
|
|
6
|
+
/**
|
|
7
|
+
* You can get an instance of an embedded website by using the WA.room.website.get() method. It returns a promise of an EmbeddedWebsite instance.
|
|
8
|
+
* {@link https://workadventu.re/map-building/api-room.md#getting-an-instance-of-a-website-already-embedded-in-the-map | Website documentation}
|
|
9
|
+
*
|
|
10
|
+
* @param {string} objectName Object name
|
|
11
|
+
* @returns {Promise<EmbeddedWebsite>} Promise to get a embed website
|
|
12
|
+
*/
|
|
13
|
+
get(objectName: string): Promise<EmbeddedWebsite>;
|
|
14
|
+
/**
|
|
15
|
+
* You can create an instance of an embedded website by using the WA.room.website.create() method. It returns an EmbeddedWebsite instance.
|
|
16
|
+
* {@link https://workadventu.re/map-building/api-room.md#adding-a-new-website-in-a-map | Website documentation}
|
|
17
|
+
*
|
|
18
|
+
* @param createEmbeddedWebsiteEvent
|
|
19
|
+
* @returns {EmbeddedWebsite} Created embed website
|
|
20
|
+
*/
|
|
21
|
+
create(createEmbeddedWebsiteEvent: CreateEmbeddedWebsiteEvent): EmbeddedWebsite;
|
|
22
|
+
/**
|
|
23
|
+
* Use WA.room.website.delete to completely remove an embedded website from your map.
|
|
24
|
+
* {@link https://workadventu.re/map-building/api-room.md#deleting-a-website-from-a-map | Website documentation}
|
|
25
|
+
*
|
|
26
|
+
* @param {string} objectName Object name
|
|
27
|
+
* @returns {Promise<void>} Promise to away to known when the object has been deleted
|
|
28
|
+
*/
|
|
29
|
+
delete(objectName: string): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
declare const _default: WorkadventureRoomWebsiteCommands;
|
|
32
|
+
export default _default;
|
package/iframe_api.d.ts
CHANGED
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
import { CoWebsite } from "./Api/
|
|
2
|
-
import type { ButtonDescriptor } from "./Api/
|
|
3
|
-
import type { Popup } from "./Api/
|
|
4
|
-
import type { Sound } from "./Api/
|
|
5
|
-
export type { UIWebsite } from "./Api/
|
|
6
|
-
export type { Menu } from "./Api/
|
|
7
|
-
export type { ActionMessage } from "./Api/
|
|
8
|
-
export type { EmbeddedWebsite } from "./Api/
|
|
9
|
-
export type { Area } from "./Api/
|
|
10
|
-
export type {
|
|
1
|
+
import { CoWebsite } from "./Api/Iframe/nav";
|
|
2
|
+
import type { ButtonDescriptor } from "./Api/Iframe/Ui/ButtonDescriptor";
|
|
3
|
+
import type { Popup } from "./Api/Iframe/Ui/Popup";
|
|
4
|
+
import type { Sound } from "./Api/Iframe/Sound/Sound";
|
|
5
|
+
export type { UIWebsite } from "./Api/Iframe/Ui/UIWebsite";
|
|
6
|
+
export type { Menu } from "./Api/Iframe/Ui/Menu";
|
|
7
|
+
export type { ActionMessage } from "./Api/Iframe/Ui/ActionMessage";
|
|
8
|
+
export type { EmbeddedWebsite } from "./Api/Iframe/Room/EmbeddedWebsite";
|
|
9
|
+
export type { Area } from "./Api/Iframe/Area/Area";
|
|
10
|
+
export type { ActionsMenuAction } from "./Api/Iframe/ui";
|
|
11
11
|
declare const wa: {
|
|
12
|
-
ui: import("./Api/
|
|
13
|
-
nav: import("./Api/
|
|
14
|
-
controls: import("./Api/
|
|
15
|
-
chat: import("./Api/
|
|
16
|
-
sound: import("./Api/
|
|
17
|
-
room: import("./Api/
|
|
18
|
-
player: import("./Api/
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
ui: import("./Api/Iframe/ui").WorkAdventureUiCommands;
|
|
13
|
+
nav: import("./Api/Iframe/nav").WorkadventureNavigationCommands;
|
|
14
|
+
controls: import("./Api/Iframe/controls").WorkadventureControlsCommands;
|
|
15
|
+
chat: import("./Api/Iframe/chat").WorkadventureChatCommands;
|
|
16
|
+
sound: import("./Api/Iframe/sound").WorkadventureSoundCommands;
|
|
17
|
+
room: import("./Api/Iframe/room").WorkadventureRoomCommands;
|
|
18
|
+
player: import("./Api/Iframe/player").WorkadventurePlayerCommands;
|
|
19
|
+
players: import("./Api/Iframe/players").WorkadventurePlayersCommands;
|
|
20
|
+
camera: import("./Api/Iframe/camera").WorkAdventureCameraCommands;
|
|
21
|
+
state: import("./Api/Iframe/state").WorkadventureStateCommands & {
|
|
21
22
|
[key: string]: unknown;
|
|
22
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* When your script / iFrame loads WorkAdventure, it takes a few milliseconds for your
|
|
26
|
+
* script / iFrame to exchange data with WorkAdventure. You should wait for the WorkAdventure
|
|
27
|
+
* API to be fully ready using the WA.onInit() method.
|
|
28
|
+
* {@link https://workadventu.re/map-building/api-start.md#waiting-for-workadventure-api-to-be-available | Website documentation}
|
|
29
|
+
*
|
|
30
|
+
* Some properties (like the current user name, or the room ID) are not available until WA.onInit has completed.
|
|
31
|
+
*
|
|
32
|
+
* @returns {void}
|
|
33
|
+
*/
|
|
23
34
|
onInit(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* The metadata sent by the administration website.
|
|
37
|
+
* Important: You need to wait for the end of the initialization before accessing.
|
|
38
|
+
* {@link https://workadventu.re/map-building/api-metadata.md | Website documentation}
|
|
39
|
+
*
|
|
40
|
+
* @returns {unknown|undefined} Metadata
|
|
41
|
+
*/
|
|
42
|
+
readonly metadata: unknown;
|
|
24
43
|
/**
|
|
25
44
|
* @deprecated Use WA.chat.sendChatMessage instead
|
|
26
45
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workadventure/iframe-api-typings",
|
|
3
|
-
"version": "v1.
|
|
3
|
+
"version": "v1.12.1",
|
|
4
4
|
"description": "Typescript typings for WorkAdventure iFrame API",
|
|
5
5
|
"main": "iframe_api.js",
|
|
6
6
|
"types": "iframe_api.d.ts",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"rxjs": "^6.6.3"
|
|
14
|
+
"rxjs": "^6.6.3",
|
|
15
|
+
"zod": "^3.14.3"
|
|
15
16
|
}
|
|
16
17
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const isRemotePlayerClickedEvent: z.ZodObject<{
|
|
3
|
-
id: z.ZodNumber;
|
|
4
|
-
uuid: z.ZodString;
|
|
5
|
-
name: z.ZodString;
|
|
6
|
-
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
id: number;
|
|
8
|
-
name: string;
|
|
9
|
-
uuid: string;
|
|
10
|
-
}, {
|
|
11
|
-
id: number;
|
|
12
|
-
name: string;
|
|
13
|
-
uuid: string;
|
|
14
|
-
}>;
|
|
15
|
-
/**
|
|
16
|
-
* A message sent from the game to the iFrame when RemotePlayer is clicked.
|
|
17
|
-
*/
|
|
18
|
-
export declare type RemotePlayerClickedEvent = z.infer<typeof isRemotePlayerClickedEvent>;
|
|
19
|
-
export declare type RemotePlayerClickedEventCallback = (event: RemotePlayerClickedEvent) => void;
|
package/Api/iframe/area.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Subject } from "rxjs";
|
|
2
|
-
import { CreateAreaEvent, ModifyAreaEvent } from "../Events/CreateAreaEvent";
|
|
3
|
-
import { Area } from "./Area/Area";
|
|
4
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
5
|
-
export declare class WorkadventureAreaCommands extends IframeApiContribution<WorkadventureAreaCommands> {
|
|
6
|
-
callbacks: ({
|
|
7
|
-
type: "enterAreaEvent";
|
|
8
|
-
callback: (event: {
|
|
9
|
-
name: string;
|
|
10
|
-
}) => void;
|
|
11
|
-
} | {
|
|
12
|
-
type: "leaveAreaEvent";
|
|
13
|
-
callback: (event: {
|
|
14
|
-
name: string;
|
|
15
|
-
}) => void;
|
|
16
|
-
})[];
|
|
17
|
-
create(createAreaEvent: CreateAreaEvent): Area;
|
|
18
|
-
get(name: string): Promise<Area>;
|
|
19
|
-
delete(name: string): Promise<void>;
|
|
20
|
-
modify(modifyAreaEvent: ModifyAreaEvent): void;
|
|
21
|
-
onEnter(areaName: string): Subject<void>;
|
|
22
|
-
onLeave(areaName: string): Subject<void>;
|
|
23
|
-
}
|
|
24
|
-
declare const _default: WorkadventureAreaCommands;
|
|
25
|
-
export default _default;
|
package/Api/iframe/camera.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
2
|
-
import { Subject } from "rxjs";
|
|
3
|
-
import type { WasCameraUpdatedEvent } from "../Events/WasCameraUpdatedEvent";
|
|
4
|
-
export declare class WorkAdventureCameraCommands extends IframeApiContribution<WorkAdventureCameraCommands> {
|
|
5
|
-
callbacks: {
|
|
6
|
-
type: "wasCameraUpdated";
|
|
7
|
-
callback: (event: {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
zoom: number;
|
|
13
|
-
}) => void;
|
|
14
|
-
}[];
|
|
15
|
-
set(x: number, y: number, width?: number, height?: number, lock?: boolean, smooth?: boolean): void;
|
|
16
|
-
followPlayer(smooth?: boolean): void;
|
|
17
|
-
onCameraUpdate(): Subject<WasCameraUpdatedEvent>;
|
|
18
|
-
}
|
|
19
|
-
declare const _default: WorkAdventureCameraCommands;
|
|
20
|
-
export default _default;
|
package/Api/iframe/chat.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
2
|
-
export declare class WorkadventureChatCommands extends IframeApiContribution<WorkadventureChatCommands> {
|
|
3
|
-
callbacks: {
|
|
4
|
-
type: "userInputChat";
|
|
5
|
-
callback: (event: {
|
|
6
|
-
message: string;
|
|
7
|
-
}) => void;
|
|
8
|
-
}[];
|
|
9
|
-
sendChatMessage(message: string, author: string): void;
|
|
10
|
-
/**
|
|
11
|
-
* Listen to messages sent by the local user, in the chat.
|
|
12
|
-
*/
|
|
13
|
-
onChatMessage(callback: (message: string) => void): void;
|
|
14
|
-
}
|
|
15
|
-
declare const _default: WorkadventureChatCommands;
|
|
16
|
-
export default _default;
|
package/Api/iframe/controls.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
2
|
-
export declare class WorkadventureControlsCommands extends IframeApiContribution<WorkadventureControlsCommands> {
|
|
3
|
-
callbacks: never[];
|
|
4
|
-
disablePlayerControls(): void;
|
|
5
|
-
restorePlayerControls(): void;
|
|
6
|
-
disablePlayerProximityMeeting(): void;
|
|
7
|
-
restorePlayerProximityMeeting(): void;
|
|
8
|
-
}
|
|
9
|
-
declare const _default: WorkadventureControlsCommands;
|
|
10
|
-
export default _default;
|
package/Api/iframe/nav.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
2
|
-
export declare class CoWebsite {
|
|
3
|
-
private readonly id;
|
|
4
|
-
constructor(id: string);
|
|
5
|
-
close(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
export declare class WorkadventureNavigationCommands extends IframeApiContribution<WorkadventureNavigationCommands> {
|
|
8
|
-
callbacks: never[];
|
|
9
|
-
openTab(url: string): void;
|
|
10
|
-
goToPage(url: string): void;
|
|
11
|
-
goToRoom(url: string): void;
|
|
12
|
-
openCoWebSite(url: string, allowApi?: boolean, allowPolicy?: string, widthPercent?: number, position?: number, closable?: boolean, lazy?: boolean): Promise<CoWebsite>;
|
|
13
|
-
getCoWebSites(): Promise<CoWebsite[]>;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use closeCoWebsites instead to close all co-websites
|
|
16
|
-
*/
|
|
17
|
-
closeCoWebSite(): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
declare const _default: WorkadventureNavigationCommands;
|
|
20
|
-
export default _default;
|
package/Api/iframe/player.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
2
|
-
import type { HasPlayerMovedEventCallback } from "../Events/HasPlayerMovedEvent";
|
|
3
|
-
export declare const setPlayerName: (name: string) => void;
|
|
4
|
-
export declare const setPlayerLanguage: (language: string | undefined) => void;
|
|
5
|
-
export declare const setTags: (_tags: string[]) => void;
|
|
6
|
-
export declare const setUserRoomToken: (token: string | undefined) => void;
|
|
7
|
-
export declare const setUuid: (_uuid: string | undefined) => void;
|
|
8
|
-
export declare class WorkadventurePlayerCommands extends IframeApiContribution<WorkadventurePlayerCommands> {
|
|
9
|
-
readonly state: import("./state").WorkadventureStateCommands & {
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
};
|
|
12
|
-
callbacks: {
|
|
13
|
-
type: "hasPlayerMoved";
|
|
14
|
-
callback: (event: {
|
|
15
|
-
oldX?: number | undefined;
|
|
16
|
-
oldY?: number | undefined;
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
direction: "left" | "right" | "up" | "down";
|
|
20
|
-
moving: boolean;
|
|
21
|
-
}) => void;
|
|
22
|
-
}[];
|
|
23
|
-
onPlayerMove(callback: HasPlayerMovedEventCallback): void;
|
|
24
|
-
get name(): string;
|
|
25
|
-
get language(): string;
|
|
26
|
-
get tags(): string[];
|
|
27
|
-
get id(): string | undefined;
|
|
28
|
-
getPosition(): Promise<Position>;
|
|
29
|
-
moveTo(x: number, y: number, speed?: number): Promise<{
|
|
30
|
-
x: number;
|
|
31
|
-
y: number;
|
|
32
|
-
cancelled: boolean;
|
|
33
|
-
}>;
|
|
34
|
-
get userRoomToken(): string | undefined;
|
|
35
|
-
setOutlineColor(red: number, green: number, blue: number): Promise<void>;
|
|
36
|
-
removeOutlineColor(): Promise<void>;
|
|
37
|
-
}
|
|
38
|
-
export declare type Position = {
|
|
39
|
-
x: number;
|
|
40
|
-
y: number;
|
|
41
|
-
};
|
|
42
|
-
declare const _default: WorkadventurePlayerCommands;
|
|
43
|
-
export default _default;
|
package/Api/iframe/room.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Subject } from "rxjs";
|
|
2
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
3
|
-
import type { ITiledMap } from "../../Phaser/Map/ITiledMap";
|
|
4
|
-
import type { WorkadventureRoomWebsiteCommands } from "./website";
|
|
5
|
-
import { WorkadventureAreaCommands } from "./area";
|
|
6
|
-
interface TileDescriptor {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
tile: number | string | null;
|
|
10
|
-
layer: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const setRoomId: (id: string) => void;
|
|
13
|
-
export declare const setMapURL: (url: string) => void;
|
|
14
|
-
export declare class WorkadventureRoomCommands extends IframeApiContribution<WorkadventureRoomCommands> {
|
|
15
|
-
callbacks: ({
|
|
16
|
-
type: "enterEvent";
|
|
17
|
-
callback: (event: {
|
|
18
|
-
name: string;
|
|
19
|
-
}) => void;
|
|
20
|
-
} | {
|
|
21
|
-
type: "leaveEvent";
|
|
22
|
-
callback: (event: {
|
|
23
|
-
name: string;
|
|
24
|
-
}) => void;
|
|
25
|
-
} | {
|
|
26
|
-
type: "enterLayerEvent";
|
|
27
|
-
callback: (event: {
|
|
28
|
-
name: string;
|
|
29
|
-
}) => void;
|
|
30
|
-
} | {
|
|
31
|
-
type: "leaveLayerEvent";
|
|
32
|
-
callback: (event: {
|
|
33
|
-
name: string;
|
|
34
|
-
}) => void;
|
|
35
|
-
})[];
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Use onEnterLayer instead
|
|
38
|
-
*/
|
|
39
|
-
onEnterZone(name: string, callback: () => void): void;
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Use onLeaveLayer instead
|
|
42
|
-
*/
|
|
43
|
-
onLeaveZone(name: string, callback: () => void): void;
|
|
44
|
-
onEnterLayer(layerName: string): Subject<void>;
|
|
45
|
-
onLeaveLayer(layerName: string): Subject<void>;
|
|
46
|
-
showLayer(layerName: string): void;
|
|
47
|
-
hideLayer(layerName: string): void;
|
|
48
|
-
setProperty(layerName: string, propertyName: string, propertyValue: string | number | boolean | undefined): void;
|
|
49
|
-
getTiledMap(): Promise<ITiledMap>;
|
|
50
|
-
setTiles(tiles: TileDescriptor[]): void;
|
|
51
|
-
get id(): string;
|
|
52
|
-
get mapURL(): string;
|
|
53
|
-
loadTileset(url: string): Promise<number>;
|
|
54
|
-
get website(): WorkadventureRoomWebsiteCommands;
|
|
55
|
-
get area(): WorkadventureAreaCommands;
|
|
56
|
-
}
|
|
57
|
-
declare const _default: WorkadventureRoomCommands;
|
|
58
|
-
export default _default;
|
package/Api/iframe/sound.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
2
|
-
import { Sound } from "./Sound/Sound";
|
|
3
|
-
export declare class WorkadventureSoundCommands extends IframeApiContribution<WorkadventureSoundCommands> {
|
|
4
|
-
callbacks: never[];
|
|
5
|
-
loadSound(url: string): Sound;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: WorkadventureSoundCommands;
|
|
8
|
-
export default _default;
|
package/Api/iframe/state.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
3
|
-
export declare class WorkadventureStateCommands extends IframeApiContribution<WorkadventureStateCommands> {
|
|
4
|
-
private target;
|
|
5
|
-
private setVariableResolvers;
|
|
6
|
-
private variables;
|
|
7
|
-
private variableSubscribers;
|
|
8
|
-
constructor(target: "global" | "player");
|
|
9
|
-
callbacks: {
|
|
10
|
-
type: "setVariable";
|
|
11
|
-
callback: (event: {
|
|
12
|
-
value?: unknown;
|
|
13
|
-
key: string;
|
|
14
|
-
target: "global" | "player";
|
|
15
|
-
}) => void;
|
|
16
|
-
}[];
|
|
17
|
-
initVariables(_variables: Map<string, unknown>): void;
|
|
18
|
-
saveVariable(key: string, value: unknown): Promise<void>;
|
|
19
|
-
loadVariable(key: string): unknown;
|
|
20
|
-
hasVariable(key: string): boolean;
|
|
21
|
-
onVariableChange(key: string): Observable<unknown>;
|
|
22
|
-
}
|
|
23
|
-
export declare function createState(target: "global" | "player"): WorkadventureStateCommands & {
|
|
24
|
-
[key: string]: unknown;
|
|
25
|
-
};
|
package/Api/iframe/website.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IframeApiContribution } from "./IframeApiContribution";
|
|
2
|
-
import { EmbeddedWebsite } from "./Room/EmbeddedWebsite";
|
|
3
|
-
import type { CreateEmbeddedWebsiteEvent } from "../Events/EmbeddedWebsiteEvent";
|
|
4
|
-
export declare class WorkadventureRoomWebsiteCommands extends IframeApiContribution<WorkadventureRoomWebsiteCommands> {
|
|
5
|
-
callbacks: never[];
|
|
6
|
-
get(objectName: string): Promise<EmbeddedWebsite>;
|
|
7
|
-
create(createEmbeddedWebsiteEvent: CreateEmbeddedWebsiteEvent): EmbeddedWebsite;
|
|
8
|
-
delete(objectName: string): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
declare const _default: WorkadventureRoomWebsiteCommands;
|
|
11
|
-
export default _default;
|