feat(workers): "crypto" global accessible in Worker scope (#5121)

This commit is contained in:
Oliver Lenehan 2020-05-08 22:30:53 +10:00 committed by GitHub
parent c0e8bae498
commit a08a4abac1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 24 deletions

View file

@ -12,7 +12,6 @@ declare interface Window extends EventTarget {
readonly self: Window & typeof globalThis;
onload: ((this: Window, ev: Event) => any) | null;
onunload: ((this: Window, ev: Event) => any) | null;
crypto: Crypto;
close: () => void;
readonly closed: boolean;
Deno: typeof Deno;
@ -22,26 +21,5 @@ declare const window: Window & typeof globalThis;
declare const self: Window & typeof globalThis;
declare const onload: ((this: Window, ev: Event) => any) | null;
declare const onunload: ((this: Window, ev: Event) => any) | null;
declare const crypto: Crypto;
declare interface Crypto {
readonly subtle: null;
getRandomValues<
T extends
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| null
>(
array: T
): T;
}
/* eslint-enable @typescript-eslint/no-explicit-any */