typeson-registry 13.3.0 → 14.0.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 +115 -4
- 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 +174 -3
- 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/postmessage.d.ts.map +1 -1
- package/dist/presets/postmessage.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/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/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/dist/index.umd.cjs
CHANGED
|
@@ -1769,6 +1769,84 @@
|
|
|
1769
1769
|
};
|
|
1770
1770
|
}
|
|
1771
1771
|
|
|
1772
|
+
/* globals EncodedAudioChunk -- Polyfills */
|
|
1773
|
+
|
|
1774
|
+
/**
|
|
1775
|
+
* @type {import('typeson').TypeSpecSet}
|
|
1776
|
+
*/
|
|
1777
|
+
var encodedaudiochunk = {
|
|
1778
|
+
encodedaudiochunk: {
|
|
1779
|
+
test: function test(x) {
|
|
1780
|
+
return toStringTag(x) === 'EncodedAudioChunk';
|
|
1781
|
+
},
|
|
1782
|
+
replace: function replace(chunk) {
|
|
1783
|
+
var type = chunk.type,
|
|
1784
|
+
timestamp = chunk.timestamp,
|
|
1785
|
+
duration = chunk.duration,
|
|
1786
|
+
byteLength = chunk.byteLength;
|
|
1787
|
+
var data = new ArrayBuffer(byteLength);
|
|
1788
|
+
chunk.copyTo(data);
|
|
1789
|
+
return {
|
|
1790
|
+
type: type,
|
|
1791
|
+
timestamp: timestamp,
|
|
1792
|
+
duration: duration,
|
|
1793
|
+
data: data
|
|
1794
|
+
};
|
|
1795
|
+
},
|
|
1796
|
+
revive: function revive(_ref) {
|
|
1797
|
+
var type = _ref.type,
|
|
1798
|
+
timestamp = _ref.timestamp,
|
|
1799
|
+
duration = _ref.duration,
|
|
1800
|
+
data = _ref.data;
|
|
1801
|
+
return new EncodedAudioChunk({
|
|
1802
|
+
type: type,
|
|
1803
|
+
timestamp: timestamp,
|
|
1804
|
+
duration: duration,
|
|
1805
|
+
data: new Uint8Array(data)
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
};
|
|
1810
|
+
|
|
1811
|
+
/* globals EncodedVideoChunk -- Polyfills */
|
|
1812
|
+
|
|
1813
|
+
/**
|
|
1814
|
+
* @type {import('typeson').TypeSpecSet}
|
|
1815
|
+
*/
|
|
1816
|
+
var encodedvideochunk = {
|
|
1817
|
+
encodedvideochunk: {
|
|
1818
|
+
test: function test(x) {
|
|
1819
|
+
return toStringTag(x) === 'EncodedVideoChunk';
|
|
1820
|
+
},
|
|
1821
|
+
replace: function replace(chunk) {
|
|
1822
|
+
var type = chunk.type,
|
|
1823
|
+
timestamp = chunk.timestamp,
|
|
1824
|
+
duration = chunk.duration,
|
|
1825
|
+
byteLength = chunk.byteLength;
|
|
1826
|
+
var data = new ArrayBuffer(byteLength);
|
|
1827
|
+
chunk.copyTo(data);
|
|
1828
|
+
return {
|
|
1829
|
+
type: type,
|
|
1830
|
+
timestamp: timestamp,
|
|
1831
|
+
duration: duration,
|
|
1832
|
+
data: data
|
|
1833
|
+
};
|
|
1834
|
+
},
|
|
1835
|
+
revive: function revive(_ref) {
|
|
1836
|
+
var type = _ref.type,
|
|
1837
|
+
timestamp = _ref.timestamp,
|
|
1838
|
+
duration = _ref.duration,
|
|
1839
|
+
data = _ref.data;
|
|
1840
|
+
return new EncodedVideoChunk({
|
|
1841
|
+
type: type,
|
|
1842
|
+
timestamp: timestamp,
|
|
1843
|
+
duration: duration,
|
|
1844
|
+
data: new Uint8Array(data)
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1849
|
+
|
|
1772
1850
|
/**
|
|
1773
1851
|
* @type {import('typeson').TypeSpecSet}
|
|
1774
1852
|
*/
|
|
@@ -2703,6 +2781,92 @@
|
|
|
2703
2781
|
}
|
|
2704
2782
|
};
|
|
2705
2783
|
|
|
2784
|
+
/**
|
|
2785
|
+
* @type {import('typeson').TypeSpecSet}
|
|
2786
|
+
*/
|
|
2787
|
+
var videoframe = {
|
|
2788
|
+
videoframe: {
|
|
2789
|
+
test: function test(x) {
|
|
2790
|
+
return toStringTag(x) === 'VideoFrame';
|
|
2791
|
+
},
|
|
2792
|
+
replaceAsync: function replaceAsync(frame) {
|
|
2793
|
+
return new TypesonPromise(/*#__PURE__*/function () {
|
|
2794
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(resolve, reject) {
|
|
2795
|
+
var format, codedWidth, codedHeight, timestamp, duration, visibleRect, displayWidth, displayHeight, colorSpace, data, _t;
|
|
2796
|
+
return _regenerator().w(function (_context) {
|
|
2797
|
+
while (1) switch (_context.p = _context.n) {
|
|
2798
|
+
case 0:
|
|
2799
|
+
_context.p = 0;
|
|
2800
|
+
format = frame.format, codedWidth = frame.codedWidth, codedHeight = frame.codedHeight, timestamp = frame.timestamp, duration = frame.duration, visibleRect = frame.visibleRect, displayWidth = frame.displayWidth, displayHeight = frame.displayHeight, colorSpace = frame.colorSpace;
|
|
2801
|
+
data = new ArrayBuffer(frame.allocationSize());
|
|
2802
|
+
_context.n = 1;
|
|
2803
|
+
return frame.copyTo(data);
|
|
2804
|
+
case 1:
|
|
2805
|
+
resolve({
|
|
2806
|
+
format: format,
|
|
2807
|
+
codedWidth: codedWidth,
|
|
2808
|
+
codedHeight: codedHeight,
|
|
2809
|
+
timestamp: timestamp,
|
|
2810
|
+
duration: duration,
|
|
2811
|
+
visibleRect: {
|
|
2812
|
+
x: visibleRect.x,
|
|
2813
|
+
y: visibleRect.y,
|
|
2814
|
+
width: visibleRect.width,
|
|
2815
|
+
height: visibleRect.height
|
|
2816
|
+
},
|
|
2817
|
+
displayWidth: displayWidth,
|
|
2818
|
+
displayHeight: displayHeight,
|
|
2819
|
+
colorSpace: {
|
|
2820
|
+
primaries: colorSpace.primaries,
|
|
2821
|
+
transfer: colorSpace.transfer,
|
|
2822
|
+
matrix: colorSpace.matrix,
|
|
2823
|
+
fullRange: colorSpace.fullRange
|
|
2824
|
+
},
|
|
2825
|
+
data: data
|
|
2826
|
+
});
|
|
2827
|
+
/* c8 ignore next 3 -- How to simulate? */
|
|
2828
|
+
_context.n = 3;
|
|
2829
|
+
break;
|
|
2830
|
+
case 2:
|
|
2831
|
+
_context.p = 2;
|
|
2832
|
+
_t = _context.v;
|
|
2833
|
+
reject(_t);
|
|
2834
|
+
case 3:
|
|
2835
|
+
return _context.a(2);
|
|
2836
|
+
}
|
|
2837
|
+
}, _callee, null, [[0, 2]]);
|
|
2838
|
+
}));
|
|
2839
|
+
return function (_x, _x2) {
|
|
2840
|
+
return _ref.apply(this, arguments);
|
|
2841
|
+
};
|
|
2842
|
+
}());
|
|
2843
|
+
},
|
|
2844
|
+
revive: function revive(_ref2) {
|
|
2845
|
+
var format = _ref2.format,
|
|
2846
|
+
codedWidth = _ref2.codedWidth,
|
|
2847
|
+
codedHeight = _ref2.codedHeight,
|
|
2848
|
+
timestamp = _ref2.timestamp,
|
|
2849
|
+
duration = _ref2.duration,
|
|
2850
|
+
visibleRect = _ref2.visibleRect,
|
|
2851
|
+
displayWidth = _ref2.displayWidth,
|
|
2852
|
+
displayHeight = _ref2.displayHeight,
|
|
2853
|
+
colorSpace = _ref2.colorSpace,
|
|
2854
|
+
data = _ref2.data;
|
|
2855
|
+
return new VideoFrame(new Uint8Array(data), {
|
|
2856
|
+
format: format,
|
|
2857
|
+
codedWidth: codedWidth,
|
|
2858
|
+
codedHeight: codedHeight,
|
|
2859
|
+
timestamp: timestamp,
|
|
2860
|
+
duration: duration,
|
|
2861
|
+
visibleRect: visibleRect,
|
|
2862
|
+
displayWidth: displayWidth,
|
|
2863
|
+
displayHeight: displayHeight,
|
|
2864
|
+
colorSpace: colorSpace
|
|
2865
|
+
});
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
};
|
|
2869
|
+
|
|
2706
2870
|
/* globals WebTransportError -- Newer API */
|
|
2707
2871
|
|
|
2708
2872
|
/**
|
|
@@ -2853,8 +3017,9 @@
|
|
|
2853
3017
|
DOM types. Therefore, only types that are not included in the structured clone
|
|
2854
3018
|
algorithm need to be registered, which is:
|
|
2855
3019
|
|
|
2856
|
-
* Error
|
|
2857
|
-
* Specific Errors like SyntaxError, TypeError, etc.
|
|
3020
|
+
* Error (now included in structured cloning)
|
|
3021
|
+
* Specific Errors like SyntaxError, TypeError, etc. (now included in structured
|
|
3022
|
+
* cloning)
|
|
2858
3023
|
* Any custom type you want to send across window- or worker boundraries
|
|
2859
3024
|
|
|
2860
3025
|
This preset will only include the Error types and you can register your
|
|
@@ -2938,7 +3103,10 @@
|
|
|
2938
3103
|
typeof DOMPoint !== 'undefined' ? dompoint : [], /* c8 ignore next */
|
|
2939
3104
|
typeof DOMQuad !== 'undefined' ? domquad : [], /* c8 ignore next */
|
|
2940
3105
|
typeof DOMMatrix !== 'undefined' ? dommatrix : [], /* c8 ignore next */
|
|
2941
|
-
typeof AudioData !== 'undefined' ? audiodata : []
|
|
3106
|
+
typeof AudioData !== 'undefined' ? audiodata : [], /* c8 ignore next */
|
|
3107
|
+
typeof EncodedAudioChunk !== 'undefined' ? encodedaudiochunk : [], /* c8 ignore next */
|
|
3108
|
+
typeof EncodedVideoChunk !== 'undefined' ? encodedvideochunk : [], /* c8 ignore next */
|
|
3109
|
+
typeof VideoFrame !== 'undefined' ? videoframe : []);
|
|
2942
3110
|
|
|
2943
3111
|
/**
|
|
2944
3112
|
* @param {BufferSource} buffer
|
|
@@ -3067,6 +3235,8 @@
|
|
|
3067
3235
|
exports.dompoint = dompoint;
|
|
3068
3236
|
exports.domquad = domquad;
|
|
3069
3237
|
exports.domrect = domrect;
|
|
3238
|
+
exports.encodedaudiochunk = encodedaudiochunk;
|
|
3239
|
+
exports.encodedvideochunk = encodedvideochunk;
|
|
3070
3240
|
exports.error = error;
|
|
3071
3241
|
exports.errors = errors;
|
|
3072
3242
|
exports.escapeKeyPathComponent = escapeKeyPathComponent;
|
|
@@ -3110,6 +3280,7 @@
|
|
|
3110
3280
|
exports.unescapeKeyPathComponent = unescapeKeyPathComponent;
|
|
3111
3281
|
exports.universal = universal;
|
|
3112
3282
|
exports.userObject = userObject;
|
|
3283
|
+
exports.videoframe = videoframe;
|
|
3113
3284
|
exports.webtransporterror = webtransporterror;
|
|
3114
3285
|
|
|
3115
3286
|
}));
|