Skip to content

Interface: CursorEngine\<TCursor\>

@roomful/core


@roomful/core / CursorEngine

Defined in: packages/core/src/types.ts:1316

Exposes cursor operations for a room.

TCursor extends CursorData = CursorData

The custom cursor payload shape.

getPositions(): CursorPosition<TCursor>[]

Defined in: packages/core/src/types.ts:1353

Returns the latest known cursor positions.

CursorPosition<TCursor>[]

The current cursor position list.


mount(el): void

Defined in: packages/core/src/types.ts:1323

Starts tracking pointer movement within an element.

HTMLElement

The element to observe for local cursor updates.

void

Nothing.


render(options?): void

Defined in: packages/core/src/types.ts:1338

Renders remote cursors into the DOM.

CursorRenderOptions

Optional cursor rendering overrides.

void

Nothing.


setPosition(position): void

Defined in: packages/core/src/types.ts:1361

Updates the local cursor payload. Merges into the existing value.

Partial<CursorPosition<TCursor>>

The partial cursor payload to publish.

void

Nothing.


subscribe(cb): Unsubscribe

Defined in: packages/core/src/types.ts:1346

Subscribes to cursor position updates.

(positions) => void

The callback invoked with current cursor positions.

Unsubscribe

A function that removes the listener.


unmount(): void

Defined in: packages/core/src/types.ts:1330

Stops tracking local cursor movement.

void

Nothing.