playhtml 2.3.0 → 2.4.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/dist/main.d.ts +28 -3
- package/dist/playhtml.es.js +1767 -1806
- package/package.json +2 -3
package/dist/main.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Cursor } from '../../common/src';
|
|
2
|
+
import { CursorPresence } from '../../common/src';
|
|
1
3
|
import { default as default_2 } from 'y-partykit/provider';
|
|
2
4
|
import { ElementAwarenessEventHandlerData } from '../../common/src';
|
|
3
5
|
import { ElementData } from '../../common/src';
|
|
@@ -7,11 +9,14 @@ import { ElementSetupData } from '../../common/src';
|
|
|
7
9
|
import { EventMessage } from '../../common/src';
|
|
8
10
|
import { MappedTypeDescription } from '@syncedstore/core/types/doc';
|
|
9
11
|
import { ModifierKey } from '../../common/src';
|
|
12
|
+
import { PlayerIdentity } from '../../common/src';
|
|
10
13
|
import { PlayEvent } from '../../common/src';
|
|
11
14
|
import { RegisteredPlayEvent } from '../../common/src';
|
|
12
15
|
import { TagType } from '../../common/src';
|
|
13
16
|
import * as Y from 'yjs';
|
|
14
17
|
|
|
18
|
+
export { Cursor }
|
|
19
|
+
|
|
15
20
|
declare class CursorClientAwareness {
|
|
16
21
|
private provider;
|
|
17
22
|
private options;
|
|
@@ -46,6 +51,7 @@ declare class CursorClientAwareness {
|
|
|
46
51
|
private getTouchCursorSVG;
|
|
47
52
|
private getCustomCursorSVG;
|
|
48
53
|
private removeCursor;
|
|
54
|
+
private savePlayerIdentityToStorage;
|
|
49
55
|
private setupGlobalAPI;
|
|
50
56
|
private emitGlobalEvent;
|
|
51
57
|
private updateGlobalColors;
|
|
@@ -56,6 +62,11 @@ declare class CursorClientAwareness {
|
|
|
56
62
|
private hslToRgb;
|
|
57
63
|
private getLuminance;
|
|
58
64
|
private getContrastColor;
|
|
65
|
+
private updateAllCursorVisibility;
|
|
66
|
+
private showAllCursors;
|
|
67
|
+
configure(options: Partial<CursorOptions>): void;
|
|
68
|
+
hideCursor(connectionId: string): void;
|
|
69
|
+
showCursor(connectionId: string): void;
|
|
59
70
|
destroy(): void;
|
|
60
71
|
getDebugInfo(): {
|
|
61
72
|
totalCursors: number;
|
|
@@ -70,11 +81,23 @@ export declare interface CursorOptions {
|
|
|
70
81
|
proximityThreshold?: number;
|
|
71
82
|
visibilityThreshold?: number;
|
|
72
83
|
cursorStyle?: string;
|
|
73
|
-
onProximityEntered?: (playerIdentity?: any
|
|
84
|
+
onProximityEntered?: (playerIdentity?: any, positions?: {
|
|
85
|
+
ours: {
|
|
86
|
+
x: number;
|
|
87
|
+
y: number;
|
|
88
|
+
};
|
|
89
|
+
theirs: {
|
|
90
|
+
x: number;
|
|
91
|
+
y: number;
|
|
92
|
+
};
|
|
93
|
+
}, angle?: number) => void;
|
|
74
94
|
onProximityLeft?: (connectionId: string) => void;
|
|
95
|
+
onCustomCursorRender?: (connectionId: string, element: HTMLElement) => HTMLElement | null;
|
|
75
96
|
enableChat?: boolean;
|
|
76
97
|
}
|
|
77
98
|
|
|
99
|
+
export { CursorPresence }
|
|
100
|
+
|
|
78
101
|
declare function dispatchPlayEvent(message: EventMessage): void;
|
|
79
102
|
|
|
80
103
|
declare class ElementHandler<T = any, U = any, V = any> {
|
|
@@ -194,6 +217,8 @@ export declare interface InitOptions<T = any> {
|
|
|
194
217
|
|
|
195
218
|
declare function initPlayHTML({ host, extraCapabilities, events, defaultRoomOptions, room: inputRoom, onError, developmentMode, cursors, }?: InitOptions): Promise<default_2 | undefined>;
|
|
196
219
|
|
|
220
|
+
export { PlayerIdentity }
|
|
221
|
+
|
|
197
222
|
export declare const playhtml: PlayHTMLComponents;
|
|
198
223
|
|
|
199
224
|
declare interface PlayHTMLComponents {
|
|
@@ -248,6 +273,8 @@ declare type StoreShape = {
|
|
|
248
273
|
play: Record<string, Record<string, any>>;
|
|
249
274
|
};
|
|
250
275
|
|
|
276
|
+
export { TagType }
|
|
277
|
+
|
|
251
278
|
export { }
|
|
252
279
|
|
|
253
280
|
|
|
@@ -258,8 +285,6 @@ declare global {
|
|
|
258
285
|
name: string;
|
|
259
286
|
allColors: string[];
|
|
260
287
|
count: number;
|
|
261
|
-
setColor?: (color: string) => void;
|
|
262
|
-
setName?: (name: string) => void;
|
|
263
288
|
on: CursorEventEmitter["on"];
|
|
264
289
|
off: CursorEventEmitter["off"];
|
|
265
290
|
};
|