import { t as ClockPort } from "../clock-C7SUuYN0.js"; import { DocumentFormat } from "./port.js"; import { t as ContentVariant } from "../capability-BmRwrPL9.js"; import { i as SvgDiagnosticSink } from "../diagnostics-DVAXKgcf.js"; import { i as CellTypeInferenceSink } from "../cell-typing-BQ-xQ5X5.js"; import { t as OmmlDiagnostic } from "../shared-DHu5jDJf.js"; import { Package } from "ooxml.js"; import { ContentDocument, DocumentTree, FontSubstitution, ProvidedFont } from "document-schema.js"; import { PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec"; import { MarkdownImageResolver } from "markdown-codec"; //#region src/convert/composition.d.ts type SourcePackage = Package; interface UnifiedConversionOptions { readonly signal?: AbortSignal; readonly onDocument?: (pkg: DocumentTree) => void; readonly fonts?: readonly ProvidedFont[]; readonly onFontSubstitution?: (substitution: FontSubstitution) => void; readonly onSubstitution?: (substitution: WinAnsiSubstitution, context: { readonly pageIndex: number; }) => void; readonly sink?: PdfDiagnosticSink; readonly onMathDiagnostic?: (diagnostic: OmmlDiagnostic, context: { readonly sourcePath?: string; }) => void; readonly images?: MarkdownImageResolver; readonly delimiter?: string; readonly sheet?: string; readonly onCellTypeInference?: CellTypeInferenceSink; readonly page?: number; readonly onSvgDiagnostic?: SvgDiagnosticSink; readonly clock?: ClockPort; } type ContentFormat = "docx" | "pptx" | "xlsx" | "odt" | "odp" | "ods" | "odg" | "svg" | "csv" | "markdown" | "rtf" | "doc" | "xls" | "ppt" | "epub"; type LayoutVariant = Exclude; interface PackageFormatNode { readonly variant: LayoutVariant; readonly family: "ooxml" | "odf"; readonly decode: (bytes: Uint8Array) => SourcePackage; readonly read: (pkg: SourcePackage, options?: UnifiedConversionOptions) => ContentDocument; readonly build: (content: ContentDocument, options?: UnifiedConversionOptions) => SourcePackage; readonly encode: (pkg: SourcePackage) => Uint8Array; readonly hasSourcePackage: true; } interface TextFormatNode { readonly variant: LayoutVariant; readonly family: "markdown" | "csv" | "svg" | "rtf" | "doc" | "xls" | "ppt" | "epub"; readonly decode: (bytes: Uint8Array) => string; readonly read: (text: string, options?: UnifiedConversionOptions) => ContentDocument; readonly build: (content: ContentDocument, options?: UnifiedConversionOptions) => string; readonly encode: (text: string) => Uint8Array; readonly hasSourcePackage: false; } type FormatNode = PackageFormatNode | TextFormatNode; declare function isTextFormatNode(node: FormatNode): node is TextFormatNode; type ReadOnlyContentFormat = "wpd"; interface ReadOnlyFormatNode { readonly variant: LayoutVariant; readonly read: (bytes: Uint8Array, options?: UnifiedConversionOptions) => ContentDocument; } declare const READ_ONLY_FORMAT_NODES: Readonly>; type SourceContentFormat = ContentFormat | ReadOnlyContentFormat; declare function isReadOnlyContentFormat(format: DocumentFormat): format is ReadOnlyContentFormat; declare const FORMAT_NODES: Readonly>; declare const LAYOUT_CAPABLE: ReadonlySet; declare function executeBridge(source: SourceContentFormat, target: ContentFormat, bytes: Uint8Array, options?: UnifiedConversionOptions): Uint8Array; declare function executeFromPdf(target: ContentFormat, bytes: Uint8Array, options?: UnifiedConversionOptions): Uint8Array; type HopExecutor = "bridge" | "toPdf" | "fromPdf"; interface CompositionHop { readonly executor: HopExecutor; readonly from: DocumentFormat; readonly to: DocumentFormat; } interface ConversionPlan { readonly hops: readonly CompositionHop[]; } declare function resolveCompositionPlan(source: DocumentFormat, target: DocumentFormat): ConversionPlan | undefined; interface CompositionExecutorBinding { readonly bridge: (source: SourceContentFormat, target: ContentFormat, bytes: Uint8Array, options?: UnifiedConversionOptions) => Uint8Array; readonly fromPdf: (target: ContentFormat, bytes: Uint8Array, options?: UnifiedConversionOptions) => Uint8Array; readonly toPdf?: (source: SourceContentFormat, bytes: Uint8Array, options?: UnifiedConversionOptions) => Uint8Array; } declare function runCompositionPlan(plan: ConversionPlan, bytes: Uint8Array, options: UnifiedConversionOptions | undefined, executors: CompositionExecutorBinding): Uint8Array; declare function convertDocumentFromPdf(target: ContentFormat, bytes: Uint8Array, options?: UnifiedConversionOptions): Uint8Array; //#endregion export { CompositionExecutorBinding, CompositionHop, ContentFormat, ConversionPlan, FORMAT_NODES, FormatNode, HopExecutor, LAYOUT_CAPABLE, READ_ONLY_FORMAT_NODES, ReadOnlyContentFormat, ReadOnlyFormatNode, SourceContentFormat, UnifiedConversionOptions, convertDocumentFromPdf, executeBridge, executeFromPdf, isReadOnlyContentFormat, isTextFormatNode, resolveCompositionPlan, runCompositionPlan };