import { next as A } from "@automerge/automerge/slim"; export type DocHandle = { doc(): T; change: (fn: (doc: T) => void) => void; on(event: "change", callback: (p: DocHandleChangePayload) => void): void; off(event: "change", callback: (p: DocHandleChangePayload) => void): void; }; export interface DocHandleChangePayload { /** The handle that changed */ handle: DocHandle; /** The value of the document after the change */ doc: A.Doc; /** The patches representing the change that occurred */ patches: A.Patch[]; /** Information about the change */ patchInfo: A.PatchInfo; }