@workadventure/iframe-api-typings 1.11.2 → 1.11.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/Api/Events/IframeEvent.d.ts +18 -0
- package/Api/iframe/Area/Area.d.ts +4 -4
- package/Api/iframe/chat.d.ts +2 -0
- package/Api/iframe/room.d.ts +1 -1
- package/Api/iframe/ui.d.ts +2 -2
- package/iframe_api.d.ts +7 -1
- package/package.json +1 -1
- package/Phaser/Map/ITiledMap.d.ts +0 -170
|
@@ -96,6 +96,24 @@ export declare const isIframeEventWrapper: z.ZodUnion<[z.ZodObject<{
|
|
|
96
96
|
message: string;
|
|
97
97
|
author: string;
|
|
98
98
|
};
|
|
99
|
+
}>, z.ZodObject<{
|
|
100
|
+
type: z.ZodLiteral<"openChat">;
|
|
101
|
+
data: z.ZodUndefined;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
data?: undefined;
|
|
104
|
+
type: "openChat";
|
|
105
|
+
}, {
|
|
106
|
+
data?: undefined;
|
|
107
|
+
type: "openChat";
|
|
108
|
+
}>, z.ZodObject<{
|
|
109
|
+
type: z.ZodLiteral<"closeChat">;
|
|
110
|
+
data: z.ZodUndefined;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
data?: undefined;
|
|
113
|
+
type: "closeChat";
|
|
114
|
+
}, {
|
|
115
|
+
data?: undefined;
|
|
116
|
+
type: "closeChat";
|
|
99
117
|
}>, z.ZodObject<{
|
|
100
118
|
type: z.ZodLiteral<"cameraFollowPlayer">;
|
|
101
119
|
data: z.ZodObject<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITiledMapObject } from "
|
|
1
|
+
import { ITiledMapObject } from "@workadventure/tiled-map-type-guard";
|
|
2
2
|
import { CreateAreaEvent } from "../../Events/CreateAreaEvent";
|
|
3
3
|
export declare type IArea = Omit<ITiledMapObject, "id" | "gid" | "visible" | "rotation" | "ellipse" | "polygon" | "polyline">;
|
|
4
4
|
export declare class Area implements IArea {
|
|
@@ -11,12 +11,12 @@ export declare class Area implements IArea {
|
|
|
11
11
|
private _height;
|
|
12
12
|
constructor(config: CreateAreaEvent);
|
|
13
13
|
setProperty(propertyName: string, propertyValue: string | number | boolean | undefined): void;
|
|
14
|
+
get x(): number;
|
|
14
15
|
set x(x: number);
|
|
15
16
|
set y(y: number);
|
|
16
|
-
set width(width: number);
|
|
17
|
-
set height(height: number);
|
|
18
|
-
get x(): number;
|
|
19
17
|
get y(): number;
|
|
18
|
+
set width(width: number);
|
|
20
19
|
get width(): number;
|
|
20
|
+
set height(height: number);
|
|
21
21
|
get height(): number;
|
|
22
22
|
}
|
package/Api/iframe/chat.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare class WorkadventureChatCommands extends IframeApiContribution<Wor
|
|
|
11
11
|
* Listen to messages sent by the local user, in the chat.
|
|
12
12
|
*/
|
|
13
13
|
onChatMessage(callback: (message: string) => void): void;
|
|
14
|
+
open(): void;
|
|
15
|
+
close(): void;
|
|
14
16
|
}
|
|
15
17
|
declare const _default: WorkadventureChatCommands;
|
|
16
18
|
export default _default;
|
package/Api/iframe/room.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Subject } from "rxjs";
|
|
2
2
|
import { IframeApiContribution } from "./IframeApiContribution";
|
|
3
|
-
import type { ITiledMap } from "../../Phaser/Map/ITiledMap";
|
|
4
3
|
import type { WorkadventureRoomWebsiteCommands } from "./website";
|
|
5
4
|
import { WorkadventureAreaCommands } from "./area";
|
|
5
|
+
import { ITiledMap } from "@workadventure/tiled-map-type-guard";
|
|
6
6
|
interface TileDescriptor {
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
package/Api/iframe/ui.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare class RemotePlayer {
|
|
|
24
24
|
readonly name: string;
|
|
25
25
|
private actions;
|
|
26
26
|
constructor(remotePlayer: RemotePlayerClickedEvent);
|
|
27
|
-
addAction(key: string, callback:
|
|
27
|
+
addAction(key: string, callback: () => void): ActionsMenuAction;
|
|
28
28
|
callAction(key: string): void;
|
|
29
29
|
removeAction(key: string): void;
|
|
30
30
|
}
|
|
@@ -32,7 +32,7 @@ export declare class ActionsMenuAction {
|
|
|
32
32
|
private remotePlayer;
|
|
33
33
|
private key;
|
|
34
34
|
private callback;
|
|
35
|
-
constructor(remotePlayer: RemotePlayer, key: string, callback:
|
|
35
|
+
constructor(remotePlayer: RemotePlayer, key: string, callback: () => void);
|
|
36
36
|
call(): void;
|
|
37
37
|
remove(): void;
|
|
38
38
|
}
|
package/iframe_api.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ import { CoWebsite } from "./Api/iframe/nav";
|
|
|
2
2
|
import type { ButtonDescriptor } from "./Api/iframe/Ui/ButtonDescriptor";
|
|
3
3
|
import type { Popup } from "./Api/iframe/Ui/Popup";
|
|
4
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 { RemotePlayer, ActionsMenuAction } from "./Api/iframe/ui";
|
|
5
11
|
declare const wa: {
|
|
6
12
|
ui: import("./Api/iframe/ui").WorkAdventureUiCommands;
|
|
7
13
|
nav: import("./Api/iframe/nav").WorkadventureNavigationCommands;
|
|
@@ -77,10 +83,10 @@ declare const wa: {
|
|
|
77
83
|
onLeaveZone(name: string, callback: () => void): void;
|
|
78
84
|
};
|
|
79
85
|
export declare type WorkAdventureApi = typeof wa;
|
|
86
|
+
export type { Sound, Popup, ButtonDescriptor, CoWebsite };
|
|
80
87
|
declare global {
|
|
81
88
|
interface Window {
|
|
82
89
|
WA: WorkAdventureApi;
|
|
83
90
|
}
|
|
84
91
|
let WA: WorkAdventureApi;
|
|
85
92
|
}
|
|
86
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/// <reference types="phaser" />
|
|
2
|
-
/**
|
|
3
|
-
* Tiled Map Interface
|
|
4
|
-
*
|
|
5
|
-
* Represents the interface for the Tiled exported data structure (JSON). Used
|
|
6
|
-
* when loading resources via Resource loader.
|
|
7
|
-
*/
|
|
8
|
-
import TilemapLayer = Phaser.Tilemaps.TilemapLayer;
|
|
9
|
-
export interface ITiledMap {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
layers: ITiledMapLayer[];
|
|
13
|
-
nextobjectid: number;
|
|
14
|
-
/**
|
|
15
|
-
* Map orientation (orthogonal)
|
|
16
|
-
*/
|
|
17
|
-
orientation: string;
|
|
18
|
-
properties?: ITiledMapProperty[];
|
|
19
|
-
/**
|
|
20
|
-
* Render order (right-down)
|
|
21
|
-
*/
|
|
22
|
-
renderorder: string;
|
|
23
|
-
tileheight: number;
|
|
24
|
-
tilewidth: number;
|
|
25
|
-
tilesets: ITiledTileSet[];
|
|
26
|
-
version: number;
|
|
27
|
-
compressionlevel?: number;
|
|
28
|
-
infinite?: boolean;
|
|
29
|
-
nextlayerid?: number;
|
|
30
|
-
tiledversion?: string;
|
|
31
|
-
type?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface ITiledMapProperty {
|
|
34
|
-
name: string;
|
|
35
|
-
type: string;
|
|
36
|
-
value: string | boolean | number | undefined;
|
|
37
|
-
}
|
|
38
|
-
export declare type ITiledMapLayer = ITiledMapGroupLayer | ITiledMapObjectLayer | ITiledMapTileLayer;
|
|
39
|
-
export interface ITiledMapGroupLayer {
|
|
40
|
-
id?: number;
|
|
41
|
-
name: string;
|
|
42
|
-
opacity: number;
|
|
43
|
-
properties?: ITiledMapProperty[];
|
|
44
|
-
type: "group";
|
|
45
|
-
visible: boolean;
|
|
46
|
-
x: number;
|
|
47
|
-
y: number;
|
|
48
|
-
/**
|
|
49
|
-
* Layers for group layer
|
|
50
|
-
*/
|
|
51
|
-
layers: ITiledMapLayer[];
|
|
52
|
-
}
|
|
53
|
-
export interface ITiledMapTileLayer {
|
|
54
|
-
id?: number;
|
|
55
|
-
data: number[] | string;
|
|
56
|
-
height: number;
|
|
57
|
-
name: string;
|
|
58
|
-
opacity: number;
|
|
59
|
-
properties?: ITiledMapProperty[];
|
|
60
|
-
encoding?: string;
|
|
61
|
-
compression?: string;
|
|
62
|
-
type: "tilelayer";
|
|
63
|
-
visible: boolean;
|
|
64
|
-
width: number;
|
|
65
|
-
x: number;
|
|
66
|
-
y: number;
|
|
67
|
-
parallaxx?: number;
|
|
68
|
-
parallaxy?: number;
|
|
69
|
-
/**
|
|
70
|
-
* Draw order (topdown (default), index)
|
|
71
|
-
*/
|
|
72
|
-
draworder?: string;
|
|
73
|
-
phaserLayer?: TilemapLayer;
|
|
74
|
-
}
|
|
75
|
-
export interface ITiledMapObjectLayer {
|
|
76
|
-
id?: number;
|
|
77
|
-
height: number;
|
|
78
|
-
name: string;
|
|
79
|
-
opacity: number;
|
|
80
|
-
properties?: ITiledMapProperty[];
|
|
81
|
-
encoding?: string;
|
|
82
|
-
compression?: string;
|
|
83
|
-
type: "objectgroup";
|
|
84
|
-
visible: boolean;
|
|
85
|
-
width: number;
|
|
86
|
-
x: number;
|
|
87
|
-
y: number;
|
|
88
|
-
/**
|
|
89
|
-
* Draw order (topdown (default), index)
|
|
90
|
-
*/
|
|
91
|
-
draworder?: string;
|
|
92
|
-
objects: ITiledMapObject[];
|
|
93
|
-
}
|
|
94
|
-
export interface ITiledMapObject {
|
|
95
|
-
id: number;
|
|
96
|
-
/**
|
|
97
|
-
* Tile object id
|
|
98
|
-
*/
|
|
99
|
-
gid: number;
|
|
100
|
-
height: number;
|
|
101
|
-
name: string;
|
|
102
|
-
properties?: ITiledMapProperty[];
|
|
103
|
-
rotation: number;
|
|
104
|
-
type: string;
|
|
105
|
-
visible: boolean;
|
|
106
|
-
width: number;
|
|
107
|
-
x: number;
|
|
108
|
-
y: number;
|
|
109
|
-
/**
|
|
110
|
-
* Whether or not object is an ellipse
|
|
111
|
-
*/
|
|
112
|
-
ellipse: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Polygon points
|
|
115
|
-
*/
|
|
116
|
-
polygon: {
|
|
117
|
-
x: number;
|
|
118
|
-
y: number;
|
|
119
|
-
}[];
|
|
120
|
-
/**
|
|
121
|
-
* Polyline points
|
|
122
|
-
*/
|
|
123
|
-
polyline: {
|
|
124
|
-
x: number;
|
|
125
|
-
y: number;
|
|
126
|
-
}[];
|
|
127
|
-
text?: ITiledText;
|
|
128
|
-
template?: string;
|
|
129
|
-
}
|
|
130
|
-
export interface ITiledText {
|
|
131
|
-
text: string;
|
|
132
|
-
wrap?: boolean;
|
|
133
|
-
fontfamily?: string;
|
|
134
|
-
pixelsize?: number;
|
|
135
|
-
color?: string;
|
|
136
|
-
underline?: boolean;
|
|
137
|
-
italic?: boolean;
|
|
138
|
-
strikeout?: boolean;
|
|
139
|
-
halign?: "center" | "right" | "justify" | "left";
|
|
140
|
-
}
|
|
141
|
-
export interface ITiledTileSet {
|
|
142
|
-
firstgid: number;
|
|
143
|
-
image: string;
|
|
144
|
-
imageheight: number;
|
|
145
|
-
imagewidth: number;
|
|
146
|
-
columns: number;
|
|
147
|
-
margin: number;
|
|
148
|
-
name: string;
|
|
149
|
-
properties?: ITiledMapProperty[];
|
|
150
|
-
spacing: number;
|
|
151
|
-
tilecount: number;
|
|
152
|
-
tileheight: number;
|
|
153
|
-
tilewidth: number;
|
|
154
|
-
transparentcolor: string;
|
|
155
|
-
terrains: ITiledMapTerrain[];
|
|
156
|
-
tiles?: Array<ITile>;
|
|
157
|
-
/**
|
|
158
|
-
* Refers to external tileset file (should be JSON)
|
|
159
|
-
*/
|
|
160
|
-
source: string;
|
|
161
|
-
}
|
|
162
|
-
export interface ITile {
|
|
163
|
-
id: number;
|
|
164
|
-
type?: string;
|
|
165
|
-
properties?: ITiledMapProperty[];
|
|
166
|
-
}
|
|
167
|
-
export interface ITiledMapTerrain {
|
|
168
|
-
name: string;
|
|
169
|
-
tile: number;
|
|
170
|
-
}
|