diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..5687371 --- /dev/null +++ b/index.d.ts @@ -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(array: T): T; + } + + class CryptoKey implements NativeCryptoKey { + public algorithm: KeyAlgorithm; + public extractable: boolean; + public type: KeyType; + public usages: KeyUsage[]; + } + +} + +export = WebCrypto;