import { AnyExtension, Editor, JSONContent } from '@tiptap/react'; import { handleMarkdownContent } from '../extensions/mardown-paste-handler'; import { IpfsImageUploadResponse } from '../types'; import * as Y from 'yjs'; export interface UseHeadlessEditorProps { optionalExtensions?: string[]; } /** * The exact extension set the headless editor runs with. Exported so tests * can build an equivalent editor without the hook. */ export declare const getHeadlessExtensions: (options?: { ydoc?: Y.Doc; optionalExtensions?: string[]; }) => AnyExtension[]; export declare const useHeadlessEditor: (props?: UseHeadlessEditorProps) => { setContent: (initialContent: string | string[] | JSONContent, editor: Editor, ydoc: Y.Doc) => void; getEditor: () => { editor: Editor; ydoc: Y.Doc; }; getYjsConvertor: () => { convertJSONContentToYjsEncodedString: (content: JSONContent) => string; cleanup: () => void; }; downloadContentAsMd: (content: string | string[] | JSONContent, title: string) => Promise; downloadContentAsHtml: (content: string | string[] | JSONContent, title: string) => Promise; downloadContentAsTxt: (content: string | string[] | JSONContent, title: string) => Promise; mergeYjsUpdates: (contents: string[]) => string; handleMarkdownContent: typeof handleMarkdownContent; getYjsContentFromMarkdown: (file: File, ipfsImageUploadFn: (file: File) => Promise) => Promise; getYjsContentFromDocx: (file: File, ipfsImageUploadFn: (file: File) => Promise) => Promise; };