Skip to content
Roomful is in public beta — install with the @beta tag. Share feedback →

Interface: CursorEngine\<TCursor\>

@roomful/core


@roomful/core / CursorEngine

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

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:1073

Returns the latest known cursor positions.

CursorPosition<TCursor>[]

The current cursor position list.


mount(el): void

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

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:1058

Renders remote cursors into the DOM.

CursorRenderOptions

Optional cursor rendering overrides.

void

Nothing.


setPosition(position): void

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

Updates the local cursor payload.

Partial<CursorPosition<TCursor>>

The partial cursor payload to publish.

void

Nothing.


subscribe(cb): Unsubscribe

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

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:1050

Stops tracking local cursor movement.

void

Nothing.