@svta/cml-iso-bmff 1.0.0-alpha.2 → 1.0.0-alpha.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.
package/dist/index.d.ts CHANGED
@@ -6,12 +6,12 @@
6
6
  */
7
7
  type AdditionalMetadataContainerBoxChild = any;
8
8
  /**
9
- * Additional Metadata Container Box - 'meta' - Container
9
+ * Additional Metadata Container Box - 'meco' - Container - 8.11.7.1
10
10
  *
11
11
  * @public
12
12
  */
13
13
  type AdditionalMetadataContainerBox = {
14
- type: "meta";
14
+ type: "meco";
15
15
  boxes: AdditionalMetadataContainerBoxChild[];
16
16
  };
17
17
  //#endregion
@@ -37,6 +37,22 @@ type AudioRenderingIndicationBox = FullBox & {
37
37
  audioRenderingIndication: number;
38
38
  };
39
39
  //#endregion
40
+ //#region src/IsoBoxType.d.ts
41
+ /**
42
+ * Iso Box Type
43
+ *
44
+ * @public
45
+ */
46
+ type IsoBoxType = `${string}${string}${string}${string}`;
47
+ //#endregion
48
+ //#region src/boxes/AudioSampleEntryType.d.ts
49
+ /**
50
+ * The type of audio sample entry box.
51
+ *
52
+ * @public
53
+ */
54
+ type AudioSampleEntryType = "mp4a" | "enca";
55
+ //#endregion
40
56
  //#region src/boxes/SampleEntryBox.d.ts
41
57
  /**
42
58
  * ISO/IEC 14496-12:2015 - 8.5.2.2 Sample Entry
@@ -50,11 +66,17 @@ type SampleEntryBox = {
50
66
  //#endregion
51
67
  //#region src/boxes/AudioSampleEntryBox.d.ts
52
68
  /**
69
+ * Child boxes of AudioSampleEntryBox
70
+ *
71
+ * @public
72
+ */
73
+ type AudioSampleEntryBoxChild = any;
74
+ /**
53
75
  * ISO/IEC 14496-12:2012 - 8.5.2.2 mp4a box (use AudioSampleEntry definition and naming)
54
76
  *
55
77
  * @public
56
78
  */
57
- type AudioSampleEntryBox<T$1 extends "mp4a" | "enca" = "mp4a" | "enca"> = SampleEntryBox & {
79
+ type AudioSampleEntryBox<T$1 extends IsoBoxType = AudioSampleEntryType> = SampleEntryBox & {
58
80
  type: T$1;
59
81
  reserved2: number[];
60
82
  channelcount: number;
@@ -62,7 +84,17 @@ type AudioSampleEntryBox<T$1 extends "mp4a" | "enca" = "mp4a" | "enca"> = Sample
62
84
  preDefined: number;
63
85
  reserved3: number;
64
86
  samplerate: number;
65
- esds: Uint8Array;
87
+ boxes: AudioSampleEntryBoxChild[];
88
+ };
89
+ //#endregion
90
+ //#region src/boxes/Box.d.ts
91
+ /**
92
+ * Base Box Type
93
+ *
94
+ * @public
95
+ */
96
+ type Box<T$1 extends IsoBoxType = never> = {
97
+ type: T$1;
66
98
  };
67
99
  //#endregion
68
100
  //#region src/boxes/ChunkLargeOffsetBox.d.ts
@@ -274,6 +306,39 @@ type EditBox = {
274
306
  boxes: EditBoxChild[];
275
307
  };
276
308
  //#endregion
309
+ //#region src/boxes/SubsampleEncryption.d.ts
310
+ /**
311
+ * Subsample Encryption
312
+ *
313
+ * @public
314
+ */
315
+ type SubsampleEncryption = {
316
+ bytesOfClearData: number;
317
+ bytesOfProtectedData: number;
318
+ };
319
+ //#endregion
320
+ //#region src/boxes/EncryptedSample.d.ts
321
+ /**
322
+ * Encrypted Sample
323
+ *
324
+ * @public
325
+ */
326
+ type EncryptedSample = {
327
+ initializationVector?: Uint8Array;
328
+ subsampleEncryption?: SubsampleEncryption[];
329
+ };
330
+ //#endregion
331
+ //#region src/boxes/Entity.d.ts
332
+ /**
333
+ * Entity
334
+ *
335
+ * @public
336
+ */
337
+ type Entity = {
338
+ /** Entity ID */
339
+ entityId: number;
340
+ };
341
+ //#endregion
277
342
  //#region src/boxes/EventMessageBox.d.ts
278
343
  /**
279
344
  * ISO/IEC 23009-1:2014 - 5.10.3.3 Event Message Box
@@ -403,6 +468,18 @@ type IpmpInfoBox = FullBox & {
403
468
  ipmpDescr: any[];
404
469
  };
405
470
  //#endregion
471
+ //#region src/boxes/ItemExtent.d.ts
472
+ /**
473
+ * Item Extent
474
+ *
475
+ * @public
476
+ */
477
+ type ItemExtent = {
478
+ extentIndex?: number;
479
+ extentOffset: number;
480
+ extentLength: number;
481
+ };
482
+ //#endregion
406
483
  //#region src/boxes/ItemInfoEntry.d.ts
407
484
  /**
408
485
  * Item Info Entry - 'infe'
@@ -437,18 +514,6 @@ type ItemInfoBox = {
437
514
  entryCount: number;
438
515
  };
439
516
  //#endregion
440
- //#region src/boxes/ItemExtent.d.ts
441
- /**
442
- * Item Extent
443
- *
444
- * @public
445
- */
446
- type ItemExtent = {
447
- extentIndex?: number;
448
- extentOffset: number;
449
- extentLength: number;
450
- };
451
- //#endregion
452
517
  //#region src/boxes/ItemLocation.d.ts
453
518
  /**
454
519
  * Item Location
@@ -664,11 +729,17 @@ type VisualSampleEntryType = "avc1" | "avc2" | "avc3" | "avc4" | "hev1" | "hvc1"
664
729
  //#endregion
665
730
  //#region src/boxes/VisualSampleEntryBox.d.ts
666
731
  /**
732
+ * Child boxes of VisualSampleEntryBox
733
+ *
734
+ * @public
735
+ */
736
+ type VisualSampleEntryBoxChild = any;
737
+ /**
667
738
  * ISO/IEC 14496-15:2014 - 12.1.3.1 avc1/2/3/4, hev1, hvc1, encv
668
739
  *
669
740
  * @public
670
741
  */
671
- type VisualSampleEntryBox<T$1 extends VisualSampleEntryType = VisualSampleEntryType> = SampleEntryBox & {
742
+ type VisualSampleEntryBox<T$1 extends IsoBoxType = VisualSampleEntryType> = SampleEntryBox & {
672
743
  type: T$1;
673
744
  preDefined1: number;
674
745
  reserved2: number;
@@ -682,7 +753,7 @@ type VisualSampleEntryBox<T$1 extends VisualSampleEntryType = VisualSampleEntryT
682
753
  compressorName: number[];
683
754
  depth: number;
684
755
  preDefined3: number;
685
- config: Uint8Array;
756
+ boxes: VisualSampleEntryBoxChild[];
686
757
  };
687
758
  //#endregion
688
759
  //#region src/boxes/SampleDescriptionBox.d.ts
@@ -1148,28 +1219,6 @@ type SampleAuxiliaryInformationSizesBox = FullBox & {
1148
1219
  sampleInfoSize?: number[];
1149
1220
  };
1150
1221
  //#endregion
1151
- //#region src/boxes/SubsampleEncryption.d.ts
1152
- /**
1153
- * Subsample Encryption
1154
- *
1155
- * @public
1156
- */
1157
- type SubsampleEncryption = {
1158
- bytesOfClearData: number;
1159
- bytesOfProtectedData: number;
1160
- };
1161
- //#endregion
1162
- //#region src/boxes/EncryptedSample.d.ts
1163
- /**
1164
- * Encrypted Sample
1165
- *
1166
- * @public
1167
- */
1168
- type EncryptedSample = {
1169
- initializationVector?: Uint8Array;
1170
- subsampleEncryption?: SubsampleEncryption[];
1171
- };
1172
- //#endregion
1173
1222
  //#region src/boxes/SampleEncryptionBox.d.ts
1174
1223
  /**
1175
1224
  * Sample Encryption Box - 'senc'
@@ -1369,18 +1418,13 @@ type MovieFragmentRandomAccessBox = {
1369
1418
  boxes: MovieFragmentRandomAccessBoxChild[];
1370
1419
  };
1371
1420
  //#endregion
1372
- //#region src/boxes/Entity.d.ts
1421
+ //#region src/boxes/PreselectionGroupBox.d.ts
1373
1422
  /**
1374
- * Entity
1423
+ * Child boxes of Preselection Group Box
1375
1424
  *
1376
1425
  * @public
1377
1426
  */
1378
- type Entity = {
1379
- /** Entity ID */
1380
- entityId: number;
1381
- };
1382
- //#endregion
1383
- //#region src/boxes/PreselectionGroupBox.d.ts
1427
+ type PreselectionGroupBoxChild = any;
1384
1428
  /**
1385
1429
  * ISO/IEC 14496-12:202x - 8.18.4.1 Preselection group box
1386
1430
  *
@@ -1397,6 +1441,7 @@ type PreselectionGroupBox = FullBox & {
1397
1441
  preselectionTag?: string;
1398
1442
  selectionPriority?: number;
1399
1443
  interleavingTag?: string;
1444
+ boxes: PreselectionGroupBoxChild[];
1400
1445
  };
1401
1446
  //#endregion
1402
1447
  //#region src/boxes/ProducerReferenceTimeBox.d.ts
@@ -1614,6 +1659,54 @@ type WebVttSourceLabelBox = {
1614
1659
  sourceLabel: string;
1615
1660
  };
1616
1661
  //#endregion
1662
+ //#region src/fields/DATA.d.ts
1663
+ /**
1664
+ * The data field type
1665
+ *
1666
+ * @public
1667
+ */
1668
+ declare const DATA = "data";
1669
+ //#endregion
1670
+ //#region src/fields/INT.d.ts
1671
+ /**
1672
+ * The integer field type
1673
+ *
1674
+ * @public
1675
+ */
1676
+ declare const INT = "int";
1677
+ //#endregion
1678
+ //#region src/fields/STRING.d.ts
1679
+ /**
1680
+ * The string field type
1681
+ *
1682
+ * @public
1683
+ */
1684
+ declare const STRING = "string";
1685
+ //#endregion
1686
+ //#region src/fields/TEMPLATE.d.ts
1687
+ /**
1688
+ * The template field type
1689
+ *
1690
+ * @public
1691
+ */
1692
+ declare const TEMPLATE = "template";
1693
+ //#endregion
1694
+ //#region src/fields/UINT.d.ts
1695
+ /**
1696
+ * The unsigned integer field type
1697
+ *
1698
+ * @public
1699
+ */
1700
+ declare const UINT = "uint";
1701
+ //#endregion
1702
+ //#region src/fields/UTF8.d.ts
1703
+ /**
1704
+ * The UTF8 field type
1705
+ *
1706
+ * @public
1707
+ */
1708
+ declare const UTF8 = "utf8";
1709
+ //#endregion
1617
1710
  //#region src/IsoBoxMap.d.ts
1618
1711
  /**
1619
1712
  * Comprehensive mapping from box type strings to their corresponding TypeScript interfaces
@@ -1731,13 +1824,49 @@ type IsoBoxMap = {
1731
1824
  */
1732
1825
  type IsoBox = IsoBoxMap[keyof IsoBoxMap];
1733
1826
  //#endregion
1734
- //#region src/IsoBoxReader.d.ts
1827
+ //#region src/IsoBoxContainerMap.d.ts
1735
1828
  /**
1736
- * ISO BMFF box reader
1829
+ * Map of container box types to their allowed child box types
1830
+ *
1831
+ * @public
1832
+ */
1833
+ type IsoBoxContainerMap = {
1834
+ dinf: DataInformationBox;
1835
+ edts: EditBox;
1836
+ grpl: GroupsListBox;
1837
+ mdia: MediaBox;
1838
+ meco: AdditionalMetadataContainerBox;
1839
+ mfra: MovieFragmentRandomAccessBox;
1840
+ minf: MediaInformationBox;
1841
+ moof: MovieFragmentBox;
1842
+ moov: MovieBox;
1843
+ mvex: MovieExtendsBox;
1844
+ schi: SchemeInformationBox;
1845
+ sinf: ProtectionSchemeInformationBox;
1846
+ stbl: SampleTableBox;
1847
+ strk: SubTrackBox;
1848
+ traf: TrackFragmentBox;
1849
+ trak: TrackBox;
1850
+ tref: TrackReferenceBox;
1851
+ udta: UserDataBox;
1852
+ vttc: WebVttCueBox;
1853
+ };
1854
+ //#endregion
1855
+ //#region src/IsoBoxContainer.d.ts
1856
+ /**
1857
+ * Iso Box Container Type
1858
+ *
1859
+ * @public
1860
+ */
1861
+ type IsoBoxContainer = IsoBoxContainerMap[keyof IsoBoxContainerMap];
1862
+ //#endregion
1863
+ //#region src/IsoBoxData.d.ts
1864
+ /**
1865
+ * ISO data
1737
1866
  *
1738
1867
  * @public
1739
1868
  */
1740
- type IsoBoxReader<B$1 extends IsoBox> = (view: IsoBoxReadView) => B$1;
1869
+ type IsoBoxData = ArrayBuffer | ArrayBufferView<ArrayBuffer>;
1741
1870
  //#endregion
1742
1871
  //#region src/IsoBoxReaderMap.d.ts
1743
1872
  /**
@@ -1745,7 +1874,7 @@ type IsoBoxReader<B$1 extends IsoBox> = (view: IsoBoxReadView) => B$1;
1745
1874
  *
1746
1875
  * @public
1747
1876
  */
1748
- type IsoBoxReaderMap = Partial<{ [P in IsoBox["type"]]: IsoBoxReader<Extract<IsoBox, Record<"type", P>>> }>;
1877
+ type IsoBoxReaderMap = Record<string, IsoBoxReader>;
1749
1878
  //#endregion
1750
1879
  //#region src/IsoBoxReadViewConfig.d.ts
1751
1880
  /**
@@ -1753,11 +1882,11 @@ type IsoBoxReaderMap = Partial<{ [P in IsoBox["type"]]: IsoBoxReader<Extract<Iso
1753
1882
  *
1754
1883
  * @public
1755
1884
  */
1756
- type IsoBoxReadViewConfig<R extends IsoBoxReaderMap = IsoBoxReaderMap> = {
1885
+ type IsoBoxReadViewConfig = {
1757
1886
  /**
1758
1887
  * A map of box parsers to their box types
1759
1888
  */
1760
- readers?: R;
1889
+ readers?: IsoBoxReaderMap;
1761
1890
  };
1762
1891
  //#endregion
1763
1892
  //#region src/IsoFieldTypeMap.d.ts
@@ -1776,21 +1905,26 @@ type IsoFieldTypeMap = {
1776
1905
  utf8string: string;
1777
1906
  };
1778
1907
  //#endregion
1779
- //#region src/IsoParsedBox.d.ts
1908
+ //#region src/ParsedBox.d.ts
1780
1909
  /**
1781
- * Iso Parsed Box Type
1910
+ * A Parsed Box Type
1782
1911
  *
1783
1912
  * @public
1784
1913
  */
1785
- type IsoParsedBox<T$1 extends IsoBox = IsoBox> = T$1 & Omit<Box, "type">;
1914
+ type ParsedBox<T$1 = Box> = (T$1 extends IsoBox ? T$1 & Omit<Box, "type"> : T$1) & {
1915
+ view: IsoBoxReadView;
1916
+ size: number;
1917
+ largesize?: number;
1918
+ usertype?: number[];
1919
+ };
1786
1920
  //#endregion
1787
- //#region src/ParsedBox.d.ts
1921
+ //#region src/ParsedIsoBox.d.ts
1788
1922
  /**
1789
1923
  * Parsed Box Type
1790
1924
  *
1791
1925
  * @public
1792
1926
  */
1793
- type ParsedBox = IsoParsedBox | Box;
1927
+ type ParsedIsoBox = ParsedBox<IsoBox | Box>;
1794
1928
  //#endregion
1795
1929
  //#region src/IsoBoxReadView.d.ts
1796
1930
  /**
@@ -1799,7 +1933,7 @@ type ParsedBox = IsoParsedBox | Box;
1799
1933
  *
1800
1934
  * @public
1801
1935
  */
1802
- declare class IsoBoxReadView<R extends IsoBoxReaderMap = IsoBoxReaderMap> {
1936
+ declare class IsoBoxReadView {
1803
1937
  private dataView;
1804
1938
  private offset;
1805
1939
  private config;
@@ -1812,7 +1946,7 @@ declare class IsoBoxReadView<R extends IsoBoxReaderMap = IsoBoxReaderMap> {
1812
1946
  * @param raw - The raw data to view.
1813
1947
  * @param config - The configuration for the IsoView.
1814
1948
  */
1815
- constructor(raw: ArrayBuffer | ArrayBufferView<ArrayBuffer>, config?: IsoBoxReadViewConfig<R>);
1949
+ constructor(raw: IsoBoxData, config?: IsoBoxReadViewConfig);
1816
1950
  /**
1817
1951
  * The buffer of the data view.
1818
1952
  */
@@ -1843,7 +1977,7 @@ declare class IsoBoxReadView<R extends IsoBoxReaderMap = IsoBoxReaderMap> {
1843
1977
  * @param size - The size of the slice.
1844
1978
  * @returns A new IsoView instance.
1845
1979
  */
1846
- slice: (offset: number, size: number) => IsoBoxReadView<R>;
1980
+ slice: (offset: number, size: number) => IsoBoxReadView;
1847
1981
  private read;
1848
1982
  /**
1849
1983
  * Reads a unsigned integer from the data view.
@@ -1913,7 +2047,7 @@ declare class IsoBoxReadView<R extends IsoBoxReaderMap = IsoBoxReaderMap> {
1913
2047
  *
1914
2048
  * @returns The box.
1915
2049
  */
1916
- readBox: () => Box;
2050
+ readBox: () => ParsedBox;
1917
2051
  /**
1918
2052
  * Reads a number of boxes from the data view.
1919
2053
  *
@@ -1934,176 +2068,69 @@ declare class IsoBoxReadView<R extends IsoBoxReaderMap = IsoBoxReaderMap> {
1934
2068
  *
1935
2069
  * @returns A generator of boxes.
1936
2070
  */
1937
- [Symbol.iterator](): Generator<ParsedBox>;
2071
+ [Symbol.iterator](): Generator<ParsedIsoBox>;
1938
2072
  }
1939
2073
  //#endregion
1940
- //#region src/boxes/Box.d.ts
2074
+ //#region src/IsoBoxReader.d.ts
1941
2075
  /**
1942
- * Base Box Type
2076
+ * ISO BMFF box reader
1943
2077
  *
1944
2078
  * @public
1945
2079
  */
1946
- type Box = {
1947
- type: "";
1948
- size: number;
1949
- view: IsoBoxReadView;
1950
- largesize?: number;
1951
- usertype?: number[];
1952
- };
2080
+ type IsoBoxReader<B = unknown> = (view: IsoBoxReadView) => B;
1953
2081
  //#endregion
1954
- //#region src/fields/DATA.d.ts
2082
+ //#region src/IsoBoxReaderReturn.d.ts
1955
2083
  /**
1956
- * The data field type
2084
+ * Return type for the ISO box reader.
2085
+ *
2086
+ * Creates a discriminated union of all box types returned by the readers,
2087
+ * plus ParsedBox for unknown/container boxes. This enables type narrowing
2088
+ * via `box.type === 'xxxx'`.
1957
2089
  *
1958
2090
  * @public
1959
2091
  */
1960
- declare const DATA = "data";
2092
+ type IsoBoxReaderReturn<T$1> = { [K in keyof T$1]: T$1[K] extends ((...args: never[]) => infer R) ? ParsedBox<R> : never }[keyof T$1] | ParsedIsoBox;
1961
2093
  //#endregion
1962
- //#region src/fields/INT.d.ts
2094
+ //#region src/IsoBoxStreamable.d.ts
1963
2095
  /**
1964
- * The integer field type
2096
+ * A type that represents a streamable ISO BMFF box or array buffer view.
1965
2097
  *
1966
2098
  * @public
1967
2099
  */
1968
- declare const INT = "int";
2100
+ type IsoBoxStreamable = IsoBox | ParsedIsoBox | ArrayBufferView;
1969
2101
  //#endregion
1970
- //#region src/fields/STRING.d.ts
2102
+ //#region src/IsoBoxWriterMap.d.ts
1971
2103
  /**
1972
- * The string field type
2104
+ * A map of box writers to their box types
1973
2105
  *
1974
2106
  * @public
1975
2107
  */
1976
- declare const STRING = "string";
2108
+ type IsoBoxWriterMap = Partial<{ [P in IsoBox["type"]]: IsoBoxWriter<Extract<IsoBox, Record<"type", P>>> }>;
1977
2109
  //#endregion
1978
- //#region src/fields/TEMPLATE.d.ts
2110
+ //#region src/IsoBoxWriteViewConfig.d.ts
1979
2111
  /**
1980
- * The template field type
2112
+ * Configuration for the IsoBoxReadableStream.
1981
2113
  *
1982
2114
  * @public
1983
2115
  */
1984
- declare const TEMPLATE = "template";
2116
+ type IsoBoxWriteViewConfig = {
2117
+ /**
2118
+ * A map of box writers to their box types
2119
+ */
2120
+ writers?: IsoBoxWriterMap;
2121
+ };
1985
2122
  //#endregion
1986
- //#region src/fields/UINT.d.ts
2123
+ //#region src/IsoBoxWriter.d.ts
1987
2124
  /**
1988
- * The unsigned integer field type
2125
+ * ISO box writer.
1989
2126
  *
1990
2127
  * @public
1991
2128
  */
1992
- declare const UINT = "uint";
2129
+ type IsoBoxWriter<B> = (box: B, config: IsoBoxWriteViewConfig) => ArrayBufferView;
1993
2130
  //#endregion
1994
- //#region src/fields/UTF8.d.ts
2131
+ //#region src/IsoBoxWriteView.d.ts
1995
2132
  /**
1996
- * The UTF8 field type
1997
- *
1998
- * @public
1999
- */
2000
- declare const UTF8 = "utf8";
2001
- //#endregion
2002
- //#region src/IsoBoxContainerMap.d.ts
2003
- /**
2004
- * Map of container box types to their allowed child box types
2005
- *
2006
- * @public
2007
- */
2008
- type IsoBoxContainerMap = {
2009
- dinf: DataInformationBox;
2010
- edts: EditBox;
2011
- grpl: GroupsListBox;
2012
- mdia: MediaBox;
2013
- meco: AdditionalMetadataContainerBox;
2014
- meta: MetaBox;
2015
- mfra: MovieFragmentRandomAccessBox;
2016
- minf: MediaInformationBox;
2017
- moof: MovieFragmentBox;
2018
- moov: MovieBox;
2019
- mvex: MovieExtendsBox;
2020
- schi: SchemeInformationBox;
2021
- sinf: ProtectionSchemeInformationBox;
2022
- stbl: SampleTableBox;
2023
- strk: SubTrackBox;
2024
- traf: TrackFragmentBox;
2025
- trak: TrackBox;
2026
- tref: TrackReferenceBox;
2027
- udta: UserDataBox;
2028
- vttc: WebVttCueBox;
2029
- };
2030
- //#endregion
2031
- //#region src/IsoBoxContainer.d.ts
2032
- /**
2033
- * Iso Box Container Type
2034
- *
2035
- * @public
2036
- */
2037
- type IsoBoxContainer = IsoBoxContainerMap[keyof IsoBoxContainerMap];
2038
- //#endregion
2039
- //#region src/IsoBoxData.d.ts
2040
- /**
2041
- * ISO data
2042
- *
2043
- * @public
2044
- */
2045
- type IsoBoxData = ArrayBuffer | DataView<ArrayBuffer> | Uint8Array<ArrayBuffer>;
2046
- //#endregion
2047
- //#region src/IsoBoxReaderReturn.d.ts
2048
- /**
2049
- * Return type for a box reader.
2050
- *
2051
- * @public
2052
- */
2053
- type BoxReturn<T$1 extends IsoBoxReaderMap> = IsoParsedBox<{ [K in keyof T$1]: T$1[K] extends IsoBoxReader<infer B> ? B : never }[keyof T$1]>;
2054
- /**
2055
- * Return type for a container reader
2056
- *
2057
- * @public
2058
- */
2059
- type ContainerReturn = IsoParsedBox<IsoBoxContainer>;
2060
- /**
2061
- * Return type for the ISO box reader
2062
- *
2063
- * @public
2064
- */
2065
- type IsoBoxReaderReturn<T$1 extends IsoBoxReaderMap> = BoxReturn<T$1> | ContainerReturn | ParsedBox;
2066
- //#endregion
2067
- //#region src/IsoBoxStreamable.d.ts
2068
- /**
2069
- * A type that represents a streamable ISO BMFF box or array buffer view.
2070
- *
2071
- * @public
2072
- */
2073
- type IsoBoxStreamable = IsoBox | Box | ArrayBufferView;
2074
- //#endregion
2075
- //#region src/IsoBoxWriterMap.d.ts
2076
- /**
2077
- * A map of box writers to their box types
2078
- *
2079
- * @public
2080
- */
2081
- type IsoBoxWriterMap = Partial<{ [P in IsoBox["type"]]: IsoBoxWriter<Extract<IsoBox, Record<"type", P>>> }>;
2082
- //#endregion
2083
- //#region src/IsoBoxWriteViewConfig.d.ts
2084
- /**
2085
- * Configuration for the IsoBoxReadableStream.
2086
- *
2087
- * @public
2088
- */
2089
- type IsoBoxWriteViewConfig = {
2090
- /**
2091
- * A map of box writers to their box types
2092
- */
2093
- writers?: IsoBoxWriterMap;
2094
- };
2095
- //#endregion
2096
- //#region src/IsoBoxWriter.d.ts
2097
- /**
2098
- * ISO box writer.
2099
- *
2100
- * @public
2101
- */
2102
- type IsoBoxWriter<B$1> = (box: B$1, config: Required<IsoBoxWriteViewConfig>) => ArrayBufferView;
2103
- //#endregion
2104
- //#region src/IsoBoxWriteView.d.ts
2105
- /**
2106
- * A view for writing ISO BMFF data.
2133
+ * A view for writing ISO BMFF data.
2107
2134
  *
2108
2135
  * @public
2109
2136
  */
@@ -2171,7 +2198,7 @@ declare class IsoBoxWriteView {
2171
2198
  *
2172
2199
  * @param data - The data to write.
2173
2200
  */
2174
- writeBytes: (data: Uint8Array) => void;
2201
+ writeBytes: (data: Uint8Array | Uint8Array[]) => void;
2175
2202
  /**
2176
2203
  * Writes an array of numbers to the data view.
2177
2204
  *
@@ -2210,7 +2237,28 @@ declare class IsoBoxWriteView {
2210
2237
  *
2211
2238
  * @public
2212
2239
  */
2213
- type IsoTypedParsedBox<T$1 extends keyof IsoBoxMap> = IsoBoxMap[T$1] & Omit<Box, "type">;
2240
+ type IsoTypedParsedBox<T$1 extends keyof IsoBoxMap> = ParsedBox<IsoBoxMap[T$1]>;
2241
+ //#endregion
2242
+ //#region src/TraverseIsoBoxesConfig.d.ts
2243
+ /**
2244
+ * Configuration options for traversing ISO boxes.
2245
+ *
2246
+ * @public
2247
+ */
2248
+ type TraverseIsoBoxesConfig = {
2249
+ /**
2250
+ * Whether to traverse the boxes depth-first or breadth-first.
2251
+ *
2252
+ * @defaultValue true
2253
+ */
2254
+ depthFirst?: boolean;
2255
+ /**
2256
+ * The maximum depth to traverse. A value of 0 will only traverse the root boxes.
2257
+ *
2258
+ * @defaultValue Infinity
2259
+ */
2260
+ maxDepth?: number;
2261
+ };
2214
2262
  //#endregion
2215
2263
  //#region src/createIsoBoxReadableStream.d.ts
2216
2264
  /**
@@ -2228,6 +2276,46 @@ type IsoTypedParsedBox<T$1 extends keyof IsoBoxMap> = IsoBoxMap[T$1] & Omit<Box,
2228
2276
  */
2229
2277
  declare function createIsoBoxReadableStream(boxes: Iterable<IsoBoxStreamable>, config?: IsoBoxWriteViewConfig): ReadableStream<Uint8Array>;
2230
2278
  //#endregion
2279
+ //#region src/filterIsoBoxes.d.ts
2280
+ /**
2281
+ * Filters boxes in the tree that satisfy the provided testing function.
2282
+ *
2283
+ * This function traverses the entire box structure (including nested boxes)
2284
+ * and returns all boxes for which the callback returns true.
2285
+ *
2286
+ * @param boxes - The boxes to search through
2287
+ * @param callback - A function that accepts a box and returns true if it matches
2288
+ * @param config - Configuration options for traversal
2289
+ *
2290
+ * @returns An array of boxes that satisfy the callback
2291
+ *
2292
+ * @example
2293
+ * {@includeCode ../test/filterIsoBoxes.test.ts#example}
2294
+ *
2295
+ * @public
2296
+ */
2297
+ declare function filterIsoBoxes<T$1 extends ParsedIsoBox>(boxes: Iterable<T$1>, callback: (box: T$1) => boolean, config?: TraverseIsoBoxesConfig): T$1[];
2298
+ //#endregion
2299
+ //#region src/findIsoBox.d.ts
2300
+ /**
2301
+ * Finds the first box in the tree that satisfies the provided testing function.
2302
+ *
2303
+ * This function traverses the entire box structure (including nested boxes)
2304
+ * and returns the first box for which the callback returns true.
2305
+ *
2306
+ * @param boxes - The boxes to search through
2307
+ * @param callback - A function that accepts a box and returns true if it matches
2308
+ * @param config - Configuration options for traversal
2309
+ *
2310
+ * @returns The first box that satisfies the callback, or null if none is found
2311
+ *
2312
+ * @example
2313
+ * {@includeCode ../test/findIsoBox.test.ts#example}
2314
+ *
2315
+ * @public
2316
+ */
2317
+ declare function findIsoBox<T$1 extends ParsedIsoBox>(boxes: Iterable<T$1>, callback: (box: T$1) => boolean, config?: TraverseIsoBoxesConfig): T$1 | null;
2318
+ //#endregion
2231
2319
  //#region src/IsoBoxReadableStream.d.ts
2232
2320
  /**
2233
2321
  * A readable stream of ISO BMFF boxes as Uint8Arrays.
@@ -2244,6 +2332,123 @@ declare class IsoBoxReadableStream extends ReadableStream<Uint8Array> {
2244
2332
  constructor(boxes: Iterable<IsoBoxStreamable>, config?: IsoBoxWriteViewConfig);
2245
2333
  }
2246
2334
  //#endregion
2335
+ //#region src/readIsoBoxes.d.ts
2336
+ /**
2337
+ * Reads ISO boxes from a data source.
2338
+ *
2339
+ * @param raw - The raw ISO data
2340
+ * @param config - The configuration for the IsoView
2341
+ *
2342
+ * @returns The parsed boxes
2343
+ *
2344
+ * @example
2345
+ * {@includeCode ../test/readIsoBoxes.test.ts#example}
2346
+ *
2347
+ * @public
2348
+ */
2349
+ declare function readIsoBoxes<const R$1 extends IsoBoxReaderMap>(raw: IsoBoxData, config: IsoBoxReadViewConfig & {
2350
+ readers: R$1;
2351
+ }): IsoBoxReaderReturn<R$1>[];
2352
+ /**
2353
+ * @public
2354
+ */
2355
+ declare function readIsoBoxes(raw: IsoBoxData, config?: IsoBoxReadViewConfig): ParsedIsoBox[];
2356
+ //#endregion
2357
+ //#region src/traverseIsoBoxes.d.ts
2358
+ /**
2359
+ * Traverse ISO boxes
2360
+ *
2361
+ * @param boxes - The boxes to traverse
2362
+ * @param config - Configuration options for traversal
2363
+ *
2364
+ * @returns A generator of boxes
2365
+ *
2366
+ * @example
2367
+ * {@includeCode ../test/traverseIsoBoxes.test.ts#example}
2368
+ *
2369
+ * @public
2370
+ */
2371
+ declare function traverseIsoBoxes(boxes: Iterable<ParsedIsoBox>, config?: TraverseIsoBoxesConfig): Generator<ParsedIsoBox>;
2372
+ //#endregion
2373
+ //#region src/writeIsoBox.d.ts
2374
+ /**
2375
+ * Write an ISO box to a Uint8Array.
2376
+ *
2377
+ * @param box - The box to write
2378
+ * @param config - The configuration for the writer
2379
+ *
2380
+ * @returns The written box
2381
+ *
2382
+ * @public
2383
+ */
2384
+ declare function writeIsoBox(box: IsoBoxStreamable, config?: IsoBoxWriteViewConfig): Uint8Array;
2385
+ //#endregion
2386
+ //#region src/writeIsoBoxes.d.ts
2387
+ /**
2388
+ * Writes ISO boxes to a readable stream.
2389
+ *
2390
+ * @param boxes - The boxes to write
2391
+ * @param config - The configuration for the readable stream
2392
+ *
2393
+ * @returns A readable stream of the written boxes
2394
+ *
2395
+ * @example
2396
+ * {@includeCode ../test/writeIsoBoxes.test.ts#example}
2397
+ *
2398
+ * @public
2399
+ */
2400
+ declare function writeIsoBoxes(boxes: Iterable<IsoBoxStreamable>, config?: IsoBoxWriteViewConfig): Uint8Array[];
2401
+ //#endregion
2402
+ //#region src/readers/createAudioSampleEntryReader.d.ts
2403
+ /**
2404
+ * Creates a reader function for AudioSampleEntryBox with a custom type.
2405
+ *
2406
+ * This utility allows reading audio sample entry boxes with types that
2407
+ * aren't in the standard AudioSampleEntryType union (e.g., 'mp4a', 'enca').
2408
+ *
2409
+ * @param type - The 4-character box type
2410
+ *
2411
+ * @returns A reader function that can be passed to readIsoBoxes
2412
+ *
2413
+ * @example
2414
+ * ```ts
2415
+ * const boxes = readIsoBoxes(data, {
2416
+ * readers: {
2417
+ * 'ac-3': createAudioSampleEntryReader('ac-3'),
2418
+ * 'ec-3': createAudioSampleEntryReader('ec-3'),
2419
+ * }
2420
+ * })
2421
+ * ```
2422
+ *
2423
+ * @public
2424
+ */
2425
+ declare function createAudioSampleEntryReader<T$1 extends IsoBoxType>(type: T$1): (view: IsoBoxReadView) => AudioSampleEntryBox<T$1>;
2426
+ //#endregion
2427
+ //#region src/readers/createVisualSampleEntryReader.d.ts
2428
+ /**
2429
+ * Creates a reader function for VisualSampleEntryBox with a custom type.
2430
+ *
2431
+ * This utility allows reading visual sample entry boxes with types that
2432
+ * aren't in the standard VisualSampleEntryType union (e.g., 'avc1', 'hvc1').
2433
+ *
2434
+ * @param type - The 4-character box type
2435
+ *
2436
+ * @returns A reader function that can be passed to readIsoBoxes
2437
+ *
2438
+ * @example
2439
+ * ```ts
2440
+ * const boxes = readIsoBoxes(data, {
2441
+ * readers: {
2442
+ * 'vp09': createVisualSampleEntryReader('vp09'),
2443
+ * 'av01': createVisualSampleEntryReader('av01'),
2444
+ * }
2445
+ * })
2446
+ * ```
2447
+ *
2448
+ * @public
2449
+ */
2450
+ declare function createVisualSampleEntryReader<T$1 extends IsoBoxType>(type: T$1): (view: IsoBoxReadView) => VisualSampleEntryBox<T$1>;
2451
+ //#endregion
2247
2452
  //#region src/readers/readArdi.d.ts
2248
2453
  /**
2249
2454
  * Parse a AudioRenderingIndicationBox from an IsoView
@@ -2256,6 +2461,19 @@ declare class IsoBoxReadableStream extends ReadableStream<Uint8Array> {
2256
2461
  */
2257
2462
  declare function readArdi(view: IsoBoxReadView): AudioRenderingIndicationBox;
2258
2463
  //#endregion
2464
+ //#region src/readers/readAudioSampleEntryBox.d.ts
2465
+ /**
2466
+ * Parse a AudioSampleEntryBox from an IsoView
2467
+ *
2468
+ * @param type - The type of AudioSampleEntryBox to read
2469
+ * @param view - The IsoView to read data from
2470
+ *
2471
+ * @returns A parsed AudioSampleEntryBox
2472
+ *
2473
+ * @public
2474
+ */
2475
+ declare function readAudioSampleEntryBox<T$1 extends IsoBoxType>(type: T$1, view: IsoBoxReadView): AudioSampleEntryBox<T$1>;
2476
+ //#endregion
2259
2477
  //#region src/readers/readAvc1.d.ts
2260
2478
  /**
2261
2479
  * Parse a VisualSampleEntryBox from an IsoView
@@ -2916,6 +3134,19 @@ declare function readUrl(view: IsoBoxReadView): DataEntryUrlBox;
2916
3134
  */
2917
3135
  declare function readUrn(view: IsoBoxReadView): DataEntryUrnBox;
2918
3136
  //#endregion
3137
+ //#region src/readers/readVisualSampleEntryBox.d.ts
3138
+ /**
3139
+ * Parse a VisualSampleEntryBox from an IsoView
3140
+ *
3141
+ * @param type - The type of VisualSampleEntryBox to read
3142
+ * @param view - The IsoView to read data from
3143
+ *
3144
+ * @returns A parsed VisualSampleEntryBox
3145
+ *
3146
+ * @public
3147
+ */
3148
+ declare function readVisualSampleEntryBox<T$1 extends IsoBoxType>(type: T$1, view: IsoBoxReadView): VisualSampleEntryBox<T$1>;
3149
+ //#endregion
2919
3150
  //#region src/readers/readVlab.d.ts
2920
3151
  /**
2921
3152
  * Parse a WebVTTSourceLabelBox from an IsoView
@@ -2962,39 +3193,6 @@ declare function readVttC(view: IsoBoxReadView): WebVttConfigurationBox;
2962
3193
  */
2963
3194
  declare function readVtte(_: IsoBoxReadView): WebVttEmptySampleBox;
2964
3195
  //#endregion
2965
- //#region src/readIsoBoxes.d.ts
2966
- /**
2967
- * Reads ISO boxes from a data source.
2968
- *
2969
- * @param raw - The raw ISO data
2970
- * @param config - The configuration for the IsoView
2971
- *
2972
- * @returns The parsed boxes
2973
- *
2974
- * @example
2975
- * {@includeCode ../test/readIsoBoxes.test.ts#example}
2976
- *
2977
- * @public
2978
- */
2979
- declare function readIsoBoxes<R extends IsoBoxReaderMap>(raw: IsoBoxData, config?: IsoBoxReadViewConfig<R>): IsoBoxReaderReturn<R>[];
2980
- //#endregion
2981
- //#region src/traverseIsoBoxes.d.ts
2982
- /**
2983
- * Traverse ISO boxes
2984
- *
2985
- * @param boxes - The boxes to traverse
2986
- * @param depthFirst - Whether to traverse the boxes depth-first or breadth-first
2987
- * @param maxDepth - The maximum depth to traverse. A value of 0 will only traverse the root boxes.
2988
- *
2989
- * @returns A generator of boxes
2990
- *
2991
- * @example
2992
- * {@includeCode ../test/traverseIsoBoxes.test.ts#example}
2993
- *
2994
- * @public
2995
- */
2996
- declare function traverseIsoBoxes(boxes: Iterable<ParsedBox>, depthFirst?: boolean, maxDepth?: number): Generator<ParsedBox>;
2997
- //#endregion
2998
3196
  //#region src/utils/CONTAINERS.d.ts
2999
3197
  /**
3000
3198
  * List of container box types
@@ -3013,7 +3211,7 @@ declare const CONTAINERS: string[];
3013
3211
  *
3014
3212
  * @public
3015
3213
  */
3016
- declare function isContainer(box: IsoBox | Box): box is IsoBoxContainer;
3214
+ declare function isContainer<T$1 extends IsoBox | Box<IsoBox["type"]>>(box: T$1): box is T$1 & IsoBoxContainer;
3017
3215
  //#endregion
3018
3216
  //#region src/utils/isFullBox.d.ts
3019
3217
  /**
@@ -3027,45 +3225,32 @@ declare function isContainer(box: IsoBox | Box): box is IsoBoxContainer;
3027
3225
  */
3028
3226
  declare function isFullBox(box: any): box is FullBox;
3029
3227
  //#endregion
3030
- //#region src/writeIsoBox.d.ts
3031
- /**
3032
- * Write an ISO box to a Uint8Array.
3033
- *
3034
- * @param box - The box to write
3035
- * @param writers - The writers to use
3036
- * @returns The written box
3037
- *
3038
- * @public
3039
- */
3040
- declare function writeIsoBox(box: IsoBoxStreamable, config?: IsoBoxWriteViewConfig): Uint8Array;
3041
- //#endregion
3042
- //#region src/writeIsoBoxes.d.ts
3228
+ //#region src/writers/writeArdi.d.ts
3043
3229
  /**
3044
- * Writes ISO boxes to a readable stream.
3045
- *
3046
- * @param boxes - The boxes to write
3047
- * @param config - The configuration for the readable stream
3230
+ * Write an AudioRenderingIndicationBox to an IsoDataWriter.
3048
3231
  *
3049
- * @returns A readable stream of the written boxes
3232
+ * @param box - The AudioRenderingIndicationBox fields to write
3050
3233
  *
3051
- * @example
3052
- * {@includeCode ../test/writeIsoBoxes.test.ts#example}
3234
+ * @returns An IsoDataWriter containing the encoded box
3053
3235
  *
3054
3236
  * @public
3055
3237
  */
3056
- declare function writeIsoBoxes(boxes: Iterable<IsoBoxStreamable>, config?: IsoBoxWriteViewConfig): Uint8Array[];
3238
+ declare function writeArdi(box: AudioRenderingIndicationBox): IsoBoxWriteView;
3057
3239
  //#endregion
3058
- //#region src/writers/writeArdi.d.ts
3240
+ //#region src/writers/writeAudioSampleEntryBox.d.ts
3059
3241
  /**
3060
- * Write an AudioRenderingIndicationBox to an IsoDataWriter.
3242
+ * Write an AudioSampleEntryBox to an IsoDataWriter.
3061
3243
  *
3062
- * @param box - The AudioRenderingIndicationBox fields to write
3244
+ * ISO/IEC 14496-12:2012 - 12.2.3 Audio Sample Entry
3245
+ *
3246
+ * @param box - The AudioSampleEntryBox fields to write
3247
+ * @param config - The IsoBoxWriteViewConfig to use
3063
3248
  *
3064
3249
  * @returns An IsoDataWriter containing the encoded box
3065
3250
  *
3066
3251
  * @public
3067
3252
  */
3068
- declare function writeArdi(box: AudioRenderingIndicationBox): IsoBoxWriteView;
3253
+ declare function writeAudioSampleEntryBox<T$1 extends AudioSampleEntryType = AudioSampleEntryType>(box: AudioSampleEntryBox<T$1>, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3069
3254
  //#endregion
3070
3255
  //#region src/writers/writeAvc1.d.ts
3071
3256
  /**
@@ -3074,48 +3259,52 @@ declare function writeArdi(box: AudioRenderingIndicationBox): IsoBoxWriteView;
3074
3259
  * ISO/IEC 14496-12:2012 - 12.1.3 Visual Sample Entry
3075
3260
  *
3076
3261
  * @param box - The VisualSampleEntryBox fields to write
3262
+ * @param config - The IsoBoxWriteViewConfig to use
3077
3263
  *
3078
3264
  * @returns An IsoDataWriter containing the encoded box
3079
3265
  *
3080
3266
  * @public
3081
3267
  */
3082
- declare function writeAvc1(box: VisualSampleEntryBox<"avc1">): IsoBoxWriteView;
3268
+ declare function writeAvc1(box: VisualSampleEntryBox<"avc1">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3083
3269
  //#endregion
3084
3270
  //#region src/writers/writeAvc2.d.ts
3085
3271
  /**
3086
3272
  * Write a VisualSampleEntryBox (avc2) to an IsoDataWriter.
3087
3273
  *
3088
3274
  * @param box - The VisualSampleEntryBox fields to write
3275
+ * @param config - The IsoBoxWriteViewConfig to use
3089
3276
  *
3090
3277
  * @returns An IsoDataWriter containing the encoded box
3091
3278
  *
3092
3279
  * @public
3093
3280
  */
3094
- declare function writeAvc2(box: VisualSampleEntryBox<"avc2">): IsoBoxWriteView;
3281
+ declare function writeAvc2(box: VisualSampleEntryBox<"avc2">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3095
3282
  //#endregion
3096
3283
  //#region src/writers/writeAvc3.d.ts
3097
3284
  /**
3098
3285
  * Write a VisualSampleEntryBox (avc3) to an IsoDataWriter.
3099
3286
  *
3100
3287
  * @param box - The VisualSampleEntryBox fields to write
3288
+ * @param config - The IsoBoxWriteViewConfig to use
3101
3289
  *
3102
3290
  * @returns An IsoDataWriter containing the encoded box
3103
3291
  *
3104
3292
  * @public
3105
3293
  */
3106
- declare function writeAvc3(box: VisualSampleEntryBox<"avc3">): IsoBoxWriteView;
3294
+ declare function writeAvc3(box: VisualSampleEntryBox<"avc3">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3107
3295
  //#endregion
3108
3296
  //#region src/writers/writeAvc4.d.ts
3109
3297
  /**
3110
3298
  * Write a VisualSampleEntryBox (avc4) to an IsoDataWriter.
3111
3299
  *
3112
3300
  * @param box - The VisualSampleEntryBox fields to write
3301
+ * @param config - The IsoBoxWriteViewConfig to use
3113
3302
  *
3114
3303
  * @returns An IsoDataWriter containing the encoded box
3115
3304
  *
3116
3305
  * @public
3117
3306
  */
3118
- declare function writeAvc4(box: VisualSampleEntryBox<"avc4">): IsoBoxWriteView;
3307
+ declare function writeAvc4(box: VisualSampleEntryBox<"avc4">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3119
3308
  //#endregion
3120
3309
  //#region src/writers/writeCtts.d.ts
3121
3310
  /**
@@ -3136,6 +3325,7 @@ declare function writeCtts(box: CompositionTimeToSampleBox): IsoBoxWriteView;
3136
3325
  * Write a DataReferenceBox to an IsoDataWriter.
3137
3326
  *
3138
3327
  * @param box - The DataReferenceBox fields to write
3328
+ * @param config - The IsoBoxWriteViewConfig to use
3139
3329
  *
3140
3330
  * @returns An IsoDataWriter containing the encoded box
3141
3331
  *
@@ -3190,24 +3380,26 @@ declare function writeEmsg(box: EventMessageBox): IsoBoxWriteView;
3190
3380
  * Write an AudioSampleEntryBox (enca) to an IsoDataWriter.
3191
3381
  *
3192
3382
  * @param box - The AudioSampleEntryBox fields to write
3383
+ * @param config - The IsoBoxWriteViewConfig to use
3193
3384
  *
3194
3385
  * @returns An IsoDataWriter containing the encoded box
3195
3386
  *
3196
3387
  * @public
3197
3388
  */
3198
- declare function writeEnca(box: AudioSampleEntryBox<"enca">): IsoBoxWriteView;
3389
+ declare function writeEnca(box: AudioSampleEntryBox<"enca">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3199
3390
  //#endregion
3200
3391
  //#region src/writers/writeEncv.d.ts
3201
3392
  /**
3202
3393
  * Write a VisualSampleEntryBox (encv) to an IsoDataWriter.
3203
3394
  *
3204
3395
  * @param box - The VisualSampleEntryBox fields to write
3396
+ * @param config - The IsoBoxWriteViewConfig to use
3205
3397
  *
3206
3398
  * @returns An IsoDataWriter containing the encoded box
3207
3399
  *
3208
3400
  * @public
3209
3401
  */
3210
- declare function writeEncv(box: VisualSampleEntryBox<"encv">): IsoBoxWriteView;
3402
+ declare function writeEncv(box: VisualSampleEntryBox<"encv">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3211
3403
  //#endregion
3212
3404
  //#region src/writers/writeFree.d.ts
3213
3405
  /**
@@ -3270,24 +3462,26 @@ declare function writeHdlr(box: HandlerReferenceBox): IsoBoxWriteView;
3270
3462
  * Write a VisualSampleEntryBox (hev1) to an IsoDataWriter.
3271
3463
  *
3272
3464
  * @param box - The VisualSampleEntryBox fields to write
3465
+ * @param config - The IsoBoxWriteViewConfig to use
3273
3466
  *
3274
3467
  * @returns An IsoDataWriter containing the encoded box
3275
3468
  *
3276
3469
  * @public
3277
3470
  */
3278
- declare function writeHev1(box: VisualSampleEntryBox<"hev1">): IsoBoxWriteView;
3471
+ declare function writeHev1(box: VisualSampleEntryBox<"hev1">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3279
3472
  //#endregion
3280
3473
  //#region src/writers/writeHvc1.d.ts
3281
3474
  /**
3282
3475
  * Write a VisualSampleEntryBox (hvc1) to an IsoDataWriter.
3283
3476
  *
3284
3477
  * @param box - The VisualSampleEntryBox fields to write
3478
+ * @param config - The IsoBoxWriteViewConfig to use
3285
3479
  *
3286
3480
  * @returns An IsoDataWriter containing the encoded box
3287
3481
  *
3288
3482
  * @public
3289
3483
  */
3290
- declare function writeHvc1(box: VisualSampleEntryBox<"hvc1">): IsoBoxWriteView;
3484
+ declare function writeHvc1(box: VisualSampleEntryBox<"hvc1">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3291
3485
  //#endregion
3292
3486
  //#region src/writers/writeIden.d.ts
3293
3487
  /**
@@ -3386,12 +3580,13 @@ declare function writeMehd(box: MovieExtendsHeaderBox): IsoBoxWriteView;
3386
3580
  * ISO/IEC 14496-12:2012 - 8.11.1 Meta Box
3387
3581
  *
3388
3582
  * @param box - The MetaBox fields to write
3583
+ * @param config - The IsoBoxWriteViewConfig to use
3389
3584
  *
3390
3585
  * @returns An IsoDataWriter containing the encoded box
3391
3586
  *
3392
3587
  * @public
3393
3588
  */
3394
- declare function writeMeta(box: MetaBox): IsoBoxWriteView;
3589
+ declare function writeMeta(box: MetaBox, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3395
3590
  //#endregion
3396
3591
  //#region src/writers/writeMfhd.d.ts
3397
3592
  /**
@@ -3433,7 +3628,7 @@ declare function writeMfro(box: MovieFragmentRandomAccessOffsetBox): IsoBoxWrite
3433
3628
  *
3434
3629
  * @public
3435
3630
  */
3436
- declare function writeMp4a(box: AudioSampleEntryBox<"mp4a">): IsoBoxWriteView;
3631
+ declare function writeMp4a(box: AudioSampleEntryBox<"mp4a">, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3437
3632
  //#endregion
3438
3633
  //#region src/writers/writeMvhd.d.ts
3439
3634
  /**
@@ -3480,12 +3675,13 @@ declare function writePrft(box: ProducerReferenceTimeBox): IsoBoxWriteView;
3480
3675
  * Write a PreselectionGroupBox to an IsoDataWriter.
3481
3676
  *
3482
3677
  * @param box - The PreselectionGroupBox fields to write
3678
+ * @param config - The IsoBoxWriteViewConfig to use
3483
3679
  *
3484
3680
  * @returns An IsoDataWriter containing the encoded box
3485
3681
  *
3486
3682
  * @public
3487
3683
  */
3488
- declare function writePrsl(box: PreselectionGroupBox): IsoBoxWriteView;
3684
+ declare function writePrsl(box: PreselectionGroupBox, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
3489
3685
  //#endregion
3490
3686
  //#region src/writers/writePssh.d.ts
3491
3687
  /**
@@ -3604,6 +3800,7 @@ declare function writeSthd(box: SubtitleMediaHeaderBox): IsoBoxWriteView;
3604
3800
  * Write a SampleDescriptionBox to an IsoDataWriter.
3605
3801
  *
3606
3802
  * @param box - The SampleDescriptionBox fields to write
3803
+ * @param config - The IsoBoxWriteViewConfig to use
3607
3804
  *
3608
3805
  * @returns An IsoDataWriter containing the encoded box
3609
3806
  *
@@ -3805,6 +4002,21 @@ declare function writeUrl(box: DataEntryUrlBox): IsoBoxWriteView;
3805
4002
  */
3806
4003
  declare function writeUrn(box: DataEntryUrnBox): IsoBoxWriteView;
3807
4004
  //#endregion
4005
+ //#region src/writers/writeVisualSampleEntryBox.d.ts
4006
+ /**
4007
+ * Write a VisualSampleEntryBox to an IsoDataWriter.
4008
+ *
4009
+ * ISO/IEC 14496-12:2012 - 12.1.3 Visual Sample Entry
4010
+ *
4011
+ * @param box - The VisualSampleEntryBox fields to write
4012
+ * @param config - The configuration for the writer
4013
+ *
4014
+ * @returns An IsoDataWriter containing the encoded box
4015
+ *
4016
+ * @public
4017
+ */
4018
+ declare function writeVisualSampleEntryBox<T$1 extends VisualSampleEntryType = VisualSampleEntryType>(box: VisualSampleEntryBox<T$1>, config: IsoBoxWriteViewConfig): IsoBoxWriteView;
4019
+ //#endregion
3808
4020
  //#region src/writers/writeVlab.d.ts
3809
4021
  /**
3810
4022
  * Write a WebVttSourceLabelBox to an IsoDataWriter.
@@ -3853,5 +4065,5 @@ declare function writeVttC(box: WebVttConfigurationBox): IsoBoxWriteView;
3853
4065
  */
3854
4066
  declare function writeVtte(_: WebVttEmptySampleBox): IsoBoxWriteView;
3855
4067
  //#endregion
3856
- export { AdditionalMetadataContainerBox, AdditionalMetadataContainerBoxChild, AudioRenderingIndicationBox, AudioSampleEntryBox, Box, BoxReturn, CONTAINERS, ChunkLargeOffsetBox, ChunkOffsetBox, CompactSampleSizeBox, CompositionTimeToSampleBox, CompositionTimeToSampleEntry, ContainerReturn, DATA, DataEntryUrlBox, DataEntryUrnBox, DataInformationBox, DataInformationBoxChild, DataReferenceBox, DecodingTimeSample, DecodingTimeToSampleBox, DegradationPriorityBox, EditBox, EditBoxChild, EditListBox, EditListEntry, EncryptedSample, Entity, EventMessageBox, ExtendedLanguageBox, FileTypeBox, FreeSpaceBox, FullBox, GroupsListBox, GroupsListBoxChild, HandlerReferenceBox, HintMediaHeaderBox, INT, IdentifiedMediaDataBox, IpmpInfoBox, IsoBox, IsoBoxContainer, IsoBoxContainerMap, IsoBoxData, IsoBoxMap, IsoBoxReadView, IsoBoxReadViewConfig, IsoBoxReadableStream, IsoBoxReader, IsoBoxReaderMap, IsoBoxReaderReturn, IsoBoxStreamable, IsoBoxWriteView, IsoBoxWriteViewConfig, IsoBoxWriter, IsoBoxWriterMap, IsoFieldTypeMap, IsoParsedBox, IsoTypedParsedBox, ItemExtent, ItemInfoBox, ItemInfoBoxChild, ItemInfoEntry, ItemLocation, ItemLocationBox, ItemProtectionBox, ItemProtectionBoxChild, ItemReferenceBox, ItemReferenceBoxChild, LabelBox, MediaBox, MediaBoxChild, MediaDataBox, MediaHeaderBox, MediaInformationBox, MediaInformationBoxChild, MetaBox, MetaBoxChild, MovieBox, MovieBoxChild, MovieExtendsBox, MovieExtendsBoxChild, MovieExtendsHeaderBox, MovieFragmentBox, MovieFragmentBoxChild, MovieFragmentHeaderBox, MovieFragmentRandomAccessBox, MovieFragmentRandomAccessBoxChild, MovieFragmentRandomAccessOffsetBox, MovieHeaderBox, NullMediaHeaderBox, OriginalFormatBox, ParsedBox, PreselectionGroupBox, PrimaryItemBox, ProducerReferenceTimeBox, ProtectionSchemeInformationBox, ProtectionSchemeInformationBoxChild, ProtectionSystemSpecificHeaderBox, STRING, SampleAuxiliaryInformationOffsetsBox, SampleAuxiliaryInformationSizesBox, SampleDependencyTypeBox, SampleDescriptionBox, SampleEncryptionBox, SampleEntryBox, SampleGroupDescriptionBox, SampleSizeBox, SampleTableBox, SampleTableBoxChild, SampleToChunkBox, SampleToChunkEntry, SampleToGroupBox, SampleToGroupEntry, SchemeInformationBox, SchemeInformationBoxChild, SchemeTypeBox, SegmentIndexBox, SegmentIndexReference, SegmentTypeBox, ShadowSyncEntry, ShadowSyncSampleBox, SingleItemTypeReferenceBox, SoundMediaHeaderBox, SubTrackBox, SubTrackBoxChild, Subsample, SubsampleEncryption, SubsampleEntry, SubsampleInformationBox, Subsegment, SubsegmentIndexBox, SubsegmentRange, SubtitleMediaHeaderBox, SyncSample, SyncSampleBox, TEMPLATE, TrackBox, TrackBoxChild, TrackEncryptionBox, TrackExtendsBox, TrackFragmentBaseMediaDecodeTimeBox, TrackFragmentBox, TrackFragmentBoxChild, TrackFragmentHeaderBox, TrackFragmentRandomAccessBox, TrackFragmentRandomAccessEntry, TrackHeaderBox, TrackKindBox, TrackReferenceBox, TrackReferenceBoxChild, TrackReferenceTypeBox, TrackRunBox, TrackRunSample, TypeBox, UINT, UTF8, UserDataBox, UserDataBoxChild, VideoMediaHeaderBox, VisualSampleEntryBox, VisualSampleEntryType, WebVttConfigurationBox, WebVttCueBox, WebVttCueChild, WebVttCueIdBox, WebVttCuePayloadBox, WebVttEmptySampleBox, WebVttSettingsBox, WebVttSourceLabelBox, co64, createIsoBoxReadableStream, isContainer, isFullBox, readArdi, readAvc1, readAvc2, readAvc3, readAvc4, readCtts, readDref, readElng, readElst, readEmsg, readEnca, readEncv, readFree, readFrma, readFtyp, readHdlr, readHev1, readHvc1, readIden, readImda, readIsoBoxes, readKind, readLabl, readMdat, readMdhd, readMehd, readMeta, readMfhd, readMfro, readMp4a, readMvhd, readPayl, readPrft, readPrsl, readPssh, readSchm, readSdtp, readSidx, readSkip, readSmhd, readSsix, readSthd, readStsd, readStss, readSttg, readStts, readStyp, readSubs, readTenc, readTfdt, readTfhd, readTfra, readTkhd, readTrex, readTrun, readUrl, readUrn, readVlab, readVmhd, readVttC, readVtte, stz2, traverseIsoBoxes, url, urn, writeArdi, writeAvc1, writeAvc2, writeAvc3, writeAvc4, writeCtts, writeDref, writeElng, writeElst, writeEmsg, writeEnca, writeEncv, writeFree, writeFrma, writeFtyp, writeHdlr, writeHev1, writeHvc1, writeIden, writeImda, writeIsoBox, writeIsoBoxes, writeKind, writeLabl, writeMdat, writeMdhd, writeMehd, writeMeta, writeMfhd, writeMfro, writeMp4a, writeMvhd, writePayl, writePrft, writePrsl, writePssh, writeSchm, writeSdtp, writeSidx, writeSkip, writeSmhd, writeSsix, writeSthd, writeStsd, writeStss, writeSttg, writeStts, writeStyp, writeSubs, writeTenc, writeTfdt, writeTfhd, writeTfra, writeTkhd, writeTrex, writeTrun, writeUrl, writeUrn, writeVlab, writeVmhd, writeVttC, writeVtte };
4068
+ export { AdditionalMetadataContainerBox, AdditionalMetadataContainerBoxChild, AudioRenderingIndicationBox, AudioSampleEntryBox, AudioSampleEntryBoxChild, AudioSampleEntryType, Box, CONTAINERS, ChunkLargeOffsetBox, ChunkOffsetBox, CompactSampleSizeBox, CompositionTimeToSampleBox, CompositionTimeToSampleEntry, DATA, DataEntryUrlBox, DataEntryUrnBox, DataInformationBox, DataInformationBoxChild, DataReferenceBox, DecodingTimeSample, DecodingTimeToSampleBox, DegradationPriorityBox, EditBox, EditBoxChild, EditListBox, EditListEntry, EncryptedSample, Entity, EventMessageBox, ExtendedLanguageBox, FileTypeBox, FreeSpaceBox, FullBox, GroupsListBox, GroupsListBoxChild, HandlerReferenceBox, HintMediaHeaderBox, INT, IdentifiedMediaDataBox, IpmpInfoBox, IsoBox, IsoBoxContainer, IsoBoxContainerMap, IsoBoxData, IsoBoxMap, IsoBoxReadView, IsoBoxReadViewConfig, IsoBoxReadableStream, IsoBoxReader, IsoBoxReaderMap, IsoBoxReaderReturn, IsoBoxStreamable, IsoBoxType, IsoBoxWriteView, IsoBoxWriteViewConfig, IsoBoxWriter, IsoBoxWriterMap, IsoFieldTypeMap, IsoTypedParsedBox, ItemExtent, ItemInfoBox, ItemInfoBoxChild, ItemInfoEntry, ItemLocation, ItemLocationBox, ItemProtectionBox, ItemProtectionBoxChild, ItemReferenceBox, ItemReferenceBoxChild, LabelBox, MediaBox, MediaBoxChild, MediaDataBox, MediaHeaderBox, MediaInformationBox, MediaInformationBoxChild, MetaBox, MetaBoxChild, MovieBox, MovieBoxChild, MovieExtendsBox, MovieExtendsBoxChild, MovieExtendsHeaderBox, MovieFragmentBox, MovieFragmentBoxChild, MovieFragmentHeaderBox, MovieFragmentRandomAccessBox, MovieFragmentRandomAccessBoxChild, MovieFragmentRandomAccessOffsetBox, MovieHeaderBox, NullMediaHeaderBox, OriginalFormatBox, ParsedBox, ParsedIsoBox, PreselectionGroupBox, PreselectionGroupBoxChild, PrimaryItemBox, ProducerReferenceTimeBox, ProtectionSchemeInformationBox, ProtectionSchemeInformationBoxChild, ProtectionSystemSpecificHeaderBox, STRING, SampleAuxiliaryInformationOffsetsBox, SampleAuxiliaryInformationSizesBox, SampleDependencyTypeBox, SampleDescriptionBox, SampleEncryptionBox, SampleEntryBox, SampleGroupDescriptionBox, SampleSizeBox, SampleTableBox, SampleTableBoxChild, SampleToChunkBox, SampleToChunkEntry, SampleToGroupBox, SampleToGroupEntry, SchemeInformationBox, SchemeInformationBoxChild, SchemeTypeBox, SegmentIndexBox, SegmentIndexReference, SegmentTypeBox, ShadowSyncEntry, ShadowSyncSampleBox, SingleItemTypeReferenceBox, SoundMediaHeaderBox, SubTrackBox, SubTrackBoxChild, Subsample, SubsampleEncryption, SubsampleEntry, SubsampleInformationBox, Subsegment, SubsegmentIndexBox, SubsegmentRange, SubtitleMediaHeaderBox, SyncSample, SyncSampleBox, TEMPLATE, TrackBox, TrackBoxChild, TrackEncryptionBox, TrackExtendsBox, TrackFragmentBaseMediaDecodeTimeBox, TrackFragmentBox, TrackFragmentBoxChild, TrackFragmentHeaderBox, TrackFragmentRandomAccessBox, TrackFragmentRandomAccessEntry, TrackHeaderBox, TrackKindBox, TrackReferenceBox, TrackReferenceBoxChild, TrackReferenceTypeBox, TrackRunBox, TrackRunSample, TraverseIsoBoxesConfig, TypeBox, UINT, UTF8, UserDataBox, UserDataBoxChild, VideoMediaHeaderBox, VisualSampleEntryBox, VisualSampleEntryBoxChild, VisualSampleEntryType, WebVttConfigurationBox, WebVttCueBox, WebVttCueChild, WebVttCueIdBox, WebVttCuePayloadBox, WebVttEmptySampleBox, WebVttSettingsBox, WebVttSourceLabelBox, co64, createAudioSampleEntryReader, createIsoBoxReadableStream, createVisualSampleEntryReader, filterIsoBoxes, findIsoBox, isContainer, isFullBox, readArdi, readAudioSampleEntryBox, readAvc1, readAvc2, readAvc3, readAvc4, readCtts, readDref, readElng, readElst, readEmsg, readEnca, readEncv, readFree, readFrma, readFtyp, readHdlr, readHev1, readHvc1, readIden, readImda, readIsoBoxes, readKind, readLabl, readMdat, readMdhd, readMehd, readMeta, readMfhd, readMfro, readMp4a, readMvhd, readPayl, readPrft, readPrsl, readPssh, readSchm, readSdtp, readSidx, readSkip, readSmhd, readSsix, readSthd, readStsd, readStss, readSttg, readStts, readStyp, readSubs, readTenc, readTfdt, readTfhd, readTfra, readTkhd, readTrex, readTrun, readUrl, readUrn, readVisualSampleEntryBox, readVlab, readVmhd, readVttC, readVtte, stz2, traverseIsoBoxes, url, urn, writeArdi, writeAudioSampleEntryBox, writeAvc1, writeAvc2, writeAvc3, writeAvc4, writeCtts, writeDref, writeElng, writeElst, writeEmsg, writeEnca, writeEncv, writeFree, writeFrma, writeFtyp, writeHdlr, writeHev1, writeHvc1, writeIden, writeImda, writeIsoBox, writeIsoBoxes, writeKind, writeLabl, writeMdat, writeMdhd, writeMehd, writeMeta, writeMfhd, writeMfro, writeMp4a, writeMvhd, writePayl, writePrft, writePrsl, writePssh, writeSchm, writeSdtp, writeSidx, writeSkip, writeSmhd, writeSsix, writeSthd, writeStsd, writeStss, writeSttg, writeStts, writeStyp, writeSubs, writeTenc, writeTfdt, writeTfhd, writeTfra, writeTkhd, writeTrex, writeTrun, writeUrl, writeUrn, writeVisualSampleEntryBox, writeVlab, writeVmhd, writeVttC, writeVtte };
3857
4069
  //# sourceMappingURL=index.d.ts.map