import type { EditableArtifactResource } from "@opengeni/sdk/artifacts"; import { type CreateBrowserEditableArtifactSessionOptions, type EditableArtifactBrowserRuntime, type EditableArtifactCacheAuthority } from "@opengeni/sdk/editable-artifacts"; import { type ArtifactLoadErrorView } from "./artifact-chrome.js"; /** * The browser kernels an editor needs, one per modality, plus the host-built * Worker URL (for Vite: `@opengeni/sdk/editable-artifacts/worker?worker&url`). * Kernels come from `@opengeni/artifact-kernel-wasm-{document,spreadsheet,presentation}`. */ export type EditableArtifactRuntimes = Readonly<{ document: Omit; spreadsheet: Omit; presentation: Omit; workerUrl: string; applicationOrigin?: string | undefined; /** Loopback development only. */ allowInsecureDevelopmentAssets?: boolean | undefined; }>; /** Everything needed to open one artifact for the current principal. */ export type OpenedEditableArtifact = Readonly<{ artifact: EditableArtifactResource; authority: EditableArtifactCacheAuthority; replicaId: string; }>; export type EditableArtifactViewProps = Readonly<{ /** Absolute API (or session proxy) base the live transport talks to. */ baseUrl: URL; workspaceId: string; artifactId: string; /** Resolve metadata, cache authority, and replica; called again on retry. */ open: (signal: AbortSignal) => Promise; runtimes: EditableArtifactRuntimes; transport?: CreateBrowserEditableArtifactSessionOptions["transport"]; /** Show the editor's own title header (hosts with their own header hide it). */ showHeader?: boolean | undefined; /** Re-open when this changes (for example the host's credential version). */ authorityKey?: string | undefined; describeError?: ((error: unknown) => ArtifactLoadErrorView) | undefined; onTitle?: ((title: string) => void) | undefined; /** Loading copy; defaults to the `opening` label. */ loadingLabel?: string | undefined; /** * Host-authenticated Office export (DOCX, XLSX, or PPTX by modality); omitted * for hosts without export support. Every editor shows Download when set. */ downloadArtifact?: ((opened: OpenedEditableArtifact, signal: AbortSignal) => Promise) | undefined; /** Spreadsheet-only XLSX export; `downloadArtifact` takes precedence when both are set. */ downloadSpreadsheet?: ((opened: OpenedEditableArtifact, signal: AbortSignal) => Promise) | undefined; }>; /** * One editable document, spreadsheet, or presentation with its first-party * editor. The console dock/page and embedding hosts supply only data access. */ export declare function EditableArtifactView({ baseUrl, workspaceId, artifactId, open, runtimes, transport, showHeader, authorityKey, describeError, onTitle, loadingLabel, downloadArtifact, downloadSpreadsheet, }: EditableArtifactViewProps): import("react").JSX.Element;