@js-toolkit/web-utils 1.51.0 → 1.51.1
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.
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
declare global {
|
|
2
|
+
interface ManagedMediaSourceEventMap extends MediaSourceEventMap {
|
|
3
|
+
startstreaming: Event;
|
|
4
|
+
endstreaming: Event;
|
|
5
|
+
}
|
|
6
|
+
interface ManagedMediaSource extends MediaSource {
|
|
7
|
+
readonly streaming: boolean;
|
|
8
|
+
onstartstreaming: ((this: ManagedMediaSource, ev: Event) => any) | null;
|
|
9
|
+
onendstreaming: ((this: ManagedMediaSource, ev: Event) => any) | null;
|
|
10
|
+
addEventListener<K extends keyof ManagedMediaSourceEventMap>(type: K, listener: (this: MediaSource, ev: ManagedMediaSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
11
|
+
removeEventListener<K extends keyof ManagedMediaSourceEventMap>(type: K, listener: (this: MediaSource, ev: ManagedMediaSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
12
|
+
}
|
|
2
13
|
interface Window {
|
|
3
14
|
WebKitMediaSource?: typeof MediaSource;
|
|
15
|
+
ManagedMediaSource?: ManagedMediaSource;
|
|
4
16
|
}
|
|
5
17
|
}
|
|
6
18
|
export declare function getMediaSource(): typeof MediaSource | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@js-toolkit/web-utils",
|
|
3
|
-
"version": "1.51.
|
|
3
|
+
"version": "1.51.1",
|
|
4
4
|
"description": "Web utils",
|
|
5
5
|
"author": "VZH",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@js-toolkit/configs": "^3.90.0",
|
|
24
|
-
"@js-toolkit/utils": "^1.
|
|
24
|
+
"@js-toolkit/utils": "^1.51.0",
|
|
25
25
|
"@types/uuid": "^9.0.7",
|
|
26
|
-
"@typescript-eslint/eslint-plugin": "^6.19.
|
|
27
|
-
"@typescript-eslint/parser": "^6.19.
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
|
27
|
+
"@typescript-eslint/parser": "^6.19.1",
|
|
28
28
|
"copyfiles": "^2.4.1",
|
|
29
29
|
"eslint": "^8.56.0",
|
|
30
30
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typescript": "^5.3.3",
|
|
40
40
|
"ua-parser-js": "^2.0.0-beta.1",
|
|
41
41
|
"uuid": "^9.0.1",
|
|
42
|
-
"webpack": "^5.
|
|
42
|
+
"webpack": "^5.90.0",
|
|
43
43
|
"yargs": "^17.7.2"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="ua-parser-js/src/main/ua-parser" />
|
|
2
2
|
type PlatformInfo = DeepReadonly<OmitStrict<UAParser.IResult, 'withClientHints' | 'withFeatureCheck'>> & {
|
|
3
3
|
toStringObject(): Record<Keys<ExcludeKeysOfType<UAParser.IResult, AnyFunction>>, string>;
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter}from"tslib";import{UAParser}from"ua-parser-js";
|
|
1
|
+
import{__awaiter}from"tslib";import{UAParser}from"ua-parser-js";let result,promise;export function getPlatformInfo(){return __awaiter(this,void 0,void 0,(function*(){return null==result&&(promise=null!=promise?promise:Promise.resolve(new UAParser(navigator.userAgent).getResult().withFeatureCheck().withClientHints()),result=Object.assign(Object.assign({},yield promise),{toStringObject(){return Object.getOwnPropertyNames(this).reduce(((t,e)=>{const r=e;return null!=this[r]&&"function"!=typeof this[r]&&(t[r]=this[r].toString()),t}),{})}}),promise=void 0),result}))}export function getCachedPlatformInfo(){return null==result&&(console.warn("PlatformInfo is not ready yet."),getPlatformInfo()),result}
|