import type { CSL, EditorUser } from "./types.js"; import type { StaticAppConfig } from "./static_app.js"; import type { Editor } from "./index.js"; export type { StaticAppConfig } from "./static_app.js"; export interface StaticEditorConfig extends Omit { /** gettext function for UI strings. When omitted, a function backed by `localeCatalog` is used. */ gettext?: (msgid: string) => string; /** CSL engine instance. When omitted, a default engine is created. */ csl?: CSL; /** Display name for the user. Used to build the user object when `user` is not given. */ username?: string; /** User id. Used to build the user object when `user` is not given. Defaults to 1. */ userId?: number; /** Pre-built user object. Takes precedence over `username` and `userId`. */ user?: EditorUser; /** * Base path for resolving static assets. * Defaults to the directory containing the current page. */ staticBasePath?: string; /** * Optional locale catalog. When omitted, the catalog is fetched from * `../locale/{locale}/messages.json` relative to the current page. */ localeCatalog?: Record; /** * Optional callback for save attempts. Receives the document payload. */ onSaveDocument?: (data: Record) => Promise<{ json: Record; status: number; }>; /** * Whether the document title/path shown in the header is editable. * * With the Fidus Writer server backend, editing the header title * changes the document's path via a `path_change` WebSocket message. * Static deployments have no such concept by default, so editing is * disabled unless the host opts in (e.g. a WebDAV host that renames * the underlying file). */ pathEditable?: boolean; /** * Optional callback invoked after the user edited the header title * (i.e. the document path). Only called when `pathEditable` is * enabled and only on the host that received the edit. */ onPathChange?: (path: string) => void; /** Optional extra editor plugins. */ plugins?: Array<[string, Record]>; /** * Optional container element (or selector) to mount the editor into. * When omitted, the editor replaces `document.body` (full-page mode). */ mount?: HTMLElement | string; /** * Optional user preferences that control inline editing helpers. * Recognized keys include `inline_references` and `inline_math`. */ userPreferences?: Record; } /** * Create and initialize a statically served Fidus Writer editor. * * This is the high-level entry point for running `@fiduswriter/editor` without * a backend server. It sets up the runtime globals, loads locale strings, * creates the static app shell, and initializes the editor. * * The lower-level {@link Editor} constructor and {@link createStaticApp} are * still available for server-backed deployments or advanced customization. */ export declare function createStaticEditor(config: StaticEditorConfig): Promise; //# sourceMappingURL=static_editor.d.ts.map