@workadventure/iframe-api-typings 1.29.3 → 1.30.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workadventure/iframe-api-typings",
3
- "version": "v1.29.3",
3
+ "version": "v1.30.1",
4
4
  "description": "Typescript typings for WorkAdventure iFrame API",
5
5
  "main": "iframe_api.js",
6
6
  "types": "iframe_api.d.ts",
@@ -1572,6 +1572,25 @@ export declare const isIframeEventWrapper: z.ZodUnion<[z.ZodObject<{
1572
1572
  }, {
1573
1573
  type: "stopListeningToStreamInBubble";
1574
1574
  data?: undefined;
1575
+ }>, z.ZodObject<{
1576
+ type: z.ZodLiteral<"setStatus">;
1577
+ data: z.ZodObject<{
1578
+ status: z.ZodUnion<[z.ZodLiteral<"ONLINE">, z.ZodLiteral<"BUSY">, z.ZodLiteral<"DO_NOT_DISTURB">, z.ZodLiteral<"BACK_IN_A_MOMENT">]>;
1579
+ }, "strip", z.ZodTypeAny, {
1580
+ status: "ONLINE" | "BUSY" | "DO_NOT_DISTURB" | "BACK_IN_A_MOMENT";
1581
+ }, {
1582
+ status: "ONLINE" | "BUSY" | "DO_NOT_DISTURB" | "BACK_IN_A_MOMENT";
1583
+ }>;
1584
+ }, "strip", z.ZodTypeAny, {
1585
+ type: "setStatus";
1586
+ data: {
1587
+ status: "ONLINE" | "BUSY" | "DO_NOT_DISTURB" | "BACK_IN_A_MOMENT";
1588
+ };
1589
+ }, {
1590
+ type: "setStatus";
1591
+ data: {
1592
+ status: "ONLINE" | "BUSY" | "DO_NOT_DISTURB" | "BACK_IN_A_MOMENT";
1593
+ };
1575
1594
  }>]>;
1576
1595
  export type IframeEvent = z.infer<typeof isIframeEventWrapper>;
1577
1596
  export declare const isIframeResponseEvent: z.ZodUnion<[z.ZodObject<{
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Event to set the player's availability status
4
+ *
5
+ * Supported statuses:
6
+ * - ONLINE: Clear any custom status (default state)
7
+ * - BUSY: User is busy
8
+ * - DO_NOT_DISTURB: User does not want to be disturbed
9
+ * - BACK_IN_A_MOMENT: User is temporarily away
10
+ *
11
+ * Note: SILENT and AWAY are auto-managed by the system and cannot be set directly.
12
+ * Attempting to set them will result in a console warning.
13
+ */
14
+ export declare const isSetStatusEvent: z.ZodObject<{
15
+ status: z.ZodUnion<[z.ZodLiteral<"ONLINE">, z.ZodLiteral<"BUSY">, z.ZodLiteral<"DO_NOT_DISTURB">, z.ZodLiteral<"BACK_IN_A_MOMENT">]>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ status: "ONLINE" | "BUSY" | "DO_NOT_DISTURB" | "BACK_IN_A_MOMENT";
18
+ }, {
19
+ status: "ONLINE" | "BUSY" | "DO_NOT_DISTURB" | "BACK_IN_A_MOMENT";
20
+ }>;
21
+ /**
22
+ * A message sent from the iFrame to the game to set the player's status.
23
+ */
24
+ export type SetStatusEvent = z.infer<typeof isSetStatusEvent>;
@@ -152,6 +152,21 @@ export declare class WorkadventurePlayerCommands extends IframeApiContribution<W
152
152
  * @returns {Promise<string>} Current player woka in base64
153
153
  */
154
154
  getWokaPicture(): Promise<string>;
155
+ /**
156
+ * Set the availability status of the current player.
157
+ *
158
+ * Supported statuses:
159
+ * - "ONLINE": Clear any custom status (default state)
160
+ * - "BUSY": Indicate the player is busy
161
+ * - "DO_NOT_DISTURB": Indicate the player does not want to be disturbed
162
+ * - "BACK_IN_A_MOMENT": Indicate the player is temporarily away
163
+ *
164
+ * {@link https://docs.workadventu.re/map-building/api-player.md#set-the-status-of-the-player | Website documentation}
165
+ *
166
+ * @param {string} status The status to set. Allowed values: "ONLINE", "BUSY", "DO_NOT_DISTURB", "BACK_IN_A_MOMENT"
167
+ * @returns {void}
168
+ */
169
+ setStatus(status: "ONLINE" | "BUSY" | "DO_NOT_DISTURB" | "BACK_IN_A_MOMENT"): void;
155
170
  }
156
171
  export type Position = {
157
172
  x: number;