Add types

This commit is contained in:
microshine 2019-01-25 15:49:00 +03:00
parent e0d7811045
commit bcf78eda1a
1 changed files with 21 additions and 0 deletions

21
index.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
type NativeCrypto = Crypto;
type NativeSubtleCrypto = SubtleCrypto;
type NativeCryptoKey = CryptoKey;
declare namespace WebCrypto {
class Crypto implements NativeCrypto {
public subtle: SubtleCrypto;
public getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T;
}
class CryptoKey implements NativeCryptoKey {
public algorithm: KeyAlgorithm;
public extractable: boolean;
public type: KeyType;
public usages: KeyUsage[];
}
}
export = WebCrypto;