@yorkie-js/sdk
    Preparing search index...

    Interface AttachOptions<R, P>

    AttachOptions are user-settable options used when attaching documents.

    interface AttachOptions<R, P> {
        disableGC?: boolean;
        disablePresence?: boolean;
        documentPollInterval?: number;
        initialPresence?: P;
        initialRoot?: R;
        schema?: string;
        syncMode?: SyncMode;
    }

    Type Parameters

    • R
    • P
    Index

    Properties

    disableGC?: boolean

    disableGC declares that this attachment will not produce or consume tombstones. The server skips minVV tracking and omits the response VersionVector for this client. Use only with Counter or primitive workloads; misuse on a document that uses Tree, Text, or Array deletions leads to undefined GC behavior on this client.

    This option controls the wire contract with the server. It is distinct from any local-only GC toggle on the Document.

    disablePresence?: boolean

    disablePresence declares that this document does not use presence. The first client to attach a document sets the persisted server-side flag — subsequent attaches inherit the fixated value regardless of what they pass. The client uses the server response to gate Document.update's presence emits (silently dropped) and skips the initial presence.set(opts.initialPresence) emitted on attach.

    If omitted, the resolved value is doc.isPresenceDisabled() (the value seeded from DocumentOptions.disablePresence, then overwritten by any previous attach response on the same Document instance), with a final fallback of false.

    documentPollInterval?: number

    documentPollInterval (ms) — only used when syncMode is Polling. Default: 3000.

    initialPresence?: P

    initialPresence is the initial presence of the client.

    initialRoot?: R

    initialRoot is the initial root of the document. It is used to initialize the document. It is used when the fields are not set in the document.

    schema?: string

    schema is the schema of the document. It is used to validate the document.

    syncMode?: SyncMode

    syncMode defines the synchronization mode of the document.