@deepseek-ai/libreoffice-kit 0.0.2-rc9 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/NOTICE +0 -240
  2. package/README.md +70 -43
  3. package/README.zh.md +75 -35
  4. package/lib/cli.js +859 -137
  5. package/lib/font-snapshot-worker.js +454 -0
  6. package/lib/index.js +893 -138
  7. package/lib/types/engine.d.ts +5 -5
  8. package/lib/types/font-loader.d.ts +18 -16
  9. package/lib/types/font-metadata-cache.d.ts +11 -0
  10. package/lib/types/font-snapshot-state.d.ts +15 -0
  11. package/lib/types/font-snapshot-validation.d.ts +4 -0
  12. package/lib/types/font-snapshot-worker.d.ts +9 -0
  13. package/lib/types/font-snapshot.d.ts +11 -0
  14. package/lib/types/fonts.d.ts +45 -22
  15. package/lib/types/image-operations.d.ts +1 -1
  16. package/lib/types/index.d.ts +17 -7
  17. package/lib/types/native-image-renderer.d.ts +19 -0
  18. package/lib/types/native.d.ts +1 -1
  19. package/lib/types/options.d.ts +5 -1
  20. package/lib/types/wasm.d.ts +4 -1
  21. package/lib/types/worker.d.ts +5 -3
  22. package/lib/worker.js +257 -1020
  23. package/package.json +14 -55
  24. package/assets/font-subset.json +0 -70
  25. package/assets/font-subset.wasm +0 -0
  26. package/lib/browser/assets.json +0 -10
  27. package/lib/browser/index.js +0 -626
  28. package/lib/browser/types/connection.d.ts +0 -42
  29. package/lib/browser/types/engine-rendering.d.ts +0 -3
  30. package/lib/browser/types/engine-types.d.ts +0 -17
  31. package/lib/browser/types/font-channel.d.ts +0 -36
  32. package/lib/browser/types/index.d.ts +0 -14
  33. package/lib/browser/types/office-engine.d.ts +0 -56
  34. package/lib/browser/types/office-types.d.ts +0 -166
  35. package/lib/browser/types/office.d.ts +0 -19
  36. package/lib/browser/types/preparation.d.ts +0 -13
  37. package/lib/browser/types/protocol.d.ts +0 -137
  38. package/lib/browser/types/rendering.d.ts +0 -4
  39. package/lib/browser/types/types.d.ts +0 -115
  40. package/lib/browser/types/worker.d.ts +0 -2
  41. package/lib/browser/worker.js +0 -3796
  42. package/lib/browser-assets.js +0 -119
  43. package/lib/document.js +0 -178
  44. package/lib/engine-rendering.js +0 -120
  45. package/lib/font-config.js +0 -46
  46. package/lib/font-source.js +0 -395
  47. package/lib/font-worker.js +0 -1481
  48. package/lib/rendering.js +0 -99
  49. package/lib/sheet-geometry.js +0 -111
  50. package/lib/types/browser-assets.d.ts +0 -15
  51. package/lib/types/default-fonts.d.ts +0 -3
  52. package/lib/types/font-config.d.ts +0 -24
  53. package/lib/types/font-preferences-data.d.ts +0 -16
  54. package/lib/types/font-preferences.d.ts +0 -29
  55. package/lib/types/font-request.d.ts +0 -12
  56. package/lib/types/font-source-types.d.ts +0 -95
  57. package/lib/types/font-source.d.ts +0 -10
  58. package/lib/types/font-subsets.d.ts +0 -39
  59. package/lib/types/font-worker.d.ts +0 -2
  60. package/lib/types/harfbuzz-subset.d.ts +0 -11
  61. package/lib/types/unicode-scripts.d.ts +0 -18
  62. package/licenses/font-subset/harfbuzz-COPYING +0 -42
  63. package/licenses/font-subset/harfbuzzjs-LICENSE +0 -19
  64. package/licenses/javascript/fflate-LICENSE +0 -21
  65. package/licenses/javascript/saxes-LICENSE +0 -64
  66. package/licenses/javascript/xmlchars-LICENSE +0 -18
  67. package/sources/browser/packages/browser/package.json +0 -22
  68. package/sources/browser/packages/browser/src/connection.ts +0 -237
  69. package/sources/browser/packages/browser/src/engine-rendering.ts +0 -2
  70. package/sources/browser/packages/browser/src/engine-types.ts +0 -14
  71. package/sources/browser/packages/browser/src/font-channel.ts +0 -169
  72. package/sources/browser/packages/browser/src/index.ts +0 -40
  73. package/sources/browser/packages/browser/src/office-engine.ts +0 -397
  74. package/sources/browser/packages/browser/src/office-types.ts +0 -128
  75. package/sources/browser/packages/browser/src/office.ts +0 -128
  76. package/sources/browser/packages/browser/src/preparation.ts +0 -41
  77. package/sources/browser/packages/browser/src/protocol.ts +0 -55
  78. package/sources/browser/packages/browser/src/rendering.ts +0 -3
  79. package/sources/browser/packages/browser/src/types.ts +0 -118
  80. package/sources/browser/packages/browser/src/worker.ts +0 -260
  81. package/sources/browser/packages/browser/tsconfig.json +0 -5
  82. package/sources/browser/packages/browser/tsdown.config.ts +0 -7
  83. package/sources/browser/scripts/build-browser.mjs +0 -86
  84. package/sources/font-subset/engine/font-subset/README.md +0 -23
  85. package/sources/font-subset/engine/font-subset/README.zh.md +0 -23
  86. package/sources/font-subset/engine/font-subset/source.json +0 -16
  87. package/sources/font-subset/harfbuzzjs/config-override-subset.h +0 -7
  88. package/sources/font-subset/harfbuzzjs/harfbuzz-subset.symbols +0 -34
  89. package/sources/font-subset/scripts/build-font-subset.mjs +0 -64
  90. package/sources/font-subset/scripts/pack-utils.mjs +0 -69
  91. package/sources/font-subset/scripts/platform-matrix.mjs +0 -100
  92. package/sources/font-subset/scripts/verify-artifacts.mjs +0 -260
@@ -2,7 +2,7 @@
2
2
  * Engine-family version every installed engine package must carry. The engine
3
3
  * family shares its release version with this Node API.
4
4
  */
5
- export declare const ENGINE_VERSION = "0.0.2-rc9";
5
+ export declare const ENGINE_VERSION = "0.0.4";
6
6
  /** Host diagnostic fields used to identify the runtime glibc version. */
7
7
  export interface EngineHostReport {
8
8
  readonly header?: {
@@ -56,12 +56,12 @@ export declare function installedPackageExists(name: string): boolean;
56
56
  */
57
57
  export declare function platformTarget(platform?: string, arch?: string, report?: () => EngineHostReport): string | undefined;
58
58
  /**
59
- * Resolve the shared WASM engine on every supported operating system.
59
+ * macOS and Windows require their native engine. Linux uses WASM when no compatible development native engine is installed.
60
60
  * @param resolvePackage - Package manifest resolver; injectable for selection tests.
61
- * @param _packageExists - Retained positional compatibility with earlier resolvers.
61
+ * @param packageExists - Installed-package probe; injectable for selection tests.
62
62
  * @param host - Process identification and diagnostic report.
63
- * @returns the installed WASM engine; native packages never change selection.
63
+ * @returns the installed native engine, or the installed WASM engine.
64
64
  */
65
- export declare function resolveEngine(resolvePackage?: (name: string) => string, _packageExists?: (name: string) => boolean, { platform, arch }?: EngineResolutionHost): Promise<Engine>;
65
+ export declare function resolveEngine(resolvePackage?: (name: string) => string, packageExists?: (name: string) => boolean, { platform, arch, report }?: EngineResolutionHost): Promise<Engine>;
66
66
  export {};
67
67
  //# sourceMappingURL=engine.d.ts.map
@@ -7,30 +7,32 @@ export interface FontSubstitution {
7
7
  /** Installed family selected for the missing one. */
8
8
  readonly substitute: string;
9
9
  }
10
+ /** Serializable match state shared by converters created from one factory. */
11
+ export interface FontResolutionCacheEntry {
12
+ readonly key: string;
13
+ readonly codePoints: number[];
14
+ readonly emptyRequest: boolean;
15
+ readonly faces: {
16
+ readonly path: string;
17
+ readonly faceIndex: number;
18
+ }[];
19
+ readonly missingFamily?: string;
20
+ }
10
21
  /** One conversion's font imports: a serialized resolver plus its diagnostics. */
11
22
  export interface FontLoader {
12
- /** Declared document families no installed face provides, in discovery order. */
13
23
  readonly missingFonts: string[];
14
- /** Missing families the catalog resolved to an installed substitute. */
15
24
  readonly substitutions: FontSubstitution[];
16
- /** Installed file paths this conversion received, deduplicated by origin. */
17
25
  readonly files: string[];
18
- /**
19
- * @param request - VCL family/style attributes and the scalars it still needs.
20
- * @returns installed file paths for the selected faces.
21
- */
26
+ /** Most-recently-used entries safe to merge into the owning factory. */
27
+ readonly cacheEntries: FontResolutionCacheEntry[];
22
28
  resolve(request: FontMatchRequest): string[];
23
29
  }
24
- /**
25
- * Place installed original bytes where the engine can read them.
26
- * @param name - Unique file name within this conversion's font directory.
27
- * @param bytes - Complete original font bytes.
28
- * @returns the path the engine should read.
29
- */
30
+ /** Place installed original bytes where the engine can read them. */
30
31
  export type FontInstaller = (name: string, bytes: Buffer) => string;
31
- /** Build the metadata catalog inside a cancellable conversion worker. */
32
- export declare function createFontLoader(options: ResolvedOptions, document: DocumentFontMetadata, install: FontInstaller, faces: readonly FontFace[]): FontLoader;
32
+ /** Build one operation's loader over a factory-owned immutable font snapshot. */
33
+ export declare function createFontLoader(options: ResolvedOptions, document: DocumentFontMetadata, install: FontInstaller, faces: readonly FontFace[], cache?: readonly FontResolutionCacheEntry[]): FontLoader;
33
34
  /** Supply native imports and seed WASM's first usable default font. */
34
35
  export declare function preloadFonts(loader: FontLoader, options: ResolvedOptions, document: DocumentFontMetadata, native?: boolean): void;
35
- export { memoryFontConfig } from './font-config.ts';
36
+ /** Fontconfig XML restricts WASM discovery to imported originals in MEMFS. */
37
+ export declare function memoryFontConfig(families: readonly (readonly string[])[], requested?: Iterable<string>): string;
36
38
  //# sourceMappingURL=font-loader.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { FontFileMetadata } from './fonts.ts';
2
+ import type { ResolvedOptions } from './options.ts';
3
+ type CacheOptions = Pick<ResolvedOptions, 'fontMetadataCacheDirectory' | 'maxFontMetadataCacheBytes'>;
4
+ /** Resolve the platform's user-local cache, independently of font discovery. */
5
+ export declare function defaultFontMetadataCacheDirectory(platform?: NodeJS.Platform, home?: string, env?: NodeJS.ProcessEnv): string;
6
+ /** Read validated records within the configured byte limit; unusable derived data is a cache miss. */
7
+ export declare function readFontMetadataCache(options: CacheOptions): FontFileMetadata[];
8
+ /** Atomically publish a bounded snapshot through a caller-owned unique temporary path. */
9
+ export declare function writeFontMetadataCache(options: CacheOptions, records: readonly FontFileMetadata[], temporaryPath: string): void;
10
+ export {};
11
+ //# sourceMappingURL=font-metadata-cache.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { FontSnapshot } from './font-snapshot.ts';
2
+ import type { FontFileMetadata } from './fonts.ts';
3
+ import type { ResolvedOptions } from './options.ts';
4
+ /** Run one scan outside the event loop and join it before returning or cleaning its temporary file. */
5
+ export declare function runFontSnapshot(options: ResolvedOptions, previous: readonly FontFileMetadata[], signal: AbortSignal): Promise<FontSnapshot>;
6
+ /** Each acquisition refreshes inventory; overlapping acquisitions share only the active scan. */
7
+ export declare class FontSnapshotState {
8
+ private previous;
9
+ private scan;
10
+ /** Revalidate files for an operation without coupling its cancellation to other waiters. */
11
+ acquire(options: ResolvedOptions, signal: AbortSignal): Promise<FontSnapshot>;
12
+ /** Release completed metadata after the owning factory has joined its operations. */
13
+ clear(): void;
14
+ }
15
+ //# sourceMappingURL=font-snapshot-state.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { FontSnapshot } from './font-snapshot.ts';
2
+ /** Reject changed, removed, or replaced sources without exposing local font paths. */
3
+ export declare function validateFontSnapshot(snapshot: FontSnapshot): Promise<void>;
4
+ //# sourceMappingURL=font-snapshot-validation.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { FontFileMetadata } from './fonts.ts';
2
+ import type { ResolvedOptions } from './options.ts';
3
+ /** Private input supplied by the shared scan owner. */
4
+ export interface FontSnapshotRequest {
5
+ readonly options: ResolvedOptions;
6
+ readonly previous: readonly FontFileMetadata[];
7
+ readonly temporaryPath?: string;
8
+ }
9
+ //# sourceMappingURL=font-snapshot-worker.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { FontFace, FontFileMetadata } from './fonts.ts';
2
+ import type { ResolvedOptions } from './options.ts';
3
+ /** Immutable metadata handed to one operation; generation excludes document-specific matches. */
4
+ export interface FontSnapshot {
5
+ readonly faces: FontFace[];
6
+ readonly records: FontFileMetadata[];
7
+ readonly generation: string;
8
+ }
9
+ /** Re-enumerate all configured sources; only unchanged physical files skip inspection. */
10
+ export declare function scanFontSnapshot(options: ResolvedOptions, previous?: readonly FontFileMetadata[]): FontSnapshot;
11
+ //# sourceMappingURL=font-snapshot.d.ts.map
@@ -1,6 +1,3 @@
1
- import type { FontMatchRequest } from './font-request.ts';
2
- export type { FontMatchRequest } from './font-request.ts';
3
- export { fontFamilyPriority, normalize } from './font-config.ts';
4
1
  import type { Font, FontCollection } from 'fontkit';
5
2
  /** One inclusive Unicode range a physical face renders. */
6
3
  export type GlyphRange = [number, number];
@@ -20,32 +17,39 @@ export interface FontFace {
20
17
  readonly width: number;
21
18
  readonly italic: boolean;
22
19
  readonly fixed: boolean;
23
- /** OS/2 identifies a script or ornamental face; deprioritized only after named preferences. */
24
- readonly decorative: boolean;
25
20
  readonly postscriptName: string | null;
26
21
  /** Decoded glyph ranges; absent until a match reads this face's coverage. */
27
22
  coverage?: GlyphRange[];
28
23
  }
24
+ /** All faces decoded from one unchanged physical file, including an empty parse result. */
25
+ export interface FontFileMetadata extends Pick<FontFace, 'path' | 'dev' | 'ino' | 'size' | 'mtimeMs' | 'ctimeMs'> {
26
+ readonly faces: FontFace[];
27
+ }
28
+ /** VCL attributes LibreOffice requests one family for. */
29
+ export interface FontMatchRequest {
30
+ readonly family: string;
31
+ readonly style: string;
32
+ readonly weight: number;
33
+ readonly italic: number;
34
+ readonly width: number;
35
+ readonly pitch: number;
36
+ readonly language: string;
37
+ readonly codePoints: readonly number[];
38
+ }
29
39
  /** Selected physical files and the requested family the catalog could not find. */
30
40
  export interface FontMatchResult {
31
41
  readonly fonts: FontFace[];
32
42
  readonly missingFamily?: string;
33
- /** Requested scalars no installed face covers. */
34
- readonly unresolvedCodePoints?: readonly number[];
43
+ readonly unresolvedCodePoints?: number[];
35
44
  }
36
45
  /** One host font snapshot and the ordered fallback groups a conversion supplies. */
37
46
  export interface SystemFontCatalogOptions {
38
47
  readonly faces: readonly FontFace[];
39
48
  readonly fallbackFamilies: readonly (readonly string[])[];
40
- /** Whole-file consumers deduplicate collections; subset consumers retain each selected face. */
41
- readonly deduplicateBy?: 'file' | 'face';
42
- /** Platform owning the indexed font snapshot; defaults to the current Host. */
43
- readonly platform?: string;
44
49
  }
45
50
  /** Host font roots and physical file limits. */
46
51
  export interface FontIndexOptions {
47
52
  readonly directories: readonly string[];
48
- readonly files?: readonly string[];
49
53
  readonly maxFiles: number;
50
54
  readonly maxFileBytes: number;
51
55
  }
@@ -54,6 +58,21 @@ export interface FontIndexOptions {
54
58
  * @returns whether it means the path is not a usable font source.
55
59
  */
56
60
  export declare function absent(error: unknown): boolean;
61
+ /**
62
+ * Case- and separator-insensitive family key used to compare names across sources.
63
+ * @param value - Family, style, or postscript name as recorded by a document or font.
64
+ * @returns The normalized key.
65
+ */
66
+ export declare function normalize(value: string): string;
67
+ /**
68
+ * Order named substitutions and their generic text family without excluding unlisted fonts.
69
+ * @param requested - Original family names, in document order.
70
+ * @param groups - Ordered family groups shared with Fontconfig aliases.
71
+ * @param pitch - VCL pitch; one requests a monospaced fallback.
72
+ * @param symbols - Whether symbol alternatives precede the generic fallback.
73
+ * @returns distinct family names, with original requests first.
74
+ */
75
+ export declare function fontFamilyPriority(requested: readonly string[], groups: readonly (readonly string[])[], pitch?: number, symbols?: boolean): string[];
57
76
  /**
58
77
  * Discover system and per-user font roots using the selected platform's path separators.
59
78
  * @param platform - Host operating system.
@@ -83,19 +102,24 @@ export declare function faceCoverage(font: Font): GlyphRange[];
83
102
  */
84
103
  export declare function indexedFace(parsed: Font | FontCollection, face: Pick<FontFace, 'faceIndex' | 'postscriptName'>): Font;
85
104
  /**
86
- * VCL metrics and OS/2 design classification for one parsed face.
105
+ * VCL weight, width, and fixed-pitch values for one parsed face.
87
106
  * @param font - The parsed physical face, whose `OS/2` and `post` tables may be absent.
88
107
  * @returns the recorded classes, or the regular defaults for an absent table.
89
108
  */
90
- export declare function faceMetrics(font: Pick<Font, 'OS/2' | 'post'>): Pick<FontFace, 'weight' | 'width' | 'fixed' | 'decorative'>;
109
+ export declare function faceMetrics(font: Pick<Font, 'OS/2' | 'post'>): {
110
+ weight: number;
111
+ width: number;
112
+ fixed: boolean;
113
+ };
91
114
  /**
92
115
  * Snapshot eligible local font metadata without retaining font bytes or decoding glyph coverage.
93
116
  * @param options - Host font roots and physical file limits.
94
- * @param previous - Optional prior snapshot whose unchanged physical files can reuse parsed metadata.
95
- * @returns current metadata; changed and newly installed files are decoded again.
117
+ * @param previous - Prior per-file records, reused only after opening and checking the current file.
118
+ * @param observed - Receives successfully read records for this scan, including damaged-font parse results.
119
+ * @returns metadata in discovery order for the current font inventory.
96
120
  */
97
- export declare function indexSystemFonts(options: FontIndexOptions, previous?: readonly FontFace[]): FontFace[];
98
- /** Conversion-local glyph coverage over the converter's first metadata snapshot. */
121
+ export declare function indexSystemFonts(options: FontIndexOptions, previous?: ReadonlyMap<string, FontFileMetadata>, observed?: Map<string, FontFileMetadata>): FontFace[];
122
+ /** Conversion-local glyph coverage over one operation's metadata snapshot. */
99
123
  export declare class SystemFontCatalog {
100
124
  private readonly options;
101
125
  private readonly faces;
@@ -105,12 +129,11 @@ export declare class SystemFontCatalog {
105
129
  constructor(options: SystemFontCatalogOptions);
106
130
  /**
107
131
  * Find installed faces covering the requested family or missing characters.
108
- * Exact families and configured aliases precede script/region body preferences,
109
- * then other glyph-covering faces. Unlisted decorative Latin/CJK faces follow
110
- * body faces; normal cursive writing systems retain their typographic traditions.
132
+ * Exact families precede configured alternatives, symbol families for missing symbols,
133
+ * generic families, then other glyph-covering faces.
111
134
  * @param request - VCL family/style attributes and Unicode scalars missing from its current font.
112
135
  * @param signal - cancellation checked between synchronous font reads.
113
- * @returns selected files or physical faces according to deduplicateBy; absent glyphs remain unresolved.
136
+ * @returns selected physical files, deduplicated across collection faces; absent glyphs remain unresolved.
114
137
  * @throws if an indexed font changes or cannot be read during glyph matching.
115
138
  */
116
139
  match(request: FontMatchRequest, signal: AbortSignal): FontMatchResult;
@@ -34,7 +34,7 @@ export interface RenderedImage {
34
34
  }
35
35
  export interface RenderImagesResult {
36
36
  readonly schemaVersion: 1;
37
- readonly backend: 'wasm';
37
+ readonly backend: 'native' | 'wasm';
38
38
  readonly rasterEngine: 'libreoffice' | 'pdfium';
39
39
  readonly source: 'saved';
40
40
  readonly inputPath: string;
@@ -11,6 +11,10 @@ export type { ConversionErrorCode } from './errors.ts';
11
11
  export { ENGINE_VERSION } from './engine.ts';
12
12
  /** Host limits used by both native and Node WASM conversions. All byte limits are positive safe integers. */
13
13
  export interface ConverterOptions {
14
+ /** User-local font metadata cache directory. Defaults to the platform cache directory; false disables disk reuse. */
15
+ fontMetadataCacheDirectory?: string | false;
16
+ /** Maximum persisted and reusable per-file metadata bytes. Default: 32 MiB. */
17
+ maxFontMetadataCacheBytes?: number;
14
18
  /** Deadline after a queued conversion starts, including font work and output. Default: 120000 ms. */
15
19
  timeoutMs?: number;
16
20
  /** Maximum source bytes. Default: 64 MiB. */
@@ -37,6 +41,8 @@ export interface ConverterOptions {
37
41
  maxFontFileBytes?: number;
38
42
  /** Complete original font bytes imported per conversion. Default: 512 MiB. Native platform fonts remain OS-managed. */
39
43
  maxLoadedFontBytes?: number;
44
+ /** Maximum font match records retained by each compatible process cache or explicit factory. Default: 4096. */
45
+ maxFontResolutionEntries?: number;
40
46
  }
41
47
  /** Result of one conversion. */
42
48
  export interface RenderResult {
@@ -77,12 +83,16 @@ export interface Converter {
77
83
  /** Abort queued and active work, await exit and cleanup, and permanently reject further renders. */
78
84
  dispose(): Promise<void>;
79
85
  }
80
- /**
81
- * Resolve the installed engine and deployment limits without starting LibreOffice.
82
- * @param options - Conversion, font, and output limits.
83
- * @returns A serial converter; dispose it after use.
84
- * @throws TypeError for invalid options, or an unavailable ConversionError for invalid installed engines.
85
- * An absent native engine or a known unsupported glibc version selects WASM.
86
- */
86
+ /** Factory-scoped engine and font metadata shared by concurrent converters. */
87
+ export interface ConverterFactory {
88
+ readonly backend: 'native' | 'wasm';
89
+ /** Create one serial converter sharing this factory's bounded font cache. */
90
+ create(): Promise<Converter>;
91
+ /** Abort and join every converter created by this factory. */
92
+ dispose(): Promise<void>;
93
+ }
94
+ /** Resolve one engine and share its bounded font state across many converters. */
95
+ export declare function createConverterFactory(options?: ConverterOptions): Promise<ConverterFactory>;
96
+ /** Create one converter with process-shared, configuration-isolated bounded font metadata. */
87
97
  export declare function createConverter(options?: ConverterOptions): Promise<Converter>;
88
98
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { type ImageRenderSpec, type RenderImagesResult } from './image-operations.ts';
2
+ import type { FontSubstitution } from './font-loader.ts';
3
+ import type { NativeEngine } from './engine.ts';
4
+ import type { ResolvedOptions } from './options.ts';
5
+ /** Run one native image batch and write final PNGs only after each bounded paint succeeds. */
6
+ export declare function renderImagesWithNative(request: {
7
+ readonly engine: NativeEngine;
8
+ readonly options: ResolvedOptions;
9
+ readonly inputPath: string;
10
+ readonly source: Uint8Array;
11
+ readonly scratch: string;
12
+ readonly profile: string;
13
+ readonly fonts: readonly string[];
14
+ readonly substitutions: readonly FontSubstitution[];
15
+ readonly missingFonts: string[];
16
+ readonly operation: ImageRenderSpec;
17
+ readonly signal: AbortSignal;
18
+ }): Promise<RenderImagesResult>;
19
+ //# sourceMappingURL=native-image-renderer.d.ts.map
@@ -32,5 +32,5 @@ export declare function nativeEnvironment(profile: string, programDirectory: str
32
32
  * @param operation - Validated output format, recalculation, and worksheet selection.
33
33
  * @throws ConversionError for a reported conversion failure, and the abort reason for cancellation.
34
34
  */
35
- export declare function runNative(engine: NativeEngine, options: ResolvedOptions, input: string, output: string, profile: string, fonts: readonly string[], substitutions: readonly FontSubstitution[], signal: AbortSignal, operation: Pick<ConversionSpec, 'format' | 'recalculate' | 'sheet'>): Promise<void>;
35
+ export declare function runNative(engine: NativeEngine, options: ResolvedOptions, input: string, output: string, profile: string, fonts: readonly string[], substitutions: readonly FontSubstitution[], signal: AbortSignal, operation?: Pick<ConversionSpec, 'format' | 'recalculate' | 'sheet'>): Promise<void>;
36
36
  //# sourceMappingURL=native.d.ts.map
@@ -1,9 +1,11 @@
1
1
  /** Validated deployment limits shared by native and Node WASM conversions. */
2
2
  import type { ConverterOptions } from './index.ts';
3
- /** Default named aliases and generic families. */
3
+ /** Ordered family groups used when the caller supplies none. */
4
4
  export declare const FONT_FALLBACKS: readonly (readonly string[])[];
5
5
  /** Resolved limits and font settings used by every conversion of one converter. */
6
6
  export interface ResolvedOptions {
7
+ readonly fontMetadataCacheDirectory: string | false;
8
+ readonly maxFontMetadataCacheBytes: number;
7
9
  readonly timeoutMs: number;
8
10
  readonly maxInputBytes: number;
9
11
  readonly maxOutputBytes: number;
@@ -13,7 +15,9 @@ export interface ResolvedOptions {
13
15
  readonly maxFontFiles: number;
14
16
  readonly maxFontFileBytes: number;
15
17
  readonly maxLoadedFontBytes: number;
18
+ readonly maxFontResolutionEntries: number;
16
19
  readonly fontDirectories: string[];
20
+ readonly includeOfficeFonts: boolean;
17
21
  readonly fontFallbacks: string[][];
18
22
  readonly initialFontFamilies: string[];
19
23
  }
@@ -1,4 +1,5 @@
1
1
  import type { FontFace } from './fonts.ts';
2
+ import type { FontResolutionCacheEntry } from './font-loader.ts';
2
3
  import type { DocumentFontMetadata } from './ooxml.ts';
3
4
  import type { ResolvedOptions } from './options.ts';
4
5
  import type { ConversionSpec } from './operations.ts';
@@ -68,10 +69,12 @@ export interface WasmConversionRequest {
68
69
  readonly engine: WasmEngine;
69
70
  readonly bytes: Uint8Array;
70
71
  readonly extension: string;
71
- readonly operation: Pick<ConversionSpec, 'format' | 'recalculate' | 'sheet'>;
72
+ readonly operation?: Pick<ConversionSpec, 'format' | 'recalculate' | 'sheet'>;
72
73
  readonly options: ResolvedOptions;
73
74
  readonly document: DocumentFontMetadata;
74
75
  readonly faces: readonly FontFace[];
76
+ readonly fontCache?: readonly FontResolutionCacheEntry[];
77
+ readonly onFontCache?: (entries: FontResolutionCacheEntry[]) => void;
75
78
  }
76
79
  /** Owned PDF bytes and declared families the installed catalog could not provide. */
77
80
  export interface WasmConversionResult {
@@ -1,9 +1,10 @@
1
+ import type { FontResolutionCacheEntry } from './font-loader.ts';
1
2
  import type { ImageRenderSpec } from './image-operations.ts';
2
3
  import type { ConversionSpec } from './operations.ts';
3
4
  import type { Engine } from './engine.ts';
4
5
  import type { FontFace } from './fonts.ts';
5
6
  import type { ResolvedOptions } from './options.ts';
6
- /** Worker input: inspected paths, validated limits, the resolved engine, and cached faces. */
7
+ /** Worker input: inspected paths, validated limits, the resolved engine, and the current font snapshot. */
7
8
  export interface WorkerRequest {
8
9
  readonly inputPath: string;
9
10
  readonly extension: string;
@@ -11,7 +12,8 @@ export interface WorkerRequest {
11
12
  readonly options: ResolvedOptions;
12
13
  readonly engine: Engine;
13
14
  readonly scratch: string;
14
- /** Faces the previous conversion indexed; absent until the worker reports them. */
15
- readonly fontFaces?: FontFace[] | undefined;
15
+ /** Faces the caller's font snapshot revalidated for this conversion. */
16
+ readonly fontFaces: FontFace[];
17
+ readonly fontCache?: FontResolutionCacheEntry[] | undefined;
16
18
  }
17
19
  //# sourceMappingURL=worker.d.ts.map