UNPKG

@samepage/internal

Version:

Utilities used across modules - not meant for use by users directly

119 lines (118 loc) 4.03 kB
import { Schema, ApplyState, DecodeState, SamePageState } from "./types"; import Automerge from "automerge"; declare const saveAndApply: ({ notebookPageId, doc, applyState, decodeState, properties, }: { notebookPageId: string; doc: Automerge.FreezeObject<Schema>; applyState?: ApplyState | undefined; decodeState?: DecodeState | undefined; properties?: Record<string, { content: string; annotations: ({ end: number; start: number; type: "block"; attributes: { level: number; viewType: "bullet" | "numbered" | "document"; }; appAttributes?: Record<string, Record<string, string>> | undefined; } | { end: number; start: number; type: "metadata"; attributes: { title: string; parent: string; }; appAttributes?: Record<string, Record<string, string>> | undefined; } | { end: number; start: number; type: "bold"; appAttributes?: Record<string, Record<string, string>> | undefined; attributes?: { open?: boolean | undefined; delimiter?: string | undefined; } | undefined; } | { end: number; start: number; type: "italics"; appAttributes?: Record<string, Record<string, string>> | undefined; attributes?: { open?: boolean | undefined; delimiter?: string | undefined; } | undefined; } | { end: number; start: number; type: "strikethrough"; appAttributes?: Record<string, Record<string, string>> | undefined; attributes?: { open?: boolean | undefined; delimiter?: string | undefined; } | undefined; } | { end: number; start: number; type: "highlighting"; appAttributes?: Record<string, Record<string, string>> | undefined; attributes?: { open?: boolean | undefined; delimiter?: string | undefined; } | undefined; } | { end: number; start: number; type: "inline"; appAttributes?: Record<string, Record<string, string>> | undefined; attributes?: { open?: boolean | undefined; delimiter?: string | undefined; } | undefined; } | { end: number; start: number; type: "link"; attributes: { href: string; }; appAttributes?: Record<string, Record<string, string>> | undefined; } | { end: number; start: number; type: "reference"; attributes: { notebookPageId: string; notebookUuid: string; }; appAttributes?: Record<string, Record<string, string>> | undefined; } | { end: number; start: number; type: "image"; attributes: { src: string; }; appAttributes?: Record<string, Record<string, string>> | undefined; } | { end: number; start: number; type: "custom"; attributes: { name: string; }; appAttributes?: Record<string, Record<string, string>> | undefined; } | { end: number; start: number; type: "code"; attributes: { language: string; ticks?: number | undefined; }; appAttributes?: Record<string, Record<string, string>> | undefined; })[]; }> | undefined; }) => Promise<void>; export default saveAndApply;