typeson-registry 13.3.0 → 14.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 +12 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +141 -21
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.cjs +194 -20
- package/dist/index.umd.cjs.map +1 -1
- package/dist/index.umd.min.cjs +2 -2
- package/dist/index.umd.min.cjs.map +1 -1
- package/dist/polyfills/AudioData.d.ts +70 -0
- package/dist/polyfills/AudioData.d.ts.map +1 -0
- package/dist/polyfills/DOMMatrix.d.ts +43 -0
- package/dist/polyfills/DOMMatrix.d.ts.map +1 -0
- package/dist/polyfills/DOMMatrixReadOnly.d.ts +43 -0
- package/dist/polyfills/DOMMatrixReadOnly.d.ts.map +1 -0
- package/dist/polyfills/DOMPoint.d.ts +21 -0
- package/dist/polyfills/DOMPoint.d.ts.map +1 -0
- package/dist/polyfills/DOMPointReadOnly.d.ts +21 -0
- package/dist/polyfills/DOMPointReadOnly.d.ts.map +1 -0
- package/dist/polyfills/DOMQuad.d.ts +22 -0
- package/dist/polyfills/DOMQuad.d.ts.map +1 -0
- package/dist/polyfills/DOMRect.d.ts +25 -0
- package/dist/polyfills/DOMRect.d.ts.map +1 -0
- package/dist/polyfills/DOMRectReadOnly.d.ts +25 -0
- package/dist/polyfills/DOMRectReadOnly.d.ts.map +1 -0
- package/dist/polyfills/EncodedAudioChunk.d.ts +40 -0
- package/dist/polyfills/EncodedAudioChunk.d.ts.map +1 -0
- package/dist/polyfills/EncodedVideoChunk.d.ts +40 -0
- package/dist/polyfills/EncodedVideoChunk.d.ts.map +1 -0
- package/dist/polyfills/FileList.d.ts +21 -0
- package/dist/polyfills/FileList.d.ts.map +1 -0
- package/dist/polyfills/QuotaExceededError.d.ts +28 -0
- package/dist/polyfills/QuotaExceededError.d.ts.map +1 -0
- package/dist/polyfills/URL.d.ts +25 -0
- package/dist/polyfills/URL.d.ts.map +1 -0
- package/dist/polyfills/VideoFrame.d.ts +142 -0
- package/dist/polyfills/VideoFrame.d.ts.map +1 -0
- package/dist/polyfills/WebTransportError.d.ts +32 -0
- package/dist/polyfills/WebTransportError.d.ts.map +1 -0
- package/dist/polyfills/createImageBitmap.d.ts +14 -0
- package/dist/polyfills/createImageBitmap.d.ts.map +1 -0
- package/dist/polyfills/index.d.cts +3 -0
- package/dist/polyfills/index.d.cts.map +1 -0
- package/dist/polyfills/index.d.ts +16 -0
- package/dist/polyfills/index.d.ts.map +1 -0
- package/dist/presets/builtin.umd.cjs +1 -1
- package/dist/presets/builtin.umd.cjs.map +1 -1
- package/dist/presets/postmessage.d.ts.map +1 -1
- package/dist/presets/postmessage.umd.cjs.map +1 -1
- package/dist/presets/socketio.umd.cjs +1 -1
- package/dist/presets/socketio.umd.cjs.map +1 -1
- package/dist/presets/structured-cloning-throwing.umd.cjs +1 -1
- package/dist/presets/structured-cloning-throwing.umd.cjs.map +1 -1
- package/dist/presets/structured-cloning.d.ts.map +1 -1
- package/dist/presets/structured-cloning.umd.cjs +1 -1
- package/dist/presets/structured-cloning.umd.cjs.map +1 -1
- package/dist/presets/universal.umd.cjs +1 -1
- package/dist/presets/universal.umd.cjs.map +1 -1
- package/dist/types/encodedaudiochunk.d.ts +6 -0
- package/dist/types/encodedaudiochunk.d.ts.map +1 -0
- package/dist/types/encodedaudiochunk.umd.cjs +2 -0
- package/dist/types/encodedaudiochunk.umd.cjs.map +1 -0
- package/dist/types/encodedvideochunk.d.ts +6 -0
- package/dist/types/encodedvideochunk.d.ts.map +1 -0
- package/dist/types/encodedvideochunk.umd.cjs +2 -0
- package/dist/types/encodedvideochunk.umd.cjs.map +1 -0
- package/dist/types/errors.umd.cjs.map +1 -1
- package/dist/types/typed-arrays-socketio.umd.cjs +1 -1
- package/dist/types/typed-arrays-socketio.umd.cjs.map +1 -1
- package/dist/types/typed-arrays.d.ts +1 -1
- package/dist/types/typed-arrays.d.ts.map +1 -1
- package/dist/types/typed-arrays.umd.cjs +1 -1
- package/dist/types/typed-arrays.umd.cjs.map +1 -1
- package/dist/types/videoframe.d.ts +6 -0
- package/dist/types/videoframe.d.ts.map +1 -0
- package/dist/types/videoframe.umd.cjs +4 -0
- package/dist/types/videoframe.umd.cjs.map +1 -0
- package/package.json +16 -8
- package/polyfills/AudioData.js +173 -0
- package/polyfills/DOMMatrix.js +55 -0
- package/polyfills/DOMMatrixReadOnly.js +55 -0
- package/polyfills/DOMPoint.js +29 -0
- package/polyfills/DOMPointReadOnly.js +30 -0
- package/polyfills/DOMQuad.js +31 -0
- package/polyfills/DOMRect.js +31 -0
- package/polyfills/DOMRectReadOnly.js +31 -0
- package/polyfills/EncodedAudioChunk.js +74 -0
- package/polyfills/EncodedVideoChunk.js +74 -0
- package/polyfills/FileList.js +51 -0
- package/polyfills/QuotaExceededError.js +53 -0
- package/polyfills/VideoFrame.js +350 -0
- package/polyfills/WebTransportError.js +44 -0
- package/polyfills/createImageBitmap.js +22 -0
- package/polyfills/{createObjectURL.cjs → index.cjs} +1474 -4
- package/polyfills/index.cjs.map +1 -0
- package/polyfills/index.js +15 -0
- package/polyfills/createObjectURL.cjs.map +0 -1
- /package/polyfills/{createObjectURL.js → URL.js} +0 -0
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Note that our `URL.createObjectURL` polyfill expects a global
|
|
|
25
25
|
which can handle `data:` URLs). For Node, you can add it like this:
|
|
26
26
|
|
|
27
27
|
```js
|
|
28
|
-
|
|
28
|
+
import {createObjectURL} from 'typeson-registry/polyfills';
|
|
29
29
|
|
|
30
30
|
URL.createObjectURL = createObjectURL;
|
|
31
31
|
```
|
|
@@ -33,11 +33,16 @@ URL.createObjectURL = createObjectURL;
|
|
|
33
33
|
We have not added `jsdom` as a dependency, but it is required if this
|
|
34
34
|
polyfill is used.
|
|
35
35
|
|
|
36
|
+
Also exported: `QuotaExceededError`, `WebTransportError`, `AudioData`, `EncodedAudioChunk`,
|
|
37
|
+
`EncodedVideoChunk`, `VideoFrame`, `DOMRect`,
|
|
38
|
+
`DOMRectReadOnly`, `DOMPoint`, `DOMPointReadOnly`, `DOMQuad`, `DOMMatrix`, `DOMMatrixReadOnly`,
|
|
39
|
+
`createImageBitmap`, `createObjectURL`, `revokeObjectURL`, `xmlHttpRequestOverrideMimeType`
|
|
40
|
+
|
|
36
41
|
Besides the polyfills for `file` or `blob`, the `structuredCloningThrowing`
|
|
37
42
|
preset also needs a global `DOMException` polyfill.
|
|
38
43
|
|
|
39
44
|
The `filelist` type, in addition to the polyfills for `file`, will need
|
|
40
|
-
a `FileList` polyfill (including a `FileList` string tag).
|
|
45
|
+
a `FileList` polyfill (including a `FileList` string tag) like the one provided.
|
|
41
46
|
|
|
42
47
|
The `imagebitmap` type requires a global `createImageBitmap` polyfill (and
|
|
43
48
|
an `ImageBitmap` polyfill (including an `ImageBitmap` string tag).
|
|
@@ -233,6 +238,8 @@ Note that the type name corresponds to the file name in the following manner:
|
|
|
233
238
|
- `domquad`
|
|
234
239
|
- `domrect`
|
|
235
240
|
- `domrectreadonly`
|
|
241
|
+
- `encodedaudiochunk`
|
|
242
|
+
- `encodedvideochunk`
|
|
236
243
|
- `error.js` (`Error`) and `errors.js` (`TypeError`, `RangeError`, `SyntaxError`, `ReferenceError`, `EvalError`, `URIError`, `InternalError`) - These
|
|
237
244
|
provide a means of resurrecting error object across cloning boundaries
|
|
238
245
|
(since they are not otherwise treated as cloneable by the Structured
|
|
@@ -276,6 +283,9 @@ Note that the type name corresponds to the file name in the following manner:
|
|
|
276
283
|
- `userObjects` - Allows for inherited objects but ensures the prototype chain
|
|
277
284
|
inherits from `Object` (or `null`). Should be low priority if one is
|
|
278
285
|
matching other objects as it will readily match many objects.
|
|
286
|
+
- `videoframe` - Reconstructs a `VideoFrame` from its raw pixel data (via
|
|
287
|
+
`allocationSize`/`copyTo`); has an async encapsulation only, as
|
|
288
|
+
`VideoFrame#copyTo` is itself asynchronous.
|
|
279
289
|
- `webtransporterror`
|
|
280
290
|
|
|
281
291
|
### Presets
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../index.cts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,SAAS,KAAK,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ import dommatrix from './types/dommatrix.js';
|
|
|
13
13
|
import dompoint from './types/dompoint.js';
|
|
14
14
|
import domquad from './types/domquad.js';
|
|
15
15
|
import domrect from './types/domrect.js';
|
|
16
|
+
import encodedaudiochunk from './types/encodedaudiochunk.js';
|
|
17
|
+
import encodedvideochunk from './types/encodedvideochunk.js';
|
|
16
18
|
import error from './types/error.js';
|
|
17
19
|
import errors from './types/errors.js';
|
|
18
20
|
import file from './types/file.js';
|
|
@@ -37,6 +39,7 @@ import typedArraysSocketio from './types/typed-arrays-socketio.js';
|
|
|
37
39
|
import typedArrays from './types/typed-arrays.js';
|
|
38
40
|
import undef from './types/undef.js';
|
|
39
41
|
import userObject from './types/user-object.js';
|
|
42
|
+
import videoframe from './types/videoframe.js';
|
|
40
43
|
import webtransporterror from './types/webtransporterror.js';
|
|
41
44
|
import arrayNonindexKeys from './presets/array-nonindex-keys.js';
|
|
42
45
|
import builtin from './presets/builtin.js';
|
|
@@ -48,5 +51,5 @@ import structuredCloningThrowing from './presets/structured-cloning-throwing.js'
|
|
|
48
51
|
import structuredCloning from './presets/structured-cloning.js';
|
|
49
52
|
import undefPreset from './presets/undef.js';
|
|
50
53
|
import universal from './presets/universal.js';
|
|
51
|
-
export { arraybuffer, audiodata, bigintObject, bigint, blob, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, error, errors, file, filelist, imagebitmap, imagedata, infinity, intlTypes, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, primitiveObjects, promise, quotaexceedederror, regexp, resurrectable, set, symbol, typedArraysSocketio, typedArrays, undef, userObject, webtransporterror, arrayNonindexKeys, builtin, postmessage, socketio, sparseUndefined, specialNumbers, structuredCloningThrowing, structuredCloning, undefPreset, universal };
|
|
54
|
+
export { arraybuffer, audiodata, bigintObject, bigint, blob, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, encodedaudiochunk, encodedvideochunk, error, errors, file, filelist, imagebitmap, imagedata, infinity, intlTypes, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, primitiveObjects, promise, quotaexceedederror, regexp, resurrectable, set, symbol, typedArraysSocketio, typedArrays, undef, userObject, videoframe, webtransporterror, arrayNonindexKeys, builtin, postmessage, socketio, sparseUndefined, specialNumbers, structuredCloningThrowing, structuredCloning, undefPreset, universal };
|
|
52
55
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":";wBAGwB,wBAAwB;sBAC1B,sBAAsB;yBACnB,0BAA0B;mBAChC,mBAAmB;iBACrB,iBAAiB;sBACZ,sBAAsB;sBACtB,sBAAsB;qBACvB,qBAAqB;iBACzB,iBAAiB;yBACT,yBAAyB;sBAC5B,sBAAsB;qBACvB,qBAAqB;oBACtB,oBAAoB;oBACpB,oBAAoB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":";wBAGwB,wBAAwB;sBAC1B,sBAAsB;yBACnB,0BAA0B;mBAChC,mBAAmB;iBACrB,iBAAiB;sBACZ,sBAAsB;sBACtB,sBAAsB;qBACvB,qBAAqB;iBACzB,iBAAiB;yBACT,yBAAyB;sBAC5B,sBAAsB;qBACvB,qBAAqB;oBACtB,oBAAoB;oBACpB,oBAAoB;8BACV,8BAA8B;8BAC9B,8BAA8B;kBAC1C,kBAAkB;mBACjB,mBAAmB;iBACrB,iBAAiB;qBACb,qBAAqB;wBAClB,wBAAwB;sBAC1B,sBAAsB;qBACvB,qBAAqB;sBACpB,uBAAuB;gBAC7B,gBAAgB;gBAChB,gBAAgB;6BACH,8BAA8B;yBAClC,0BAA0B;6BACtB,8BAA8B;6BAC9B,8BAA8B;oBACvC,oBAAoB;+BACT,+BAA+B;mBAC3C,mBAAmB;0BACZ,0BAA0B;gBACpC,gBAAgB;mBACb,mBAAmB;gCACN,kCAAkC;wBAC1C,yBAAyB;kBAC/B,kBAAkB;uBACb,wBAAwB;uBACxB,uBAAuB;8BAChB,8BAA8B;8BAG9B,kCAAkC;oBAC5C,sBAAsB;wBAClB,0BAA0B;qBAC7B,uBAAuB;4BAChB,+BAA+B;2BAChC,8BAA8B;sCAErD,0CAA0C;8BAChB,iCAAiC;wBACvC,oBAAoB;sBACtB,wBAAwB"}
|
package/dist/index.js
CHANGED
|
@@ -747,6 +747,54 @@ function create$3 (Ctor) {
|
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
749
|
|
|
750
|
+
/* globals EncodedAudioChunk -- Polyfills */
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* @type {import('typeson').TypeSpecSet}
|
|
754
|
+
*/
|
|
755
|
+
const encodedaudiochunk = {
|
|
756
|
+
encodedaudiochunk: {
|
|
757
|
+
test (x) {
|
|
758
|
+
return toStringTag(x) === 'EncodedAudioChunk';
|
|
759
|
+
},
|
|
760
|
+
replace (chunk) {
|
|
761
|
+
const {type, timestamp, duration, byteLength} = chunk;
|
|
762
|
+
const data = new ArrayBuffer(byteLength);
|
|
763
|
+
chunk.copyTo(data);
|
|
764
|
+
return {type, timestamp, duration, data};
|
|
765
|
+
},
|
|
766
|
+
revive ({type, timestamp, duration, data}) {
|
|
767
|
+
return new EncodedAudioChunk({
|
|
768
|
+
type, timestamp, duration, data: new Uint8Array(data)
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
/* globals EncodedVideoChunk -- Polyfills */
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* @type {import('typeson').TypeSpecSet}
|
|
778
|
+
*/
|
|
779
|
+
const encodedvideochunk = {
|
|
780
|
+
encodedvideochunk: {
|
|
781
|
+
test (x) {
|
|
782
|
+
return toStringTag(x) === 'EncodedVideoChunk';
|
|
783
|
+
},
|
|
784
|
+
replace (chunk) {
|
|
785
|
+
const {type, timestamp, duration, byteLength} = chunk;
|
|
786
|
+
const data = new ArrayBuffer(byteLength);
|
|
787
|
+
chunk.copyTo(data);
|
|
788
|
+
return {type, timestamp, duration, data};
|
|
789
|
+
},
|
|
790
|
+
revive ({type, timestamp, duration, data}) {
|
|
791
|
+
return new EncodedVideoChunk({
|
|
792
|
+
type, timestamp, duration, data: new Uint8Array(data)
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
|
|
750
798
|
/**
|
|
751
799
|
* @type {import('typeson').TypeSpecSet}
|
|
752
800
|
*/
|
|
@@ -821,10 +869,10 @@ if (typeof InternalError === 'function') {
|
|
|
821
869
|
|
|
822
870
|
/**
|
|
823
871
|
* Comprises all built-in errors.
|
|
824
|
-
* @param {TypeErrorConstructor|RangeErrorConstructor
|
|
825
|
-
* SyntaxErrorConstructor|ReferenceErrorConstructor
|
|
826
|
-
* EvalErrorConstructor|URIErrorConstructor
|
|
827
|
-
* AggregateErrorConstructor|InternalErrorConstructor
|
|
872
|
+
* @param {TypeErrorConstructor|RangeErrorConstructor
|
|
873
|
+
* |SyntaxErrorConstructor|ReferenceErrorConstructor
|
|
874
|
+
* |EvalErrorConstructor|URIErrorConstructor
|
|
875
|
+
* |AggregateErrorConstructor|InternalErrorConstructor
|
|
828
876
|
* } Ctor
|
|
829
877
|
* @returns {void}
|
|
830
878
|
*/
|
|
@@ -1419,12 +1467,12 @@ const symbol = {
|
|
|
1419
1467
|
const typedArraysSocketIO = {};
|
|
1420
1468
|
|
|
1421
1469
|
/**
|
|
1422
|
-
* @param {Int8ArrayConstructor|Uint8ArrayConstructor
|
|
1423
|
-
* Uint8ClampedArrayConstructor|Int16ArrayConstructor
|
|
1424
|
-
* Uint16ArrayConstructor|Int32ArrayConstructor
|
|
1425
|
-
* Uint32ArrayConstructor|Float32ArrayConstructor
|
|
1426
|
-
* Float64ArrayConstructor|
|
|
1427
|
-
* BigInt64ArrayConstructor|BigUint64ArrayConstructor
|
|
1470
|
+
* @param {Int8ArrayConstructor|Uint8ArrayConstructor
|
|
1471
|
+
* |Uint8ClampedArrayConstructor|Int16ArrayConstructor
|
|
1472
|
+
* |Uint16ArrayConstructor|Int32ArrayConstructor
|
|
1473
|
+
* |Uint32ArrayConstructor|Float32ArrayConstructor
|
|
1474
|
+
* |Float64ArrayConstructor|Float16ArrayConstructor
|
|
1475
|
+
* |BigInt64ArrayConstructor|BigUint64ArrayConstructor
|
|
1428
1476
|
* } TypedArray
|
|
1429
1477
|
* @returns {void}
|
|
1430
1478
|
*/
|
|
@@ -1473,6 +1521,10 @@ if (typeof Int8Array === 'function') {
|
|
|
1473
1521
|
...(typeof BigInt64Array === 'function'
|
|
1474
1522
|
? [BigInt64Array, BigUint64Array]
|
|
1475
1523
|
/* c8 ignore next */
|
|
1524
|
+
: []),
|
|
1525
|
+
...(typeof Float16Array === 'function'
|
|
1526
|
+
? [Float16Array]
|
|
1527
|
+
/* c8 ignore next */
|
|
1476
1528
|
: [])
|
|
1477
1529
|
].forEach((TypedArray) => create$1(TypedArray));
|
|
1478
1530
|
}
|
|
@@ -1483,13 +1535,14 @@ if (typeof Int8Array === 'function') {
|
|
|
1483
1535
|
const typedArrays = {};
|
|
1484
1536
|
|
|
1485
1537
|
/**
|
|
1486
|
-
* @typedef {Int8ArrayConstructor|Uint8ArrayConstructor
|
|
1487
|
-
* Uint8ClampedArrayConstructor
|
|
1488
|
-
* Int16ArrayConstructor|Uint16ArrayConstructor
|
|
1489
|
-
* Int32ArrayConstructor|Uint32ArrayConstructor
|
|
1490
|
-
* Float32ArrayConstructor
|
|
1491
|
-
* Float64ArrayConstructor
|
|
1492
|
-
* BigInt64ArrayConstructor|BigUint64ArrayConstructor
|
|
1538
|
+
* @typedef {Int8ArrayConstructor|Uint8ArrayConstructor
|
|
1539
|
+
* |Uint8ClampedArrayConstructor
|
|
1540
|
+
* |Int16ArrayConstructor|Uint16ArrayConstructor
|
|
1541
|
+
* |Int32ArrayConstructor|Uint32ArrayConstructor
|
|
1542
|
+
* |Float32ArrayConstructor
|
|
1543
|
+
* |Float64ArrayConstructor
|
|
1544
|
+
* |BigInt64ArrayConstructor|BigUint64ArrayConstructor
|
|
1545
|
+
* |Float16ArrayConstructor} TypedArrayConstructor
|
|
1493
1546
|
*/
|
|
1494
1547
|
|
|
1495
1548
|
/**
|
|
@@ -1576,6 +1629,10 @@ if (typeof Int8Array === 'function') {
|
|
|
1576
1629
|
...(typeof BigInt64Array === 'function'
|
|
1577
1630
|
? [BigInt64Array, BigUint64Array]
|
|
1578
1631
|
/* c8 ignore next */
|
|
1632
|
+
: []),
|
|
1633
|
+
...(typeof Float16Array === 'function'
|
|
1634
|
+
? [Float16Array]
|
|
1635
|
+
/* c8 ignore next */
|
|
1579
1636
|
: [])
|
|
1580
1637
|
].forEach((TypedArray) => create(TypedArray));
|
|
1581
1638
|
}
|
|
@@ -1612,6 +1669,62 @@ const userObject = {
|
|
|
1612
1669
|
}
|
|
1613
1670
|
};
|
|
1614
1671
|
|
|
1672
|
+
/* globals VideoFrame -- Polyfills */
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* @type {import('typeson').TypeSpecSet}
|
|
1676
|
+
*/
|
|
1677
|
+
const videoframe = {
|
|
1678
|
+
videoframe: {
|
|
1679
|
+
test (x) {
|
|
1680
|
+
return toStringTag(x) === 'VideoFrame';
|
|
1681
|
+
},
|
|
1682
|
+
replaceAsync (frame) {
|
|
1683
|
+
return new TypesonPromise(async (resolve, reject) => {
|
|
1684
|
+
try {
|
|
1685
|
+
const {
|
|
1686
|
+
format, codedWidth, codedHeight, timestamp, duration,
|
|
1687
|
+
visibleRect, displayWidth, displayHeight, colorSpace
|
|
1688
|
+
} = frame;
|
|
1689
|
+
|
|
1690
|
+
const data = new ArrayBuffer(frame.allocationSize());
|
|
1691
|
+
await frame.copyTo(data);
|
|
1692
|
+
|
|
1693
|
+
resolve({
|
|
1694
|
+
format, codedWidth, codedHeight, timestamp, duration,
|
|
1695
|
+
visibleRect: {
|
|
1696
|
+
x: visibleRect.x,
|
|
1697
|
+
y: visibleRect.y,
|
|
1698
|
+
width: visibleRect.width,
|
|
1699
|
+
height: visibleRect.height
|
|
1700
|
+
},
|
|
1701
|
+
displayWidth, displayHeight,
|
|
1702
|
+
colorSpace: {
|
|
1703
|
+
primaries: colorSpace.primaries,
|
|
1704
|
+
transfer: colorSpace.transfer,
|
|
1705
|
+
matrix: colorSpace.matrix,
|
|
1706
|
+
fullRange: colorSpace.fullRange
|
|
1707
|
+
},
|
|
1708
|
+
data
|
|
1709
|
+
});
|
|
1710
|
+
/* c8 ignore next 3 -- How to simulate? */
|
|
1711
|
+
} catch (err) {
|
|
1712
|
+
reject(err);
|
|
1713
|
+
}
|
|
1714
|
+
});
|
|
1715
|
+
},
|
|
1716
|
+
revive ({
|
|
1717
|
+
format, codedWidth, codedHeight, timestamp, duration,
|
|
1718
|
+
visibleRect, displayWidth, displayHeight, colorSpace, data
|
|
1719
|
+
}) {
|
|
1720
|
+
return new VideoFrame(new Uint8Array(data), {
|
|
1721
|
+
format, codedWidth, codedHeight, timestamp, duration,
|
|
1722
|
+
visibleRect, displayWidth, displayHeight, colorSpace
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
};
|
|
1727
|
+
|
|
1615
1728
|
/* globals WebTransportError -- Newer API */
|
|
1616
1729
|
|
|
1617
1730
|
/**
|
|
@@ -1763,8 +1876,9 @@ clone algorithm). This algorithm supports all built-in types as well as many
|
|
|
1763
1876
|
DOM types. Therefore, only types that are not included in the structured clone
|
|
1764
1877
|
algorithm need to be registered, which is:
|
|
1765
1878
|
|
|
1766
|
-
* Error
|
|
1767
|
-
* Specific Errors like SyntaxError, TypeError, etc.
|
|
1879
|
+
* Error (now included in structured cloning)
|
|
1880
|
+
* Specific Errors like SyntaxError, TypeError, etc. (now included in structured
|
|
1881
|
+
* cloning)
|
|
1768
1882
|
* Any custom type you want to send across window- or worker boundraries
|
|
1769
1883
|
|
|
1770
1884
|
This preset will only include the Error types and you can register your
|
|
@@ -1869,7 +1983,13 @@ const expObj = [
|
|
|
1869
1983
|
/* c8 ignore next */
|
|
1870
1984
|
typeof DOMMatrix !== 'undefined' ? dommatrix : [],
|
|
1871
1985
|
/* c8 ignore next */
|
|
1872
|
-
typeof AudioData !== 'undefined' ? audiodata : []
|
|
1986
|
+
typeof AudioData !== 'undefined' ? audiodata : [],
|
|
1987
|
+
/* c8 ignore next */
|
|
1988
|
+
typeof EncodedAudioChunk !== 'undefined' ? encodedaudiochunk : [],
|
|
1989
|
+
/* c8 ignore next */
|
|
1990
|
+
typeof EncodedVideoChunk !== 'undefined' ? encodedvideochunk : [],
|
|
1991
|
+
/* c8 ignore next */
|
|
1992
|
+
typeof VideoFrame !== 'undefined' ? videoframe : []
|
|
1873
1993
|
);
|
|
1874
1994
|
|
|
1875
1995
|
/**
|
|
@@ -2007,5 +2127,5 @@ const universal = [
|
|
|
2007
2127
|
// built-in into ecmasript standard.
|
|
2008
2128
|
];
|
|
2009
2129
|
|
|
2010
|
-
export { i$1 as JSON_TYPES, Typeson, TypesonPromise, Undefined, arrayNonindexKeys, arraybuffer, audiodata, bigint, bigintObject, blob, expObj$1 as builtin, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, error, errors, escapeKeyPathComponent, file, filelist, getByKeyPath, getJSONType, hasConstructorOf, imagebitmap, imagedata, infinity, intlTypes, isObject, isPlainObject, isThenable, isUserObject, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, postmessage, primitiveObjects, promise, quotaexceedederror, regexp, resurrectable, set, setAtKeyPath, socketio, sparseUndefined, specialNumbers, expObj as structuredCloning, structuredCloningThrowing, symbol, toStringTag, typedArrays, typedArraysSocketIO as typedArraysSocketio, undef$1 as undef, undef as undefPreset, unescapeKeyPathComponent, universal, userObject, webtransporterror };
|
|
2130
|
+
export { i$1 as JSON_TYPES, Typeson, TypesonPromise, Undefined, arrayNonindexKeys, arraybuffer, audiodata, bigint, bigintObject, blob, expObj$1 as builtin, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, encodedaudiochunk, encodedvideochunk, error, errors, escapeKeyPathComponent, file, filelist, getByKeyPath, getJSONType, hasConstructorOf, imagebitmap, imagedata, infinity, intlTypes, isObject, isPlainObject, isThenable, isUserObject, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, postmessage, primitiveObjects, promise, quotaexceedederror, regexp, resurrectable, set, setAtKeyPath, socketio, sparseUndefined, specialNumbers, expObj as structuredCloning, structuredCloningThrowing, symbol, toStringTag, typedArrays, typedArraysSocketIO as typedArraysSocketio, undef$1 as undef, undef as undefPreset, unescapeKeyPathComponent, universal, userObject, videoframe, webtransporterror };
|
|
2011
2131
|
//# sourceMappingURL=index.js.map
|