2021-02-26 12:06:26 -05:00
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
declare var crypto : Crypto ;
declare interface Crypto {
2021-06-06 06:57:10 -04:00
readonly subtle : SubtleCrypto ;
2021-02-26 12:06:26 -05:00
getRandomValues <
T extends
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| null ,
> (
array : T ,
) : T ;
2021-06-05 08:46:24 -04:00
randomUUID ( ) : string ;
2021-02-26 12:06:26 -05:00
}
2021-06-06 06:57:10 -04:00
interface Algorithm {
name : string ;
}
/** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */
interface SubtleCrypto {
digest (
algorithm : AlgorithmIdentifier ,
data :
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer ,
) : Promise < ArrayBuffer > ;
}
declare var SubtleCrypto : {
prototype : SubtleCrypto ;
new ( ) : SubtleCrypto ;
} ;
type AlgorithmIdentifier = string | Algorithm ;