chenyc
2025-12-09 65e034683b28d799e73c7d7e5e4769fab5b9bc9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
export {};
 
import { webcrypto } from "crypto";
 
declare global {
    var Crypto: typeof globalThis extends { onmessage: any; Crypto: infer T } ? T : {
        prototype: webcrypto.Crypto;
        new(): webcrypto.Crypto;
    };
 
    var CryptoKey: typeof globalThis extends { onmessage: any; CryptoKey: infer T } ? T : {
        prototype: webcrypto.CryptoKey;
        new(): webcrypto.CryptoKey;
    };
 
    var SubtleCrypto: typeof globalThis extends { onmessage: any; SubtleCrypto: infer T } ? T : {
        prototype: webcrypto.SubtleCrypto;
        new(): webcrypto.SubtleCrypto;
        supports(
            operation: string,
            algorithm: webcrypto.AlgorithmIdentifier,
            length?: number,
        ): boolean;
        supports(
            operation: string,
            algorithm: webcrypto.AlgorithmIdentifier,
            additionalAlgorithm: webcrypto.AlgorithmIdentifier,
        ): boolean;
    };
 
    var crypto: typeof globalThis extends { onmessage: any; crypto: infer T } ? T : webcrypto.Crypto;
}