playhtml 2.6.0 → 2.8.0

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 CHANGED
@@ -33,12 +33,16 @@ declare class CursorClientAwareness {
33
33
  private visibilityThreshold;
34
34
  private isStylesAdded;
35
35
  private globalApiListeners;
36
+ private activeAnimationCleanups;
36
37
  private allPlayerColors;
37
38
  private chat;
38
39
  private currentMessage;
39
40
  private otherUsersWithMessages;
40
41
  private cursorPresenceChangeCallbacks;
41
42
  private coordinateMode;
43
+ private zones;
44
+ private currentZone;
45
+ private cursorZoneState;
42
46
  constructor(provider: default_2, options?: CursorOptions);
43
47
  private initialize;
44
48
  private setupAwarenessHandling;
@@ -47,7 +51,11 @@ declare class CursorClientAwareness {
47
51
  private rebuildSpatialGrid;
48
52
  private checkProximityOptimized;
49
53
  private addCursorStyles;
54
+ private createCursorPositionCallback;
55
+ private applyZoneStyling;
56
+ private hitTestZones;
50
57
  private setupCursorTracking;
58
+ private repositionAllCursors;
51
59
  private throttledUpdateCursorAwareness;
52
60
  private updateCursorAwareness;
53
61
  private updateCursor;
@@ -70,6 +78,8 @@ declare class CursorClientAwareness {
70
78
  private updateAllCursorVisibility;
71
79
  private showAllCursors;
72
80
  configure(options: Partial<CursorOptions>): void;
81
+ registerZone(element: HTMLElement, options?: CursorZoneOptions): void;
82
+ unregisterZone(elementId: string): void;
73
83
  hideCursor(connectionId: string): void;
74
84
  showCursor(connectionId: string): void;
75
85
  destroy(): void;
@@ -86,6 +96,13 @@ declare class CursorClientAwareness {
86
96
  getCursorPresences(): Map<string, CursorPresenceView>;
87
97
  onCursorPresencesChange(callback: (presences: Map<string, CursorPresenceView>) => void): () => void;
88
98
  private notifyCursorPresenceListeners;
99
+ /**
100
+ * Apply a CSS class to a specific cursor element identified by the player's stableId (publicKey).
101
+ * The class is added to the actual rendered cursor DOM element and removed after `durationMs`.
102
+ * Returns true if the cursor element was found and the animation was applied.
103
+ */
104
+ triggerCursorAnimation(stableId: string, animationClass: string, durationMs?: number): boolean;
105
+ private triggerSelfCursorAnimation;
89
106
  }
90
107
 
91
108
  export declare type CursorCoordinateMode = "relative" | "absolute";
@@ -123,6 +140,11 @@ export declare type CursorRoom = "page" | "domain" | "section" | ((context: {
123
140
  search: string;
124
141
  }) => string);
125
142
 
143
+ export declare interface CursorZoneOptions {
144
+ onCustomCursorRender?: (connectionId: string, element: HTMLElement) => HTMLElement | null;
145
+ getCursorStyle?: (presence: CursorPresence) => Partial<CSSStyleDeclaration> | Record<string, string>;
146
+ }
147
+
126
148
  declare interface DefaultRoomOptions {
127
149
  includeSearch?: boolean;
128
150
  }