@imferno/wasm 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 JP Wesselink
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # imferno-wasm
2
+
3
+ SMPTE ST 2067 IMF parser and validator for JavaScript and TypeScript, powered by WebAssembly.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install imferno-wasm
9
+ ```
10
+
11
+ The package ships a prebuilt `.wasm` binary — no build step required.
12
+
13
+ ## Usage
14
+
15
+ ```javascript
16
+ import {
17
+ parseAssetmapTyped,
18
+ parseCplTyped,
19
+ parsePklTyped,
20
+ parseVolindexTyped,
21
+ validatePackage,
22
+ validateCplWithSpecSelection,
23
+ inspectPackage,
24
+ extractSourceAsset,
25
+ compareDelivery,
26
+ getVersion,
27
+ } from 'imferno-wasm';
28
+
29
+ // Parse individual XML files
30
+ const assetMap = await parseAssetmapTyped(assetmapXml);
31
+ const cpl = await parseCplTyped(cplXml);
32
+ const pkl = await parsePklTyped(pklXml);
33
+ const volindex = await parseVolindexTyped(volindexXml);
34
+
35
+ // Validate a full IMF package (pass all XML files as a map)
36
+ const report = await validatePackage({
37
+ 'ASSETMAP.xml': assetmapXml,
38
+ 'PKL_abc.xml': pklXml,
39
+ 'CPL_def.xml': cplXml,
40
+ });
41
+ console.log(report.errors);
42
+ console.log(report.warnings);
43
+
44
+ // Validate a single CPL with spec selection
45
+ const cplReport = await validateCplWithSpecSelection(cplXml, 'v2020', 'v2023');
46
+
47
+ // Inspect package structure
48
+ const info = await inspectPackage({
49
+ 'ASSETMAP.xml': assetmapXml,
50
+ 'PKL_abc.xml': pklXml,
51
+ 'CPL_def.xml': cplXml,
52
+ });
53
+ console.log(info.cplCount);
54
+ console.log(info.unreferencedAssets);
55
+
56
+ // Extract source asset from a CPL
57
+ const sourceAsset = await extractSourceAsset(cplXml);
58
+
59
+ // Compare against a delivery spec
60
+ const comparison = await compareDelivery(sourceAsset, deliverySpec);
61
+ ```
62
+
63
+ WASM initialization is handled automatically on first call.
64
+
65
+ ## API
66
+
67
+ | Function | Input | Output |
68
+ |---|---|---|
69
+ | `parseAssetmapTyped(xml)` | ASSETMAP XML | `AssetMap` |
70
+ | `parseCplTyped(xml)` | CPL XML | `CompositionPlaylist` |
71
+ | `parsePklTyped(xml)` | PKL XML | `PackingList` |
72
+ | `parseVolindexTyped(xml)` | VOLINDEX XML | `VolumeIndex` |
73
+ | `validatePackage(files, rules?)` | `{ filename: xml }` map | `ValidationReport` |
74
+ | `validateCplWithSpecSelection(xml, core?, app?)` | CPL XML + spec pins | `ValidationReport` |
75
+ | `inspectPackage(files)` | `{ filename: xml }` map | package metadata |
76
+ | `extractSourceAsset(xml)` | CPL XML | `SourceAsset` |
77
+ | `compareDelivery(asset, spec)` | `SourceAsset` + `DeliveryRequest` | `DeliveryComparison` |
78
+ | `getVersion()` | — | version string |
79
+
80
+ ### Spec selection values
81
+
82
+ - `coreSpec`: `"auto"` | `"v2013"` | `"v2016"` | `"v2020"`
83
+ - `app2eSpec`: `"auto"` | `"none"` | `"v2020"` | `"v2021"` | `"v2023"`
84
+
85
+ ## License
86
+
87
+ MIT
@@ -0,0 +1,588 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export interface Asset {
4
+ id: ImfUuid;
5
+ packing_list: boolean | null;
6
+ chunk_list: ChunkList;
7
+ }
8
+
9
+ export interface AssetList {
10
+ assets: Asset[];
11
+ }
12
+
13
+ export interface AssetMap {
14
+ id: ImfUuid;
15
+ annotation_text: string | null;
16
+ creator: string | null;
17
+ volume_count: number;
18
+ issue_date: string;
19
+ issuer: string | null;
20
+ asset_list: AssetList;
21
+ }
22
+
23
+ export interface AudienceElement {
24
+ @scope?: string | null;
25
+ $text?: string | null;
26
+ }
27
+
28
+ export interface AudioSubDescriptors {
29
+ SoundfieldGroupLabelSubDescriptor?: SoundfieldGroupLabelSubDescriptor | null;
30
+ }
31
+
32
+ export interface CDCIDescriptor {
33
+ InstanceUID?: string | null;
34
+ StoredWidth?: number | null;
35
+ StoredHeight?: number | null;
36
+ DisplayWidth?: number | null;
37
+ DisplayHeight?: number | null;
38
+ ActiveWidth?: number | null;
39
+ ActiveHeight?: number | null;
40
+ SampleRate?: EditRate | null;
41
+ ImageAspectRatio?: string | null;
42
+ ColorPrimaries?: ColorPrimaries | null;
43
+ TransferCharacteristic?: TransferCharacteristic | null;
44
+ CodingEquations?: CodingEquations | null;
45
+ PictureCompression?: VideoCodec | null;
46
+ ComponentDepth?: number | null;
47
+ FrameLayout?: string | null;
48
+ DisplayF2Offset?: number | null;
49
+ HorizontalSubsampling?: number | null;
50
+ VerticalSubsampling?: number | null;
51
+ ColorSiting?: number | null;
52
+ BlackRefLevel?: number | null;
53
+ WhiteRefLevel?: number | null;
54
+ ColorRange?: number | null;
55
+ StoredF2Offset?: number | null;
56
+ SampledWidth?: number | null;
57
+ SampledHeight?: number | null;
58
+ SampledXOffset?: number | null;
59
+ SampledYOffset?: number | null;
60
+ AlphaTransparency?: string | null;
61
+ ImageAlignmentOffset?: number | null;
62
+ ImageStartOffset?: number | null;
63
+ ImageEndOffset?: number | null;
64
+ FieldDominance?: number | null;
65
+ ReversedByteOrder?: string | null;
66
+ PaddingBits?: number | null;
67
+ AlphaSampleDepth?: number | null;
68
+ LinkedTrackID?: number | null;
69
+ SubDescriptors?: VideoSubDescriptors | null;
70
+ }
71
+
72
+ export interface Chunk {
73
+ path: string;
74
+ volume_index: number;
75
+ }
76
+
77
+ export interface ChunkList {
78
+ chunks: Chunk[];
79
+ }
80
+
81
+ export interface CompositionPlaylist {
82
+ id: ImfUuid;
83
+ annotation?: LanguageString | null;
84
+ issueDate: string;
85
+ issuer?: LanguageString | null;
86
+ creator?: LanguageString | null;
87
+ contentOriginator?: LanguageString | null;
88
+ contentTitle: LanguageString;
89
+ contentKind?: ContentKindElement;
90
+ contentVersionList?: ContentVersionList | null;
91
+ essenceDescriptorList?: EssenceDescriptorList | null;
92
+ editRate?: EditRate | null;
93
+ totalRunningTime?: string | null;
94
+ localeList?: LocaleList | null;
95
+ extensionProperties?: ExtensionProperties | null;
96
+ compositionTimecode?: CompositionTimecode | null;
97
+ segmentList: SegmentList;
98
+ }
99
+
100
+ export interface CompositionTimecode {
101
+ timecodeDropFrame: boolean | null;
102
+ timecodeRate: number | null;
103
+ timecodeStartAddress: string | null;
104
+ }
105
+
106
+ export interface ContainerConstraintsSubDescriptor {
107
+ InstanceID?: string | null;
108
+ }
109
+
110
+ export interface ContentKindElement {
111
+ kind: ContentKind;
112
+ scope: string | null;
113
+ }
114
+
115
+ export interface ContentMaturityRating {
116
+ agency: string;
117
+ rating?: string | null;
118
+ audience?: AudienceElement | null;
119
+ }
120
+
121
+ export interface ContentMaturityRatingList {
122
+ contentMaturityRating: ContentMaturityRating[];
123
+ }
124
+
125
+ export interface ContentVersion {
126
+ id: string;
127
+ labelText?: LanguageString | null;
128
+ }
129
+
130
+ export interface ContentVersionList {
131
+ contentVersion: ContentVersion[];
132
+ }
133
+
134
+ export interface DCTimedTextDescriptor {
135
+ InstanceID?: string | null;
136
+ LinkedTrackID?: number | null;
137
+ SampleRate?: EditRate | null;
138
+ RFC5646LanguageTagList?: LanguageTag[];
139
+ NamespaceURI?: string | null;
140
+ }
141
+
142
+ export interface EditRate {
143
+ numerator: number;
144
+ denominator: number;
145
+ }
146
+
147
+ export interface EssenceDescriptor {
148
+ id: ImfUuid;
149
+ rgbaDescriptor?: RGBADescriptor | null;
150
+ cdciDescriptor?: CDCIDescriptor | null;
151
+ wavePCMDescriptor?: WAVEPCMDescriptor | null;
152
+ dcTimedTextDescriptor?: DCTimedTextDescriptor | null;
153
+ iabEssenceDescriptor?: IABEssenceDescriptor | null;
154
+ isxdDataEssenceDescriptor?: ISXDDataEssenceDescriptor | null;
155
+ }
156
+
157
+ export interface EssenceDescriptorList {
158
+ essenceDescriptor: EssenceDescriptor[];
159
+ }
160
+
161
+ export interface ExtensionProperties {
162
+ applicationIdentification?: string | null;
163
+ maxCLL?: number | null;
164
+ maxFALL?: number | null;
165
+ }
166
+
167
+ export interface ForcedNarrativeSequence {
168
+ id: ImfUuid;
169
+ trackId: ImfUuid;
170
+ resourceList: ResourceList;
171
+ }
172
+
173
+ export interface HearingImpairedCaptionsSequence {
174
+ id: ImfUuid;
175
+ trackId: ImfUuid;
176
+ resourceList: ResourceList;
177
+ }
178
+
179
+ export interface IABEssenceDescriptor {
180
+ InstanceID?: string | null;
181
+ LinkedTrackID?: number | null;
182
+ SampleRate?: EditRate | null;
183
+ AudioSampleRate?: EditRate | null;
184
+ ChannelCount?: number | null;
185
+ QuantizationBits?: number | null;
186
+ ContainerFormat?: string | null;
187
+ SoundCompression?: string | null;
188
+ Codec?: string | null;
189
+ ElectrospatialFormulation?: number | null;
190
+ SubDescriptors?: IABSubDescriptors | null;
191
+ }
192
+
193
+ export interface IABSequence {
194
+ id: ImfUuid;
195
+ trackId: ImfUuid;
196
+ resourceList: ResourceList;
197
+ }
198
+
199
+ export interface IABSoundfieldLabelSubDescriptor {
200
+ InstanceID?: string | null;
201
+ MCATagSymbol?: McaTagSymbol | null;
202
+ MCATagName?: string | null;
203
+ MCALabelDictionaryID?: string | null;
204
+ RFC5646SpokenLanguage?: LanguageTag | null;
205
+ }
206
+
207
+ export interface IABSubDescriptors {
208
+ IABSoundfieldLabelSubDescriptor?: IABSoundfieldLabelSubDescriptor | null;
209
+ }
210
+
211
+ export interface ISXDDataEssenceDescriptor {
212
+ InstanceID?: string | null;
213
+ LinkedTrackID?: number | null;
214
+ SampleRate?: EditRate | null;
215
+ DataEssenceCoding?: string | null;
216
+ NamespaceURI?: string | null;
217
+ SubDescriptors?: IsxdSubDescriptors | null;
218
+ }
219
+
220
+ export interface ISXDSequence {
221
+ id: ImfUuid;
222
+ trackId: ImfUuid;
223
+ resourceList: ResourceList;
224
+ }
225
+
226
+ export interface IsxdSubDescriptors {
227
+ ContainerConstraintsSubDescriptor?: ContainerConstraintsSubDescriptor | null;
228
+ }
229
+
230
+ export interface J2CLayout {
231
+ RGBAComponent?: RGBALayoutComponent[];
232
+ }
233
+
234
+ export interface J2KComponentSizing {
235
+ Ssiz?: number | null;
236
+ XRSiz?: number | null;
237
+ YRSiz?: number | null;
238
+ }
239
+
240
+ export interface J2KExtendedCapabilities {
241
+ Pcap?: number | null;
242
+ }
243
+
244
+ export interface JPEG2000SubDescriptor {
245
+ InstanceID?: string | null;
246
+ Rsiz?: number | null;
247
+ Xsiz?: number | null;
248
+ Ysiz?: number | null;
249
+ XOsiz?: number | null;
250
+ YOsiz?: number | null;
251
+ XTsiz?: number | null;
252
+ YTsiz?: number | null;
253
+ XTOsiz?: number | null;
254
+ YTOsiz?: number | null;
255
+ Csiz?: number | null;
256
+ CodingStyleDefault?: string | null;
257
+ QuantizationDefault?: string | null;
258
+ J2CLayout?: J2CLayout | null;
259
+ J2KExtendedCapabilities?: J2KExtendedCapabilities | null;
260
+ PictureComponentSizing?: PictureComponentSizing | null;
261
+ }
262
+
263
+ export interface LanguageList {
264
+ language: LanguageTag[];
265
+ }
266
+
267
+ export interface LanguageString {
268
+ text: string;
269
+ language: LanguageTag | null;
270
+ }
271
+
272
+ export interface Locale {
273
+ languageList?: LanguageList | null;
274
+ regionList?: RegionList | null;
275
+ contentMaturityRatingList?: ContentMaturityRatingList | null;
276
+ }
277
+
278
+ export interface LocaleList {
279
+ locale: Locale[];
280
+ }
281
+
282
+ export interface MainAudioSequence {
283
+ id: ImfUuid;
284
+ trackId: ImfUuid;
285
+ resourceList: ResourceList;
286
+ }
287
+
288
+ export interface MainImageSequence {
289
+ id: ImfUuid;
290
+ trackId: ImfUuid;
291
+ resourceList: ResourceList;
292
+ }
293
+
294
+ export interface MarkerInfo {
295
+ annotation?: string | null;
296
+ label: MarkerLabelElement;
297
+ offset: number;
298
+ }
299
+
300
+ export interface MarkerLabelElement {
301
+ label: MarkerLabel;
302
+ scope: string | null;
303
+ }
304
+
305
+ export interface MarkerSequence {
306
+ id: ImfUuid;
307
+ trackId: ImfUuid;
308
+ resourceList: ResourceList;
309
+ }
310
+
311
+ export interface PHDRMetadataTrackSubDescriptor {
312
+ InstanceID?: string | null;
313
+ PHDRMetadataTrackSubDescriptor_DataDefinition?: string | null;
314
+ PHDRMetadataTrackSubDescriptor_SimplePayloadSID?: number | null;
315
+ PHDRMetadataTrackSubDescriptor_SourceTrackID?: number | null;
316
+ }
317
+
318
+ export interface PictureComponentSizing {
319
+ J2KComponentSizing?: J2KComponentSizing[];
320
+ }
321
+
322
+ export interface RGBADescriptor {
323
+ InstanceID?: string | null;
324
+ DisplayWidth?: number | null;
325
+ DisplayHeight?: number | null;
326
+ StoredWidth?: number | null;
327
+ StoredHeight?: number | null;
328
+ SampleRate?: EditRate | null;
329
+ ImageAspectRatio?: string | null;
330
+ ColorPrimaries?: ColorPrimaries | null;
331
+ TransferCharacteristic?: TransferCharacteristic | null;
332
+ CodingEquations?: CodingEquations | null;
333
+ PictureCompression?: VideoCodec | null;
334
+ FrameLayout?: string | null;
335
+ DisplayF2Offset?: number | null;
336
+ ComponentMaxRef?: number | null;
337
+ ComponentMinRef?: number | null;
338
+ ScanningDirection?: string | null;
339
+ StoredF2Offset?: number | null;
340
+ SampledWidth?: number | null;
341
+ SampledHeight?: number | null;
342
+ SampledXOffset?: number | null;
343
+ SampledYOffset?: number | null;
344
+ AlphaTransparency?: string | null;
345
+ ImageAlignmentOffset?: number | null;
346
+ ImageStartOffset?: number | null;
347
+ ImageEndOffset?: number | null;
348
+ FieldDominance?: number | null;
349
+ AlphaMaxRef?: number | null;
350
+ AlphaMinRef?: number | null;
351
+ Palette?: string | null;
352
+ PaletteLayout?: string | null;
353
+ LinkedTrackID?: number | null;
354
+ SubDescriptors?: VideoSubDescriptors | null;
355
+ }
356
+
357
+ export interface RGBALayoutComponent {
358
+ Code?: string;
359
+ ComponentSize?: number;
360
+ }
361
+
362
+ export interface RegionList {
363
+ region: string[];
364
+ }
365
+
366
+ export interface Resolution {
367
+ width: number;
368
+ height: number;
369
+ }
370
+
371
+ export interface Resource {
372
+ id: ImfUuid;
373
+ annotation?: LanguageString | null;
374
+ editRate?: EditRate | null;
375
+ intrinsicDuration: number;
376
+ entryPoint?: number | null;
377
+ sourceDuration?: number | null;
378
+ sourceEncoding?: ImfUuid | null;
379
+ trackFileId?: ImfUuid | null;
380
+ repeatCount?: number | null;
381
+ keyId?: ImfUuid | null;
382
+ hash?: string | null;
383
+ marker?: MarkerInfo[];
384
+ }
385
+
386
+ export interface ResourceList {
387
+ resource?: Resource[];
388
+ }
389
+
390
+ export interface Segment {
391
+ id: ImfUuid;
392
+ sequenceList: SequenceList;
393
+ }
394
+
395
+ export interface SegmentList {
396
+ segment: Segment[];
397
+ }
398
+
399
+ export interface SequenceList {
400
+ markerSequence?: MarkerSequence[];
401
+ mainImageSequence?: MainImageSequence[];
402
+ mainAudioSequence?: MainAudioSequence[];
403
+ subtitlesSequence?: SubtitlesSequence[];
404
+ hearingImpairedCaptionsSequence?: HearingImpairedCaptionsSequence[];
405
+ forcedNarrativeSequence?: ForcedNarrativeSequence[];
406
+ iabSequence?: IABSequence[];
407
+ isxdSequence?: ISXDSequence[];
408
+ }
409
+
410
+ export interface SoundfieldGroupLabelSubDescriptor {
411
+ MCATagSymbol?: McaTagSymbol | null;
412
+ MCATagName?: string | null;
413
+ MCAAudioContentKind?: string | null;
414
+ RFC5646SpokenLanguage?: LanguageTag | null;
415
+ }
416
+
417
+ export interface SubtitlesSequence {
418
+ id: ImfUuid;
419
+ trackId: ImfUuid;
420
+ resourceList: ResourceList;
421
+ }
422
+
423
+ export interface TrackInfo {
424
+ track_id: string;
425
+ track_type: string;
426
+ codec: string;
427
+ language: string | null;
428
+ channels: string | null;
429
+ format_details: string | null;
430
+ resolution: string | null;
431
+ framerate: string | null;
432
+ bit_depth: string | null;
433
+ subtitle_type: string | null;
434
+ }
435
+
436
+ export interface VideoSubDescriptors {
437
+ PHDRMetadataTrackSubDescriptor?: PHDRMetadataTrackSubDescriptor | null;
438
+ JPEG2000SubDescriptor?: JPEG2000SubDescriptor | null;
439
+ }
440
+
441
+ export interface VolumeIndex {
442
+ Index: number;
443
+ }
444
+
445
+ export interface WAVEPCMDescriptor {
446
+ InstanceID?: string | null;
447
+ SampleRate?: EditRate | null;
448
+ AudioSampleRate?: EditRate | null;
449
+ ChannelCount?: number | null;
450
+ QuantizationBits?: number | null;
451
+ LinkedTrackID?: number | null;
452
+ SubDescriptors?: AudioSubDescriptors | null;
453
+ }
454
+
455
+ export type CodingEquations = "Bt601" | "Bt709" | "Bt2020Ncl" | { Unknown: string };
456
+
457
+ export type ColorPrimaries = "Bt601_625" | "Bt601_525" | "Bt709" | "Bt2020" | "DciP3" | "P3D65" | { Unknown: string };
458
+
459
+ export type ContentKind = "Feature" | "Trailer" | "Test" | "Promo" | "Teaser" | "RatingBump" | "Advertisement" | "Episode" | "Short" | "Commercial" | "PublicServiceAnnouncement" | { Other: string };
460
+
461
+ export type CplNamespace = "Smpte2067_3_2013" | "Smpte2067_3_2016" | "Smpte2067_3_2020" | "Dci429_7" | { Unknown: string };
462
+
463
+ export type LanguageTag = string;
464
+
465
+ export type MarkerLabel = "Ffoc" | "Lfoc" | "Ffac" | "Lfac" | "Ffmc" | "Lfmc" | "Ffhc" | "Lfhc" | { Other: string };
466
+
467
+ export type McaTagSymbol = "Sg51" | "Sg71" | "Sg71Ds" | "SgSt" | "SgMono" | "Iab" | "Left" | "Right" | "Center" | "Lfe" | "LeftSurround" | "RightSurround" | "LeftSideSurround" | "RightSideSurround" | "LeftRearSurround" | "RightRearSurround" | { Other: string };
468
+
469
+ export type TransferCharacteristic = "Linear" | "Bt709" | "Smpte240M" | "XvYcc709" | "Bt2020" | "PqSt2084" | "Hlg" | { Unknown: string };
470
+
471
+ export type VideoCodec = "Jpeg2000" | "Jpeg2000Imf2k" | "Jpeg2000Imf4k" | "Jpeg2000Broadcast" | "Jpeg2000Ht" | "Vc5" | "Mpeg2" | "H264" | "H265" | "ProRes" | "Av1" | { Unknown: string };
472
+
473
+
474
+ /**
475
+ * Compare a SourceAsset against a delivery spec
476
+ */
477
+ export function compareDelivery(sourceAssetJson: any, deliverySpecJson: any): any;
478
+
479
+ /**
480
+ * Extract a SourceAsset from CPL XML
481
+ */
482
+ export function extractSourceAsset(cplXml: string): any;
483
+
484
+ /**
485
+ * Get library version
486
+ */
487
+ export function getVersion(): string;
488
+
489
+ /**
490
+ * Initialize the WASM module
491
+ */
492
+ export function init(): void;
493
+
494
+ /**
495
+ * Inspect an IMF package and return structural metadata including unreferenced assets.
496
+ *
497
+ * Returns `{ cplCount, scmCount, declaredSidecars, unreferencedAssets }` where
498
+ * `unreferencedAssets` are assets in the AssetMap with no CPL Virtual Track reference
499
+ * and no SCM declaration — likely sidecar essences delivered without an SCM.
500
+ */
501
+ export function inspectPackage(files: any): any;
502
+
503
+ /**
504
+ * Parse ASSETMAP.xml and return a typed AssetMap object
505
+ */
506
+ export function parseAssetmapTyped(xmlContent: string): any;
507
+
508
+ /**
509
+ * Parse CPL XML and return a typed CompositionPlaylist object
510
+ */
511
+ export function parseCplTyped(xmlContent: string): CompositionPlaylist;
512
+
513
+ /**
514
+ * Parse PKL XML and return a typed PackingList object
515
+ */
516
+ export function parsePklTyped(xmlContent: string): any;
517
+
518
+ /**
519
+ * Parse VOLINDEX.xml and return a typed VolumeIndex object
520
+ */
521
+ export function parseVolindexTyped(xmlContent: string): VolumeIndex;
522
+
523
+ /**
524
+ * Validate a CPL with configurable built-in spec selection (ST 2067-2/App2E).
525
+ *
526
+ * `coreSpec`: "auto" | "v2013" | "v2016" | "v2020"
527
+ * `app2eSpec`: "auto" | "none" | "v2020" | "v2021" | "v2023"
528
+ */
529
+ export function validateCplWithSpecSelection(cplXml: string, coreSpec?: string | null, app2eSpec?: string | null): any;
530
+
531
+ /**
532
+ * Validate a full IMF package from an in-memory map of filename → XML string.
533
+ *
534
+ * Pass all XML files from the package as a plain JS object where each key is
535
+ * the filename and each value is the file's text content. ASSETMAP.xml is
536
+ * required; VOLINDEX.xml, PKL files, and CPL files are resolved automatically
537
+ * from the AssetMap.
538
+ *
539
+ * Returns a `ValidationReport` serialized to JS.
540
+ */
541
+ export function validatePackage(files: any, rules: any): any;
542
+
543
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
544
+
545
+ export interface InitOutput {
546
+ readonly memory: WebAssembly.Memory;
547
+ readonly compareDelivery: (a: any, b: any) => [number, number, number];
548
+ readonly extractSourceAsset: (a: number, b: number) => [number, number, number];
549
+ readonly getVersion: () => [number, number];
550
+ readonly init: () => void;
551
+ readonly inspectPackage: (a: any) => [number, number, number];
552
+ readonly parseAssetmapTyped: (a: number, b: number) => [number, number, number];
553
+ readonly parseCplTyped: (a: number, b: number) => [number, number, number];
554
+ readonly parsePklTyped: (a: number, b: number) => [number, number, number];
555
+ readonly parseVolindexTyped: (a: number, b: number) => [number, number, number];
556
+ readonly validateCplWithSpecSelection: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
557
+ readonly validatePackage: (a: any, b: any) => [number, number, number];
558
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
559
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
560
+ readonly __wbindgen_exn_store: (a: number) => void;
561
+ readonly __externref_table_alloc: () => number;
562
+ readonly __wbindgen_externrefs: WebAssembly.Table;
563
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
564
+ readonly __externref_table_dealloc: (a: number) => void;
565
+ readonly __wbindgen_start: () => void;
566
+ }
567
+
568
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
569
+
570
+ /**
571
+ * Instantiates the given `module`, which can either be bytes or
572
+ * a precompiled `WebAssembly.Module`.
573
+ *
574
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
575
+ *
576
+ * @returns {InitOutput}
577
+ */
578
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
579
+
580
+ /**
581
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
582
+ * for everything else, calls `WebAssembly.instantiate` directly.
583
+ *
584
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
585
+ *
586
+ * @returns {Promise<InitOutput>}
587
+ */
588
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;