import { t as ClockPort } from "./clock-Cewekmhw.js"; import { DocumentFormat } from "./convert/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 { a as ReconstructOptions } from "./reconstruct-BKOCAedo.js"; import { t as OmmlDiagnostic } from "./shared-DHu5jDJf.js"; import { Package } from "ooxml.js"; import { ContentDocument, DocumentTree, FontSubstitution, ProvidedFont } from "document-schema.js"; import { LayoutDocument, PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec"; import { MarkdownImageResolver } from "markdown-codec"; //#region src/convert/composition.d.ts declare const THROUGH_PDF_EDGE_COST = 3; declare const MAX_CONVERSION_PATH_NODES = 4; declare const FORMAT_NODES: Readonly>; 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"; declare const CONTENT_FORMATS: readonly ContentFormat[]; 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"; declare const READ_ONLY_CONTENT_FORMATS: readonly ReadOnlyContentFormat[]; 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 LAYOUT_CAPABLE: ReadonlySet; declare const TRANSFORMS: Readonly ContentDocument>>; declare const RECONSTRUCTORS: Readonly ContentDocument>>; declare function executeBridge(source: SourceContentFormat, target: ContentFormat, bytes: Uint8Array, options?: UnifiedConversionOptions): Uint8Array; declare function executeFromPdf(target: ContentFormat, bytes: Uint8Array, options?: UnifiedConversionOptions): Uint8Array; 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 //#region src/convert/composition-plan.d.ts type HopExecutor = "bridge" | "toPdf" | "fromPdf"; interface CompositionHop { readonly executor: HopExecutor; readonly from: DocumentFormat; readonly to: DocumentFormat; } interface ConversionPlan { readonly hops: readonly CompositionHop[]; } interface GraphEdge { readonly to: DocumentFormat; readonly cost: number; } declare function buildCompositionGraph(): ReadonlyMap; declare function shortestPath(source: DocumentFormat, target: DocumentFormat): readonly DocumentFormat[] | undefined; declare function resolveCompositionPlan(source: DocumentFormat, target: DocumentFormat): ConversionPlan | undefined; declare function isContentFormat(format: DocumentFormat): format is ContentFormat; declare function isSourceContentFormat(format: DocumentFormat): format is SourceContentFormat; //#endregion export { isTextFormatNode as A, THROUGH_PDF_EDGE_COST as C, executeBridge as D, convertDocumentFromPdf as E, executeFromPdf as O, SourceContentFormat as S, UnifiedConversionOptions as T, READ_ONLY_CONTENT_FORMATS as _, buildCompositionGraph as a, ReadOnlyContentFormat as b, resolveCompositionPlan as c, CompositionExecutorBinding as d, ContentFormat as f, MAX_CONVERSION_PATH_NODES as g, LAYOUT_CAPABLE as h, HopExecutor as i, runCompositionPlan as j, isReadOnlyContentFormat as k, shortestPath as l, FormatNode as m, ConversionPlan as n, isContentFormat as o, FORMAT_NODES as p, GraphEdge as r, isSourceContentFormat as s, CompositionHop as t, CONTENT_FORMATS as u, READ_ONLY_FORMAT_NODES as v, TRANSFORMS as w, ReadOnlyFormatNode as x, RECONSTRUCTORS as y };