@workadventure/iframe-api-typings 1.11.3 → 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.
Files changed (61) hide show
  1. package/Api/Events/AddPlayerEvent.d.ts +86 -0
  2. package/Api/Events/AskPositionEvent.d.ts +15 -0
  3. package/Api/Events/ChatEvent.d.ts +29 -0
  4. package/Api/Events/ChatVisibilityEvent.d.ts +9 -0
  5. package/Api/Events/EnablePlayersTrackingEvent.d.ts +15 -0
  6. package/Api/Events/GameStateEvent.d.ts +6 -0
  7. package/Api/Events/IframeEvent.d.ts +1123 -114
  8. package/Api/Events/JoinMucEvent.d.ts +21 -0
  9. package/Api/Events/LeaveMucEvent.d.ts +12 -0
  10. package/Api/Events/NotificationEvent.d.ts +18 -0
  11. package/Api/Events/ProximityMeeting/JoinProximityMeetingEvent.d.ts +70 -0
  12. package/Api/Events/ProximityMeeting/ParticipantProximityMeetingEvent.d.ts +70 -0
  13. package/Api/Events/SetPlayerVariableEvent.d.ts +27 -0
  14. package/Api/Events/SetSharedPlayerVariableEvent.d.ts +18 -0
  15. package/Api/Events/SetVariableEvent.d.ts +1 -9
  16. package/Api/Events/SettingsEvent.d.ts +12 -0
  17. package/Api/Events/ShowBusinessCardEvent.d.ts +12 -0
  18. package/Api/Events/{ui → Ui}/MenuItemClickedEvent.d.ts +0 -0
  19. package/Api/Events/{ui → Ui}/MenuRegisterEvent.d.ts +0 -0
  20. package/Api/Events/{ui → Ui}/TriggerActionMessageEvent.d.ts +0 -0
  21. package/Api/Events/{ui → Ui}/UIWebsite.d.ts +0 -0
  22. package/Api/Iframe/AbstractState.d.ts +14 -0
  23. package/Api/{iframe → Iframe}/Area/Area.d.ts +0 -0
  24. package/Api/{iframe → Iframe}/IframeApiContribution.d.ts +0 -0
  25. package/Api/Iframe/Player/ProximityMeeting.d.ts +85 -0
  26. package/Api/Iframe/Players/RemotePlayer.d.ts +81 -0
  27. package/Api/{iframe → Iframe}/Room/EmbeddedWebsite.d.ts +0 -0
  28. package/Api/Iframe/Sound/Sound.d.ts +43 -0
  29. package/Api/{iframe → Iframe}/Ui/ActionMessage.d.ts +0 -0
  30. package/Api/{iframe → Iframe}/Ui/ButtonDescriptor.d.ts +0 -0
  31. package/Api/{iframe → Iframe}/Ui/Menu.d.ts +0 -0
  32. package/Api/{iframe → Iframe}/Ui/Popup.d.ts +0 -0
  33. package/Api/{iframe → Iframe}/Ui/UIWebsite.d.ts +14 -1
  34. package/Api/Iframe/area.d.ts +59 -0
  35. package/Api/Iframe/camera.d.ts +46 -0
  36. package/Api/Iframe/chat.d.ts +36 -0
  37. package/Api/Iframe/controls.d.ts +56 -0
  38. package/Api/Iframe/nav.d.ts +58 -0
  39. package/Api/Iframe/player.d.ts +141 -0
  40. package/Api/Iframe/playerState.d.ts +20 -0
  41. package/Api/Iframe/players.d.ts +135 -0
  42. package/Api/{iframe → Iframe}/registeredCallbacks.d.ts +2 -2
  43. package/Api/Iframe/room.d.ts +128 -0
  44. package/Api/Iframe/sound.d.ts +21 -0
  45. package/Api/Iframe/state.d.ts +15 -0
  46. package/Api/{iframe → Iframe}/ui.d.ts +44 -15
  47. package/Api/Iframe/website.d.ts +32 -0
  48. package/iframe_api.d.ts +38 -19
  49. package/package.json +3 -2
  50. package/Api/Events/RemotePlayerClickedEvent.d.ts +0 -19
  51. package/Api/iframe/Sound/Sound.d.ts +0 -8
  52. package/Api/iframe/area.d.ts +0 -25
  53. package/Api/iframe/camera.d.ts +0 -20
  54. package/Api/iframe/chat.d.ts +0 -18
  55. package/Api/iframe/controls.d.ts +0 -10
  56. package/Api/iframe/nav.d.ts +0 -20
  57. package/Api/iframe/player.d.ts +0 -43
  58. package/Api/iframe/room.d.ts +0 -58
  59. package/Api/iframe/sound.d.ts +0 -8
  60. package/Api/iframe/state.d.ts +0 -25
  61. package/Api/iframe/website.d.ts +0 -11
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ export declare const isJoinMucEvent: z.ZodObject<{
3
+ url: z.ZodString;
4
+ name: z.ZodString;
5
+ type: z.ZodString;
6
+ subscribe: z.ZodBoolean;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: string;
9
+ url: string;
10
+ name: string;
11
+ subscribe: boolean;
12
+ }, {
13
+ type: string;
14
+ url: string;
15
+ name: string;
16
+ subscribe: boolean;
17
+ }>;
18
+ /**
19
+ * A message sent from the iFrame to the game to change the camera position.
20
+ */
21
+ export declare type JoinMucEvent = z.infer<typeof isJoinMucEvent>;
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export declare const isLeaveMucEvent: z.ZodObject<{
3
+ url: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ url: string;
6
+ }, {
7
+ url: string;
8
+ }>;
9
+ /**
10
+ * A message sent from the iFrame to the game to change the camera position.
11
+ */
12
+ export declare type LeaveMucEvent = z.infer<typeof isLeaveMucEvent>;
@@ -0,0 +1,18 @@
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 declare type NotificationEvent = z.infer<typeof isNotificationEvent>;
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ export declare const isJoinProximityMeetingEvent: z.ZodObject<{
3
+ users: z.ZodArray<z.ZodObject<{
4
+ playerId: z.ZodNumber;
5
+ name: z.ZodString;
6
+ userUuid: z.ZodString;
7
+ availabilityStatus: z.ZodString;
8
+ outlineColor: z.ZodOptional<z.ZodNumber>;
9
+ position: z.ZodObject<{
10
+ x: z.ZodNumber;
11
+ y: z.ZodNumber;
12
+ }, "strip", z.ZodTypeAny, {
13
+ x: number;
14
+ y: number;
15
+ }, {
16
+ x: number;
17
+ y: number;
18
+ }>;
19
+ variables: z.ZodMap<z.ZodString, z.ZodUnknown>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ outlineColor?: number | undefined;
22
+ position: {
23
+ x: number;
24
+ y: number;
25
+ };
26
+ name: string;
27
+ playerId: number;
28
+ variables: Map<string, unknown>;
29
+ userUuid: string;
30
+ availabilityStatus: string;
31
+ }, {
32
+ outlineColor?: number | undefined;
33
+ position: {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ name: string;
38
+ playerId: number;
39
+ variables: Map<string, unknown>;
40
+ userUuid: string;
41
+ availabilityStatus: string;
42
+ }>, "many">;
43
+ }, "strip", z.ZodTypeAny, {
44
+ users: {
45
+ outlineColor?: number | undefined;
46
+ position: {
47
+ x: number;
48
+ y: number;
49
+ };
50
+ name: string;
51
+ playerId: number;
52
+ variables: Map<string, unknown>;
53
+ userUuid: string;
54
+ availabilityStatus: string;
55
+ }[];
56
+ }, {
57
+ users: {
58
+ outlineColor?: number | undefined;
59
+ position: {
60
+ x: number;
61
+ y: number;
62
+ };
63
+ name: string;
64
+ playerId: number;
65
+ variables: Map<string, unknown>;
66
+ userUuid: string;
67
+ availabilityStatus: string;
68
+ }[];
69
+ }>;
70
+ export declare type JoinProximityMeetingEvent = z.infer<typeof isJoinProximityMeetingEvent>;
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ export declare const isParticipantProximityMeetingEvent: z.ZodObject<{
3
+ user: z.ZodObject<{
4
+ playerId: z.ZodNumber;
5
+ name: z.ZodString;
6
+ userUuid: z.ZodString;
7
+ availabilityStatus: z.ZodString;
8
+ outlineColor: z.ZodOptional<z.ZodNumber>;
9
+ position: z.ZodObject<{
10
+ x: z.ZodNumber;
11
+ y: z.ZodNumber;
12
+ }, "strip", z.ZodTypeAny, {
13
+ x: number;
14
+ y: number;
15
+ }, {
16
+ x: number;
17
+ y: number;
18
+ }>;
19
+ variables: z.ZodMap<z.ZodString, z.ZodUnknown>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ outlineColor?: number | undefined;
22
+ position: {
23
+ x: number;
24
+ y: number;
25
+ };
26
+ name: string;
27
+ playerId: number;
28
+ variables: Map<string, unknown>;
29
+ userUuid: string;
30
+ availabilityStatus: string;
31
+ }, {
32
+ outlineColor?: number | undefined;
33
+ position: {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ name: string;
38
+ playerId: number;
39
+ variables: Map<string, unknown>;
40
+ userUuid: string;
41
+ availabilityStatus: string;
42
+ }>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ user: {
45
+ outlineColor?: number | undefined;
46
+ position: {
47
+ x: number;
48
+ y: number;
49
+ };
50
+ name: string;
51
+ playerId: number;
52
+ variables: Map<string, unknown>;
53
+ userUuid: string;
54
+ availabilityStatus: string;
55
+ };
56
+ }, {
57
+ user: {
58
+ outlineColor?: number | undefined;
59
+ position: {
60
+ x: number;
61
+ y: number;
62
+ };
63
+ name: string;
64
+ playerId: number;
65
+ variables: Map<string, unknown>;
66
+ userUuid: string;
67
+ availabilityStatus: string;
68
+ };
69
+ }>;
70
+ export declare type ParticipantProximityMeetingEvent = z.infer<typeof isParticipantProximityMeetingEvent>;
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ export declare const isSetPlayerVariableEvent: z.ZodObject<{
3
+ key: z.ZodString;
4
+ value: z.ZodUnknown;
5
+ public: z.ZodBoolean;
6
+ persist: z.ZodBoolean;
7
+ ttl: z.ZodOptional<z.ZodNumber>;
8
+ scope: z.ZodUnion<[z.ZodLiteral<"room">, z.ZodLiteral<"world">]>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ value?: unknown;
11
+ ttl?: number | undefined;
12
+ key: string;
13
+ public: boolean;
14
+ persist: boolean;
15
+ scope: "room" | "world";
16
+ }, {
17
+ value?: unknown;
18
+ ttl?: number | undefined;
19
+ key: string;
20
+ public: boolean;
21
+ persist: boolean;
22
+ scope: "room" | "world";
23
+ }>;
24
+ /**
25
+ * A message sent from the iFrame to the game to set a variable related to the player
26
+ */
27
+ export declare type SetPlayerVariableEvent = z.infer<typeof isSetPlayerVariableEvent>;
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ export declare const isSetSharedPlayerVariableEvent: z.ZodObject<{
3
+ key: z.ZodString;
4
+ value: z.ZodUnknown;
5
+ playerId: z.ZodNumber;
6
+ }, "strip", z.ZodTypeAny, {
7
+ value?: unknown;
8
+ playerId: number;
9
+ key: string;
10
+ }, {
11
+ value?: unknown;
12
+ playerId: number;
13
+ key: string;
14
+ }>;
15
+ /**
16
+ * A message sent from the iFrame to the game to change the value of the property of the layer
17
+ */
18
+ export declare type SetSharedPlayerVariableEvent = z.infer<typeof isSetSharedPlayerVariableEvent>;
@@ -2,44 +2,36 @@ import { z } from "zod";
2
2
  export declare const isSetVariableEvent: z.ZodObject<{
3
3
  key: z.ZodString;
4
4
  value: z.ZodUnknown;
5
- target: z.ZodEnum<["global", "player"]>;
6
5
  }, "strip", z.ZodTypeAny, {
7
6
  value?: unknown;
8
7
  key: string;
9
- target: "global" | "player";
10
8
  }, {
11
9
  value?: unknown;
12
10
  key: string;
13
- target: "global" | "player";
14
11
  }>;
15
12
  export declare const isSetVariableIframeEvent: z.ZodObject<{
16
- type: z.ZodEnum<["setVariable"]>;
13
+ type: z.ZodLiteral<"setVariable">;
17
14
  data: z.ZodObject<{
18
15
  key: z.ZodString;
19
16
  value: z.ZodUnknown;
20
- target: z.ZodEnum<["global", "player"]>;
21
17
  }, "strip", z.ZodTypeAny, {
22
18
  value?: unknown;
23
19
  key: string;
24
- target: "global" | "player";
25
20
  }, {
26
21
  value?: unknown;
27
22
  key: string;
28
- target: "global" | "player";
29
23
  }>;
30
24
  }, "strip", z.ZodTypeAny, {
31
25
  type: "setVariable";
32
26
  data: {
33
27
  value?: unknown;
34
28
  key: string;
35
- target: "global" | "player";
36
29
  };
37
30
  }, {
38
31
  type: "setVariable";
39
32
  data: {
40
33
  value?: unknown;
41
34
  key: string;
42
- target: "global" | "player";
43
35
  };
44
36
  }>;
45
37
  /**
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export declare const isSettingsEvent: z.ZodObject<{
3
+ notification: z.ZodBoolean;
4
+ chatSounds: z.ZodBoolean;
5
+ }, "strip", z.ZodTypeAny, {
6
+ notification: boolean;
7
+ chatSounds: boolean;
8
+ }, {
9
+ notification: boolean;
10
+ chatSounds: boolean;
11
+ }>;
12
+ export declare type SettingsEvent = z.infer<typeof isSettingsEvent>;
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export declare const isShowBusinessCardEvent: z.ZodObject<{
3
+ visitCardUrl: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ visitCardUrl: string;
6
+ }, {
7
+ visitCardUrl: string;
8
+ }>;
9
+ /**
10
+ * A message sent from the iFrame to the game to emit a notification.
11
+ */
12
+ export declare type ShowBusinessCardEvent = z.infer<typeof isShowBusinessCardEvent>;
File without changes
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ import { Observable, Subject } from "rxjs";
2
+ export declare abstract class AbstractWorkadventureStateCommands {
3
+ protected setVariableResolvers: Subject<{
4
+ value?: unknown;
5
+ key: string;
6
+ }>;
7
+ protected variables: Map<string, unknown>;
8
+ private variableSubscribers;
9
+ protected constructor();
10
+ initVariables(_variables: Map<string, unknown>): void;
11
+ loadVariable(key: string): unknown;
12
+ hasVariable(key: string): boolean;
13
+ onVariableChange(key: string): Observable<unknown>;
14
+ }
File without changes
@@ -0,0 +1,85 @@
1
+ import { Subject } from "rxjs";
2
+ import { IframeApiContribution } from "../IframeApiContribution";
3
+ import { RemotePlayer } from "../Players/RemotePlayer";
4
+ export declare class WorkadventureProximityMeetingCommands extends IframeApiContribution<WorkadventureProximityMeetingCommands> {
5
+ callbacks: ({
6
+ type: "joinProximityMeetingEvent";
7
+ callback: (event: {
8
+ users: {
9
+ outlineColor?: number | undefined;
10
+ position: {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ name: string;
15
+ playerId: number;
16
+ variables: Map<string, unknown>;
17
+ userUuid: string;
18
+ availabilityStatus: string;
19
+ }[];
20
+ }) => void;
21
+ } | {
22
+ type: "participantJoinProximityMeetingEvent";
23
+ callback: (event: {
24
+ user: {
25
+ outlineColor?: number | undefined;
26
+ position: {
27
+ x: number;
28
+ y: number;
29
+ };
30
+ name: string;
31
+ playerId: number;
32
+ variables: Map<string, unknown>;
33
+ userUuid: string;
34
+ availabilityStatus: string;
35
+ };
36
+ }) => void;
37
+ } | {
38
+ type: "participantLeaveProximityMeetingEvent";
39
+ callback: (event: {
40
+ user: {
41
+ outlineColor?: number | undefined;
42
+ position: {
43
+ x: number;
44
+ y: number;
45
+ };
46
+ name: string;
47
+ playerId: number;
48
+ variables: Map<string, unknown>;
49
+ userUuid: string;
50
+ availabilityStatus: string;
51
+ };
52
+ }) => void;
53
+ } | {
54
+ type: "leaveProximityMeetingEvent";
55
+ callback: (event: undefined) => void;
56
+ })[];
57
+ /**
58
+ * Detecting when the user enter on a meeting.
59
+ * {@link https://workadventu.re/map-building/api-player.md#detecting-when-the-user-entersleaves-a-meeting | Website documentation}
60
+ *
61
+ * @returns {Subject<RemotePlayer[]>} Observable who return the joined users
62
+ */
63
+ onJoin(): Subject<RemotePlayer[]>;
64
+ /**
65
+ * Detecting when a participant joined on the current meeting.
66
+ * {@link https://workadventu.re/map-building/api-player.md#detecting-when-a-participant-entersleaves-the-current-meeting | Website documentation}
67
+ *
68
+ * @returns {Subject<RemotePlayer>} Observable who return the joined user
69
+ */
70
+ onParticipantJoin(): Subject<RemotePlayer>;
71
+ /**
72
+ * Detecting when a participant left on the current meeting.
73
+ * {@link https://workadventu.re/map-building/api-player.md#detecting-when-a-participant-entersleaves-the-current-meeting | Website documentation}
74
+ *
75
+ * @returns {Subject<RemotePlayer>} Observable who return the left user
76
+ */
77
+ onParticipantLeave(): Subject<RemotePlayer>;
78
+ /**
79
+ * Detecting when the user leave on a meeting.
80
+ * {@link https://workadventu.re/map-building/api-player.md#detecting-when-the-user-entersleaves-a-meeting | Website documentation}
81
+ */
82
+ onLeave(): Subject<void>;
83
+ }
84
+ declare const _default: WorkadventureProximityMeetingCommands;
85
+ export default _default;
@@ -0,0 +1,81 @@
1
+ import { AddPlayerEvent } from "../../Events/AddPlayerEvent";
2
+ import { Observable, Subject } from "rxjs";
3
+ import { PlayerPosition } from "../../Events/PlayerPosition";
4
+ import { ActionsMenuAction } from "../ui";
5
+ export declare const remotePlayers: Map<number, RemotePlayer>;
6
+ export interface RemotePlayerInterface {
7
+ /**
8
+ * A unique ID for this player. Each character on the map has a unique ID
9
+ */
10
+ readonly playerId: number;
11
+ /**
12
+ * The displayed name for this player
13
+ */
14
+ readonly name: string;
15
+ /**
16
+ * A unique ID for the user. Unlike the "id", 2 characters can have the same UUID if they belong to the same user
17
+ * (i.e. if the same user logged twice using 2 different tabs)
18
+ */
19
+ readonly uuid: string;
20
+ /**
21
+ * The color of the outline around the player's name
22
+ */
23
+ readonly outlineColor: number | undefined;
24
+ /**
25
+ * The position of the current player, expressed in game pixels, relative to the top - left of the map.
26
+ */
27
+ readonly position: PlayerPosition;
28
+ /**
29
+ * A stream updated with the position of this current player.
30
+ */
31
+ readonly position$: Observable<PlayerPosition>;
32
+ /**
33
+ * An object storing players variables
34
+ */
35
+ readonly state: ReadOnlyState;
36
+ }
37
+ export declare type ReadOnlyState = {
38
+ onVariableChange(key: string): Observable<unknown>;
39
+ } & {
40
+ readonly [key: string]: unknown;
41
+ };
42
+ export declare class RemotePlayer implements RemotePlayerInterface {
43
+ private _playerId;
44
+ private _name;
45
+ private _userUuid;
46
+ private _availabilityStatus;
47
+ private _outlineColor;
48
+ private _position;
49
+ private _variables;
50
+ private _variablesSubjects;
51
+ readonly state: ReadOnlyState;
52
+ private actions;
53
+ constructor(addPlayerEvent: AddPlayerEvent);
54
+ get playerId(): number;
55
+ get name(): string;
56
+ get uuid(): string;
57
+ /**
58
+ * Todo
59
+ */
60
+ get outlineColor(): number | undefined;
61
+ get position(): PlayerPosition;
62
+ set position(_position: PlayerPosition);
63
+ readonly _position$: Subject<{
64
+ x: number;
65
+ y: number;
66
+ }>;
67
+ readonly position$: Observable<{
68
+ x: number;
69
+ y: number;
70
+ }>;
71
+ destroy(): void;
72
+ setVariable(name: string, value: unknown): void;
73
+ addAction(key: string, callback: () => void): ActionsMenuAction;
74
+ callAction(key: string): void;
75
+ removeAction(key: string): void;
76
+ }
77
+ export interface RemotePlayerMoved {
78
+ player: RemotePlayerInterface;
79
+ newPosition: PlayerPosition;
80
+ oldPosition: PlayerPosition;
81
+ }
File without changes
@@ -0,0 +1,43 @@
1
+ /**
2
+ * A copy of the SoundConfig type from Phaser
3
+ */
4
+ export declare type SoundConfig = {
5
+ /**
6
+ * Boolean indicating whether the sound should be muted or not.
7
+ */
8
+ mute?: boolean;
9
+ /**
10
+ * A value between 0 (silence) and 1 (full volume).
11
+ */
12
+ volume?: number;
13
+ /**
14
+ * Defines the speed at which the sound should be played.
15
+ */
16
+ rate?: number;
17
+ /**
18
+ * Represents detuning of sound in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).
19
+ */
20
+ detune?: number;
21
+ /**
22
+ * Position of playback for this sound, in seconds.
23
+ */
24
+ seek?: number;
25
+ /**
26
+ * Whether or not the sound or current sound marker should loop.
27
+ */
28
+ loop?: boolean;
29
+ /**
30
+ * Time, in seconds, that should elapse before the sound actually starts its playback.
31
+ */
32
+ delay?: number;
33
+ /**
34
+ * A value between -1 (full left pan) and 1 (full right pan). 0 means no pan.
35
+ */
36
+ pan?: number;
37
+ };
38
+ export declare class Sound {
39
+ private url;
40
+ constructor(url: string);
41
+ play(config: SoundConfig | undefined): string;
42
+ stop(): string;
43
+ }
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- import { CreateUIWebsiteEvent, UIWebsiteMargin, UIWebsitePosition, UIWebsiteSize, UIWebsite as UIWebsiteCore } from "../../Events/ui/UIWebsite";
1
+ import { CreateUIWebsiteEvent, UIWebsiteMargin, UIWebsitePosition, UIWebsiteSize, UIWebsite as UIWebsiteCore } from "../../Events/Ui/UIWebsite";
2
2
  import { IframeApiContribution } from "../IframeApiContribution";
3
3
  export declare class UIWebsite {
4
4
  readonly id: string;
@@ -26,7 +26,20 @@ export declare class UIWebsite {
26
26
  }
27
27
  export declare class UIWebsiteCommands extends IframeApiContribution<UIWebsiteCommands> {
28
28
  callbacks: never[];
29
+ /**
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}
32
+ *
33
+ * @param {CreateUIWebsiteEvent} createUIWebsite The details of the UIWebsite to create
34
+ * @returns {Promise<UIWebsite>} Promise to return a UIWebsite
35
+ */
29
36
  open(createUIWebsite: CreateUIWebsiteEvent): Promise<UIWebsite>;
37
+ /**
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}
40
+ *
41
+ * @returns {Promise<UIWebsite[]>} Promise to return all UI websites
42
+ */
30
43
  getAll(): Promise<UIWebsite[]>;
31
44
  }
32
45
  declare const _default: UIWebsiteCommands;
@@ -0,0 +1,59 @@
1
+ import { Observable } from "rxjs";
2
+ import { CreateAreaEvent } 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
+ /**
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}
20
+ *
21
+ * @param {{name: string, x: number, y: number, width: number, height: number}} createAreaEvent Define the name, position and size of the area
22
+ * @returns {Area} Area object
23
+ */
24
+ create(createAreaEvent: CreateAreaEvent): Area;
25
+ /**
26
+ * Get an existing Area object.
27
+ * {@link https://workadventu.re/map-building/api-room.md#get-an-area | Website documentation}
28
+ *
29
+ * @param {string} name Name of the area searched
30
+ * @returns {Area} Area found
31
+ */
32
+ get(name: string): Promise<Area>;
33
+ /**
34
+ * Delete Area by it's name.
35
+ * {@link https://workadventu.re/map-building/api-room.md#delete-area | Website documentation}
36
+ *
37
+ * @param {string} name Area name
38
+ * @returns {Promise<void>} Promise resolved when the removing is finished
39
+ */
40
+ delete(name: string): Promise<void>;
41
+ /**
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}
44
+ *
45
+ * @param {string} areaName Area name
46
+ * @returns {Subject<void>} An observable fired when someone enters the area
47
+ */
48
+ onEnter(areaName: string): Observable<void>;
49
+ /**
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}
52
+ *
53
+ * @param {string} areaName Area name
54
+ * @returns {Subject<void>} An observable fired when someone leaves the area
55
+ */
56
+ onLeave(areaName: string): Observable<void>;
57
+ }
58
+ declare const _default: WorkadventureAreaCommands;
59
+ export default _default;