export { uuid } from "./uuid"; import { AutomergeValue } from "./types"; export { AutomergeValue, Text, Counter, Int, Uint, Float64 } from "./types"; import { API } from "automerge-wasm"; import { Actor as ActorId, Prop, ObjID, Change, DecodedChange, Heads, Automerge, MaterializeValue } from "automerge-wasm"; import { JsSyncState as SyncState, SyncMessage, DecodedSyncMessage } from "automerge-wasm"; export { JsSyncState as SyncState } from "automerge-wasm"; export declare type ChangeOptions = { message?: string; time?: number; patchCallback?: Function; }; export declare type ApplyOptions = { patchCallback?: Function; }; export declare type Doc = { readonly [P in keyof T]: Doc; }; export declare type ChangeFn = (doc: T) => void; export interface State { change: DecodedChange; snapshot: T; } export declare type InitOptions = { actor?: ActorId; freeze?: boolean; patchCallback?: Function; }; export declare function use(api: API): void; export declare function getBackend(doc: Doc): Automerge; export declare function init(_opts?: ActorId | InitOptions): Doc; export declare function clone(doc: Doc): Doc; export declare function free(doc: Doc): void; export declare function from>(initialState: T | Doc, actor?: ActorId): Doc; export declare function change(doc: Doc, options: string | ChangeOptions | ChangeFn, callback?: ChangeFn): Doc; export declare function emptyChange(doc: Doc, options: ChangeOptions): Doc; export declare function load(data: Uint8Array, _opts?: ActorId | InitOptions): Doc; export declare function save(doc: Doc): Uint8Array; export declare function merge(local: Doc, remote: Doc): Doc; export declare function getActorId(doc: Doc): ActorId; declare type Conflicts = { [key: string]: AutomergeValue; }; export declare function getConflicts(doc: Doc, prop: Prop): Conflicts | undefined; export declare function getLastLocalChange(doc: Doc): Change | undefined; export declare function getObjectId(doc: Doc): ObjID; export declare function getChanges(oldState: Doc, newState: Doc): Change[]; export declare function getAllChanges(doc: Doc): Change[]; export declare function applyChanges(doc: Doc, changes: Change[], opts?: ApplyOptions): [Doc]; export declare function getHistory(doc: Doc): State[]; export declare function equals(val1: unknown, val2: unknown): boolean; export declare function encodeSyncState(state: SyncState): Uint8Array; export declare function decodeSyncState(state: Uint8Array): SyncState; export declare function generateSyncMessage(doc: Doc, inState: SyncState): [SyncState, SyncMessage | null]; export declare function receiveSyncMessage(doc: Doc, inState: SyncState, message: SyncMessage, opts?: ApplyOptions): [Doc, SyncState, null]; export declare function initSyncState(): SyncState; export declare function encodeChange(change: DecodedChange): Change; export declare function decodeChange(data: Change): DecodedChange; export declare function encodeSyncMessage(message: DecodedSyncMessage): SyncMessage; export declare function decodeSyncMessage(message: SyncMessage): DecodedSyncMessage; export declare function getMissingDeps(doc: Doc, heads: Heads): Heads; export declare function getHeads(doc: Doc): Heads; export declare function dump(doc: Doc): void; export declare function toJS(doc: Doc): MaterializeValue;