@meetploy/types 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/globals.d.ts +660 -0
- package/package.json +6 -2
package/globals.d.ts
ADDED
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global type declarations for Ploy worker environments.
|
|
3
|
+
*
|
|
4
|
+
* Provides web platform types (Request, Response, URL, etc.) for workerd
|
|
5
|
+
* environments without the "dom" lib, plus global re-exports of all Ploy
|
|
6
|
+
* binding and handler types.
|
|
7
|
+
*
|
|
8
|
+
* Referenced via: /// <reference types="@meetploy/types/globals" />
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
declare global {
|
|
12
|
+
// PloyEnv is augmented by the generated env.d.ts with project-specific bindings.
|
|
13
|
+
interface PloyEnv {}
|
|
14
|
+
|
|
15
|
+
// --- Ploy handler types ---
|
|
16
|
+
type PloyHandler<TEnv = unknown> =
|
|
17
|
+
import("@meetploy/types").PloyHandler<TEnv>;
|
|
18
|
+
type Ploy = PloyHandler<PloyEnv>;
|
|
19
|
+
|
|
20
|
+
// --- Binding types ---
|
|
21
|
+
type D1Database = import("@meetploy/types").D1Database;
|
|
22
|
+
type D1PreparedStatement = import("@meetploy/types").D1PreparedStatement;
|
|
23
|
+
type D1Result<T = unknown> = import("@meetploy/types").D1Result<T>;
|
|
24
|
+
type D1ResultMeta = import("@meetploy/types").D1ResultMeta;
|
|
25
|
+
type CacheBinding = import("@meetploy/types").CacheBinding;
|
|
26
|
+
type QueueBinding = import("@meetploy/types").QueueBinding;
|
|
27
|
+
type StateBinding = import("@meetploy/types").StateBinding;
|
|
28
|
+
type WorkflowBinding = import("@meetploy/types").WorkflowBinding;
|
|
29
|
+
type FileStorageBinding = import("@meetploy/types").FileStorageBinding;
|
|
30
|
+
type TimerBinding = import("@meetploy/types").TimerBinding;
|
|
31
|
+
type PloyAuth = import("@meetploy/types").PloyAuth;
|
|
32
|
+
type PloyUser = import("@meetploy/types").PloyUser;
|
|
33
|
+
|
|
34
|
+
// --- Handler and context types ---
|
|
35
|
+
type WorkflowContext<
|
|
36
|
+
TEnv = unknown,
|
|
37
|
+
TInput = unknown,
|
|
38
|
+
> = import("@meetploy/types").WorkflowContext<TEnv, TInput>;
|
|
39
|
+
type QueueMessageEvent = import("@meetploy/types").QueueMessageEvent;
|
|
40
|
+
type ScheduledEvent = import("@meetploy/types").ScheduledEvent;
|
|
41
|
+
type TimerEvent = import("@meetploy/types").TimerEvent;
|
|
42
|
+
type ExecutionContext = import("@meetploy/types").ExecutionContext;
|
|
43
|
+
|
|
44
|
+
// --- Web Platform Supporting types ---
|
|
45
|
+
type HeadersInit = Headers | Record<string, string> | [string, string][];
|
|
46
|
+
type BodyInit =
|
|
47
|
+
| string
|
|
48
|
+
| ArrayBuffer
|
|
49
|
+
| ArrayBufferView
|
|
50
|
+
| Blob
|
|
51
|
+
| FormData
|
|
52
|
+
| URLSearchParams
|
|
53
|
+
| ReadableStream;
|
|
54
|
+
type RequestInfo = string | Request | URL;
|
|
55
|
+
type RequestRedirect = "follow" | "error" | "manual";
|
|
56
|
+
type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors";
|
|
57
|
+
type RequestCredentials = "omit" | "same-origin" | "include";
|
|
58
|
+
type RequestCache =
|
|
59
|
+
| "default"
|
|
60
|
+
| "no-store"
|
|
61
|
+
| "reload"
|
|
62
|
+
| "no-cache"
|
|
63
|
+
| "force-cache"
|
|
64
|
+
| "only-if-cached";
|
|
65
|
+
type ReferrerPolicy =
|
|
66
|
+
| ""
|
|
67
|
+
| "no-referrer"
|
|
68
|
+
| "no-referrer-when-downgrade"
|
|
69
|
+
| "same-origin"
|
|
70
|
+
| "origin"
|
|
71
|
+
| "strict-origin"
|
|
72
|
+
| "origin-when-cross-origin"
|
|
73
|
+
| "strict-origin-when-cross-origin"
|
|
74
|
+
| "unsafe-url";
|
|
75
|
+
type ResponseType =
|
|
76
|
+
| "basic"
|
|
77
|
+
| "cors"
|
|
78
|
+
| "default"
|
|
79
|
+
| "error"
|
|
80
|
+
| "opaque"
|
|
81
|
+
| "opaqueredirect";
|
|
82
|
+
type FormDataEntryValue = string | File;
|
|
83
|
+
|
|
84
|
+
interface RequestInit {
|
|
85
|
+
method?: string;
|
|
86
|
+
headers?: HeadersInit;
|
|
87
|
+
body?: BodyInit | null;
|
|
88
|
+
redirect?: RequestRedirect;
|
|
89
|
+
mode?: RequestMode;
|
|
90
|
+
credentials?: RequestCredentials;
|
|
91
|
+
cache?: RequestCache;
|
|
92
|
+
referrerPolicy?: ReferrerPolicy;
|
|
93
|
+
integrity?: string;
|
|
94
|
+
keepalive?: boolean;
|
|
95
|
+
signal?: AbortSignal | null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface ResponseInit {
|
|
99
|
+
status?: number;
|
|
100
|
+
statusText?: string;
|
|
101
|
+
headers?: HeadersInit;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface BlobPropertyBag {
|
|
105
|
+
type?: string;
|
|
106
|
+
endings?: "native" | "transparent";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface FilePropertyBag extends BlobPropertyBag {
|
|
110
|
+
lastModified?: number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// --- Core Web API classes ---
|
|
114
|
+
|
|
115
|
+
class Headers {
|
|
116
|
+
constructor(init?: HeadersInit);
|
|
117
|
+
append(name: string, value: string): void;
|
|
118
|
+
delete(name: string): void;
|
|
119
|
+
get(name: string): string | null;
|
|
120
|
+
has(name: string): boolean;
|
|
121
|
+
set(name: string, value: string): void;
|
|
122
|
+
forEach(
|
|
123
|
+
callback: (value: string, name: string, parent: Headers) => void,
|
|
124
|
+
): void;
|
|
125
|
+
entries(): IterableIterator<[string, string]>;
|
|
126
|
+
keys(): IterableIterator<string>;
|
|
127
|
+
values(): IterableIterator<string>;
|
|
128
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
class URL {
|
|
132
|
+
constructor(url: string | URL, base?: string | URL);
|
|
133
|
+
hash: string;
|
|
134
|
+
host: string;
|
|
135
|
+
hostname: string;
|
|
136
|
+
href: string;
|
|
137
|
+
readonly origin: string;
|
|
138
|
+
password: string;
|
|
139
|
+
pathname: string;
|
|
140
|
+
port: string;
|
|
141
|
+
protocol: string;
|
|
142
|
+
search: string;
|
|
143
|
+
readonly searchParams: URLSearchParams;
|
|
144
|
+
username: string;
|
|
145
|
+
toString(): string;
|
|
146
|
+
toJSON(): string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
class URLSearchParams {
|
|
150
|
+
constructor(
|
|
151
|
+
init?:
|
|
152
|
+
| string
|
|
153
|
+
| URLSearchParams
|
|
154
|
+
| Record<string, string>
|
|
155
|
+
| [string, string][],
|
|
156
|
+
);
|
|
157
|
+
append(name: string, value: string): void;
|
|
158
|
+
delete(name: string): void;
|
|
159
|
+
get(name: string): string | null;
|
|
160
|
+
getAll(name: string): string[];
|
|
161
|
+
has(name: string): boolean;
|
|
162
|
+
set(name: string, value: string): void;
|
|
163
|
+
sort(): void;
|
|
164
|
+
toString(): string;
|
|
165
|
+
forEach(
|
|
166
|
+
callback: (value: string, name: string, parent: URLSearchParams) => void,
|
|
167
|
+
): void;
|
|
168
|
+
entries(): IterableIterator<[string, string]>;
|
|
169
|
+
keys(): IterableIterator<string>;
|
|
170
|
+
values(): IterableIterator<string>;
|
|
171
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
class Blob {
|
|
175
|
+
constructor(blobParts?: BlobPart[], options?: BlobPropertyBag);
|
|
176
|
+
readonly size: number;
|
|
177
|
+
readonly type: string;
|
|
178
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
179
|
+
bytes(): Promise<Uint8Array>;
|
|
180
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
181
|
+
text(): Promise<string>;
|
|
182
|
+
stream(): ReadableStream;
|
|
183
|
+
}
|
|
184
|
+
type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob;
|
|
185
|
+
|
|
186
|
+
class File extends Blob {
|
|
187
|
+
constructor(
|
|
188
|
+
fileBits: BlobPart[],
|
|
189
|
+
fileName: string,
|
|
190
|
+
options?: FilePropertyBag,
|
|
191
|
+
);
|
|
192
|
+
readonly lastModified: number;
|
|
193
|
+
readonly name: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
class FormData {
|
|
197
|
+
constructor();
|
|
198
|
+
append(name: string, value: string | Blob, fileName?: string): void;
|
|
199
|
+
delete(name: string): void;
|
|
200
|
+
get(name: string): FormDataEntryValue | null;
|
|
201
|
+
getAll(name: string): FormDataEntryValue[];
|
|
202
|
+
has(name: string): boolean;
|
|
203
|
+
set(name: string, value: string | Blob, fileName?: string): void;
|
|
204
|
+
forEach(
|
|
205
|
+
callback: (
|
|
206
|
+
value: FormDataEntryValue,
|
|
207
|
+
name: string,
|
|
208
|
+
parent: FormData,
|
|
209
|
+
) => void,
|
|
210
|
+
): void;
|
|
211
|
+
entries(): IterableIterator<[string, FormDataEntryValue]>;
|
|
212
|
+
keys(): IterableIterator<string>;
|
|
213
|
+
values(): IterableIterator<FormDataEntryValue>;
|
|
214
|
+
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
class AbortController {
|
|
218
|
+
readonly signal: AbortSignal;
|
|
219
|
+
abort(reason?: unknown): void;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
class AbortSignal extends EventTarget {
|
|
223
|
+
static abort(reason?: unknown): AbortSignal;
|
|
224
|
+
static timeout(milliseconds: number): AbortSignal;
|
|
225
|
+
readonly aborted: boolean;
|
|
226
|
+
readonly reason: unknown;
|
|
227
|
+
throwIfAborted(): void;
|
|
228
|
+
onabort: ((this: AbortSignal, ev: Event) => unknown) | null;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
class TextEncoder {
|
|
232
|
+
readonly encoding: "utf-8";
|
|
233
|
+
encode(input?: string): Uint8Array;
|
|
234
|
+
encodeInto(
|
|
235
|
+
input: string,
|
|
236
|
+
dest: Uint8Array,
|
|
237
|
+
): { read: number; written: number };
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface TextDecoderOptions {
|
|
241
|
+
fatal?: boolean;
|
|
242
|
+
ignoreBOM?: boolean;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
interface TextDecodeOptions {
|
|
246
|
+
stream?: boolean;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
class TextDecoder {
|
|
250
|
+
constructor(label?: string, options?: TextDecoderOptions);
|
|
251
|
+
readonly encoding: string;
|
|
252
|
+
readonly fatal: boolean;
|
|
253
|
+
readonly ignoreBOM: boolean;
|
|
254
|
+
decode(
|
|
255
|
+
input?: ArrayBuffer | ArrayBufferView,
|
|
256
|
+
options?: TextDecodeOptions,
|
|
257
|
+
): string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// --- Request & Response classes ---
|
|
261
|
+
|
|
262
|
+
class Request {
|
|
263
|
+
constructor(input: RequestInfo, init?: RequestInit);
|
|
264
|
+
readonly method: string;
|
|
265
|
+
readonly url: string;
|
|
266
|
+
readonly headers: Headers;
|
|
267
|
+
readonly redirect: RequestRedirect;
|
|
268
|
+
readonly signal: AbortSignal;
|
|
269
|
+
readonly integrity: string;
|
|
270
|
+
readonly keepalive: boolean;
|
|
271
|
+
readonly mode: RequestMode;
|
|
272
|
+
readonly credentials: RequestCredentials;
|
|
273
|
+
readonly cache: RequestCache;
|
|
274
|
+
readonly referrerPolicy: ReferrerPolicy;
|
|
275
|
+
readonly body: ReadableStream | null;
|
|
276
|
+
readonly bodyUsed: boolean;
|
|
277
|
+
clone(): Request;
|
|
278
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
279
|
+
bytes(): Promise<Uint8Array>;
|
|
280
|
+
text(): Promise<string>;
|
|
281
|
+
json<T = unknown>(): Promise<T>;
|
|
282
|
+
formData(): Promise<FormData>;
|
|
283
|
+
blob(): Promise<Blob>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
class Response {
|
|
287
|
+
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
288
|
+
readonly status: number;
|
|
289
|
+
readonly statusText: string;
|
|
290
|
+
readonly headers: Headers;
|
|
291
|
+
readonly ok: boolean;
|
|
292
|
+
readonly redirected: boolean;
|
|
293
|
+
readonly url: string;
|
|
294
|
+
readonly type: ResponseType;
|
|
295
|
+
readonly body: ReadableStream | null;
|
|
296
|
+
readonly bodyUsed: boolean;
|
|
297
|
+
clone(): Response;
|
|
298
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
299
|
+
bytes(): Promise<Uint8Array>;
|
|
300
|
+
text(): Promise<string>;
|
|
301
|
+
json<T = unknown>(): Promise<T>;
|
|
302
|
+
formData(): Promise<FormData>;
|
|
303
|
+
blob(): Promise<Blob>;
|
|
304
|
+
static json(data: unknown, init?: ResponseInit): Response;
|
|
305
|
+
static redirect(url: string | URL, status?: number): Response;
|
|
306
|
+
static error(): Response;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// --- Streams ---
|
|
310
|
+
|
|
311
|
+
interface ReadableStreamReadResult<T> {
|
|
312
|
+
done: boolean;
|
|
313
|
+
value: T;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
interface ReadableStreamDefaultReader<R = unknown> {
|
|
317
|
+
readonly closed: Promise<undefined>;
|
|
318
|
+
cancel(reason?: unknown): Promise<void>;
|
|
319
|
+
read(): Promise<ReadableStreamReadResult<R>>;
|
|
320
|
+
releaseLock(): void;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface ReadableStreamDefaultController<R = unknown> {
|
|
324
|
+
readonly desiredSize: number | null;
|
|
325
|
+
close(): void;
|
|
326
|
+
enqueue(chunk?: R): void;
|
|
327
|
+
error(reason?: unknown): void;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
interface UnderlyingSource<R = unknown> {
|
|
331
|
+
start?: (
|
|
332
|
+
controller: ReadableStreamDefaultController<R>,
|
|
333
|
+
) => void | Promise<void>;
|
|
334
|
+
pull?: (
|
|
335
|
+
controller: ReadableStreamDefaultController<R>,
|
|
336
|
+
) => void | Promise<void>;
|
|
337
|
+
cancel?: (reason?: unknown) => void | Promise<void>;
|
|
338
|
+
type?: undefined;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
interface QueuingStrategy<T = unknown> {
|
|
342
|
+
highWaterMark?: number;
|
|
343
|
+
size?: (chunk: T) => number;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
class ReadableStream<R = unknown> {
|
|
347
|
+
constructor(
|
|
348
|
+
underlyingSource?: UnderlyingSource<R>,
|
|
349
|
+
strategy?: QueuingStrategy<R>,
|
|
350
|
+
);
|
|
351
|
+
readonly locked: boolean;
|
|
352
|
+
cancel(reason?: unknown): Promise<void>;
|
|
353
|
+
getReader(): ReadableStreamDefaultReader<R>;
|
|
354
|
+
pipeThrough<T>(
|
|
355
|
+
transform: ReadableWritablePair<T, R>,
|
|
356
|
+
options?: StreamPipeOptions,
|
|
357
|
+
): ReadableStream<T>;
|
|
358
|
+
pipeTo(
|
|
359
|
+
destination: WritableStream<R>,
|
|
360
|
+
options?: StreamPipeOptions,
|
|
361
|
+
): Promise<void>;
|
|
362
|
+
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
363
|
+
values(options?: { preventCancel?: boolean }): AsyncIterableIterator<R>;
|
|
364
|
+
[Symbol.asyncIterator](options?: {
|
|
365
|
+
preventCancel?: boolean;
|
|
366
|
+
}): AsyncIterableIterator<R>;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
interface WritableStreamDefaultWriter<W = unknown> {
|
|
370
|
+
readonly closed: Promise<undefined>;
|
|
371
|
+
readonly desiredSize: number | null;
|
|
372
|
+
readonly ready: Promise<undefined>;
|
|
373
|
+
abort(reason?: unknown): Promise<void>;
|
|
374
|
+
close(): Promise<void>;
|
|
375
|
+
releaseLock(): void;
|
|
376
|
+
write(chunk?: W): Promise<void>;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
interface WritableStreamDefaultController {
|
|
380
|
+
readonly signal: AbortSignal;
|
|
381
|
+
error(reason?: unknown): void;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
interface UnderlyingSink<W = unknown> {
|
|
385
|
+
start?: (
|
|
386
|
+
controller: WritableStreamDefaultController,
|
|
387
|
+
) => void | Promise<void>;
|
|
388
|
+
write?: (
|
|
389
|
+
chunk: W,
|
|
390
|
+
controller: WritableStreamDefaultController,
|
|
391
|
+
) => void | Promise<void>;
|
|
392
|
+
close?: () => void | Promise<void>;
|
|
393
|
+
abort?: (reason?: unknown) => void | Promise<void>;
|
|
394
|
+
type?: undefined;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
class WritableStream<W = unknown> {
|
|
398
|
+
constructor(
|
|
399
|
+
underlyingSink?: UnderlyingSink<W>,
|
|
400
|
+
strategy?: QueuingStrategy<W>,
|
|
401
|
+
);
|
|
402
|
+
readonly locked: boolean;
|
|
403
|
+
abort(reason?: unknown): Promise<void>;
|
|
404
|
+
close(): Promise<void>;
|
|
405
|
+
getWriter(): WritableStreamDefaultWriter<W>;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
interface ReadableWritablePair<R = unknown, W = unknown> {
|
|
409
|
+
readable: ReadableStream<R>;
|
|
410
|
+
writable: WritableStream<W>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
interface StreamPipeOptions {
|
|
414
|
+
preventClose?: boolean;
|
|
415
|
+
preventAbort?: boolean;
|
|
416
|
+
preventCancel?: boolean;
|
|
417
|
+
signal?: AbortSignal;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
interface TransformStreamDefaultController<O = unknown> {
|
|
421
|
+
readonly desiredSize: number | null;
|
|
422
|
+
enqueue(chunk?: O): void;
|
|
423
|
+
error(reason?: unknown): void;
|
|
424
|
+
terminate(): void;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
interface Transformer<I = unknown, O = unknown> {
|
|
428
|
+
start?: (
|
|
429
|
+
controller: TransformStreamDefaultController<O>,
|
|
430
|
+
) => void | Promise<void>;
|
|
431
|
+
transform?: (
|
|
432
|
+
chunk: I,
|
|
433
|
+
controller: TransformStreamDefaultController<O>,
|
|
434
|
+
) => void | Promise<void>;
|
|
435
|
+
flush?: (
|
|
436
|
+
controller: TransformStreamDefaultController<O>,
|
|
437
|
+
) => void | Promise<void>;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
class TransformStream<I = unknown, O = unknown> {
|
|
441
|
+
constructor(
|
|
442
|
+
transformer?: Transformer<I, O>,
|
|
443
|
+
writableStrategy?: QueuingStrategy<I>,
|
|
444
|
+
readableStrategy?: QueuingStrategy<O>,
|
|
445
|
+
);
|
|
446
|
+
readonly readable: ReadableStream<O>;
|
|
447
|
+
readonly writable: WritableStream<I>;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// --- Crypto ---
|
|
451
|
+
|
|
452
|
+
interface CryptoKey {
|
|
453
|
+
readonly type: string;
|
|
454
|
+
readonly extractable: boolean;
|
|
455
|
+
readonly algorithm: object;
|
|
456
|
+
readonly usages: string[];
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
interface CryptoKeyPair {
|
|
460
|
+
publicKey: CryptoKey;
|
|
461
|
+
privateKey: CryptoKey;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
interface JsonWebKey {
|
|
465
|
+
kty: string;
|
|
466
|
+
use?: string;
|
|
467
|
+
key_ops?: string[];
|
|
468
|
+
alg?: string;
|
|
469
|
+
ext?: boolean;
|
|
470
|
+
crv?: string;
|
|
471
|
+
x?: string;
|
|
472
|
+
y?: string;
|
|
473
|
+
d?: string;
|
|
474
|
+
n?: string;
|
|
475
|
+
e?: string;
|
|
476
|
+
p?: string;
|
|
477
|
+
q?: string;
|
|
478
|
+
dp?: string;
|
|
479
|
+
dq?: string;
|
|
480
|
+
qi?: string;
|
|
481
|
+
oth?: { r: string; d: string; t: string }[];
|
|
482
|
+
k?: string;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
interface SubtleCrypto {
|
|
486
|
+
encrypt(
|
|
487
|
+
algorithm: object,
|
|
488
|
+
key: CryptoKey,
|
|
489
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
490
|
+
): Promise<ArrayBuffer>;
|
|
491
|
+
decrypt(
|
|
492
|
+
algorithm: object,
|
|
493
|
+
key: CryptoKey,
|
|
494
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
495
|
+
): Promise<ArrayBuffer>;
|
|
496
|
+
sign(
|
|
497
|
+
algorithm: object,
|
|
498
|
+
key: CryptoKey,
|
|
499
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
500
|
+
): Promise<ArrayBuffer>;
|
|
501
|
+
verify(
|
|
502
|
+
algorithm: object,
|
|
503
|
+
key: CryptoKey,
|
|
504
|
+
signature: ArrayBuffer | ArrayBufferView,
|
|
505
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
506
|
+
): Promise<boolean>;
|
|
507
|
+
digest(
|
|
508
|
+
algorithm: object | string,
|
|
509
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
510
|
+
): Promise<ArrayBuffer>;
|
|
511
|
+
generateKey(
|
|
512
|
+
algorithm: object,
|
|
513
|
+
extractable: boolean,
|
|
514
|
+
keyUsages: string[],
|
|
515
|
+
): Promise<CryptoKey | CryptoKeyPair>;
|
|
516
|
+
deriveKey(
|
|
517
|
+
algorithm: object,
|
|
518
|
+
baseKey: CryptoKey,
|
|
519
|
+
derivedKeyType: object,
|
|
520
|
+
extractable: boolean,
|
|
521
|
+
keyUsages: string[],
|
|
522
|
+
): Promise<CryptoKey>;
|
|
523
|
+
deriveBits(
|
|
524
|
+
algorithm: object,
|
|
525
|
+
baseKey: CryptoKey,
|
|
526
|
+
length: number,
|
|
527
|
+
): Promise<ArrayBuffer>;
|
|
528
|
+
importKey(
|
|
529
|
+
format: string,
|
|
530
|
+
keyData: JsonWebKey | ArrayBuffer | ArrayBufferView,
|
|
531
|
+
algorithm: object,
|
|
532
|
+
extractable: boolean,
|
|
533
|
+
keyUsages: string[],
|
|
534
|
+
): Promise<CryptoKey>;
|
|
535
|
+
exportKey(
|
|
536
|
+
format: string,
|
|
537
|
+
key: CryptoKey,
|
|
538
|
+
): Promise<JsonWebKey | ArrayBuffer>;
|
|
539
|
+
wrapKey(
|
|
540
|
+
format: string,
|
|
541
|
+
key: CryptoKey,
|
|
542
|
+
wrappingKey: CryptoKey,
|
|
543
|
+
wrapAlgorithm: object,
|
|
544
|
+
): Promise<ArrayBuffer>;
|
|
545
|
+
unwrapKey(
|
|
546
|
+
format: string,
|
|
547
|
+
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
548
|
+
unwrappingKey: CryptoKey,
|
|
549
|
+
unwrapAlgorithm: object,
|
|
550
|
+
unwrappedKeyAlgorithm: object,
|
|
551
|
+
extractable: boolean,
|
|
552
|
+
keyUsages: string[],
|
|
553
|
+
): Promise<CryptoKey>;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
interface Crypto {
|
|
557
|
+
readonly subtle: SubtleCrypto;
|
|
558
|
+
getRandomValues<T extends ArrayBufferView>(array: T): T;
|
|
559
|
+
randomUUID(): string;
|
|
560
|
+
}
|
|
561
|
+
var crypto: Crypto;
|
|
562
|
+
|
|
563
|
+
// --- Console ---
|
|
564
|
+
|
|
565
|
+
interface Console {
|
|
566
|
+
log(...data: unknown[]): void;
|
|
567
|
+
warn(...data: unknown[]): void;
|
|
568
|
+
error(...data: unknown[]): void;
|
|
569
|
+
info(...data: unknown[]): void;
|
|
570
|
+
debug(...data: unknown[]): void;
|
|
571
|
+
trace(...data: unknown[]): void;
|
|
572
|
+
dir(item: unknown, options?: object): void;
|
|
573
|
+
dirxml(...data: unknown[]): void;
|
|
574
|
+
table(tabularData: unknown, properties?: string[]): void;
|
|
575
|
+
time(label?: string): void;
|
|
576
|
+
timeEnd(label?: string): void;
|
|
577
|
+
timeLog(label?: string, ...data: unknown[]): void;
|
|
578
|
+
count(label?: string): void;
|
|
579
|
+
countReset(label?: string): void;
|
|
580
|
+
group(...data: unknown[]): void;
|
|
581
|
+
groupCollapsed(...data: unknown[]): void;
|
|
582
|
+
groupEnd(): void;
|
|
583
|
+
clear(): void;
|
|
584
|
+
assert(condition?: boolean, ...data: unknown[]): void;
|
|
585
|
+
}
|
|
586
|
+
var console: Console;
|
|
587
|
+
|
|
588
|
+
// --- Timers & Utilities ---
|
|
589
|
+
|
|
590
|
+
function setTimeout(
|
|
591
|
+
callback: (...args: unknown[]) => void,
|
|
592
|
+
ms?: number,
|
|
593
|
+
...args: unknown[]
|
|
594
|
+
): number;
|
|
595
|
+
function clearTimeout(id: number | undefined): void;
|
|
596
|
+
function setInterval(
|
|
597
|
+
callback: (...args: unknown[]) => void,
|
|
598
|
+
ms?: number,
|
|
599
|
+
...args: unknown[]
|
|
600
|
+
): number;
|
|
601
|
+
function clearInterval(id: number | undefined): void;
|
|
602
|
+
function queueMicrotask(callback: () => void): void;
|
|
603
|
+
function structuredClone<T>(
|
|
604
|
+
value: T,
|
|
605
|
+
options?: { transfer?: Transferable[] },
|
|
606
|
+
): T;
|
|
607
|
+
function atob(data: string): string;
|
|
608
|
+
function btoa(data: string): string;
|
|
609
|
+
function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
610
|
+
|
|
611
|
+
// --- Events (minimal, for AbortSignal) ---
|
|
612
|
+
|
|
613
|
+
class Event {
|
|
614
|
+
constructor(type: string, eventInitDict?: EventInit);
|
|
615
|
+
readonly type: string;
|
|
616
|
+
readonly bubbles: boolean;
|
|
617
|
+
readonly cancelable: boolean;
|
|
618
|
+
readonly defaultPrevented: boolean;
|
|
619
|
+
readonly timeStamp: number;
|
|
620
|
+
preventDefault(): void;
|
|
621
|
+
stopPropagation(): void;
|
|
622
|
+
stopImmediatePropagation(): void;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
interface EventInit {
|
|
626
|
+
bubbles?: boolean;
|
|
627
|
+
cancelable?: boolean;
|
|
628
|
+
composed?: boolean;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
interface EventListenerOptions {
|
|
632
|
+
capture?: boolean;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
interface AddEventListenerOptions extends EventListenerOptions {
|
|
636
|
+
once?: boolean;
|
|
637
|
+
passive?: boolean;
|
|
638
|
+
signal?: AbortSignal;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
type EventListenerOrEventListenerObject =
|
|
642
|
+
| ((event: Event) => void)
|
|
643
|
+
| { handleEvent(event: Event): void };
|
|
644
|
+
|
|
645
|
+
class EventTarget {
|
|
646
|
+
addEventListener(
|
|
647
|
+
type: string,
|
|
648
|
+
listener: EventListenerOrEventListenerObject | null,
|
|
649
|
+
options?: AddEventListenerOptions | boolean,
|
|
650
|
+
): void;
|
|
651
|
+
removeEventListener(
|
|
652
|
+
type: string,
|
|
653
|
+
listener: EventListenerOrEventListenerObject | null,
|
|
654
|
+
options?: EventListenerOptions | boolean,
|
|
655
|
+
): void;
|
|
656
|
+
dispatchEvent(event: Event): boolean;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meetploy/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,12 +13,16 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./globals": {
|
|
18
|
+
"types": "./globals.d.ts"
|
|
16
19
|
}
|
|
17
20
|
},
|
|
18
21
|
"module": "./dist/index.js",
|
|
19
22
|
"types": "./dist/index.d.ts",
|
|
20
23
|
"files": [
|
|
21
|
-
"dist/"
|
|
24
|
+
"dist/",
|
|
25
|
+
"globals.d.ts"
|
|
22
26
|
],
|
|
23
27
|
"scripts": {
|
|
24
28
|
"build": "tsc && resolve-tspaths",
|