@joycostudio/chopper 0.1.0
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/README.md +37 -0
- package/THIRD_PARTY_NOTICES.md +19 -0
- package/codecs/avif_enc.wasm +0 -0
- package/codecs/basis_encoder.wasm +0 -0
- package/codecs/draco_decoder_gltf.js +116 -0
- package/codecs/draco_decoder_gltf.wasm +0 -0
- package/codecs/draco_encoder.wasm +0 -0
- package/codecs/draco_encoder_gltf.js +98 -0
- package/codecs/manifest.json +86 -0
- package/codecs/mozjpeg_dec.wasm +0 -0
- package/codecs/mozjpeg_enc.wasm +0 -0
- package/codecs/squoosh_png_bg.wasm +0 -0
- package/codecs/squoosh_resize_bg.wasm +0 -0
- package/codecs/webp_enc.wasm +0 -0
- package/dist/browser/chunk-5WRI5ZAA.js +29 -0
- package/dist/browser/chunk-5WRI5ZAA.js.map +1 -0
- package/dist/browser/chunk-OTTLKWP4.js +105 -0
- package/dist/browser/chunk-OTTLKWP4.js.map +1 -0
- package/dist/browser/in-process-V4NPIVZF.js +26747 -0
- package/dist/browser/in-process-V4NPIVZF.js.map +1 -0
- package/dist/browser/index.d.ts +244 -0
- package/dist/browser/index.js +86 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/node-shim-3YE6NHES.js +16 -0
- package/dist/browser/node-shim-3YE6NHES.js.map +1 -0
- package/dist/browser/worker.d.ts +2 -0
- package/dist/browser/worker.js +27425 -0
- package/dist/browser/worker.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +1421 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/index.d.ts +123 -0
- package/dist/config/index.js +9 -0
- package/dist/config/index.js.map +1 -0
- package/dist/index.d.ts +367 -0
- package/dist/index.js +396 -0
- package/dist/index.js.map +1 -0
- package/dist/node/index.d.ts +346 -0
- package/dist/node/index.js +1266 -0
- package/dist/node/index.js.map +1 -0
- package/package.json +64 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
declare const RECIPE_SCHEMA_VERSION: 1;
|
|
2
|
+
type TextureSize = readonly [width: number, height: number];
|
|
3
|
+
interface SizedEncoding {
|
|
4
|
+
/** Maximum dimensions. Aspect ratio is preserved and images are not enlarged. */
|
|
5
|
+
maxSize?: TextureSize;
|
|
6
|
+
}
|
|
7
|
+
interface WebpEncoding extends SizedEncoding {
|
|
8
|
+
codec: 'webp';
|
|
9
|
+
quality?: number;
|
|
10
|
+
effort?: number;
|
|
11
|
+
lossless?: boolean;
|
|
12
|
+
/** WebP near-lossless preprocessing strength, from 0 (lossy) to 100. */
|
|
13
|
+
nearLossless?: number;
|
|
14
|
+
}
|
|
15
|
+
interface AvifEncoding extends SizedEncoding {
|
|
16
|
+
codec: 'avif';
|
|
17
|
+
quality?: number;
|
|
18
|
+
effort?: number;
|
|
19
|
+
lossless?: boolean;
|
|
20
|
+
chromaSubsampling?: '4:2:0' | '4:4:4';
|
|
21
|
+
}
|
|
22
|
+
interface JpegEncoding extends SizedEncoding {
|
|
23
|
+
codec: 'jpeg';
|
|
24
|
+
quality?: number;
|
|
25
|
+
chromaSubsampling?: '4:2:0' | '4:4:4';
|
|
26
|
+
}
|
|
27
|
+
interface PngEncoding extends SizedEncoding {
|
|
28
|
+
codec: 'png';
|
|
29
|
+
}
|
|
30
|
+
interface UastcEncoding extends SizedEncoding {
|
|
31
|
+
codec: 'ktx2';
|
|
32
|
+
mode: 'uastc';
|
|
33
|
+
colorSpace?: 'srgb' | 'linear';
|
|
34
|
+
normalMap?: boolean;
|
|
35
|
+
level?: 0 | 1 | 2 | 3 | 4;
|
|
36
|
+
mipmaps?: boolean;
|
|
37
|
+
zstd?: boolean;
|
|
38
|
+
rdo?: {
|
|
39
|
+
lambda?: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
interface Etc1sEncoding extends SizedEncoding {
|
|
43
|
+
codec: 'ktx2';
|
|
44
|
+
mode: 'etc1s';
|
|
45
|
+
colorSpace?: 'srgb' | 'linear';
|
|
46
|
+
normalMap?: boolean;
|
|
47
|
+
quality?: number;
|
|
48
|
+
compression?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
49
|
+
mipmaps?: boolean;
|
|
50
|
+
}
|
|
51
|
+
type RasterEncoding = WebpEncoding | AvifEncoding | JpegEncoding | PngEncoding;
|
|
52
|
+
type ImageEncoding = RasterEncoding | UastcEncoding | Etc1sEncoding;
|
|
53
|
+
type GlbProperty = 'accessor' | 'animation' | 'buffer' | 'camera' | 'material' | 'mesh' | 'node' | 'primitive' | 'primitiveTarget' | 'skin' | 'texture';
|
|
54
|
+
type GlbMethodRecipe = {
|
|
55
|
+
method: 'dedup';
|
|
56
|
+
keepUniqueNames?: boolean;
|
|
57
|
+
propertyTypes?: readonly Extract<GlbProperty, 'accessor' | 'material' | 'mesh' | 'skin' | 'texture'>[];
|
|
58
|
+
} | {
|
|
59
|
+
method: 'prune';
|
|
60
|
+
keepAttributes?: boolean;
|
|
61
|
+
keepExtras?: boolean;
|
|
62
|
+
keepLeaves?: boolean;
|
|
63
|
+
keepSolidTextures?: boolean;
|
|
64
|
+
propertyTypes?: readonly GlbProperty[];
|
|
65
|
+
} | {
|
|
66
|
+
method: 'resample';
|
|
67
|
+
tolerance?: number;
|
|
68
|
+
cleanup?: boolean;
|
|
69
|
+
};
|
|
70
|
+
type TextureSelector = {
|
|
71
|
+
by: 'slot';
|
|
72
|
+
slots: readonly string[];
|
|
73
|
+
} | {
|
|
74
|
+
by: 'name';
|
|
75
|
+
names: readonly string[];
|
|
76
|
+
} | {
|
|
77
|
+
by: 'index';
|
|
78
|
+
indices: readonly number[];
|
|
79
|
+
};
|
|
80
|
+
interface EmbeddedTextureRecipe {
|
|
81
|
+
label: string;
|
|
82
|
+
select: TextureSelector;
|
|
83
|
+
encode: ImageEncoding;
|
|
84
|
+
}
|
|
85
|
+
type GeometryEncoding = {
|
|
86
|
+
codec: 'draco';
|
|
87
|
+
} | {
|
|
88
|
+
codec: 'meshopt';
|
|
89
|
+
};
|
|
90
|
+
interface GlbAssetRecipe {
|
|
91
|
+
schemaVersion: typeof RECIPE_SCHEMA_VERSION;
|
|
92
|
+
kind: 'glb';
|
|
93
|
+
methods?: readonly GlbMethodRecipe[];
|
|
94
|
+
textures?: readonly EmbeddedTextureRecipe[];
|
|
95
|
+
geometry?: GeometryEncoding | false;
|
|
96
|
+
}
|
|
97
|
+
interface ImageAssetRecipe {
|
|
98
|
+
schemaVersion: typeof RECIPE_SCHEMA_VERSION;
|
|
99
|
+
kind: 'image';
|
|
100
|
+
encode: ImageEncoding;
|
|
101
|
+
}
|
|
102
|
+
type AssetRecipe = GlbAssetRecipe | ImageAssetRecipe;
|
|
103
|
+
type NormalizedImageEncoding = (Required<Omit<WebpEncoding, 'maxSize'>> & Pick<WebpEncoding, 'maxSize'>) | (Required<Omit<AvifEncoding, 'maxSize'>> & Pick<AvifEncoding, 'maxSize'>) | (Required<Omit<JpegEncoding, 'maxSize'>> & Pick<JpegEncoding, 'maxSize'>) | PngEncoding | (Required<Omit<UastcEncoding, 'maxSize' | 'rdo'>> & Pick<UastcEncoding, 'maxSize' | 'rdo'>) | (Required<Omit<Etc1sEncoding, 'maxSize'>> & Pick<Etc1sEncoding, 'maxSize'>);
|
|
104
|
+
type NormalizedAssetRecipe = {
|
|
105
|
+
schemaVersion: typeof RECIPE_SCHEMA_VERSION;
|
|
106
|
+
kind: 'image';
|
|
107
|
+
encode: NormalizedImageEncoding;
|
|
108
|
+
} | {
|
|
109
|
+
schemaVersion: typeof RECIPE_SCHEMA_VERSION;
|
|
110
|
+
kind: 'glb';
|
|
111
|
+
methods: readonly GlbMethodRecipe[];
|
|
112
|
+
textures: readonly (Omit<EmbeddedTextureRecipe, 'encode'> & {
|
|
113
|
+
encode: NormalizedImageEncoding;
|
|
114
|
+
})[];
|
|
115
|
+
geometry: GeometryEncoding | false;
|
|
116
|
+
};
|
|
117
|
+
declare const COLOR_TEXTURE_SLOTS: readonly ["baseColorTexture", "emissiveTexture", "specularColorTexture", "sheenColorTexture"];
|
|
118
|
+
declare const DIRECTIONAL_TEXTURE_SLOTS: readonly ["normalTexture", "clearcoatNormalTexture", "anisotropyTexture"];
|
|
119
|
+
declare const DATA_TEXTURE_SLOTS: readonly ["occlusionTexture", "metallicRoughnessTexture", "specularTexture", "clearcoatTexture", "clearcoatRoughnessTexture", "sheenRoughnessTexture", "transmissionTexture", "thicknessTexture", "iridescenceTexture", "iridescenceThicknessTexture"];
|
|
120
|
+
declare const DEFAULT_GLB_RECIPE: GlbAssetRecipe;
|
|
121
|
+
declare const DEFAULT_IMAGE_RECIPE: ImageAssetRecipe;
|
|
122
|
+
declare const defineRecipe: <const T extends AssetRecipe>(recipe: T) => T;
|
|
123
|
+
declare function outputExtension(encoding: ImageEncoding): string;
|
|
124
|
+
declare function outputMimeType(encoding: ImageEncoding): string;
|
|
125
|
+
|
|
126
|
+
type ChopperErrorCode = 'unsupported_asset' | 'invalid_recipe' | 'codec_load_failed' | 'decode_failed' | 'encode_failed' | 'validation_failed' | 'aborted' | 'io_failed';
|
|
127
|
+
interface ChopperFailure {
|
|
128
|
+
ok: false;
|
|
129
|
+
error: {
|
|
130
|
+
code: ChopperErrorCode;
|
|
131
|
+
message: string;
|
|
132
|
+
cause?: unknown;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
interface ChopperSuccess<T> {
|
|
136
|
+
ok: true;
|
|
137
|
+
data: T;
|
|
138
|
+
}
|
|
139
|
+
type ChopperResult<T> = ChopperSuccess<T> | ChopperFailure;
|
|
140
|
+
declare const success: <T>(data: T) => ChopperSuccess<T>;
|
|
141
|
+
declare const failure: (code: ChopperErrorCode, message: string, cause?: unknown) => ChopperFailure;
|
|
142
|
+
|
|
143
|
+
interface AssetInput {
|
|
144
|
+
bytes: Uint8Array;
|
|
145
|
+
fileName: string;
|
|
146
|
+
mimeType?: string;
|
|
147
|
+
}
|
|
148
|
+
interface ImageInspection {
|
|
149
|
+
kind: 'image';
|
|
150
|
+
mimeType: 'image/png' | 'image/jpeg';
|
|
151
|
+
width: number;
|
|
152
|
+
height: number;
|
|
153
|
+
byteLength: number;
|
|
154
|
+
}
|
|
155
|
+
interface GlbTextureInspection {
|
|
156
|
+
index: number;
|
|
157
|
+
name: string;
|
|
158
|
+
uri: string;
|
|
159
|
+
mimeType: string | null;
|
|
160
|
+
size: readonly [number, number] | null;
|
|
161
|
+
slots: readonly string[];
|
|
162
|
+
bytes: Uint8Array;
|
|
163
|
+
authoringSelector: TextureSelector;
|
|
164
|
+
}
|
|
165
|
+
interface GlbInspection {
|
|
166
|
+
kind: 'glb';
|
|
167
|
+
byteLength: number;
|
|
168
|
+
textures: GlbTextureInspection[];
|
|
169
|
+
geometry: {
|
|
170
|
+
compression: 'draco' | 'meshopt' | false;
|
|
171
|
+
meshCount: number;
|
|
172
|
+
primitiveCount: number;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
type AssetInspection = ImageInspection | GlbInspection;
|
|
176
|
+
type OptimizationProgress = {
|
|
177
|
+
phase: 'inspect';
|
|
178
|
+
} | {
|
|
179
|
+
phase: 'decode';
|
|
180
|
+
} | {
|
|
181
|
+
phase: 'transform';
|
|
182
|
+
method: string;
|
|
183
|
+
index: number;
|
|
184
|
+
total: number;
|
|
185
|
+
} | {
|
|
186
|
+
phase: 'texture';
|
|
187
|
+
label: string;
|
|
188
|
+
index: number;
|
|
189
|
+
total: number;
|
|
190
|
+
} | {
|
|
191
|
+
phase: 'geometry';
|
|
192
|
+
codec: 'draco' | 'meshopt';
|
|
193
|
+
} | {
|
|
194
|
+
phase: 'validate';
|
|
195
|
+
} | {
|
|
196
|
+
phase: 'complete';
|
|
197
|
+
};
|
|
198
|
+
interface OptimizationOptions {
|
|
199
|
+
signal?: AbortSignal;
|
|
200
|
+
onProgress?: (event: OptimizationProgress) => void;
|
|
201
|
+
}
|
|
202
|
+
interface TextureOptimizationReport {
|
|
203
|
+
label: string;
|
|
204
|
+
sourceIndex: number;
|
|
205
|
+
outputIndex: number;
|
|
206
|
+
beforeBytes: number;
|
|
207
|
+
afterBytes: number;
|
|
208
|
+
beforeMimeType: string;
|
|
209
|
+
afterMimeType: string;
|
|
210
|
+
}
|
|
211
|
+
interface OptimizationReport {
|
|
212
|
+
engineId: string;
|
|
213
|
+
manifestHash: string;
|
|
214
|
+
recipe: NormalizedAssetRecipe;
|
|
215
|
+
beforeBytes: number;
|
|
216
|
+
afterBytes: number;
|
|
217
|
+
durationMs: number;
|
|
218
|
+
textures: TextureOptimizationReport[];
|
|
219
|
+
warnings: string[];
|
|
220
|
+
validation: {
|
|
221
|
+
valid: boolean;
|
|
222
|
+
messages: string[];
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
interface OptimizationOutput {
|
|
226
|
+
bytes: Uint8Array;
|
|
227
|
+
fileName: string;
|
|
228
|
+
mimeType: string;
|
|
229
|
+
inspection: AssetInspection;
|
|
230
|
+
report: OptimizationReport;
|
|
231
|
+
}
|
|
232
|
+
interface Chopper {
|
|
233
|
+
readonly engine: {
|
|
234
|
+
id: string;
|
|
235
|
+
version: string;
|
|
236
|
+
manifestHash: string;
|
|
237
|
+
};
|
|
238
|
+
inspect(input: AssetInput): Promise<ChopperResult<AssetInspection>>;
|
|
239
|
+
optimize(input: AssetInput, recipe: AssetRecipe, options?: OptimizationOptions): Promise<ChopperResult<OptimizationOutput>>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
declare function validateRecipe(recipe: unknown): ChopperResult<AssetRecipe>;
|
|
243
|
+
declare function normalizeRecipe(value: AssetRecipe): ChopperResult<NormalizedAssetRecipe>;
|
|
244
|
+
|
|
245
|
+
declare const CODEC_MANIFEST_HASH = "2046d60deb0f9f224743f4404f3c6e8ba5399f81b2811fa50466e93fce3bd322";
|
|
246
|
+
declare const CODEC_MANIFEST: {
|
|
247
|
+
readonly schemaVersion: 1;
|
|
248
|
+
readonly chopperVersion: string;
|
|
249
|
+
readonly manifestHash: "2046d60deb0f9f224743f4404f3c6e8ba5399f81b2811fa50466e93fce3bd322";
|
|
250
|
+
readonly gltfTransformVersion: "4.4.2";
|
|
251
|
+
readonly meshoptimizerVersion: "1.0.1";
|
|
252
|
+
readonly artifacts: {
|
|
253
|
+
readonly avifEncoder: {
|
|
254
|
+
readonly packageName: "@jsquash/avif";
|
|
255
|
+
readonly packageVersion: "2.1.1";
|
|
256
|
+
readonly packagePath: "codec/enc/avif_enc.wasm";
|
|
257
|
+
readonly publicFile: "avif_enc.wasm";
|
|
258
|
+
readonly sha256: "d9f2a95164362af48558d176e619becfd49dd97b50b86c679b47100860522b3d";
|
|
259
|
+
};
|
|
260
|
+
readonly jpegDecoder: {
|
|
261
|
+
readonly packageName: "@jsquash/jpeg";
|
|
262
|
+
readonly packageVersion: "1.6.0";
|
|
263
|
+
readonly packagePath: "codec/dec/mozjpeg_dec.wasm";
|
|
264
|
+
readonly publicFile: "mozjpeg_dec.wasm";
|
|
265
|
+
readonly sha256: "a7c4b12169817e779ff4af137981393ae924944e167ad1bd95747c9199162d3e";
|
|
266
|
+
};
|
|
267
|
+
readonly jpegEncoder: {
|
|
268
|
+
readonly packageName: "@jsquash/jpeg";
|
|
269
|
+
readonly packageVersion: "1.6.0";
|
|
270
|
+
readonly packagePath: "codec/enc/mozjpeg_enc.wasm";
|
|
271
|
+
readonly publicFile: "mozjpeg_enc.wasm";
|
|
272
|
+
readonly sha256: "24d4177f1c4963e2058b107189249651c61fdef125570e79b1dfb63c8bb49326";
|
|
273
|
+
};
|
|
274
|
+
readonly ktx2Encoder: {
|
|
275
|
+
readonly packageName: "ktx2-encoder";
|
|
276
|
+
readonly packageVersion: "0.6.0";
|
|
277
|
+
readonly packagePath: "dist/basis/basis_encoder.wasm";
|
|
278
|
+
readonly publicFile: "basis_encoder.wasm";
|
|
279
|
+
readonly sha256: "9807719e87cf3d979b0d69ae7112eb88aec6a0e0206c0b2d00dc0bed0d581b80";
|
|
280
|
+
};
|
|
281
|
+
readonly png: {
|
|
282
|
+
readonly packageName: "@jsquash/png";
|
|
283
|
+
readonly packageVersion: "3.1.1";
|
|
284
|
+
readonly packagePath: "codec/pkg/squoosh_png_bg.wasm";
|
|
285
|
+
readonly publicFile: "squoosh_png_bg.wasm";
|
|
286
|
+
readonly sha256: "263d6e658808a74b72a1a99c5cc1d619237e70c150db6e41d5d84d3d117ab9be";
|
|
287
|
+
};
|
|
288
|
+
readonly resize: {
|
|
289
|
+
readonly packageName: "@jsquash/resize";
|
|
290
|
+
readonly packageVersion: "2.1.1";
|
|
291
|
+
readonly packagePath: "lib/resize/pkg/squoosh_resize_bg.wasm";
|
|
292
|
+
readonly publicFile: "squoosh_resize_bg.wasm";
|
|
293
|
+
readonly sha256: "5b1f702d502c4d0a70b99f78691bd554d566ba95859e4c57af5435955a1d74a5";
|
|
294
|
+
};
|
|
295
|
+
readonly webpEncoder: {
|
|
296
|
+
readonly packageName: "@jsquash/webp";
|
|
297
|
+
readonly packageVersion: "1.5.0";
|
|
298
|
+
readonly packagePath: "codec/enc/webp_enc.wasm";
|
|
299
|
+
readonly publicFile: "webp_enc.wasm";
|
|
300
|
+
readonly sha256: "b6085bb6702f144e9dc6016d58d230b34a84976bf0d080b7390b4b4b137d6ab7";
|
|
301
|
+
};
|
|
302
|
+
readonly dracoDecoderScript: {
|
|
303
|
+
readonly packageName: "draco3dgltf";
|
|
304
|
+
readonly packageVersion: "1.5.7";
|
|
305
|
+
readonly packagePath: "draco_decoder_gltf_nodejs.js";
|
|
306
|
+
readonly publicFile: "draco_decoder_gltf.js";
|
|
307
|
+
readonly sha256: "8bb2952d2ba7d67e1414f8df819410cb0434a666be53f671fff75f68843d76f6";
|
|
308
|
+
};
|
|
309
|
+
readonly dracoDecoderWasm: {
|
|
310
|
+
readonly packageName: "draco3dgltf";
|
|
311
|
+
readonly packageVersion: "1.5.7";
|
|
312
|
+
readonly packagePath: "draco_decoder_gltf.wasm";
|
|
313
|
+
readonly publicFile: "draco_decoder_gltf.wasm";
|
|
314
|
+
readonly sha256: "712db3449ae2041d6e8a224c395bda6cedb49e51322fae38b7db9beb8b381889";
|
|
315
|
+
};
|
|
316
|
+
readonly dracoEncoderScript: {
|
|
317
|
+
readonly packageName: "draco3dgltf";
|
|
318
|
+
readonly packageVersion: "1.5.7";
|
|
319
|
+
readonly packagePath: "draco_encoder_gltf_nodejs.js";
|
|
320
|
+
readonly publicFile: "draco_encoder_gltf.js";
|
|
321
|
+
readonly sha256: "8434adecd1446459601763e499be3697546056bca90b286a538ae0483a00845a";
|
|
322
|
+
};
|
|
323
|
+
readonly dracoEncoderWasm: {
|
|
324
|
+
readonly packageName: "draco3dgltf";
|
|
325
|
+
readonly packageVersion: "1.5.7";
|
|
326
|
+
readonly packagePath: "draco_encoder.wasm";
|
|
327
|
+
readonly publicFile: "draco_encoder.wasm";
|
|
328
|
+
readonly sha256: "d2a3ac80c91980d5d321c116454834ff36264825c6d1794cc84e42288f158958";
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
declare const ENGINE_ID: `chopper@${string}:2046d60deb0f9f224743f4404f3c6e8ba5399f81b2811fa50466e93fce3bd322`;
|
|
333
|
+
|
|
334
|
+
type SourceImageMimeType = 'image/jpeg' | 'image/png';
|
|
335
|
+
interface SourceImage {
|
|
336
|
+
bytes: Uint8Array;
|
|
337
|
+
mimeType: SourceImageMimeType;
|
|
338
|
+
}
|
|
339
|
+
interface EncodedImage {
|
|
340
|
+
bytes: Uint8Array;
|
|
341
|
+
mimeType: string;
|
|
342
|
+
width: number;
|
|
343
|
+
height: number;
|
|
344
|
+
}
|
|
345
|
+
interface ImageDimensions {
|
|
346
|
+
width: number;
|
|
347
|
+
height: number;
|
|
348
|
+
}
|
|
349
|
+
interface ImageCompressionEngine {
|
|
350
|
+
readonly id: string;
|
|
351
|
+
readonly manifestHash: string;
|
|
352
|
+
inspect(source: SourceImage): Promise<ChopperResult<ImageDimensions>>;
|
|
353
|
+
encode(source: SourceImage, encoding: ImageEncoding, signal?: AbortSignal): Promise<ChopperResult<EncodedImage>>;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
interface OptimizedGlb {
|
|
357
|
+
bytes: Uint8Array;
|
|
358
|
+
inspection: GlbInspection;
|
|
359
|
+
textures: TextureOptimizationReport[];
|
|
360
|
+
}
|
|
361
|
+
interface GlbCompressionEngine {
|
|
362
|
+
readonly id: string;
|
|
363
|
+
inspect(source: Uint8Array): Promise<ChopperResult<GlbInspection>>;
|
|
364
|
+
optimize(source: Uint8Array, recipe: GlbAssetRecipe, options?: OptimizationOptions): Promise<ChopperResult<OptimizedGlb>>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export { type AssetInput, type AssetInspection, type AssetRecipe, type AvifEncoding, CODEC_MANIFEST, CODEC_MANIFEST_HASH, COLOR_TEXTURE_SLOTS, type Chopper, type ChopperErrorCode, type ChopperFailure, type ChopperResult, type ChopperSuccess, DATA_TEXTURE_SLOTS, DEFAULT_GLB_RECIPE, DEFAULT_IMAGE_RECIPE, DIRECTIONAL_TEXTURE_SLOTS, ENGINE_ID, type EmbeddedTextureRecipe, type EncodedImage, type Etc1sEncoding, type GeometryEncoding, type GlbAssetRecipe, type GlbCompressionEngine, type GlbInspection, type GlbMethodRecipe, type GlbProperty, type GlbTextureInspection, type ImageAssetRecipe, type ImageCompressionEngine, type ImageDimensions, type ImageEncoding, type ImageInspection, type JpegEncoding, type NormalizedAssetRecipe, type NormalizedImageEncoding, type OptimizationOptions, type OptimizationOutput, type OptimizationProgress, type OptimizationReport, type OptimizedGlb, type PngEncoding, RECIPE_SCHEMA_VERSION, type RasterEncoding, type SourceImage, type SourceImageMimeType, type TextureOptimizationReport, type TextureSelector, type TextureSize, type UastcEncoding, type WebpEncoding, defineRecipe, failure, normalizeRecipe, outputExtension, outputMimeType, success, validateRecipe };
|