UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

41 lines (40 loc) 1.52 kB
import { Type } from 'alinea/core'; import * as Y from 'yjs'; export declare class Edits { private entryId; /** The mutable doc that we are editing */ doc: Y.Doc; /** The state vector of the source doc */ sourceVector: Uint8Array | undefined; sourceUpdate: Uint8Array | undefined; /** The root map containing field data */ root: Y.Map<unknown>; /** Did we make any local changes? */ hasChanges: import("jotai").PrimitiveAtom<boolean> & { init: boolean; }; /** Clear local changes, reset to source */ resetChanges: import("jotai").WritableAtom<null, [], void> & { init: null; }; /** Whether we have a draft loaded */ isLoading: import("jotai").Atom<boolean>; yUpdate: import("jotai").Atom<Uint8Array>; constructor(entryId: string); hasData(): boolean; /** Apply updates from the source */ applyRemoteUpdate(update: Uint8Array): void; /** Apply local updates */ applyLocalUpdate(update: Uint8Array): void; /** A Y.js update that contains our own edits, base64 encoded */ getLocalUpdate(): Uint8Array; /** The source doc */ getRemoteUpdate(): Uint8Array; /** Update entry field data */ applyEntryData(type: Type, entryData: Record<string, any>): void; /** The field data */ getEntryData(type: Type): Record<string, any>; } export declare const entryEditsAtoms: import("jotai/vanilla/utils/atomFamily.js").AtomFamily<string, import("jotai").PrimitiveAtom<Edits> & { init: Edits; }>;