@workadventure/iframe-api-typings 1.14.7 → 1.15.3
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/front/Api/Events/ActionsMenuActionClickedEvent.d.ts +2 -2
- package/front/Api/Events/AddActionsMenuKeyToRemotePlayerEvent.d.ts +2 -2
- package/front/Api/Events/AddPlayerEvent.d.ts +2 -2
- package/front/Api/Events/AskPositionEvent.d.ts +1 -1
- package/front/Api/Events/ButtonClickedEvent.d.ts +1 -1
- package/front/Api/Events/CameraFollowPlayerEvent.d.ts +1 -1
- package/front/Api/Events/CameraSetEvent.d.ts +1 -1
- package/front/Api/Events/ChangeAreaEvent.d.ts +1 -1
- package/front/Api/Events/ChangeLayerEvent.d.ts +1 -1
- package/front/Api/Events/ChatEvent.d.ts +2 -2
- package/front/Api/Events/ChatVisibilityEvent.d.ts +1 -1
- package/front/Api/Events/ClosePopupEvent.d.ts +1 -1
- package/front/Api/Events/ColorEvent.d.ts +1 -1
- package/front/Api/Events/CreateAreaEvent.d.ts +2 -2
- package/front/Api/Events/EmbeddedWebsiteEvent.d.ts +7 -7
- package/front/Api/Events/EnablePlayersTrackingEvent.d.ts +1 -1
- package/front/Api/Events/EnterLeaveEvent.d.ts +1 -1
- package/front/Api/Events/GameStateEvent.d.ts +4 -1
- package/front/Api/Events/GoToPageEvent.d.ts +1 -1
- package/front/Api/Events/HasPlayerMovedEvent.d.ts +2 -2
- package/front/Api/Events/IframeEvent.d.ts +308 -76
- package/front/Api/Events/JoinMucEvent.d.ts +1 -1
- package/front/Api/Events/LayerEvent.d.ts +1 -1
- package/front/Api/Events/LeaveMucEvent.d.ts +1 -1
- package/front/Api/Events/LoadPageEvent.d.ts +1 -1
- package/front/Api/Events/LoadSoundEvent.d.ts +1 -1
- package/front/Api/Events/LoadTilesetEvent.d.ts +1 -1
- package/front/Api/Events/MapDataEvent.d.ts +1 -1
- package/front/Api/Events/ModalEvent.d.ts +1 -1
- package/front/Api/Events/MovePlayerToEvent.d.ts +1 -1
- package/front/Api/Events/MovePlayerToEventAnswer.d.ts +1 -1
- package/front/Api/Events/NotificationEvent.d.ts +1 -1
- package/front/Api/Events/OpenCoWebsiteEvent.d.ts +1 -1
- package/front/Api/Events/OpenPopupEvent.d.ts +1 -1
- package/front/Api/Events/OpenTabEvent.d.ts +1 -1
- package/front/Api/Events/PlaySoundEvent.d.ts +1 -1
- package/front/Api/Events/PlayerPosition.d.ts +1 -1
- package/front/Api/Events/ProximityMeeting/JoinProximityMeetingEvent.d.ts +1 -1
- package/front/Api/Events/ProximityMeeting/ParticipantProximityMeetingEvent.d.ts +1 -1
- package/front/Api/Events/RemoveActionsMenuKeyFromRemotePlayerEvent.d.ts +2 -2
- package/front/Api/Events/SetAreaPropertyEvent.d.ts +1 -1
- package/front/Api/Events/SetPlayerVariableEvent.d.ts +1 -1
- package/front/Api/Events/SetPropertyEvent.d.ts +1 -1
- package/front/Api/Events/SetSharedPlayerVariableEvent.d.ts +1 -1
- package/front/Api/Events/SetTilesEvent.d.ts +1 -1
- package/front/Api/Events/SetVariableEvent.d.ts +1 -1
- package/front/Api/Events/SettingsEvent.d.ts +1 -1
- package/front/Api/Events/ShowBusinessCardEvent.d.ts +1 -1
- package/front/Api/Events/StopSoundEvent.d.ts +1 -1
- package/front/Api/Events/Ui/BannerEvent.d.ts +39 -0
- package/front/Api/Events/Ui/ButtonActionBarEvent.d.ts +53 -4
- package/front/Api/Events/Ui/MenuItemClickedEvent.d.ts +1 -1
- package/front/Api/Events/Ui/MenuRegisterEvent.d.ts +2 -2
- package/front/Api/Events/Ui/TriggerActionMessageEvent.d.ts +3 -3
- package/front/Api/Events/Ui/UIWebsite.d.ts +49 -49
- package/front/Api/Events/UserInputChatEvent.d.ts +1 -1
- package/front/Api/Events/WasCameraUpdatedEvent.d.ts +2 -2
- package/front/Api/Events/XmppSettingsMessageEvent.d.ts +1 -1
- package/front/Api/Iframe/Area/Area.d.ts +1 -1
- package/front/Api/Iframe/Players/RemotePlayer.d.ts +1 -1
- package/front/Api/Iframe/Sound/Sound.d.ts +1 -1
- package/front/Api/Iframe/Ui/Banner.d.ts +21 -0
- package/front/Api/Iframe/Ui/ButtonActionBar.d.ts +26 -8
- package/front/Api/Iframe/Ui/ButtonDescriptor.d.ts +1 -1
- package/front/Api/Iframe/Ui/UIWebsite.d.ts +7 -0
- package/front/Api/Iframe/player.d.ts +1 -1
- package/front/Api/Iframe/ui.d.ts +3 -1
- package/front/Api/types.d.ts +1 -1
- package/iframe_api.d.ts +9 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BannerEvent } from "./../../Events/Ui/BannerEvent";
|
|
2
|
+
import { IframeApiContribution } from "../IframeApiContribution";
|
|
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;
|
|
@@ -1,29 +1,47 @@
|
|
|
1
1
|
import { AddButtonActionBarEvent } from "../../Events/Ui/ButtonActionBarEvent";
|
|
2
2
|
import { IframeApiContribution } from "../IframeApiContribution";
|
|
3
|
-
export
|
|
3
|
+
export type ButtonActionBarClickedCallback = (buttonActionBar: AddButtonActionBarEvent) => void;
|
|
4
|
+
declare const ActionBarButtonType: {
|
|
5
|
+
readonly button: "button";
|
|
6
|
+
readonly action: "action";
|
|
7
|
+
};
|
|
8
|
+
type ActionBarButtonType = (typeof ActionBarButtonType)[keyof typeof ActionBarButtonType];
|
|
9
|
+
export type ActionBarClassicButtonDescriptor = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
type?: ActionBarButtonType;
|
|
13
|
+
callback?: ButtonActionBarClickedCallback;
|
|
14
|
+
};
|
|
15
|
+
export type ActionBarActionButtonDescriptor = {
|
|
16
|
+
id: string;
|
|
17
|
+
type: ActionBarButtonType;
|
|
18
|
+
imageSrc: string;
|
|
19
|
+
toolTip: string;
|
|
20
|
+
callback?: ButtonActionBarClickedCallback;
|
|
21
|
+
};
|
|
4
22
|
export declare class WorkAdventureButtonActionBarCommands extends IframeApiContribution<WorkAdventureButtonActionBarCommands> {
|
|
5
23
|
private _callbacks;
|
|
6
24
|
callbacks: {
|
|
7
25
|
type: "buttonActionBarTrigger";
|
|
8
26
|
callback: (event: {
|
|
27
|
+
type: "button";
|
|
9
28
|
id: string;
|
|
10
29
|
label: string;
|
|
30
|
+
} | {
|
|
31
|
+
type: "action";
|
|
32
|
+
id: string;
|
|
33
|
+
imageSrc: string;
|
|
34
|
+
toolTip: string;
|
|
11
35
|
}) => void;
|
|
12
36
|
}[];
|
|
13
37
|
/**
|
|
14
38
|
* Add action bar button
|
|
15
39
|
* {@link http://workadventure.localhost/map-building/api-ui.md#add-action-bar | Website documentation}
|
|
16
|
-
*
|
|
17
|
-
* @param id
|
|
18
|
-
* @param label
|
|
19
|
-
* @param callback
|
|
20
40
|
*/
|
|
21
|
-
addButton(
|
|
41
|
+
addButton(descriptor: ActionBarClassicButtonDescriptor | ActionBarActionButtonDescriptor): void;
|
|
22
42
|
/**
|
|
23
43
|
* Remove action bar button
|
|
24
44
|
* {@link http://workadventure.localhost/map-building/api-ui.md#remove-action-bar | Website documentation}
|
|
25
|
-
*
|
|
26
|
-
* @param id
|
|
27
45
|
*/
|
|
28
46
|
removeButton(id: string): void;
|
|
29
47
|
}
|
|
@@ -41,6 +41,13 @@ export declare class UIWebsiteCommands extends IframeApiContribution<UIWebsiteCo
|
|
|
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://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;
|
package/front/Api/Iframe/ui.d.ts
CHANGED
|
@@ -10,12 +10,13 @@ import type { UIWebsiteCommands } from "./Ui/UIWebsite";
|
|
|
10
10
|
import { RemotePlayer } from "./Players/RemotePlayer";
|
|
11
11
|
import type { WorkadventureModalCommands } from "./Ui/Modal";
|
|
12
12
|
import { WorkAdventureButtonActionBarCommands } from "./Ui/ButtonActionBar";
|
|
13
|
+
import { WorkadventureBannerCommands } from "./Ui/Banner";
|
|
13
14
|
interface MenuDescriptor {
|
|
14
15
|
callback?: (commandDescriptor: string) => void;
|
|
15
16
|
iframe?: string;
|
|
16
17
|
allowApi?: boolean;
|
|
17
18
|
}
|
|
18
|
-
export
|
|
19
|
+
export type MenuOptions = RequireOnlyOne<MenuDescriptor, "callback" | "iframe">;
|
|
19
20
|
export interface ActionMessageOptions {
|
|
20
21
|
message: string;
|
|
21
22
|
type?: "message" | "warning";
|
|
@@ -113,6 +114,7 @@ export declare class WorkAdventureUiCommands extends IframeApiContribution<WorkA
|
|
|
113
114
|
get website(): UIWebsiteCommands;
|
|
114
115
|
get modal(): WorkadventureModalCommands;
|
|
115
116
|
get actionBar(): WorkAdventureButtonActionBarCommands;
|
|
117
|
+
get banner(): WorkadventureBannerCommands;
|
|
116
118
|
}
|
|
117
119
|
declare const _default: WorkAdventureUiCommands;
|
|
118
120
|
export default _default;
|
package/front/Api/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type RequireOnlyOne<T, keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, keys>> & {
|
|
2
2
|
[K in keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<keys, K>, undefined>>;
|
|
3
3
|
}[keys];
|
package/iframe_api.d.ts
CHANGED
|
@@ -40,6 +40,14 @@ declare const wa: {
|
|
|
40
40
|
* @returns {unknown|undefined} Metadata
|
|
41
41
|
*/
|
|
42
42
|
readonly metadata: unknown;
|
|
43
|
+
/**
|
|
44
|
+
* The iframeId (only set if the code is executed from a UIWebsite iframe)
|
|
45
|
+
* Important: You need to wait for the end of the initialization before accessing.
|
|
46
|
+
* {@link https://workadventu.re/map-building/api-ui.md#get-ui-website-by-id | Website documentation}
|
|
47
|
+
*
|
|
48
|
+
* @returns {string|undefined} IframeId
|
|
49
|
+
*/
|
|
50
|
+
readonly iframeId: string | undefined;
|
|
43
51
|
/**
|
|
44
52
|
* @deprecated Use WA.chat.sendChatMessage instead
|
|
45
53
|
*/
|
|
@@ -101,7 +109,7 @@ declare const wa: {
|
|
|
101
109
|
*/
|
|
102
110
|
onLeaveZone(name: string, callback: () => void): void;
|
|
103
111
|
};
|
|
104
|
-
export
|
|
112
|
+
export type WorkAdventureApi = typeof wa;
|
|
105
113
|
export type { Sound, Popup, ButtonDescriptor, CoWebsite };
|
|
106
114
|
declare global {
|
|
107
115
|
interface Window {
|