Interface: ViewportStore
@roomful/svelte / ViewportStore
Interface: ViewportStore
Section titled “Interface: ViewportStore”Defined in: packages/svelte/src/index.ts:330
Readable viewport store augmented with DOM and follow helpers.
Extends
Section titled “Extends”Readable<ViewportState[]>
Properties
Section titled “Properties”broadcast()
Section titled “broadcast()”broadcast: () =>
void
Defined in: packages/svelte/src/index.ts:346
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: packages/svelte/src/index.ts:366
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.
mount:
Action<HTMLElement,undefined>
Defined in: packages/svelte/src/index.ts:334
Svelte action that mounts viewport tracking on a scrollable container.
present()
Section titled “present()”present: () =>
void
Defined in: packages/svelte/src/index.ts:356
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.
stopBroadcast()
Section titled “stopBroadcast()”stopBroadcast: () =>
void
Defined in: packages/svelte/src/index.ts:351
Stops streaming the local viewport.
Stops streaming the local viewport.
Returns
Section titled “Returns”void
Nothing.
stopPresenting()
Section titled “stopPresenting()”stopPresenting: () =>
void
Defined in: packages/svelte/src/index.ts:361
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: packages/svelte/src/index.ts:371
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”subscribe()
Section titled “subscribe()”subscribe(
this,run,invalidate?):Unsubscriber
Defined in: node_modules/.pnpm/svelte@4.2.20/node_modules/svelte/types/index.d.ts:1619
Subscribe on value changes.
Parameters
Section titled “Parameters”void
Subscriber<ViewportState[]>
subscription callback
invalidate?
Section titled “invalidate?”Invalidator<ViewportState[]>
cleanup callback
Returns
Section titled “Returns”Unsubscriber
Inherited from
Section titled “Inherited from”Readable.subscribe
unmount()
Section titled “unmount()”unmount():
void
Defined in: packages/svelte/src/index.ts:341
Unmounts viewport tracking.
Returns
Section titled “Returns”void
Nothing.