@deepseek-ai/libreoffice-kit 0.0.2-rc9 → 0.0.3
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.
- package/NOTICE +0 -240
- package/README.md +53 -43
- package/README.zh.md +58 -35
- package/lib/cli.js +725 -132
- package/lib/index.js +757 -133
- package/lib/types/engine.d.ts +5 -5
- package/lib/types/font-loader.d.ts +18 -16
- package/lib/types/fonts.d.ts +38 -21
- package/lib/types/image-operations.d.ts +1 -1
- package/lib/types/index.d.ts +13 -7
- package/lib/types/native-image-renderer.d.ts +19 -0
- package/lib/types/native.d.ts +1 -1
- package/lib/types/options.d.ts +3 -1
- package/lib/types/wasm.d.ts +4 -1
- package/lib/types/worker.d.ts +2 -0
- package/lib/worker.js +420 -942
- package/package.json +13 -55
- package/assets/font-subset.json +0 -70
- package/assets/font-subset.wasm +0 -0
- package/lib/browser/assets.json +0 -10
- package/lib/browser/index.js +0 -626
- package/lib/browser/types/connection.d.ts +0 -42
- package/lib/browser/types/engine-rendering.d.ts +0 -3
- package/lib/browser/types/engine-types.d.ts +0 -17
- package/lib/browser/types/font-channel.d.ts +0 -36
- package/lib/browser/types/index.d.ts +0 -14
- package/lib/browser/types/office-engine.d.ts +0 -56
- package/lib/browser/types/office-types.d.ts +0 -166
- package/lib/browser/types/office.d.ts +0 -19
- package/lib/browser/types/preparation.d.ts +0 -13
- package/lib/browser/types/protocol.d.ts +0 -137
- package/lib/browser/types/rendering.d.ts +0 -4
- package/lib/browser/types/types.d.ts +0 -115
- package/lib/browser/types/worker.d.ts +0 -2
- package/lib/browser/worker.js +0 -3796
- package/lib/browser-assets.js +0 -119
- package/lib/document.js +0 -178
- package/lib/engine-rendering.js +0 -120
- package/lib/font-config.js +0 -46
- package/lib/font-source.js +0 -395
- package/lib/font-worker.js +0 -1481
- package/lib/rendering.js +0 -99
- package/lib/sheet-geometry.js +0 -111
- package/lib/types/browser-assets.d.ts +0 -15
- package/lib/types/default-fonts.d.ts +0 -3
- package/lib/types/font-config.d.ts +0 -24
- package/lib/types/font-preferences-data.d.ts +0 -16
- package/lib/types/font-preferences.d.ts +0 -29
- package/lib/types/font-request.d.ts +0 -12
- package/lib/types/font-source-types.d.ts +0 -95
- package/lib/types/font-source.d.ts +0 -10
- package/lib/types/font-subsets.d.ts +0 -39
- package/lib/types/font-worker.d.ts +0 -2
- package/lib/types/harfbuzz-subset.d.ts +0 -11
- package/lib/types/unicode-scripts.d.ts +0 -18
- package/licenses/font-subset/harfbuzz-COPYING +0 -42
- package/licenses/font-subset/harfbuzzjs-LICENSE +0 -19
- package/licenses/javascript/fflate-LICENSE +0 -21
- package/licenses/javascript/saxes-LICENSE +0 -64
- package/licenses/javascript/xmlchars-LICENSE +0 -18
- package/sources/browser/packages/browser/package.json +0 -22
- package/sources/browser/packages/browser/src/connection.ts +0 -237
- package/sources/browser/packages/browser/src/engine-rendering.ts +0 -2
- package/sources/browser/packages/browser/src/engine-types.ts +0 -14
- package/sources/browser/packages/browser/src/font-channel.ts +0 -169
- package/sources/browser/packages/browser/src/index.ts +0 -40
- package/sources/browser/packages/browser/src/office-engine.ts +0 -397
- package/sources/browser/packages/browser/src/office-types.ts +0 -128
- package/sources/browser/packages/browser/src/office.ts +0 -128
- package/sources/browser/packages/browser/src/preparation.ts +0 -41
- package/sources/browser/packages/browser/src/protocol.ts +0 -55
- package/sources/browser/packages/browser/src/rendering.ts +0 -3
- package/sources/browser/packages/browser/src/types.ts +0 -118
- package/sources/browser/packages/browser/src/worker.ts +0 -260
- package/sources/browser/packages/browser/tsconfig.json +0 -5
- package/sources/browser/packages/browser/tsdown.config.ts +0 -7
- package/sources/browser/scripts/build-browser.mjs +0 -86
- package/sources/font-subset/engine/font-subset/README.md +0 -23
- package/sources/font-subset/engine/font-subset/README.zh.md +0 -23
- package/sources/font-subset/engine/font-subset/source.json +0 -16
- package/sources/font-subset/harfbuzzjs/config-override-subset.h +0 -7
- package/sources/font-subset/harfbuzzjs/harfbuzz-subset.symbols +0 -34
- package/sources/font-subset/scripts/build-font-subset.mjs +0 -64
- package/sources/font-subset/scripts/pack-utils.mjs +0 -69
- package/sources/font-subset/scripts/platform-matrix.mjs +0 -100
- package/sources/font-subset/scripts/verify-artifacts.mjs +0 -260
package/lib/types/engine.d.ts
CHANGED
|
@@ -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.
|
|
5
|
+
export declare const ENGINE_VERSION = "0.0.3";
|
|
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
|
-
*
|
|
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
|
|
61
|
+
* @param packageExists - Installed-package probe; injectable for selection tests.
|
|
62
62
|
* @param host - Process identification and diagnostic report.
|
|
63
|
-
* @returns the installed
|
|
63
|
+
* @returns the installed native engine, or the installed WASM engine.
|
|
64
64
|
*/
|
|
65
|
-
export declare function resolveEngine(resolvePackage?: (name: string) => string,
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
package/lib/types/fonts.d.ts
CHANGED
|
@@ -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,35 @@ 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
|
+
/** VCL attributes LibreOffice requests one family for. */
|
|
25
|
+
export interface FontMatchRequest {
|
|
26
|
+
readonly family: string;
|
|
27
|
+
readonly style: string;
|
|
28
|
+
readonly weight: number;
|
|
29
|
+
readonly italic: number;
|
|
30
|
+
readonly width: number;
|
|
31
|
+
readonly pitch: number;
|
|
32
|
+
readonly language: string;
|
|
33
|
+
readonly codePoints: readonly number[];
|
|
34
|
+
}
|
|
29
35
|
/** Selected physical files and the requested family the catalog could not find. */
|
|
30
36
|
export interface FontMatchResult {
|
|
31
37
|
readonly fonts: FontFace[];
|
|
32
38
|
readonly missingFamily?: string;
|
|
33
|
-
|
|
34
|
-
readonly unresolvedCodePoints?: readonly number[];
|
|
39
|
+
readonly unresolvedCodePoints?: number[];
|
|
35
40
|
}
|
|
36
41
|
/** One host font snapshot and the ordered fallback groups a conversion supplies. */
|
|
37
42
|
export interface SystemFontCatalogOptions {
|
|
38
43
|
readonly faces: readonly FontFace[];
|
|
39
44
|
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
45
|
}
|
|
45
46
|
/** Host font roots and physical file limits. */
|
|
46
47
|
export interface FontIndexOptions {
|
|
47
48
|
readonly directories: readonly string[];
|
|
48
|
-
readonly files?: readonly string[];
|
|
49
49
|
readonly maxFiles: number;
|
|
50
50
|
readonly maxFileBytes: number;
|
|
51
51
|
}
|
|
@@ -54,6 +54,21 @@ export interface FontIndexOptions {
|
|
|
54
54
|
* @returns whether it means the path is not a usable font source.
|
|
55
55
|
*/
|
|
56
56
|
export declare function absent(error: unknown): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Case- and separator-insensitive family key used to compare names across sources.
|
|
59
|
+
* @param value - Family, style, or postscript name as recorded by a document or font.
|
|
60
|
+
* @returns The normalized key.
|
|
61
|
+
*/
|
|
62
|
+
export declare function normalize(value: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Order named substitutions and their generic text family without excluding unlisted fonts.
|
|
65
|
+
* @param requested - Original family names, in document order.
|
|
66
|
+
* @param groups - Ordered family groups shared with Fontconfig aliases.
|
|
67
|
+
* @param pitch - VCL pitch; one requests a monospaced fallback.
|
|
68
|
+
* @param symbols - Whether symbol alternatives precede the generic fallback.
|
|
69
|
+
* @returns distinct family names, with original requests first.
|
|
70
|
+
*/
|
|
71
|
+
export declare function fontFamilyPriority(requested: readonly string[], groups: readonly (readonly string[])[], pitch?: number, symbols?: boolean): string[];
|
|
57
72
|
/**
|
|
58
73
|
* Discover system and per-user font roots using the selected platform's path separators.
|
|
59
74
|
* @param platform - Host operating system.
|
|
@@ -83,18 +98,21 @@ export declare function faceCoverage(font: Font): GlyphRange[];
|
|
|
83
98
|
*/
|
|
84
99
|
export declare function indexedFace(parsed: Font | FontCollection, face: Pick<FontFace, 'faceIndex' | 'postscriptName'>): Font;
|
|
85
100
|
/**
|
|
86
|
-
* VCL
|
|
101
|
+
* VCL weight, width, and fixed-pitch values for one parsed face.
|
|
87
102
|
* @param font - The parsed physical face, whose `OS/2` and `post` tables may be absent.
|
|
88
103
|
* @returns the recorded classes, or the regular defaults for an absent table.
|
|
89
104
|
*/
|
|
90
|
-
export declare function faceMetrics(font: Pick<Font, 'OS/2' | 'post'>):
|
|
105
|
+
export declare function faceMetrics(font: Pick<Font, 'OS/2' | 'post'>): {
|
|
106
|
+
weight: number;
|
|
107
|
+
width: number;
|
|
108
|
+
fixed: boolean;
|
|
109
|
+
};
|
|
91
110
|
/**
|
|
92
111
|
* Snapshot eligible local font metadata without retaining font bytes or decoding glyph coverage.
|
|
93
112
|
* @param options - Host font roots and physical file limits.
|
|
94
|
-
* @
|
|
95
|
-
* @returns current metadata; changed and newly installed files are decoded again.
|
|
113
|
+
* @returns metadata reused for the converter lifetime; recreate it after changing installed fonts.
|
|
96
114
|
*/
|
|
97
|
-
export declare function indexSystemFonts(options: FontIndexOptions
|
|
115
|
+
export declare function indexSystemFonts(options: FontIndexOptions): FontFace[];
|
|
98
116
|
/** Conversion-local glyph coverage over the converter's first metadata snapshot. */
|
|
99
117
|
export declare class SystemFontCatalog {
|
|
100
118
|
private readonly options;
|
|
@@ -105,12 +123,11 @@ export declare class SystemFontCatalog {
|
|
|
105
123
|
constructor(options: SystemFontCatalogOptions);
|
|
106
124
|
/**
|
|
107
125
|
* Find installed faces covering the requested family or missing characters.
|
|
108
|
-
* Exact families
|
|
109
|
-
* then other glyph-covering faces.
|
|
110
|
-
* body faces; normal cursive writing systems retain their typographic traditions.
|
|
126
|
+
* Exact families precede configured alternatives, symbol families for missing symbols,
|
|
127
|
+
* generic families, then other glyph-covering faces.
|
|
111
128
|
* @param request - VCL family/style attributes and Unicode scalars missing from its current font.
|
|
112
129
|
* @param signal - cancellation checked between synchronous font reads.
|
|
113
|
-
* @returns selected files
|
|
130
|
+
* @returns selected physical files, deduplicated across collection faces; absent glyphs remain unresolved.
|
|
114
131
|
* @throws if an indexed font changes or cannot be read during glyph matching.
|
|
115
132
|
*/
|
|
116
133
|
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;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export interface ConverterOptions {
|
|
|
37
37
|
maxFontFileBytes?: number;
|
|
38
38
|
/** Complete original font bytes imported per conversion. Default: 512 MiB. Native platform fonts remain OS-managed. */
|
|
39
39
|
maxLoadedFontBytes?: number;
|
|
40
|
+
/** Maximum font match records retained by each compatible process cache or explicit factory. Default: 4096. */
|
|
41
|
+
maxFontResolutionEntries?: number;
|
|
40
42
|
}
|
|
41
43
|
/** Result of one conversion. */
|
|
42
44
|
export interface RenderResult {
|
|
@@ -77,12 +79,16 @@ export interface Converter {
|
|
|
77
79
|
/** Abort queued and active work, await exit and cleanup, and permanently reject further renders. */
|
|
78
80
|
dispose(): Promise<void>;
|
|
79
81
|
}
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
/** Factory-scoped engine and font metadata shared by concurrent converters. */
|
|
83
|
+
export interface ConverterFactory {
|
|
84
|
+
readonly backend: 'native' | 'wasm';
|
|
85
|
+
/** Create one serial converter sharing this factory's bounded font cache. */
|
|
86
|
+
create(): Promise<Converter>;
|
|
87
|
+
/** Abort and join every converter created by this factory. */
|
|
88
|
+
dispose(): Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
/** Resolve one engine and share its bounded font state across many converters. */
|
|
91
|
+
export declare function createConverterFactory(options?: ConverterOptions): Promise<ConverterFactory>;
|
|
92
|
+
/** Create one converter with process-shared, configuration-isolated bounded font metadata. */
|
|
87
93
|
export declare function createConverter(options?: ConverterOptions): Promise<Converter>;
|
|
88
94
|
//# 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
|
package/lib/types/native.d.ts
CHANGED
|
@@ -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
|
|
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
|
package/lib/types/options.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Validated deployment limits shared by native and Node WASM conversions. */
|
|
2
2
|
import type { ConverterOptions } from './index.ts';
|
|
3
|
-
/**
|
|
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 {
|
|
@@ -13,7 +13,9 @@ export interface ResolvedOptions {
|
|
|
13
13
|
readonly maxFontFiles: number;
|
|
14
14
|
readonly maxFontFileBytes: number;
|
|
15
15
|
readonly maxLoadedFontBytes: number;
|
|
16
|
+
readonly maxFontResolutionEntries: number;
|
|
16
17
|
readonly fontDirectories: string[];
|
|
18
|
+
readonly includeOfficeFonts: boolean;
|
|
17
19
|
readonly fontFallbacks: string[][];
|
|
18
20
|
readonly initialFontFamilies: string[];
|
|
19
21
|
}
|
package/lib/types/wasm.d.ts
CHANGED
|
@@ -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
|
|
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 {
|
package/lib/types/worker.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
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';
|
|
@@ -13,5 +14,6 @@ export interface WorkerRequest {
|
|
|
13
14
|
readonly scratch: string;
|
|
14
15
|
/** Faces the previous conversion indexed; absent until the worker reports them. */
|
|
15
16
|
readonly fontFaces?: FontFace[] | undefined;
|
|
17
|
+
readonly fontCache?: FontResolutionCacheEntry[] | undefined;
|
|
16
18
|
}
|
|
17
19
|
//# sourceMappingURL=worker.d.ts.map
|