import * as prosemirror_model from 'prosemirror-model'; import { Node, Fragment } from 'prosemirror-model'; import { Step } from 'prosemirror-transform'; import { DatabaseReference } from 'firebase/database'; import { buildSchema } from './schema.js'; import { CompressedKeyable, CompressedChange, ResourceWarning } from './types.js'; declare const firebaseTimestamp: { '.sv': string; }; declare const storeCheckpoint: (firebaseRef: DatabaseReference, doc: Node, keyNumber: number) => Promise; declare const flattenKeyables: (keyables: Record) => CompressedChange[]; declare const createFirebaseChange: (steps: readonly Step[], clientId: string) => CompressedChange; declare const getFirebaseConnectionMonitorRef: (ref: DatabaseReference) => DatabaseReference; type Doc = { rawMetadata?: { [k: string]: any; } | undefined; doc: any; warnings: ResourceWarning[]; pandocErrorOutput: any; proposedMetadata: ProposedMetadata; }; type ProposedMetadata = { slug?: string; title?: string; description?: string; attributions?: { name: string; users: Record<'id' | 'slug' | 'fullName' | 'initials' | 'avatar', string | undefined>[] | null; }[]; customPublishedAt?: string; metadata?: Record; }; declare const writeDocumentToPubDraft: (draftRef: DatabaseReference, document: Doc, { schema, initialDocKey, postProcessor, }?: { schema?: prosemirror_model.Schema<"reference" | "table" | "table_row" | "table_cell" | "table_header" | "highlightQuote" | "citationList" | "footnoteList" | "discussion" | "audio" | "video" | "image" | "iframe" | "footnote" | "file" | "math_inline" | "math_display" | "equation" | "block_equation" | "citation", string> | undefined; initialDocKey?: number | undefined; /** * A function that takes the document and returns a new document. * * This allows you to do custom post-processing on the document to do things that the PubPub importer does not allow yet, * e.g. setting captions on Figures from an imported Word document. * */ postProcessor?: ((doc: Fragment, schema: ReturnType) => Fragment) | undefined; }) => Promise; export { Doc, ProposedMetadata, createFirebaseChange, firebaseTimestamp, flattenKeyables, getFirebaseConnectionMonitorRef, storeCheckpoint, writeDocumentToPubDraft };