Skip to content

Commit 5c1219f

Browse files
committed
chore(types): reduce redundant override-type in webcrypto
1 parent 335a660 commit 5c1219f

File tree

5 files changed

+23
-89
lines changed

5 files changed

+23
-89
lines changed

baselines/dom.generated.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ interface AddressErrors {
2222
}
2323

2424
interface AesCbcParams extends Algorithm {
25-
iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
25+
iv: BufferSource;
2626
}
2727

2828
interface AesCtrParams extends Algorithm {
29-
counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
29+
counter: BufferSource;
3030
length: number;
3131
}
3232

@@ -35,8 +35,8 @@ interface AesDerivedKeyParams extends Algorithm {
3535
}
3636

3737
interface AesGcmParams extends Algorithm {
38-
additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
39-
iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
38+
additionalData?: BufferSource;
39+
iv: BufferSource;
4040
tagLength?: number;
4141
}
4242

@@ -523,8 +523,8 @@ interface HashChangeEventInit extends EventInit {
523523

524524
interface HkdfParams extends Algorithm {
525525
hash: HashAlgorithmIdentifier;
526-
info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
527-
salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
526+
info: BufferSource;
527+
salt: BufferSource;
528528
}
529529

530530
interface HmacImportParams extends Algorithm {
@@ -1046,7 +1046,7 @@ interface PaymentValidationErrors {
10461046
interface Pbkdf2Params extends Algorithm {
10471047
hash: HashAlgorithmIdentifier;
10481048
iterations: number;
1049-
salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
1049+
salt: BufferSource;
10501050
}
10511051

10521052
interface PerformanceMarkOptions {
@@ -1545,7 +1545,7 @@ interface RsaKeyGenParams extends Algorithm {
15451545
}
15461546

15471547
interface RsaOaepParams extends Algorithm {
1548-
label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
1548+
label?: BufferSource;
15491549
}
15501550

15511551
interface RsaOtherPrimesInfo {
@@ -18307,7 +18307,7 @@ declare function addEventListener<K extends keyof WindowEventMap>(type: K, liste
1830718307
declare function addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
1830818308
declare function removeEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1830918309
declare function removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
18310-
type AlgorithmIdentifier = string | Algorithm;
18310+
type AlgorithmIdentifier = Algorithm | string;
1831118311
type BigInteger = Uint8Array;
1831218312
type BinaryData = ArrayBuffer | ArrayBufferView;
1831318313
type BlobPart = BufferSource | Blob | string;

baselines/webworker.generated.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ interface AddEventListenerOptions extends EventListenerOptions {
99
}
1010

1111
interface AesCbcParams extends Algorithm {
12-
iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
12+
iv: BufferSource;
1313
}
1414

1515
interface AesCtrParams extends Algorithm {
16-
counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
16+
counter: BufferSource;
1717
length: number;
1818
}
1919

@@ -22,8 +22,8 @@ interface AesDerivedKeyParams extends Algorithm {
2222
}
2323

2424
interface AesGcmParams extends Algorithm {
25-
additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
26-
iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
25+
additionalData?: BufferSource;
26+
iv: BufferSource;
2727
tagLength?: number;
2828
}
2929

@@ -215,8 +215,8 @@ interface GetNotificationOptions {
215215

216216
interface HkdfParams extends Algorithm {
217217
hash: HashAlgorithmIdentifier;
218-
info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
219-
salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
218+
info: BufferSource;
219+
salt: BufferSource;
220220
}
221221

222222
interface HmacImportParams extends Algorithm {
@@ -361,7 +361,7 @@ interface NotificationOptions {
361361
interface Pbkdf2Params extends Algorithm {
362362
hash: HashAlgorithmIdentifier;
363363
iterations: number;
364-
salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
364+
salt: BufferSource;
365365
}
366366

367367
interface PerformanceMarkOptions {
@@ -531,7 +531,7 @@ interface RsaKeyGenParams extends Algorithm {
531531
}
532532

533533
interface RsaOaepParams extends Algorithm {
534-
label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
534+
label?: BufferSource;
535535
}
536536

537537
interface RsaOtherPrimesInfo {
@@ -5822,7 +5822,7 @@ declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEven
58225822
declare function addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
58235823
declare function removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
58245824
declare function removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
5825-
type AlgorithmIdentifier = string | Algorithm;
5825+
type AlgorithmIdentifier = Algorithm | string;
58265826
type BigInteger = Uint8Array;
58275827
type BinaryData = ArrayBuffer | ArrayBufferView;
58285828
type BlobPart = BufferSource | Blob | string;

inputfiles/addedTypes.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,11 @@
21182118
"new-type": "IDBValidKey"
21192119
},
21202120
{
2121-
"override-type": "string | Algorithm",
2121+
"type": {
2122+
"0": {
2123+
"type": "Algorithm"
2124+
}
2125+
},
21222126
"new-type": "AlgorithmIdentifier"
21232127
},
21242128
{

inputfiles/knownTypes.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"AesGcmParams",
77
"AesKeyAlgorithm",
88
"AesKeyGenParams",
9-
"Algorithm",
109
"BigInteger",
1110
"CanvasRenderingContext2DSettings",
1211
"ClientQueryOptions",
@@ -61,7 +60,6 @@
6160
"AesGcmParams",
6261
"AesKeyAlgorithm",
6362
"AesKeyGenParams",
64-
"Algorithm",
6563
"BigInteger",
6664
"CanvasRenderingContext2DSettings",
6765
"ClientTypes",

inputfiles/overridingTypes.json

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,74 +2879,6 @@
28792879
}
28802880
]
28812881
},
2882-
"AesGcmParams": {
2883-
"members": {
2884-
"member": {
2885-
"iv": {
2886-
"name": "iv",
2887-
"override-type": "Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer"
2888-
},
2889-
"additionalData": {
2890-
"name": "additionalData",
2891-
"override-type": "Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer"
2892-
}
2893-
}
2894-
}
2895-
},
2896-
"Pbkdf2Params": {
2897-
"members": {
2898-
"member": {
2899-
"salt": {
2900-
"name": "salt",
2901-
"override-type": "Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer"
2902-
}
2903-
}
2904-
}
2905-
},
2906-
"HkdfParams": {
2907-
"members": {
2908-
"member": {
2909-
"info": {
2910-
"name": "info",
2911-
"override-type": "Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer"
2912-
},
2913-
"salt": {
2914-
"name": "salt",
2915-
"override-type": "Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer"
2916-
}
2917-
}
2918-
}
2919-
},
2920-
"AesCbcParams": {
2921-
"members": {
2922-
"member": {
2923-
"iv": {
2924-
"name": "iv",
2925-
"override-type": "Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer"
2926-
}
2927-
}
2928-
}
2929-
},
2930-
"AesCtrParams": {
2931-
"members": {
2932-
"member": {
2933-
"counter": {
2934-
"name": "counter",
2935-
"override-type": "Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer"
2936-
}
2937-
}
2938-
}
2939-
},
2940-
"RsaOaepParams": {
2941-
"members": {
2942-
"member": {
2943-
"label": {
2944-
"name": "label",
2945-
"override-type": "Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer"
2946-
}
2947-
}
2948-
}
2949-
},
29502882
"ClientQueryOptions": {
29512883
"name": "ClientQueryOptions",
29522884
"members": {

0 commit comments

Comments
 (0)