Interface: CursorEngine\<TCursor\>
@roomful/core / CursorEngine
Interface: CursorEngine<TCursor>
Section titled “Interface: CursorEngine<TCursor>”Defined in: packages/core/src/types.ts:1036
Exposes cursor operations for a room.
Type Parameters
Section titled “Type Parameters”TCursor
Section titled “TCursor”TCursor extends CursorData = CursorData
The custom cursor payload shape.
Methods
Section titled “Methods”getPositions()
Section titled “getPositions()”getPositions():
CursorPosition<TCursor>[]
Defined in: packages/core/src/types.ts:1073
Returns the latest known cursor positions.
Returns
Section titled “Returns”CursorPosition<TCursor>[]
The current cursor position list.
mount()
Section titled “mount()”mount(
el):void
Defined in: packages/core/src/types.ts:1043
Starts tracking pointer movement within an element.
Parameters
Section titled “Parameters”HTMLElement
The element to observe for local cursor updates.
Returns
Section titled “Returns”void
Nothing.
render()
Section titled “render()”render(
options?):void
Defined in: packages/core/src/types.ts:1058
Renders remote cursors into the DOM.
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional cursor rendering overrides.
Returns
Section titled “Returns”void
Nothing.
setPosition()
Section titled “setPosition()”setPosition(
position):void
Defined in: packages/core/src/types.ts:1081
Updates the local cursor payload.
Parameters
Section titled “Parameters”position
Section titled “position”Partial<CursorPosition<TCursor>>
The partial cursor payload to publish.
Returns
Section titled “Returns”void
Nothing.
subscribe()
Section titled “subscribe()”subscribe(
cb):Unsubscribe
Defined in: packages/core/src/types.ts:1066
Subscribes to cursor position updates.
Parameters
Section titled “Parameters”(positions) => void
The callback invoked with current cursor positions.
Returns
Section titled “Returns”A function that removes the listener.
unmount()
Section titled “unmount()”unmount():
void
Defined in: packages/core/src/types.ts:1050
Stops tracking local cursor movement.
Returns
Section titled “Returns”void
Nothing.