playhtml 2.11.1 → 2.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/dist/main.d.ts +65 -33
- package/dist/playhtml.es.js +1802 -1769
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,25 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { CanDuplicateTo } from "@playhtml/common";
|
|
2
|
+
import { CanMoveBounds } from "@playhtml/common";
|
|
3
|
+
import { CanMoveBoundsMinVisible } from "@playhtml/common";
|
|
4
|
+
import { CanMoveBoundsMinVisiblePx } from "@playhtml/common";
|
|
5
|
+
import { Cursor } from "@playhtml/common";
|
|
6
|
+
import { CursorEvents } from "@playhtml/common";
|
|
7
|
+
import { CursorEvents as CursorEvents_2 } from "@playhtml/common";
|
|
8
|
+
import { CursorPresence } from "@playhtml/common";
|
|
9
|
+
import { CursorPresenceView } from "@playhtml/common";
|
|
10
|
+
import { CursorPresenceView as CursorPresenceView_2 } from "@playhtml/common";
|
|
5
11
|
import { default as default_2 } from 'y-partyserver/provider';
|
|
6
|
-
import { ElementAwarenessEventHandlerData } from
|
|
7
|
-
import { ElementData } from
|
|
8
|
-
import { ElementEventHandlerData } from
|
|
9
|
-
import { ElementInitializer } from
|
|
10
|
-
import { ElementSetupData } from
|
|
11
|
-
import { EventMessage } from
|
|
12
|
-
import {
|
|
13
|
-
import { ModifierKey } from
|
|
14
|
-
import { PageDataChannel } from
|
|
15
|
-
import { PlayerIdentity } from
|
|
16
|
-
import { PlayerIdentity as PlayerIdentity_2 } from
|
|
17
|
-
import { PlayEvent } from
|
|
18
|
-
import { PresenceAPI } from
|
|
19
|
-
import { PresenceRoom } from
|
|
20
|
-
import { PresenceServerMessage } from
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
12
|
+
import { ElementAwarenessEventHandlerData } from "@playhtml/common";
|
|
13
|
+
import { ElementData } from "@playhtml/common";
|
|
14
|
+
import { ElementEventHandlerData } from "@playhtml/common";
|
|
15
|
+
import { ElementInitializer } from "@playhtml/common";
|
|
16
|
+
import { ElementSetupData } from "@playhtml/common";
|
|
17
|
+
import { EventMessage } from "@playhtml/common";
|
|
18
|
+
import { getIdForElement } from "@playhtml/common";
|
|
19
|
+
import { ModifierKey } from "@playhtml/common";
|
|
20
|
+
import { PageDataChannel } from "@playhtml/common";
|
|
21
|
+
import { PlayerIdentity } from "@playhtml/common";
|
|
22
|
+
import { PlayerIdentity as PlayerIdentity_2 } from "@playhtml/common";
|
|
23
|
+
import { PlayEvent } from "@playhtml/common";
|
|
24
|
+
import { PresenceAPI } from "@playhtml/common";
|
|
25
|
+
import { PresenceRoom } from "@playhtml/common";
|
|
26
|
+
import { PresenceServerMessage } from "@playhtml/common";
|
|
27
|
+
import { PresenceView } from "@playhtml/common";
|
|
28
|
+
import { RegisteredPlayEvent } from "@playhtml/common";
|
|
29
|
+
import { TagType } from "@playhtml/common";
|
|
30
|
+
import { TagTypeToElement } from "@playhtml/common";
|
|
31
|
+
|
|
32
|
+
export { CanDuplicateTo }
|
|
33
|
+
|
|
34
|
+
export { CanMoveBounds }
|
|
35
|
+
|
|
36
|
+
export { CanMoveBoundsMinVisible }
|
|
37
|
+
|
|
38
|
+
export { CanMoveBoundsMinVisiblePx }
|
|
23
39
|
|
|
24
40
|
declare function createPageData<T>(name: string, defaultValue: T): PageDataChannel<T>;
|
|
25
41
|
|
|
@@ -139,13 +155,13 @@ declare class CursorClientAwareness {
|
|
|
139
155
|
gridCells: number;
|
|
140
156
|
avgCursorsPerCell: number;
|
|
141
157
|
};
|
|
142
|
-
on<K extends keyof
|
|
143
|
-
off<K extends keyof
|
|
144
|
-
getSnapshot():
|
|
158
|
+
on<K extends keyof CursorEvents_2>(event: K, callback: (value: CursorEvents_2[K]) => void): void;
|
|
159
|
+
off<K extends keyof CursorEvents_2>(event: K, callback: (value: CursorEvents_2[K]) => void): void;
|
|
160
|
+
getSnapshot(): CursorEvents_2;
|
|
145
161
|
getMyPlayerIdentity(): PlayerIdentity_2;
|
|
146
162
|
getProvider(): default_2;
|
|
147
|
-
getCursorPresences(): Map<string,
|
|
148
|
-
onCursorPresencesChange(callback: (presences: Map<string,
|
|
163
|
+
getCursorPresences(): Map<string, CursorPresenceView_2>;
|
|
164
|
+
onCursorPresencesChange(callback: (presences: Map<string, CursorPresenceView_2>) => void): () => void;
|
|
149
165
|
private notifyCursorPresenceListeners;
|
|
150
166
|
/**
|
|
151
167
|
* Apply a CSS class to a specific cursor element identified by the player's stableId (publicKey).
|
|
@@ -160,6 +176,8 @@ export declare type CursorContainer = HTMLElement | string | (() => HTMLElement
|
|
|
160
176
|
|
|
161
177
|
export declare type CursorCoordinateMode = "relative" | "absolute";
|
|
162
178
|
|
|
179
|
+
export { CursorEvents }
|
|
180
|
+
|
|
163
181
|
export declare interface CursorOptions {
|
|
164
182
|
enabled?: boolean;
|
|
165
183
|
playerIdentity?: PlayerIdentity;
|
|
@@ -212,6 +230,8 @@ declare type CursorPresenceTransport = {
|
|
|
212
230
|
destroy(): void;
|
|
213
231
|
};
|
|
214
232
|
|
|
233
|
+
export { CursorPresenceView }
|
|
234
|
+
|
|
215
235
|
export declare type CursorRoom = "page" | "domain" | "section" | ((context: {
|
|
216
236
|
domain: string;
|
|
217
237
|
pathname: string;
|
|
@@ -249,6 +269,8 @@ declare function deleteElementData(tag: string, elementId: string): void;
|
|
|
249
269
|
|
|
250
270
|
declare function dispatchPlayEvent(message: EventMessage): void;
|
|
251
271
|
|
|
272
|
+
export { ElementAwarenessEventHandlerData }
|
|
273
|
+
|
|
252
274
|
declare class ElementHandler<T = any, U = any, V = any> {
|
|
253
275
|
defaultData: T;
|
|
254
276
|
localData: U;
|
|
@@ -315,6 +337,10 @@ declare class ElementHandler<T = any, U = any, V = any> {
|
|
|
315
337
|
reset(): void;
|
|
316
338
|
}
|
|
317
339
|
|
|
340
|
+
export { ElementInitializer }
|
|
341
|
+
|
|
342
|
+
export { getIdForElement }
|
|
343
|
+
|
|
318
344
|
export declare interface InitOptions<T = unknown> {
|
|
319
345
|
/**
|
|
320
346
|
* The room to connect users to (this should be a string that matches the other users
|
|
@@ -365,6 +391,8 @@ export declare interface InitOptions<T = unknown> {
|
|
|
365
391
|
|
|
366
392
|
declare function initPlayHTML(options?: InitOptions): Promise<void> | Promise<default_2>;
|
|
367
393
|
|
|
394
|
+
export { PageDataChannel }
|
|
395
|
+
|
|
368
396
|
export { PlayerIdentity }
|
|
369
397
|
|
|
370
398
|
export declare const playhtml: PlayHTMLComponents;
|
|
@@ -379,7 +407,7 @@ export declare interface PlayHTMLComponents {
|
|
|
379
407
|
removePlayElement: typeof removePlayElement;
|
|
380
408
|
deleteElementData: typeof deleteElementData;
|
|
381
409
|
setupPlayElementForTag: typeof setupPlayElementForTag;
|
|
382
|
-
syncedStore: ReadOnlyStore<
|
|
410
|
+
syncedStore: ReadOnlyStore<PlayStore["play"]>;
|
|
383
411
|
elementHandlers: Map<string, Map<string, ElementHandler>>;
|
|
384
412
|
eventHandlers: Map<string, Array<RegisteredPlayEvent>>;
|
|
385
413
|
dispatchPlayEvent: typeof dispatchPlayEvent;
|
|
@@ -401,6 +429,14 @@ export declare interface PlayHTMLComponents {
|
|
|
401
429
|
}>;
|
|
402
430
|
}
|
|
403
431
|
|
|
432
|
+
declare type PlayStore = {
|
|
433
|
+
readonly play: Partial<Record<string, Record<string, unknown>>>;
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
export { PresenceRoom }
|
|
437
|
+
|
|
438
|
+
export { PresenceView }
|
|
439
|
+
|
|
404
440
|
declare type ReadOnlyStore<T extends object> = DeepReadonlyStore<T>;
|
|
405
441
|
|
|
406
442
|
/**
|
|
@@ -450,12 +486,8 @@ declare function setupPlayElementForTag<T extends TagType | string>(element: HTM
|
|
|
450
486
|
|
|
451
487
|
export declare const sharedPermissions: Map<string, "read-only" | "read-write">;
|
|
452
488
|
|
|
453
|
-
declare let store: MappedTypeDescription<StoreShape>;
|
|
454
|
-
|
|
455
|
-
declare type StoreShape = {
|
|
456
|
-
play: Record<string, Record<string, unknown>>;
|
|
457
|
-
};
|
|
458
|
-
|
|
459
489
|
export { TagType }
|
|
460
490
|
|
|
491
|
+
export { TagTypeToElement }
|
|
492
|
+
|
|
461
493
|
export { }
|