Interface: UseViewportResult
@roomful/solid / UseViewportResult
Interface: UseViewportResult
Section titled “Interface: UseViewportResult”Defined in: solid/src/index.ts:190
Describes the return value of useViewport.
Properties
Section titled “Properties”broadcast()
Section titled “broadcast()”broadcast: () =>
void
Defined in: solid/src/index.ts:222
Starts streaming the local viewport to all peers.
Starts streaming the local viewport to all peers.
Returns
Section titled “Returns”void
Nothing.
follow()
Section titled “follow()”follow: (
peerId) =>void
Defined in: solid/src/index.ts:242
Follows a specific peer’s viewport.
Follows a specific peer’s viewport, applying their scroll position to the mounted element as their viewport changes. Zoom is exposed in state for the app to apply.
Parameters
Section titled “Parameters”peerId
Section titled “peerId”string
The peer whose viewport to follow.
Returns
Section titled “Returns”void
Nothing.
present()
Section titled “present()”present: () =>
void
Defined in: solid/src/index.ts:232
Enters present mode, forcing peers to follow the local viewport.
Enters present mode: broadcasts the local viewport and signals peers to follow it until ViewportEngine.stopPresenting is called.
Returns
Section titled “Returns”void
Nothing.
states
Section titled “states”states:
Accessor<ViewportState[]>
Defined in: solid/src/index.ts:202
Exposes remote peer viewport states only.
stopBroadcast()
Section titled “stopBroadcast()”stopBroadcast: () =>
void
Defined in: solid/src/index.ts:227
Stops streaming the local viewport.
Stops streaming the local viewport.
Returns
Section titled “Returns”void
Nothing.
stopPresenting()
Section titled “stopPresenting()”stopPresenting: () =>
void
Defined in: solid/src/index.ts:237
Leaves present mode and releases following peers.
Leaves present mode and releases peers that were following.
Returns
Section titled “Returns”void
Nothing.
unfollow()
Section titled “unfollow()”unfollow: () =>
void
Defined in: solid/src/index.ts:247
Stops following any peer and resumes independent scrolling.
Stops following any peer and resumes independent scrolling.
Returns
Section titled “Returns”void
Nothing.
Methods
Section titled “Methods”mount()
Section titled “mount()”mount(
element):void
Defined in: solid/src/index.ts:210
Mounts viewport tracking on a scrollable container.
Parameters
Section titled “Parameters”element
Section titled “element”HTMLElement
The element to observe.
Returns
Section titled “Returns”void
Nothing.
ref(
element):void
Defined in: solid/src/index.ts:197
Callback ref that mounts the viewport engine on a scrollable container.
Parameters
Section titled “Parameters”element
Section titled “element”The element to observe, or null to unmount.
HTMLElement | null
Returns
Section titled “Returns”void
Nothing.
unmount()
Section titled “unmount()”unmount():
void
Defined in: solid/src/index.ts:217
Unmounts viewport tracking.
Returns
Section titled “Returns”void
Nothing.