import type { Editor } from "@tiptap/core"; import { type FileImportControllerOptions, type ImportStructureSummary } from "@pixerate/editor"; /** * Imports markdown, HTML, plain-text and RTF files (or anything registered * with `registerImportAdapter` for the `document` target) into an editor, * with reactive `isImporting` / `error` state. Pair it with * `` to also accept dropped files. * * `getEditor` is read on every import, so pass `() => editor` for a * `bind:editor` value. */ export declare function createFileImport(getEditor: () => Editor | null | undefined, options?: FileImportControllerOptions): { readonly isImporting: boolean; readonly error: Error | null; readonly lastOutcomes: import("@pixerate/editor").ImportOutcome[]; /** * Structures detected in the last import (headings, lists, tables, * columns), or `null` when no adapter reported any (only structure-aware * adapters such as PDF do). Turn PDF detection off with * `setOptions({ adapterOptions: { pdf: { structure: false } } })`. */ readonly structureSummary: ImportStructureSummary | null; /** Value for ``. */ readonly accept: string; /** Opens the browser file picker and imports the chosen files at the selection. */ openFilePicker: () => Promise[]>; /** Imports files (e.g. from your own `` or drop zone) at `at` or the selection. */ importFiles: (files: Iterable | ArrayLike, at?: number) => Promise[]>; setOptions: (next: FileImportControllerOptions) => void; }; export type FileImportHandle = ReturnType;