Skip to content

js-bao-wss-client


js-bao-wss-client / CreateOfflineOptions

Interface: CreateOfflineOptions ​

Options for creating a document offline.

Deprecated ​

Use CreateDocumentOptions with localOnly: true instead.

Properties ​

initialContent? ​

optional initialContent?: (ydoc) => void | Promise<void>

Callback to populate the Yjs document with initial content before persistence.

Parameters ​

ydoc ​

Doc

Returns ​

void | Promise<void>


offlineWritePolicy? ​

optional offlineWritePolicy?: "ifLastKnownWrite" | "always" | "never"

Controls when offline writes are persisted: "ifLastKnownWrite" only writes if the local state is the latest, "always" always writes, "never" never writes.


retainLocal? ​

optional retainLocal?: boolean

If true, retains the local copy after the document is closed.


startNetwork? ​

optional startNetwork?: "manual" | "immediate" | "afterIndexedDb"

Controls when network sync starts: "immediate" starts right away, "afterIndexedDb" waits for local persistence, "manual" requires explicit start.


title? ​

optional title?: string

The display title for the new document.


waitForIndexedDb? ​

optional waitForIndexedDb?: boolean

If true, waits for IndexedDB persistence to complete before resolving.

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30