1 | declare namespace console {
|
2 | export function log(...args: any[]): void;
|
3 | export function trace(...args: any[]): void;
|
4 | export function debug(...args: any[]): void;
|
5 | export function info(...args: any[]): void;
|
6 | export function warn(...args: any[]): void;
|
7 | export function error(...args: any[]): void;
|
8 | export function assert(condition: boolean, message?: string, ...args: any[]): void;
|
9 | export function count(label?: any): void;
|
10 | export function countReset(label?: any): void;
|
11 | export function time(label?: any): void;
|
12 | export function timeLog(label?: any): void;
|
13 | export function timeEnd(label?: any): void;
|
14 | export function group(...args: any[]): void;
|
15 | export function groupCollapsed(...args: any[]): void;
|
16 | export function groupEnd(): void;
|
17 | }
|
18 |
|
19 | declare const crypto: Crypto;
|
20 |
|
21 | declare const window: {
|
22 | crypto: Crypto;
|
23 | };
|
24 |
|
25 | declare namespace performance {
|
26 | export function now(): number;
|
27 | }
|
28 |
|
29 | declare function btoa(text: string): string;
|
30 | declare function atob(text: string): string;
|
31 | declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): number;
|
32 | declare function clearTimeout(timeoutId: number): void;
|
33 | declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): number;
|
34 | declare function clearInterval(intervalId: number): void;
|
35 | declare function fetch<T = any>(url: string, options?: RequestInit): Promise<Response<T>>;
|
36 |
|
37 | declare class ServiceError extends Error {
|
38 | public name: string;
|
39 | public errorCode?: number;
|
40 | public service?: string;
|
41 |
|
42 | constructor(errorCode?: number, message?: string, service?: string);
|
43 |
|
44 | public set(errorCode: number, message: string): void;
|
45 | public setService(service: string): void;
|
46 | }
|
47 |
|
48 | interface Crypto {
|
49 | getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray>(array: T): T;
|
50 | subtle: CryptoSubtle;
|
51 | }
|
52 |
|
53 | interface CryptoSubtle {
|
54 | generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
|
55 | generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
56 | generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
|
57 | exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
58 | exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): Promise<ArrayBuffer>;
|
59 | importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
60 | importKey(format: "raw" | "pkcs8" | "spki", keyData: ArrayBufferView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
61 | sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: ArrayBufferView | ArrayBuffer): Promise<ArrayBuffer>;
|
62 | verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: ArrayBufferView | ArrayBuffer, data: ArrayBufferView | ArrayBuffer): Promise<boolean>;
|
63 | }
|
64 |
|
65 | declare class Body<T = any> {
|
66 | body: Blob | ArrayBuffer | FormData | string | null;
|
67 | bodyUsed: boolean;
|
68 |
|
69 | constructor(body?: Blob | ArrayBuffer | FormData | string | null);
|
70 | arrayBuffer(): Promise<ArrayBuffer>;
|
71 | blob(): Promise<Blob>;
|
72 | formData(): Promise<FormData>;
|
73 | text(): Promise<string>;
|
74 | json<J = T>(): Promise<J>;
|
75 | }
|
76 |
|
77 | interface RequestOptions {
|
78 | body?: Blob | ArrayBuffer | FormData | string | null;
|
79 | headers?: Headers;
|
80 | method?: string;
|
81 | }
|
82 |
|
83 | declare class Request<T = any> extends Body<T> {
|
84 | headers: Headers;
|
85 | method: string;
|
86 | url: string;
|
87 |
|
88 | constructor(input: Request | string, options?: RequestOptions)
|
89 |
|
90 | clone(): Request<T>;
|
91 | }
|
92 |
|
93 | interface ResponseOptions {
|
94 | status?: number;
|
95 | statusText?: string;
|
96 | headers?: Headers | Record<string, string>;
|
97 | }
|
98 |
|
99 | declare class Response<T = any> extends Body<T> {
|
100 | headers: Headers;
|
101 | ok: boolean;
|
102 | redirected: boolean;
|
103 | status: number;
|
104 | statusText: string;
|
105 | type: string;
|
106 | url: string;
|
107 |
|
108 | constructor(body?: Blob | ArrayBuffer | FormData | string | null, options?: ResponseOptions);
|
109 |
|
110 | clone(): Response<T>;
|
111 | }
|
112 |
|
113 | interface RequestInit {
|
114 | method?: string;
|
115 | headers?: FetchHeadersInit;
|
116 | body?: FetchBodyInit;
|
117 | agent?: FetchAgentInit;
|
118 | }
|
119 |
|
120 | interface FetchError {
|
121 | message: string;
|
122 | }
|
123 |
|
124 | interface BlobOptions {
|
125 | type: string;
|
126 | endings: string;
|
127 | }
|
128 |
|
129 | declare class Headers implements Iterable<[string, string]> {
|
130 | constructor(init?: FetchHeadersInit);
|
131 | forEach(callback: (value: string, name: string) => void): void;
|
132 | append(name: string, value: string): void;
|
133 | delete(name: string): void;
|
134 | get(name: string): string | null;
|
135 | getAll(name: string): string[];
|
136 | has(name: string): boolean;
|
137 | raw(): { [k: string]: string[]; };
|
138 | set(name: string, value: string): void;
|
139 |
|
140 | entries(): Iterator<[string, string]>;
|
141 | keys(): Iterator<string>;
|
142 | values(): Iterator<string>;
|
143 | [Symbol.iterator](): Iterator<[string, string]>;
|
144 | }
|
145 |
|
146 | declare class Blob {
|
147 | constructor(chunks: Array<string | ArrayBuffer | ArrayBufferView | Blob>, options?: BlobOptions);
|
148 | arrayBuffer(): Promise<ArrayBuffer>;
|
149 | arrayBufferSync(): ArrayBuffer;
|
150 | text(): Promise<string>;
|
151 | textSync(): string;
|
152 | slice(start: number, end: number, type: string): Blob;
|
153 | }
|
154 |
|
155 | declare class FormData {
|
156 | append(name: string, value: string | Blob, filename?: string): void;
|
157 | delete(name: string): void;
|
158 | entries(): Iterator<any[]>;
|
159 | getBlob(): Blob;
|
160 | get(name: string): string | Blob;
|
161 | getAll(): Array<string | Blob>;
|
162 | has(name: string): boolean;
|
163 | keys(): Iterator<string>;
|
164 | set(name: string, value: string | Blob, filename?: string): void;
|
165 | values(): Iterator<string | Blob>;
|
166 | }
|
167 |
|
168 | declare class URL {
|
169 | constructor(input: string | URL, base?: string | URL);
|
170 | hash: string;
|
171 | host: string;
|
172 | hostname: string;
|
173 | href: string;
|
174 | readonly origin: string;
|
175 | password: string;
|
176 | pathname: string;
|
177 | port: string;
|
178 | protocol: string;
|
179 | search: string;
|
180 | readonly searchParams: URLSearchParams;
|
181 | username: string;
|
182 | toString(): string;
|
183 | toJSON(): string;
|
184 | static canParse(url: string | URL, base?: string): boolean;
|
185 | }
|
186 |
|
187 | declare class URLSearchParams implements Iterable<[string, string]> {
|
188 | constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined; } | Iterable<[string, string]> | Array<[string, string]>);
|
189 | append(name: string, value: string): void;
|
190 | delete(name: string): void;
|
191 | entries(): IterableIterator<[string, string]>;
|
192 | forEach(callback: (value: string, name: string, searchParams: this) => void): void;
|
193 | get(name: string): string | null;
|
194 | getAll(name: string): string[];
|
195 | has(name: string): boolean;
|
196 | keys(): IterableIterator<string>;
|
197 | set(name: string, value: string): void;
|
198 | sort(): void;
|
199 | toString(): string;
|
200 | values(): IterableIterator<string>;
|
201 | [Symbol.iterator](): IterableIterator<[string, string]>;
|
202 | }
|
203 |
|
204 | type FetchHeadersInit = Headers | string[][] | { [key: string]: string; };
|
205 | type FetchBodyInit = FormData | ArrayBuffer | ArrayBufferView | string;
|
206 | type FetchAgentInit = {
|
207 | |
208 |
|
209 |
|
210 |
|
211 | rejectUnauthorized?: boolean;
|
212 | |
213 |
|
214 |
|
215 |
|
216 | key?: string | ArrayBuffer | (string | ArrayBuffer)[];
|
217 | |
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 | cert?: string | ArrayBuffer | (string | ArrayBuffer)[];
|
229 | |
230 |
|
231 |
|
232 |
|
233 |
|
234 | ca?: string | ArrayBuffer | (string | ArrayBuffer)[];
|
235 | |
236 |
|
237 |
|
238 | passphrase?: string;
|
239 | };
|
240 |
|
241 | interface Context {
|
242 | |
243 |
|
244 |
|
245 | readonly startTime: number;
|
246 |
|
247 | |
248 |
|
249 |
|
250 | readonly timeout: number;
|
251 |
|
252 | |
253 |
|
254 |
|
255 | readonly availableMemory: number;
|
256 |
|
257 | |
258 |
|
259 |
|
260 | readonly invocationId: string;
|
261 |
|
262 | |
263 |
|
264 |
|
265 | readonly environment: {
|
266 | |
267 |
|
268 |
|
269 | readonly uid: string;
|
270 | |
271 |
|
272 |
|
273 | readonly name: string;
|
274 | };
|
275 |
|
276 | |
277 |
|
278 |
|
279 | readonly deployment?: {
|
280 | |
281 |
|
282 |
|
283 | readonly uid: string;
|
284 |
|
285 | |
286 |
|
287 |
|
288 | readonly version: string;
|
289 |
|
290 | |
291 |
|
292 |
|
293 | readonly label?: string;
|
294 | };
|
295 |
|
296 | |
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 | readonly rootTriggerType: 'EXTERNAL' | 'MANUAL' | 'SCHEDULED' | 'MANUAL_EVENT_LISTENER';
|
306 |
|
307 | |
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 | readonly triggerType: 'EXTERNAL' | 'MANUAL' | 'SCHEDULED' | 'MANUAL_EVENT_LISTENER' | 'CHAINED';
|
317 | }
|
318 |
|
319 | interface TextEncoderOptions {
|
320 | stream?: boolean;
|
321 | }
|
322 |
|
323 | interface TextDecoderOptions {
|
324 | stream?: boolean;
|
325 | }
|
326 |
|
327 | declare class TextEncoder {
|
328 | encode(input: string, options?: TextEncoderOptions): Uint8Array;
|
329 | }
|
330 |
|
331 | declare class TextDecoder {
|
332 | decode(input: Uint8Array, options?: TextDecoderOptions): string;
|
333 | }
|
334 |
|
335 | interface Algorithm {
|
336 | name: string;
|
337 | }
|
338 |
|
339 | type AlgorithmIdentifier = string | Algorithm;
|
340 | type BigInteger = Uint8Array;
|
341 | type HashAlgorithmIdentifier = AlgorithmIdentifier;
|
342 | type NamedCurve = string;
|
343 | type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
|
344 | type KeyType = "private" | "public" | "secret";
|
345 |
|
346 | interface RsaKeyGenParams extends Algorithm {
|
347 | modulusLength: number;
|
348 | publicExponent: BigInteger;
|
349 | }
|
350 |
|
351 | interface RsaHashedKeyGenParams extends RsaKeyGenParams {
|
352 | hash: HashAlgorithmIdentifier;
|
353 | }
|
354 |
|
355 | interface EcKeyGenParams extends Algorithm {
|
356 | namedCurve: NamedCurve;
|
357 | }
|
358 |
|
359 | interface DhKeyGenParams extends Algorithm {
|
360 | generator: Uint8Array;
|
361 | prime: Uint8Array;
|
362 | }
|
363 |
|
364 | interface KeyAlgorithm {
|
365 | name: string;
|
366 | }
|
367 |
|
368 | interface AesKeyGenParams extends Algorithm {
|
369 | length: number;
|
370 | }
|
371 |
|
372 | interface HmacKeyGenParams extends Algorithm {
|
373 | hash: HashAlgorithmIdentifier;
|
374 | length?: number;
|
375 | }
|
376 |
|
377 | interface Pbkdf2Params extends Algorithm {
|
378 | hash: HashAlgorithmIdentifier;
|
379 | iterations: number;
|
380 | salt: ArrayBufferView | ArrayBuffer;
|
381 | }
|
382 |
|
383 | interface JsonWebKey {
|
384 | alg?: string;
|
385 | crv?: string;
|
386 | d?: string;
|
387 | dp?: string;
|
388 | dq?: string;
|
389 | e?: string;
|
390 | ext?: boolean;
|
391 | k?: string;
|
392 | key_ops?: string[];
|
393 | kty?: string;
|
394 | n?: string;
|
395 | oth?: RsaOtherPrimesInfo[];
|
396 | p?: string;
|
397 | q?: string;
|
398 | qi?: string;
|
399 | use?: string;
|
400 | x?: string;
|
401 | y?: string;
|
402 | }
|
403 |
|
404 | interface RsaOtherPrimesInfo {
|
405 | d?: string;
|
406 | r?: string;
|
407 | t?: string;
|
408 | }
|
409 |
|
410 | interface RsaHashedImportParams extends Algorithm {
|
411 | hash: HashAlgorithmIdentifier;
|
412 | }
|
413 |
|
414 | interface HmacImportParams extends Algorithm {
|
415 | hash: HashAlgorithmIdentifier;
|
416 | length?: number;
|
417 | }
|
418 |
|
419 | interface EcKeyImportParams extends Algorithm {
|
420 | namedCurve: NamedCurve;
|
421 | }
|
422 |
|
423 | interface AesKeyAlgorithm extends KeyAlgorithm {
|
424 | length: number;
|
425 | }
|
426 |
|
427 | interface RsaPssParams extends Algorithm {
|
428 | saltLength: number;
|
429 | }
|
430 |
|
431 | interface EcdsaParams extends Algorithm {
|
432 | hash: HashAlgorithmIdentifier;
|
433 | }
|
434 |
|
435 | interface Ed448Params extends Algorithm {
|
436 | context?: ArrayBufferView | ArrayBuffer;
|
437 | }
|
438 |
|
439 | declare class CryptoKey {
|
440 | readonly algorithm: KeyAlgorithm;
|
441 | readonly extractable: boolean;
|
442 | readonly type: KeyType;
|
443 | readonly usages: KeyUsage[];
|
444 | }
|
445 |
|
446 | declare class CryptoKeyPair {
|
447 | privateKey: CryptoKey;
|
448 | publicKey: CryptoKey;
|
449 | } |
\ | No newline at end of file |