@cloudflare/workers-types 4.20240701.0 → 4.20240712.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/2021-11-03/index.d.ts +464 -468
- package/2021-11-03/index.ts +210 -193
- package/2022-01-31/index.d.ts +464 -468
- package/2022-01-31/index.ts +210 -193
- package/2022-03-21/index.d.ts +468 -474
- package/2022-03-21/index.ts +214 -199
- package/2022-08-04/index.d.ts +468 -474
- package/2022-08-04/index.ts +214 -199
- package/2022-10-31/index.d.ts +468 -474
- package/2022-10-31/index.ts +214 -199
- package/2022-11-30/index.d.ts +463 -469
- package/2022-11-30/index.ts +214 -199
- package/2023-03-01/index.d.ts +463 -469
- package/2023-03-01/index.ts +214 -199
- package/2023-07-01/index.d.ts +463 -469
- package/2023-07-01/index.ts +214 -199
- package/experimental/index.d.ts +470 -476
- package/experimental/index.ts +214 -199
- package/index.d.ts +464 -468
- package/index.ts +210 -193
- package/oldest/index.d.ts +464 -468
- package/oldest/index.ts +210 -193
- package/package.json +1 -1
package/2022-11-30/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare class DOMException extends Error {
|
|
|
54
54
|
get stack(): any;
|
|
55
55
|
set stack(value: any);
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
type WorkerGlobalScopeEventMap = {
|
|
58
58
|
fetch: FetchEvent;
|
|
59
59
|
scheduled: ScheduledEvent;
|
|
60
60
|
queue: QueueEvent;
|
|
@@ -65,7 +65,7 @@ declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEv
|
|
|
65
65
|
EventTarget: typeof EventTarget;
|
|
66
66
|
}
|
|
67
67
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
|
|
68
|
-
|
|
68
|
+
interface Console {
|
|
69
69
|
"assert"(condition?: boolean, ...data: any[]): void;
|
|
70
70
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
|
|
71
71
|
clear(): void;
|
|
@@ -106,8 +106,8 @@ declare interface Console {
|
|
|
106
106
|
warn(...data: any[]): void;
|
|
107
107
|
}
|
|
108
108
|
declare const console: Console;
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
110
|
+
type TypedArray =
|
|
111
111
|
| Int8Array
|
|
112
112
|
| Uint8Array
|
|
113
113
|
| Uint8ClampedArray
|
|
@@ -198,7 +198,7 @@ declare namespace WebAssembly {
|
|
|
198
198
|
*
|
|
199
199
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
|
|
200
200
|
*/
|
|
201
|
-
|
|
201
|
+
interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
202
202
|
DOMException: typeof DOMException;
|
|
203
203
|
WorkerGlobalScope: typeof WorkerGlobalScope;
|
|
204
204
|
btoa(data: string): string;
|
|
@@ -286,16 +286,16 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
286
286
|
FixedLengthStream: typeof FixedLengthStream;
|
|
287
287
|
IdentityTransformStream: typeof IdentityTransformStream;
|
|
288
288
|
HTMLRewriter: typeof HTMLRewriter;
|
|
289
|
-
GPUAdapter: typeof
|
|
290
|
-
GPUOutOfMemoryError: typeof
|
|
291
|
-
GPUValidationError: typeof
|
|
292
|
-
GPUInternalError: typeof
|
|
293
|
-
GPUDeviceLostInfo: typeof
|
|
294
|
-
GPUBufferUsage: typeof
|
|
295
|
-
GPUShaderStage: typeof
|
|
296
|
-
GPUMapMode: typeof
|
|
297
|
-
GPUTextureUsage: typeof
|
|
298
|
-
GPUColorWrite: typeof
|
|
289
|
+
GPUAdapter: typeof GPUAdapter;
|
|
290
|
+
GPUOutOfMemoryError: typeof GPUOutOfMemoryError;
|
|
291
|
+
GPUValidationError: typeof GPUValidationError;
|
|
292
|
+
GPUInternalError: typeof GPUInternalError;
|
|
293
|
+
GPUDeviceLostInfo: typeof GPUDeviceLostInfo;
|
|
294
|
+
GPUBufferUsage: typeof GPUBufferUsage;
|
|
295
|
+
GPUShaderStage: typeof GPUShaderStage;
|
|
296
|
+
GPUMapMode: typeof GPUMapMode;
|
|
297
|
+
GPUTextureUsage: typeof GPUTextureUsage;
|
|
298
|
+
GPUColorWrite: typeof GPUColorWrite;
|
|
299
299
|
}
|
|
300
300
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
|
|
301
301
|
type: Type,
|
|
@@ -368,45 +368,42 @@ declare const scheduler: Scheduler;
|
|
|
368
368
|
declare const performance: Performance;
|
|
369
369
|
declare const origin: string;
|
|
370
370
|
declare const navigator: Navigator;
|
|
371
|
-
|
|
372
|
-
|
|
371
|
+
interface TestController {}
|
|
372
|
+
interface ExecutionContext {
|
|
373
373
|
waitUntil(promise: Promise<any>): void;
|
|
374
374
|
passThroughOnException(): void;
|
|
375
375
|
}
|
|
376
|
-
|
|
377
|
-
Env = unknown,
|
|
378
|
-
CfHostMetadata = unknown,
|
|
379
|
-
> = (
|
|
376
|
+
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (
|
|
380
377
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
381
378
|
env: Env,
|
|
382
379
|
ctx: ExecutionContext,
|
|
383
380
|
) => Response | Promise<Response>;
|
|
384
|
-
|
|
381
|
+
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
385
382
|
events: TraceItem[],
|
|
386
383
|
env: Env,
|
|
387
384
|
ctx: ExecutionContext,
|
|
388
385
|
) => void | Promise<void>;
|
|
389
|
-
|
|
386
|
+
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
390
387
|
traces: TraceItem[],
|
|
391
388
|
env: Env,
|
|
392
389
|
ctx: ExecutionContext,
|
|
393
390
|
) => void | Promise<void>;
|
|
394
|
-
|
|
391
|
+
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
395
392
|
controller: ScheduledController,
|
|
396
393
|
env: Env,
|
|
397
394
|
ctx: ExecutionContext,
|
|
398
395
|
) => void | Promise<void>;
|
|
399
|
-
|
|
396
|
+
type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
|
|
400
397
|
batch: MessageBatch<Message>,
|
|
401
398
|
env: Env,
|
|
402
399
|
ctx: ExecutionContext,
|
|
403
400
|
) => void | Promise<void>;
|
|
404
|
-
|
|
401
|
+
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
405
402
|
controller: TestController,
|
|
406
403
|
env: Env,
|
|
407
404
|
ctx: ExecutionContext,
|
|
408
405
|
) => void | Promise<void>;
|
|
409
|
-
|
|
406
|
+
interface ExportedHandler<
|
|
410
407
|
Env = unknown,
|
|
411
408
|
QueueHandlerMessage = unknown,
|
|
412
409
|
CfHostMetadata = unknown,
|
|
@@ -419,7 +416,7 @@ declare interface ExportedHandler<
|
|
|
419
416
|
email?: EmailExportedHandler<Env>;
|
|
420
417
|
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
421
418
|
}
|
|
422
|
-
|
|
419
|
+
interface StructuredSerializeOptions {
|
|
423
420
|
transfer?: any[];
|
|
424
421
|
}
|
|
425
422
|
declare abstract class PromiseRejectionEvent extends Event {
|
|
@@ -440,24 +437,24 @@ declare abstract class Navigator {
|
|
|
440
437
|
| FormData,
|
|
441
438
|
): boolean;
|
|
442
439
|
readonly userAgent: string;
|
|
443
|
-
readonly gpu:
|
|
440
|
+
readonly gpu: GPU;
|
|
444
441
|
}
|
|
445
442
|
/**
|
|
446
443
|
* Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API.
|
|
447
444
|
*
|
|
448
445
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance)
|
|
449
446
|
*/
|
|
450
|
-
|
|
447
|
+
interface Performance {
|
|
451
448
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin) */
|
|
452
449
|
readonly timeOrigin: number;
|
|
453
450
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/now) */
|
|
454
451
|
now(): number;
|
|
455
452
|
}
|
|
456
|
-
|
|
453
|
+
interface AlarmInvocationInfo {
|
|
457
454
|
readonly isRetry: boolean;
|
|
458
455
|
readonly retryCount: number;
|
|
459
456
|
}
|
|
460
|
-
|
|
457
|
+
interface DurableObject {
|
|
461
458
|
fetch(request: Request): Response | Promise<Response>;
|
|
462
459
|
alarm?(): void | Promise<void>;
|
|
463
460
|
webSocketMessage?(
|
|
@@ -472,7 +469,7 @@ declare interface DurableObject {
|
|
|
472
469
|
): void | Promise<void>;
|
|
473
470
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
474
471
|
}
|
|
475
|
-
|
|
472
|
+
type DurableObjectStub<
|
|
476
473
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
477
474
|
> = Fetcher<
|
|
478
475
|
T,
|
|
@@ -481,12 +478,12 @@ declare type DurableObjectStub<
|
|
|
481
478
|
readonly id: DurableObjectId;
|
|
482
479
|
readonly name?: string;
|
|
483
480
|
};
|
|
484
|
-
|
|
481
|
+
interface DurableObjectId {
|
|
485
482
|
toString(): string;
|
|
486
483
|
equals(other: DurableObjectId): boolean;
|
|
487
484
|
readonly name?: string;
|
|
488
485
|
}
|
|
489
|
-
|
|
486
|
+
interface DurableObjectNamespace<
|
|
490
487
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
491
488
|
> {
|
|
492
489
|
newUniqueId(
|
|
@@ -502,11 +499,11 @@ declare interface DurableObjectNamespace<
|
|
|
502
499
|
jurisdiction: DurableObjectJurisdiction,
|
|
503
500
|
): DurableObjectNamespace<T>;
|
|
504
501
|
}
|
|
505
|
-
|
|
506
|
-
|
|
502
|
+
type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
503
|
+
interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
507
504
|
jurisdiction?: DurableObjectJurisdiction;
|
|
508
505
|
}
|
|
509
|
-
|
|
506
|
+
type DurableObjectLocationHint =
|
|
510
507
|
| "wnam"
|
|
511
508
|
| "enam"
|
|
512
509
|
| "sam"
|
|
@@ -516,10 +513,10 @@ declare type DurableObjectLocationHint =
|
|
|
516
513
|
| "oc"
|
|
517
514
|
| "afr"
|
|
518
515
|
| "me";
|
|
519
|
-
|
|
516
|
+
interface DurableObjectNamespaceGetDurableObjectOptions {
|
|
520
517
|
locationHint?: DurableObjectLocationHint;
|
|
521
518
|
}
|
|
522
|
-
|
|
519
|
+
interface DurableObjectState {
|
|
523
520
|
waitUntil(promise: Promise<any>): void;
|
|
524
521
|
readonly id: DurableObjectId;
|
|
525
522
|
readonly storage: DurableObjectStorage;
|
|
@@ -533,7 +530,7 @@ declare interface DurableObjectState {
|
|
|
533
530
|
getHibernatableWebSocketEventTimeout(): number | null;
|
|
534
531
|
getTags(ws: WebSocket): string[];
|
|
535
532
|
}
|
|
536
|
-
|
|
533
|
+
interface DurableObjectTransaction {
|
|
537
534
|
get<T = unknown>(
|
|
538
535
|
key: string,
|
|
539
536
|
options?: DurableObjectGetOptions,
|
|
@@ -564,7 +561,7 @@ declare interface DurableObjectTransaction {
|
|
|
564
561
|
): Promise<void>;
|
|
565
562
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
566
563
|
}
|
|
567
|
-
|
|
564
|
+
interface DurableObjectStorage {
|
|
568
565
|
get<T = unknown>(
|
|
569
566
|
key: string,
|
|
570
567
|
options?: DurableObjectGetOptions,
|
|
@@ -600,7 +597,7 @@ declare interface DurableObjectStorage {
|
|
|
600
597
|
sync(): Promise<void>;
|
|
601
598
|
transactionSync<T>(closure: () => T): T;
|
|
602
599
|
}
|
|
603
|
-
|
|
600
|
+
interface DurableObjectListOptions {
|
|
604
601
|
start?: string;
|
|
605
602
|
startAfter?: string;
|
|
606
603
|
end?: string;
|
|
@@ -610,19 +607,19 @@ declare interface DurableObjectListOptions {
|
|
|
610
607
|
allowConcurrency?: boolean;
|
|
611
608
|
noCache?: boolean;
|
|
612
609
|
}
|
|
613
|
-
|
|
610
|
+
interface DurableObjectGetOptions {
|
|
614
611
|
allowConcurrency?: boolean;
|
|
615
612
|
noCache?: boolean;
|
|
616
613
|
}
|
|
617
|
-
|
|
614
|
+
interface DurableObjectGetAlarmOptions {
|
|
618
615
|
allowConcurrency?: boolean;
|
|
619
616
|
}
|
|
620
|
-
|
|
617
|
+
interface DurableObjectPutOptions {
|
|
621
618
|
allowConcurrency?: boolean;
|
|
622
619
|
allowUnconfirmed?: boolean;
|
|
623
620
|
noCache?: boolean;
|
|
624
621
|
}
|
|
625
|
-
|
|
622
|
+
interface DurableObjectSetAlarmOptions {
|
|
626
623
|
allowConcurrency?: boolean;
|
|
627
624
|
allowUnconfirmed?: boolean;
|
|
628
625
|
}
|
|
@@ -631,10 +628,10 @@ declare class WebSocketRequestResponsePair {
|
|
|
631
628
|
get request(): string;
|
|
632
629
|
get response(): string;
|
|
633
630
|
}
|
|
634
|
-
|
|
631
|
+
interface AnalyticsEngineDataset {
|
|
635
632
|
writeDataPoint(event?: AnalyticsEngineDataPoint): void;
|
|
636
633
|
}
|
|
637
|
-
|
|
634
|
+
interface AnalyticsEngineDataPoint {
|
|
638
635
|
indexes?: ((ArrayBuffer | string) | null)[];
|
|
639
636
|
doubles?: number[];
|
|
640
637
|
blobs?: ((ArrayBuffer | string) | null)[];
|
|
@@ -748,20 +745,20 @@ declare class Event {
|
|
|
748
745
|
static readonly AT_TARGET: number;
|
|
749
746
|
static readonly BUBBLING_PHASE: number;
|
|
750
747
|
}
|
|
751
|
-
|
|
748
|
+
interface EventInit {
|
|
752
749
|
bubbles?: boolean;
|
|
753
750
|
cancelable?: boolean;
|
|
754
751
|
composed?: boolean;
|
|
755
752
|
}
|
|
756
|
-
|
|
753
|
+
type EventListener<EventType extends Event = Event> = (
|
|
757
754
|
event: EventType,
|
|
758
755
|
) => void;
|
|
759
|
-
|
|
756
|
+
interface EventListenerObject<EventType extends Event = Event> {
|
|
760
757
|
handleEvent(event: EventType): void;
|
|
761
758
|
}
|
|
762
|
-
|
|
763
|
-
EventType
|
|
764
|
-
|
|
759
|
+
type EventListenerOrEventListenerObject<EventType extends Event = Event> =
|
|
760
|
+
| EventListener<EventType>
|
|
761
|
+
| EventListenerObject<EventType>;
|
|
765
762
|
declare class EventTarget<
|
|
766
763
|
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
767
764
|
> {
|
|
@@ -805,16 +802,16 @@ declare class EventTarget<
|
|
|
805
802
|
*/
|
|
806
803
|
dispatchEvent(event: EventMap[keyof EventMap]): boolean;
|
|
807
804
|
}
|
|
808
|
-
|
|
805
|
+
interface EventTargetEventListenerOptions {
|
|
809
806
|
capture?: boolean;
|
|
810
807
|
}
|
|
811
|
-
|
|
808
|
+
interface EventTargetAddEventListenerOptions {
|
|
812
809
|
capture?: boolean;
|
|
813
810
|
passive?: boolean;
|
|
814
811
|
once?: boolean;
|
|
815
812
|
signal?: AbortSignal;
|
|
816
813
|
}
|
|
817
|
-
|
|
814
|
+
interface EventTargetHandlerObject {
|
|
818
815
|
handleEvent: (event: Event) => any | undefined;
|
|
819
816
|
}
|
|
820
817
|
declare class AbortController {
|
|
@@ -853,10 +850,10 @@ declare abstract class AbortSignal extends EventTarget {
|
|
|
853
850
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
854
851
|
throwIfAborted(): void;
|
|
855
852
|
}
|
|
856
|
-
|
|
853
|
+
interface Scheduler {
|
|
857
854
|
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
|
858
855
|
}
|
|
859
|
-
|
|
856
|
+
interface SchedulerWaitOptions {
|
|
860
857
|
signal?: AbortSignal;
|
|
861
858
|
}
|
|
862
859
|
declare abstract class ExtendableEvent extends Event {
|
|
@@ -872,7 +869,7 @@ declare class CustomEvent<T = any> extends Event {
|
|
|
872
869
|
*/
|
|
873
870
|
get detail(): T;
|
|
874
871
|
}
|
|
875
|
-
|
|
872
|
+
interface CustomEventCustomEventInit {
|
|
876
873
|
bubbles?: boolean;
|
|
877
874
|
cancelable?: boolean;
|
|
878
875
|
composed?: boolean;
|
|
@@ -897,7 +894,7 @@ declare class Blob {
|
|
|
897
894
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
898
895
|
stream(): ReadableStream;
|
|
899
896
|
}
|
|
900
|
-
|
|
897
|
+
interface BlobOptions {
|
|
901
898
|
type?: string;
|
|
902
899
|
}
|
|
903
900
|
declare class File extends Blob {
|
|
@@ -911,7 +908,7 @@ declare class File extends Blob {
|
|
|
911
908
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
912
909
|
get lastModified(): number;
|
|
913
910
|
}
|
|
914
|
-
|
|
911
|
+
interface FileOptions {
|
|
915
912
|
type?: string;
|
|
916
913
|
lastModified?: number;
|
|
917
914
|
}
|
|
@@ -928,7 +925,7 @@ declare abstract class Cache {
|
|
|
928
925
|
): Promise<Response | undefined>;
|
|
929
926
|
put(request: RequestInfo, response: Response): Promise<void>;
|
|
930
927
|
}
|
|
931
|
-
|
|
928
|
+
interface CacheQueryOptions {
|
|
932
929
|
ignoreMethod?: boolean;
|
|
933
930
|
}
|
|
934
931
|
declare abstract class Crypto {
|
|
@@ -1049,11 +1046,11 @@ declare abstract class CryptoKey {
|
|
|
1049
1046
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
1050
1047
|
readonly usages: string[];
|
|
1051
1048
|
}
|
|
1052
|
-
|
|
1049
|
+
interface CryptoKeyPair {
|
|
1053
1050
|
publicKey: CryptoKey;
|
|
1054
1051
|
privateKey: CryptoKey;
|
|
1055
1052
|
}
|
|
1056
|
-
|
|
1053
|
+
interface JsonWebKey {
|
|
1057
1054
|
kty: string;
|
|
1058
1055
|
use?: string;
|
|
1059
1056
|
key_ops?: string[];
|
|
@@ -1073,12 +1070,12 @@ declare interface JsonWebKey {
|
|
|
1073
1070
|
oth?: RsaOtherPrimesInfo[];
|
|
1074
1071
|
k?: string;
|
|
1075
1072
|
}
|
|
1076
|
-
|
|
1073
|
+
interface RsaOtherPrimesInfo {
|
|
1077
1074
|
r?: string;
|
|
1078
1075
|
d?: string;
|
|
1079
1076
|
t?: string;
|
|
1080
1077
|
}
|
|
1081
|
-
|
|
1078
|
+
interface SubtleCryptoDeriveKeyAlgorithm {
|
|
1082
1079
|
name: string;
|
|
1083
1080
|
salt?: ArrayBuffer;
|
|
1084
1081
|
iterations?: number;
|
|
@@ -1086,7 +1083,7 @@ declare interface SubtleCryptoDeriveKeyAlgorithm {
|
|
|
1086
1083
|
$public?: CryptoKey;
|
|
1087
1084
|
info?: ArrayBuffer;
|
|
1088
1085
|
}
|
|
1089
|
-
|
|
1086
|
+
interface SubtleCryptoEncryptAlgorithm {
|
|
1090
1087
|
name: string;
|
|
1091
1088
|
iv?: ArrayBuffer;
|
|
1092
1089
|
additionalData?: ArrayBuffer;
|
|
@@ -1095,7 +1092,7 @@ declare interface SubtleCryptoEncryptAlgorithm {
|
|
|
1095
1092
|
length?: number;
|
|
1096
1093
|
label?: ArrayBuffer;
|
|
1097
1094
|
}
|
|
1098
|
-
|
|
1095
|
+
interface SubtleCryptoGenerateKeyAlgorithm {
|
|
1099
1096
|
name: string;
|
|
1100
1097
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1101
1098
|
modulusLength?: number;
|
|
@@ -1103,45 +1100,45 @@ declare interface SubtleCryptoGenerateKeyAlgorithm {
|
|
|
1103
1100
|
length?: number;
|
|
1104
1101
|
namedCurve?: string;
|
|
1105
1102
|
}
|
|
1106
|
-
|
|
1103
|
+
interface SubtleCryptoHashAlgorithm {
|
|
1107
1104
|
name: string;
|
|
1108
1105
|
}
|
|
1109
|
-
|
|
1106
|
+
interface SubtleCryptoImportKeyAlgorithm {
|
|
1110
1107
|
name: string;
|
|
1111
1108
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1112
1109
|
length?: number;
|
|
1113
1110
|
namedCurve?: string;
|
|
1114
1111
|
compressed?: boolean;
|
|
1115
1112
|
}
|
|
1116
|
-
|
|
1113
|
+
interface SubtleCryptoSignAlgorithm {
|
|
1117
1114
|
name: string;
|
|
1118
1115
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1119
1116
|
dataLength?: number;
|
|
1120
1117
|
saltLength?: number;
|
|
1121
1118
|
}
|
|
1122
|
-
|
|
1119
|
+
interface CryptoKeyKeyAlgorithm {
|
|
1123
1120
|
name: string;
|
|
1124
1121
|
}
|
|
1125
|
-
|
|
1122
|
+
interface CryptoKeyAesKeyAlgorithm {
|
|
1126
1123
|
name: string;
|
|
1127
1124
|
length: number;
|
|
1128
1125
|
}
|
|
1129
|
-
|
|
1126
|
+
interface CryptoKeyHmacKeyAlgorithm {
|
|
1130
1127
|
name: string;
|
|
1131
1128
|
hash: CryptoKeyKeyAlgorithm;
|
|
1132
1129
|
length: number;
|
|
1133
1130
|
}
|
|
1134
|
-
|
|
1131
|
+
interface CryptoKeyRsaKeyAlgorithm {
|
|
1135
1132
|
name: string;
|
|
1136
1133
|
modulusLength: number;
|
|
1137
1134
|
publicExponent: ArrayBuffer | (ArrayBuffer | ArrayBufferView);
|
|
1138
1135
|
hash?: CryptoKeyKeyAlgorithm;
|
|
1139
1136
|
}
|
|
1140
|
-
|
|
1137
|
+
interface CryptoKeyEllipticKeyAlgorithm {
|
|
1141
1138
|
name: string;
|
|
1142
1139
|
namedCurve: string;
|
|
1143
1140
|
}
|
|
1144
|
-
|
|
1141
|
+
interface CryptoKeyArbitraryKeyAlgorithm {
|
|
1145
1142
|
name: string;
|
|
1146
1143
|
hash?: CryptoKeyKeyAlgorithm;
|
|
1147
1144
|
namedCurve?: string;
|
|
@@ -1198,14 +1195,14 @@ declare class TextEncoder {
|
|
|
1198
1195
|
): TextEncoderEncodeIntoResult;
|
|
1199
1196
|
get encoding(): string;
|
|
1200
1197
|
}
|
|
1201
|
-
|
|
1198
|
+
interface TextDecoderConstructorOptions {
|
|
1202
1199
|
fatal: boolean;
|
|
1203
1200
|
ignoreBOM: boolean;
|
|
1204
1201
|
}
|
|
1205
|
-
|
|
1202
|
+
interface TextDecoderDecodeOptions {
|
|
1206
1203
|
stream: boolean;
|
|
1207
1204
|
}
|
|
1208
|
-
|
|
1205
|
+
interface TextEncoderEncodeIntoResult {
|
|
1209
1206
|
read: number;
|
|
1210
1207
|
written: number;
|
|
1211
1208
|
}
|
|
@@ -1222,7 +1219,7 @@ declare class ErrorEvent extends Event {
|
|
|
1222
1219
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1223
1220
|
get error(): any;
|
|
1224
1221
|
}
|
|
1225
|
-
|
|
1222
|
+
interface ErrorEventErrorEventInit {
|
|
1226
1223
|
message?: string;
|
|
1227
1224
|
filename?: string;
|
|
1228
1225
|
lineno?: number;
|
|
@@ -1256,7 +1253,7 @@ declare class FormData {
|
|
|
1256
1253
|
): void;
|
|
1257
1254
|
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
|
|
1258
1255
|
}
|
|
1259
|
-
|
|
1256
|
+
interface ContentOptions {
|
|
1260
1257
|
html?: boolean;
|
|
1261
1258
|
}
|
|
1262
1259
|
declare class HTMLRewriter {
|
|
@@ -1268,23 +1265,23 @@ declare class HTMLRewriter {
|
|
|
1268
1265
|
onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
|
|
1269
1266
|
transform(response: Response): Response;
|
|
1270
1267
|
}
|
|
1271
|
-
|
|
1268
|
+
interface HTMLRewriterElementContentHandlers {
|
|
1272
1269
|
element?(element: Element): void | Promise<void>;
|
|
1273
1270
|
comments?(comment: Comment): void | Promise<void>;
|
|
1274
1271
|
text?(element: Text): void | Promise<void>;
|
|
1275
1272
|
}
|
|
1276
|
-
|
|
1273
|
+
interface HTMLRewriterDocumentContentHandlers {
|
|
1277
1274
|
doctype?(doctype: Doctype): void | Promise<void>;
|
|
1278
1275
|
comments?(comment: Comment): void | Promise<void>;
|
|
1279
1276
|
text?(text: Text): void | Promise<void>;
|
|
1280
1277
|
end?(end: DocumentEnd): void | Promise<void>;
|
|
1281
1278
|
}
|
|
1282
|
-
|
|
1279
|
+
interface Doctype {
|
|
1283
1280
|
readonly name: string | null;
|
|
1284
1281
|
readonly publicId: string | null;
|
|
1285
1282
|
readonly systemId: string | null;
|
|
1286
1283
|
}
|
|
1287
|
-
|
|
1284
|
+
interface Element {
|
|
1288
1285
|
tagName: string;
|
|
1289
1286
|
readonly attributes: IterableIterator<string[]>;
|
|
1290
1287
|
readonly removed: boolean;
|
|
@@ -1303,13 +1300,13 @@ declare interface Element {
|
|
|
1303
1300
|
setInnerContent(content: string, options?: ContentOptions): Element;
|
|
1304
1301
|
onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
|
|
1305
1302
|
}
|
|
1306
|
-
|
|
1303
|
+
interface EndTag {
|
|
1307
1304
|
name: string;
|
|
1308
1305
|
before(content: string, options?: ContentOptions): EndTag;
|
|
1309
1306
|
after(content: string, options?: ContentOptions): EndTag;
|
|
1310
1307
|
remove(): EndTag;
|
|
1311
1308
|
}
|
|
1312
|
-
|
|
1309
|
+
interface Comment {
|
|
1313
1310
|
text: string;
|
|
1314
1311
|
readonly removed: boolean;
|
|
1315
1312
|
before(content: string, options?: ContentOptions): Comment;
|
|
@@ -1317,7 +1314,7 @@ declare interface Comment {
|
|
|
1317
1314
|
replace(content: string, options?: ContentOptions): Comment;
|
|
1318
1315
|
remove(): Comment;
|
|
1319
1316
|
}
|
|
1320
|
-
|
|
1317
|
+
interface Text {
|
|
1321
1318
|
readonly text: string;
|
|
1322
1319
|
readonly lastInTextNode: boolean;
|
|
1323
1320
|
readonly removed: boolean;
|
|
@@ -1326,7 +1323,7 @@ declare interface Text {
|
|
|
1326
1323
|
replace(content: string, options?: ContentOptions): Text;
|
|
1327
1324
|
remove(): Text;
|
|
1328
1325
|
}
|
|
1329
|
-
|
|
1326
|
+
interface DocumentEnd {
|
|
1330
1327
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
1331
1328
|
}
|
|
1332
1329
|
declare abstract class FetchEvent extends ExtendableEvent {
|
|
@@ -1336,7 +1333,7 @@ declare abstract class FetchEvent extends ExtendableEvent {
|
|
|
1336
1333
|
respondWith(promise: Response | Promise<Response>): void;
|
|
1337
1334
|
passThroughOnException(): void;
|
|
1338
1335
|
}
|
|
1339
|
-
|
|
1336
|
+
type HeadersInit =
|
|
1340
1337
|
| Headers
|
|
1341
1338
|
| Iterable<Iterable<string>>
|
|
1342
1339
|
| Record<string, string>;
|
|
@@ -1360,7 +1357,7 @@ declare class Headers {
|
|
|
1360
1357
|
values(): IterableIterator<string>;
|
|
1361
1358
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1362
1359
|
}
|
|
1363
|
-
|
|
1360
|
+
type BodyInit =
|
|
1364
1361
|
| ReadableStream<Uint8Array>
|
|
1365
1362
|
| string
|
|
1366
1363
|
| ArrayBuffer
|
|
@@ -1401,7 +1398,7 @@ declare class Response extends Body {
|
|
|
1401
1398
|
get webSocket(): WebSocket | null;
|
|
1402
1399
|
get cf(): any | undefined;
|
|
1403
1400
|
}
|
|
1404
|
-
|
|
1401
|
+
interface ResponseInit {
|
|
1405
1402
|
status?: number;
|
|
1406
1403
|
statusText?: string;
|
|
1407
1404
|
headers?: HeadersInit;
|
|
@@ -1409,10 +1406,10 @@ declare interface ResponseInit {
|
|
|
1409
1406
|
webSocket?: WebSocket | null;
|
|
1410
1407
|
encodeBody?: "automatic" | "manual";
|
|
1411
1408
|
}
|
|
1412
|
-
|
|
1413
|
-
CfHostMetadata
|
|
1414
|
-
|
|
1415
|
-
|
|
1409
|
+
type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
1410
|
+
| Request<CfHostMetadata, Cf>
|
|
1411
|
+
| string
|
|
1412
|
+
| URL;
|
|
1416
1413
|
declare class Request<
|
|
1417
1414
|
CfHostMetadata = unknown,
|
|
1418
1415
|
Cf = CfProperties<CfHostMetadata>,
|
|
@@ -1465,7 +1462,7 @@ declare class Request<
|
|
|
1465
1462
|
*/
|
|
1466
1463
|
get keepalive(): boolean;
|
|
1467
1464
|
}
|
|
1468
|
-
|
|
1465
|
+
interface RequestInit<Cf = CfProperties> {
|
|
1469
1466
|
/** A string to set request's method. */
|
|
1470
1467
|
method?: string;
|
|
1471
1468
|
/** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
|
|
@@ -1481,10 +1478,9 @@ declare interface RequestInit<Cf = CfProperties> {
|
|
|
1481
1478
|
/** An AbortSignal to set request's signal. */
|
|
1482
1479
|
signal?: AbortSignal | null;
|
|
1483
1480
|
}
|
|
1484
|
-
|
|
1485
|
-
T
|
|
1486
|
-
|
|
1487
|
-
declare type Fetcher<
|
|
1481
|
+
type Service<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> =
|
|
1482
|
+
Fetcher<T>;
|
|
1483
|
+
type Fetcher<
|
|
1488
1484
|
T extends Rpc.EntrypointBranded | undefined = undefined,
|
|
1489
1485
|
Reserved extends string = never,
|
|
1490
1486
|
> = (T extends Rpc.EntrypointBranded
|
|
@@ -1493,16 +1489,16 @@ declare type Fetcher<
|
|
|
1493
1489
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1494
1490
|
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1495
1491
|
};
|
|
1496
|
-
|
|
1492
|
+
interface FetcherPutOptions {
|
|
1497
1493
|
expiration?: number;
|
|
1498
1494
|
expirationTtl?: number;
|
|
1499
1495
|
}
|
|
1500
|
-
|
|
1496
|
+
interface KVNamespaceListKey<Metadata, Key extends string = string> {
|
|
1501
1497
|
name: Key;
|
|
1502
1498
|
expiration?: number;
|
|
1503
1499
|
metadata?: Metadata;
|
|
1504
1500
|
}
|
|
1505
|
-
|
|
1501
|
+
type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
1506
1502
|
| {
|
|
1507
1503
|
list_complete: false;
|
|
1508
1504
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
@@ -1514,7 +1510,7 @@ declare type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
|
1514
1510
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
1515
1511
|
cacheStatus: string | null;
|
|
1516
1512
|
};
|
|
1517
|
-
|
|
1513
|
+
interface KVNamespace<Key extends string = string> {
|
|
1518
1514
|
get(
|
|
1519
1515
|
key: Key,
|
|
1520
1516
|
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
@@ -1588,49 +1584,49 @@ declare interface KVNamespace<Key extends string = string> {
|
|
|
1588
1584
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1589
1585
|
delete(key: Key): Promise<void>;
|
|
1590
1586
|
}
|
|
1591
|
-
|
|
1587
|
+
interface KVNamespaceListOptions {
|
|
1592
1588
|
limit?: number;
|
|
1593
1589
|
prefix?: string | null;
|
|
1594
1590
|
cursor?: string | null;
|
|
1595
1591
|
}
|
|
1596
|
-
|
|
1592
|
+
interface KVNamespaceGetOptions<Type> {
|
|
1597
1593
|
type: Type;
|
|
1598
1594
|
cacheTtl?: number;
|
|
1599
1595
|
}
|
|
1600
|
-
|
|
1596
|
+
interface KVNamespacePutOptions {
|
|
1601
1597
|
expiration?: number;
|
|
1602
1598
|
expirationTtl?: number;
|
|
1603
1599
|
metadata?: any | null;
|
|
1604
1600
|
}
|
|
1605
|
-
|
|
1601
|
+
interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
1606
1602
|
value: Value | null;
|
|
1607
1603
|
metadata: Metadata | null;
|
|
1608
1604
|
cacheStatus: string | null;
|
|
1609
1605
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1606
|
+
type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1607
|
+
interface Queue<Body = unknown> {
|
|
1612
1608
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1613
1609
|
sendBatch(
|
|
1614
1610
|
messages: Iterable<MessageSendRequest<Body>>,
|
|
1615
1611
|
options?: QueueSendBatchOptions,
|
|
1616
1612
|
): Promise<void>;
|
|
1617
1613
|
}
|
|
1618
|
-
|
|
1614
|
+
interface QueueSendOptions {
|
|
1619
1615
|
contentType?: QueueContentType;
|
|
1620
1616
|
delaySeconds?: number;
|
|
1621
1617
|
}
|
|
1622
|
-
|
|
1618
|
+
interface QueueSendBatchOptions {
|
|
1623
1619
|
delaySeconds?: number;
|
|
1624
1620
|
}
|
|
1625
|
-
|
|
1621
|
+
interface MessageSendRequest<Body = unknown> {
|
|
1626
1622
|
body: Body;
|
|
1627
1623
|
contentType?: QueueContentType;
|
|
1628
1624
|
delaySeconds?: number;
|
|
1629
1625
|
}
|
|
1630
|
-
|
|
1626
|
+
interface QueueRetryOptions {
|
|
1631
1627
|
delaySeconds?: number;
|
|
1632
1628
|
}
|
|
1633
|
-
|
|
1629
|
+
interface Message<Body = unknown> {
|
|
1634
1630
|
readonly id: string;
|
|
1635
1631
|
readonly timestamp: Date;
|
|
1636
1632
|
readonly body: Body;
|
|
@@ -1638,26 +1634,26 @@ declare interface Message<Body = unknown> {
|
|
|
1638
1634
|
retry(options?: QueueRetryOptions): void;
|
|
1639
1635
|
ack(): void;
|
|
1640
1636
|
}
|
|
1641
|
-
|
|
1637
|
+
interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1642
1638
|
readonly messages: readonly Message<Body>[];
|
|
1643
1639
|
readonly queue: string;
|
|
1644
1640
|
retryAll(options?: QueueRetryOptions): void;
|
|
1645
1641
|
ackAll(): void;
|
|
1646
1642
|
}
|
|
1647
|
-
|
|
1643
|
+
interface MessageBatch<Body = unknown> {
|
|
1648
1644
|
readonly messages: readonly Message<Body>[];
|
|
1649
1645
|
readonly queue: string;
|
|
1650
1646
|
retryAll(options?: QueueRetryOptions): void;
|
|
1651
1647
|
ackAll(): void;
|
|
1652
1648
|
}
|
|
1653
|
-
|
|
1649
|
+
interface R2Error extends Error {
|
|
1654
1650
|
readonly name: string;
|
|
1655
1651
|
readonly code: number;
|
|
1656
1652
|
readonly message: string;
|
|
1657
1653
|
readonly action: string;
|
|
1658
1654
|
readonly stack: any;
|
|
1659
1655
|
}
|
|
1660
|
-
|
|
1656
|
+
interface R2ListOptions {
|
|
1661
1657
|
limit?: number;
|
|
1662
1658
|
prefix?: string;
|
|
1663
1659
|
cursor?: string;
|
|
@@ -1706,7 +1702,7 @@ declare abstract class R2Bucket {
|
|
|
1706
1702
|
delete(keys: string | string[]): Promise<void>;
|
|
1707
1703
|
list(options?: R2ListOptions): Promise<R2Objects>;
|
|
1708
1704
|
}
|
|
1709
|
-
|
|
1705
|
+
interface R2MultipartUpload {
|
|
1710
1706
|
readonly key: string;
|
|
1711
1707
|
readonly uploadId: string;
|
|
1712
1708
|
uploadPart(
|
|
@@ -1716,7 +1712,7 @@ declare interface R2MultipartUpload {
|
|
|
1716
1712
|
abort(): Promise<void>;
|
|
1717
1713
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
1718
1714
|
}
|
|
1719
|
-
|
|
1715
|
+
interface R2UploadedPart {
|
|
1720
1716
|
partNumber: number;
|
|
1721
1717
|
etag: string;
|
|
1722
1718
|
}
|
|
@@ -1734,7 +1730,7 @@ declare abstract class R2Object {
|
|
|
1734
1730
|
readonly storageClass: string;
|
|
1735
1731
|
writeHttpMetadata(headers: Headers): void;
|
|
1736
1732
|
}
|
|
1737
|
-
|
|
1733
|
+
interface R2ObjectBody extends R2Object {
|
|
1738
1734
|
get body(): ReadableStream;
|
|
1739
1735
|
get bodyUsed(): boolean;
|
|
1740
1736
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
@@ -1742,7 +1738,7 @@ declare interface R2ObjectBody extends R2Object {
|
|
|
1742
1738
|
json<T>(): Promise<T>;
|
|
1743
1739
|
blob(): Promise<Blob>;
|
|
1744
1740
|
}
|
|
1745
|
-
|
|
1741
|
+
type R2Range =
|
|
1746
1742
|
| {
|
|
1747
1743
|
offset: number;
|
|
1748
1744
|
length?: number;
|
|
@@ -1754,18 +1750,18 @@ declare type R2Range =
|
|
|
1754
1750
|
| {
|
|
1755
1751
|
suffix: number;
|
|
1756
1752
|
};
|
|
1757
|
-
|
|
1753
|
+
interface R2Conditional {
|
|
1758
1754
|
etagMatches?: string;
|
|
1759
1755
|
etagDoesNotMatch?: string;
|
|
1760
1756
|
uploadedBefore?: Date;
|
|
1761
1757
|
uploadedAfter?: Date;
|
|
1762
1758
|
secondsGranularity?: boolean;
|
|
1763
1759
|
}
|
|
1764
|
-
|
|
1760
|
+
interface R2GetOptions {
|
|
1765
1761
|
onlyIf?: R2Conditional | Headers;
|
|
1766
1762
|
range?: R2Range | Headers;
|
|
1767
1763
|
}
|
|
1768
|
-
|
|
1764
|
+
interface R2PutOptions {
|
|
1769
1765
|
onlyIf?: R2Conditional | Headers;
|
|
1770
1766
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1771
1767
|
customMetadata?: Record<string, string>;
|
|
@@ -1776,12 +1772,12 @@ declare interface R2PutOptions {
|
|
|
1776
1772
|
sha512?: ArrayBuffer | string;
|
|
1777
1773
|
storageClass?: string;
|
|
1778
1774
|
}
|
|
1779
|
-
|
|
1775
|
+
interface R2MultipartOptions {
|
|
1780
1776
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1781
1777
|
customMetadata?: Record<string, string>;
|
|
1782
1778
|
storageClass?: string;
|
|
1783
1779
|
}
|
|
1784
|
-
|
|
1780
|
+
interface R2Checksums {
|
|
1785
1781
|
readonly md5?: ArrayBuffer;
|
|
1786
1782
|
readonly sha1?: ArrayBuffer;
|
|
1787
1783
|
readonly sha256?: ArrayBuffer;
|
|
@@ -1789,14 +1785,14 @@ declare interface R2Checksums {
|
|
|
1789
1785
|
readonly sha512?: ArrayBuffer;
|
|
1790
1786
|
toJSON(): R2StringChecksums;
|
|
1791
1787
|
}
|
|
1792
|
-
|
|
1788
|
+
interface R2StringChecksums {
|
|
1793
1789
|
md5?: string;
|
|
1794
1790
|
sha1?: string;
|
|
1795
1791
|
sha256?: string;
|
|
1796
1792
|
sha384?: string;
|
|
1797
1793
|
sha512?: string;
|
|
1798
1794
|
}
|
|
1799
|
-
|
|
1795
|
+
interface R2HTTPMetadata {
|
|
1800
1796
|
contentType?: string;
|
|
1801
1797
|
contentLanguage?: string;
|
|
1802
1798
|
contentDisposition?: string;
|
|
@@ -1804,7 +1800,7 @@ declare interface R2HTTPMetadata {
|
|
|
1804
1800
|
cacheControl?: string;
|
|
1805
1801
|
cacheExpiry?: Date;
|
|
1806
1802
|
}
|
|
1807
|
-
|
|
1803
|
+
type R2Objects = {
|
|
1808
1804
|
objects: R2Object[];
|
|
1809
1805
|
delimitedPrefixes: string[];
|
|
1810
1806
|
} & (
|
|
@@ -1821,16 +1817,16 @@ declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
|
1821
1817
|
readonly cron: string;
|
|
1822
1818
|
noRetry(): void;
|
|
1823
1819
|
}
|
|
1824
|
-
|
|
1820
|
+
interface ScheduledController {
|
|
1825
1821
|
readonly scheduledTime: number;
|
|
1826
1822
|
readonly cron: string;
|
|
1827
1823
|
noRetry(): void;
|
|
1828
1824
|
}
|
|
1829
|
-
|
|
1825
|
+
interface QueuingStrategy<T = any> {
|
|
1830
1826
|
highWaterMark?: number | bigint;
|
|
1831
1827
|
size?: (chunk: T) => number | bigint;
|
|
1832
1828
|
}
|
|
1833
|
-
|
|
1829
|
+
interface UnderlyingSink<W = any> {
|
|
1834
1830
|
type?: string;
|
|
1835
1831
|
start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
|
|
1836
1832
|
write?: (
|
|
@@ -1840,14 +1836,14 @@ declare interface UnderlyingSink<W = any> {
|
|
|
1840
1836
|
abort?: (reason: any) => void | Promise<void>;
|
|
1841
1837
|
close?: () => void | Promise<void>;
|
|
1842
1838
|
}
|
|
1843
|
-
|
|
1839
|
+
interface UnderlyingByteSource {
|
|
1844
1840
|
type: "bytes";
|
|
1845
1841
|
autoAllocateChunkSize?: number;
|
|
1846
1842
|
start?: (controller: ReadableByteStreamController) => void | Promise<void>;
|
|
1847
1843
|
pull?: (controller: ReadableByteStreamController) => void | Promise<void>;
|
|
1848
1844
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1849
1845
|
}
|
|
1850
|
-
|
|
1846
|
+
interface UnderlyingSource<R = any> {
|
|
1851
1847
|
type?: "" | undefined;
|
|
1852
1848
|
start?: (
|
|
1853
1849
|
controller: ReadableStreamDefaultController<R>,
|
|
@@ -1858,7 +1854,7 @@ declare interface UnderlyingSource<R = any> {
|
|
|
1858
1854
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1859
1855
|
expectedLength?: number | bigint;
|
|
1860
1856
|
}
|
|
1861
|
-
|
|
1857
|
+
interface Transformer<I = any, O = any> {
|
|
1862
1858
|
readableType?: string;
|
|
1863
1859
|
writableType?: string;
|
|
1864
1860
|
start?: (
|
|
@@ -1874,7 +1870,7 @@ declare interface Transformer<I = any, O = any> {
|
|
|
1874
1870
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1875
1871
|
expectedLength?: number;
|
|
1876
1872
|
}
|
|
1877
|
-
|
|
1873
|
+
interface StreamPipeOptions {
|
|
1878
1874
|
/**
|
|
1879
1875
|
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
|
1880
1876
|
*
|
|
@@ -1897,7 +1893,7 @@ declare interface StreamPipeOptions {
|
|
|
1897
1893
|
preventCancel?: boolean;
|
|
1898
1894
|
signal?: AbortSignal;
|
|
1899
1895
|
}
|
|
1900
|
-
|
|
1896
|
+
type ReadableStreamReadResult<R = any> =
|
|
1901
1897
|
| {
|
|
1902
1898
|
done: false;
|
|
1903
1899
|
value: R;
|
|
@@ -1911,7 +1907,7 @@ declare type ReadableStreamReadResult<R = any> =
|
|
|
1911
1907
|
*
|
|
1912
1908
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1913
1909
|
*/
|
|
1914
|
-
|
|
1910
|
+
interface ReadableStream<R = any> {
|
|
1915
1911
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1916
1912
|
get locked(): boolean;
|
|
1917
1913
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
@@ -1972,10 +1968,10 @@ declare class ReadableStreamBYOBReader {
|
|
|
1972
1968
|
view: T,
|
|
1973
1969
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1974
1970
|
}
|
|
1975
|
-
|
|
1971
|
+
interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1976
1972
|
min?: number;
|
|
1977
1973
|
}
|
|
1978
|
-
|
|
1974
|
+
interface ReadableStreamGetReaderOptions {
|
|
1979
1975
|
/**
|
|
1980
1976
|
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
|
1981
1977
|
*
|
|
@@ -2030,7 +2026,7 @@ declare abstract class TransformStreamDefaultController<O = any> {
|
|
|
2030
2026
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
2031
2027
|
terminate(): void;
|
|
2032
2028
|
}
|
|
2033
|
-
|
|
2029
|
+
interface ReadableWritablePair<R = any, W = any> {
|
|
2034
2030
|
/**
|
|
2035
2031
|
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
|
|
2036
2032
|
*
|
|
@@ -2093,10 +2089,10 @@ declare class IdentityTransformStream extends TransformStream<
|
|
|
2093
2089
|
> {
|
|
2094
2090
|
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2095
2091
|
}
|
|
2096
|
-
|
|
2092
|
+
interface IdentityTransformStreamQueuingStrategy {
|
|
2097
2093
|
highWaterMark?: number | bigint;
|
|
2098
2094
|
}
|
|
2099
|
-
|
|
2095
|
+
interface ReadableStreamValuesOptions {
|
|
2100
2096
|
preventCancel?: boolean;
|
|
2101
2097
|
}
|
|
2102
2098
|
declare class CompressionStream extends TransformStream<
|
|
@@ -2124,7 +2120,7 @@ declare class TextDecoderStream extends TransformStream<
|
|
|
2124
2120
|
get fatal(): boolean;
|
|
2125
2121
|
get ignoreBOM(): boolean;
|
|
2126
2122
|
}
|
|
2127
|
-
|
|
2123
|
+
interface TextDecoderStreamTextDecoderStreamInit {
|
|
2128
2124
|
fatal?: boolean;
|
|
2129
2125
|
ignoreBOM?: boolean;
|
|
2130
2126
|
}
|
|
@@ -2144,7 +2140,7 @@ declare class CountQueuingStrategy implements QueuingStrategy {
|
|
|
2144
2140
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
2145
2141
|
get size(): (chunk?: any) => number;
|
|
2146
2142
|
}
|
|
2147
|
-
|
|
2143
|
+
interface QueuingStrategyInit {
|
|
2148
2144
|
/**
|
|
2149
2145
|
* Creates a new ByteLengthQueuingStrategy with the provided high water mark.
|
|
2150
2146
|
*
|
|
@@ -2152,7 +2148,7 @@ declare interface QueuingStrategyInit {
|
|
|
2152
2148
|
*/
|
|
2153
2149
|
highWaterMark: number;
|
|
2154
2150
|
}
|
|
2155
|
-
|
|
2151
|
+
interface ScriptVersion {
|
|
2156
2152
|
id?: string;
|
|
2157
2153
|
tag?: string;
|
|
2158
2154
|
message?: string;
|
|
@@ -2161,7 +2157,7 @@ declare abstract class TailEvent extends ExtendableEvent {
|
|
|
2161
2157
|
readonly events: TraceItem[];
|
|
2162
2158
|
readonly traces: TraceItem[];
|
|
2163
2159
|
}
|
|
2164
|
-
|
|
2160
|
+
interface TraceItem {
|
|
2165
2161
|
readonly event:
|
|
2166
2162
|
| (
|
|
2167
2163
|
| TraceItemFetchEventInfo
|
|
@@ -2186,84 +2182,84 @@ declare interface TraceItem {
|
|
|
2186
2182
|
readonly scriptTags?: string[];
|
|
2187
2183
|
readonly outcome: string;
|
|
2188
2184
|
}
|
|
2189
|
-
|
|
2185
|
+
interface TraceItemAlarmEventInfo {
|
|
2190
2186
|
readonly scheduledTime: Date;
|
|
2191
2187
|
}
|
|
2192
|
-
|
|
2193
|
-
|
|
2188
|
+
interface TraceItemCustomEventInfo {}
|
|
2189
|
+
interface TraceItemScheduledEventInfo {
|
|
2194
2190
|
readonly scheduledTime: number;
|
|
2195
2191
|
readonly cron: string;
|
|
2196
2192
|
}
|
|
2197
|
-
|
|
2193
|
+
interface TraceItemQueueEventInfo {
|
|
2198
2194
|
readonly queue: string;
|
|
2199
2195
|
readonly batchSize: number;
|
|
2200
2196
|
}
|
|
2201
|
-
|
|
2197
|
+
interface TraceItemEmailEventInfo {
|
|
2202
2198
|
readonly mailFrom: string;
|
|
2203
2199
|
readonly rcptTo: string;
|
|
2204
2200
|
readonly rawSize: number;
|
|
2205
2201
|
}
|
|
2206
|
-
|
|
2202
|
+
interface TraceItemTailEventInfo {
|
|
2207
2203
|
readonly consumedEvents: TraceItemTailEventInfoTailItem[];
|
|
2208
2204
|
}
|
|
2209
|
-
|
|
2205
|
+
interface TraceItemTailEventInfoTailItem {
|
|
2210
2206
|
readonly scriptName: string | null;
|
|
2211
2207
|
}
|
|
2212
|
-
|
|
2208
|
+
interface TraceItemFetchEventInfo {
|
|
2213
2209
|
readonly response?: TraceItemFetchEventInfoResponse;
|
|
2214
2210
|
readonly request: TraceItemFetchEventInfoRequest;
|
|
2215
2211
|
}
|
|
2216
|
-
|
|
2212
|
+
interface TraceItemFetchEventInfoRequest {
|
|
2217
2213
|
readonly cf?: any;
|
|
2218
2214
|
readonly headers: Record<string, string>;
|
|
2219
2215
|
readonly method: string;
|
|
2220
2216
|
readonly url: string;
|
|
2221
2217
|
getUnredacted(): TraceItemFetchEventInfoRequest;
|
|
2222
2218
|
}
|
|
2223
|
-
|
|
2219
|
+
interface TraceItemFetchEventInfoResponse {
|
|
2224
2220
|
readonly status: number;
|
|
2225
2221
|
}
|
|
2226
|
-
|
|
2222
|
+
interface TraceItemJsRpcEventInfo {
|
|
2227
2223
|
readonly rpcMethod: string;
|
|
2228
2224
|
}
|
|
2229
|
-
|
|
2225
|
+
interface TraceItemHibernatableWebSocketEventInfo {
|
|
2230
2226
|
readonly getWebSocketEvent:
|
|
2231
2227
|
| TraceItemHibernatableWebSocketEventInfoMessage
|
|
2232
2228
|
| TraceItemHibernatableWebSocketEventInfoClose
|
|
2233
2229
|
| TraceItemHibernatableWebSocketEventInfoError;
|
|
2234
2230
|
}
|
|
2235
|
-
|
|
2231
|
+
interface TraceItemHibernatableWebSocketEventInfoMessage {
|
|
2236
2232
|
readonly webSocketEventType: string;
|
|
2237
2233
|
}
|
|
2238
|
-
|
|
2234
|
+
interface TraceItemHibernatableWebSocketEventInfoClose {
|
|
2239
2235
|
readonly webSocketEventType: string;
|
|
2240
2236
|
readonly code: number;
|
|
2241
2237
|
readonly wasClean: boolean;
|
|
2242
2238
|
}
|
|
2243
|
-
|
|
2239
|
+
interface TraceItemHibernatableWebSocketEventInfoError {
|
|
2244
2240
|
readonly webSocketEventType: string;
|
|
2245
2241
|
}
|
|
2246
|
-
|
|
2242
|
+
interface TraceLog {
|
|
2247
2243
|
readonly timestamp: number;
|
|
2248
2244
|
readonly level: string;
|
|
2249
2245
|
readonly message: any;
|
|
2250
2246
|
}
|
|
2251
|
-
|
|
2247
|
+
interface TraceException {
|
|
2252
2248
|
readonly timestamp: number;
|
|
2253
2249
|
readonly message: string;
|
|
2254
2250
|
readonly name: string;
|
|
2255
2251
|
readonly stack?: string;
|
|
2256
2252
|
}
|
|
2257
|
-
|
|
2253
|
+
interface TraceDiagnosticChannelEvent {
|
|
2258
2254
|
readonly timestamp: number;
|
|
2259
2255
|
readonly channel: string;
|
|
2260
2256
|
readonly message: any;
|
|
2261
2257
|
}
|
|
2262
|
-
|
|
2258
|
+
interface TraceMetrics {
|
|
2263
2259
|
readonly cpuTime: number;
|
|
2264
2260
|
readonly wallTime: number;
|
|
2265
2261
|
}
|
|
2266
|
-
|
|
2262
|
+
interface UnsafeTraceMetrics {
|
|
2267
2263
|
fromTrace(item: TraceItem): TraceMetrics;
|
|
2268
2264
|
}
|
|
2269
2265
|
declare class URL {
|
|
@@ -2369,7 +2365,7 @@ declare class URLPattern {
|
|
|
2369
2365
|
baseURL?: string,
|
|
2370
2366
|
): URLPatternURLPatternResult | null;
|
|
2371
2367
|
}
|
|
2372
|
-
|
|
2368
|
+
interface URLPatternURLPatternInit {
|
|
2373
2369
|
protocol?: string;
|
|
2374
2370
|
username?: string;
|
|
2375
2371
|
password?: string;
|
|
@@ -2380,11 +2376,11 @@ declare interface URLPatternURLPatternInit {
|
|
|
2380
2376
|
hash?: string;
|
|
2381
2377
|
baseURL?: string;
|
|
2382
2378
|
}
|
|
2383
|
-
|
|
2379
|
+
interface URLPatternURLPatternComponentResult {
|
|
2384
2380
|
input: string;
|
|
2385
2381
|
groups: Record<string, string>;
|
|
2386
2382
|
}
|
|
2387
|
-
|
|
2383
|
+
interface URLPatternURLPatternResult {
|
|
2388
2384
|
inputs: (string | URLPatternURLPatternInit)[];
|
|
2389
2385
|
protocol: URLPatternURLPatternComponentResult;
|
|
2390
2386
|
username: URLPatternURLPatternComponentResult;
|
|
@@ -2395,7 +2391,7 @@ declare interface URLPatternURLPatternResult {
|
|
|
2395
2391
|
search: URLPatternURLPatternComponentResult;
|
|
2396
2392
|
hash: URLPatternURLPatternComponentResult;
|
|
2397
2393
|
}
|
|
2398
|
-
|
|
2394
|
+
interface URLPatternURLPatternOptions {
|
|
2399
2395
|
ignoreCase?: boolean;
|
|
2400
2396
|
}
|
|
2401
2397
|
declare class CloseEvent extends Event {
|
|
@@ -2419,7 +2415,7 @@ declare class CloseEvent extends Event {
|
|
|
2419
2415
|
*/
|
|
2420
2416
|
readonly wasClean: boolean;
|
|
2421
2417
|
}
|
|
2422
|
-
|
|
2418
|
+
interface CloseEventInit {
|
|
2423
2419
|
code?: number;
|
|
2424
2420
|
reason?: string;
|
|
2425
2421
|
wasClean?: boolean;
|
|
@@ -2428,10 +2424,10 @@ declare class MessageEvent extends Event {
|
|
|
2428
2424
|
constructor(type: string, initializer: MessageEventInit);
|
|
2429
2425
|
readonly data: ArrayBuffer | string;
|
|
2430
2426
|
}
|
|
2431
|
-
|
|
2427
|
+
interface MessageEventInit {
|
|
2432
2428
|
data: ArrayBuffer | string;
|
|
2433
2429
|
}
|
|
2434
|
-
|
|
2430
|
+
type WebSocketEventMap = {
|
|
2435
2431
|
close: CloseEvent;
|
|
2436
2432
|
message: MessageEvent;
|
|
2437
2433
|
open: Event;
|
|
@@ -2493,7 +2489,7 @@ declare const WebSocketPair: {
|
|
|
2493
2489
|
1: WebSocket;
|
|
2494
2490
|
};
|
|
2495
2491
|
};
|
|
2496
|
-
|
|
2492
|
+
interface Socket {
|
|
2497
2493
|
get readable(): ReadableStream;
|
|
2498
2494
|
get writable(): WritableStream;
|
|
2499
2495
|
get closed(): Promise<void>;
|
|
@@ -2501,81 +2497,77 @@ declare interface Socket {
|
|
|
2501
2497
|
close(): Promise<void>;
|
|
2502
2498
|
startTls(options?: TlsOptions): Socket;
|
|
2503
2499
|
}
|
|
2504
|
-
|
|
2500
|
+
interface SocketOptions {
|
|
2505
2501
|
secureTransport?: string;
|
|
2506
2502
|
allowHalfOpen: boolean;
|
|
2507
2503
|
highWaterMark?: number | bigint;
|
|
2508
2504
|
}
|
|
2509
|
-
|
|
2505
|
+
interface SocketAddress {
|
|
2510
2506
|
hostname: string;
|
|
2511
2507
|
port: number;
|
|
2512
2508
|
}
|
|
2513
|
-
|
|
2509
|
+
interface TlsOptions {
|
|
2514
2510
|
expectedServerHostname?: string;
|
|
2515
2511
|
}
|
|
2516
|
-
|
|
2512
|
+
interface SocketInfo {
|
|
2517
2513
|
remoteAddress?: string;
|
|
2518
2514
|
localAddress?: string;
|
|
2519
2515
|
}
|
|
2520
|
-
|
|
2521
|
-
requestAdapter(
|
|
2522
|
-
param1?: gpuGPURequestAdapterOptions,
|
|
2523
|
-
): Promise<gpuGPUAdapter | null>;
|
|
2516
|
+
interface GPU {
|
|
2517
|
+
requestAdapter(param1?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
2524
2518
|
}
|
|
2525
|
-
declare abstract class
|
|
2526
|
-
requestDevice(param1?:
|
|
2527
|
-
requestAdapterInfo(unmaskHints?: string[]): Promise<
|
|
2528
|
-
get features():
|
|
2529
|
-
get limits():
|
|
2519
|
+
declare abstract class GPUAdapter {
|
|
2520
|
+
requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
2521
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
|
|
2522
|
+
get features(): GPUSupportedFeatures;
|
|
2523
|
+
get limits(): GPUSupportedLimits;
|
|
2530
2524
|
}
|
|
2531
|
-
|
|
2532
|
-
createBuffer(param1:
|
|
2525
|
+
interface GPUDevice extends EventTarget {
|
|
2526
|
+
createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
|
|
2533
2527
|
createBindGroupLayout(
|
|
2534
|
-
descriptor:
|
|
2535
|
-
):
|
|
2536
|
-
createBindGroup(descriptor:
|
|
2537
|
-
createSampler(descriptor:
|
|
2538
|
-
createShaderModule(
|
|
2539
|
-
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2540
|
-
): gpuGPUShaderModule;
|
|
2528
|
+
descriptor: GPUBindGroupLayoutDescriptor,
|
|
2529
|
+
): GPUBindGroupLayout;
|
|
2530
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
2531
|
+
createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
|
|
2532
|
+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
2541
2533
|
createPipelineLayout(
|
|
2542
|
-
descriptor:
|
|
2543
|
-
):
|
|
2534
|
+
descriptor: GPUPipelineLayoutDescriptor,
|
|
2535
|
+
): GPUPipelineLayout;
|
|
2544
2536
|
createComputePipeline(
|
|
2545
|
-
descriptor:
|
|
2546
|
-
):
|
|
2537
|
+
descriptor: GPUComputePipelineDescriptor,
|
|
2538
|
+
): GPUComputePipeline;
|
|
2547
2539
|
createRenderPipeline(
|
|
2548
|
-
descriptor:
|
|
2549
|
-
):
|
|
2540
|
+
descriptor: GPURenderPipelineDescriptor,
|
|
2541
|
+
): GPURenderPipeline;
|
|
2550
2542
|
createCommandEncoder(
|
|
2551
|
-
descriptor?:
|
|
2552
|
-
):
|
|
2553
|
-
createTexture(param1:
|
|
2543
|
+
descriptor?: GPUCommandEncoderDescriptor,
|
|
2544
|
+
): GPUCommandEncoder;
|
|
2545
|
+
createTexture(param1: GPUTextureDescriptor): GPUTexture;
|
|
2554
2546
|
destroy(): void;
|
|
2555
|
-
createQuerySet(descriptor:
|
|
2547
|
+
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
2556
2548
|
pushErrorScope(filter: string): void;
|
|
2557
|
-
popErrorScope(): Promise<
|
|
2558
|
-
get queue():
|
|
2559
|
-
get lost(): Promise<
|
|
2560
|
-
get features():
|
|
2561
|
-
get limits():
|
|
2549
|
+
popErrorScope(): Promise<GPUError | null>;
|
|
2550
|
+
get queue(): GPUQueue;
|
|
2551
|
+
get lost(): Promise<GPUDeviceLostInfo>;
|
|
2552
|
+
get features(): GPUSupportedFeatures;
|
|
2553
|
+
get limits(): GPUSupportedLimits;
|
|
2562
2554
|
}
|
|
2563
|
-
|
|
2555
|
+
interface GPUDeviceDescriptor {
|
|
2564
2556
|
label?: string;
|
|
2565
2557
|
requiredFeatures?: string[];
|
|
2566
2558
|
requiredLimits?: Record<string, number | bigint>;
|
|
2567
|
-
defaultQueue?:
|
|
2559
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
2568
2560
|
}
|
|
2569
|
-
|
|
2561
|
+
interface GPUBufferDescriptor {
|
|
2570
2562
|
label: string;
|
|
2571
2563
|
size: number | bigint;
|
|
2572
2564
|
usage: number;
|
|
2573
2565
|
mappedAtCreation: boolean;
|
|
2574
2566
|
}
|
|
2575
|
-
|
|
2567
|
+
interface GPUQueueDescriptor {
|
|
2576
2568
|
label?: string;
|
|
2577
2569
|
}
|
|
2578
|
-
declare abstract class
|
|
2570
|
+
declare abstract class GPUBufferUsage {
|
|
2579
2571
|
static readonly MAP_READ: number;
|
|
2580
2572
|
static readonly MAP_WRITE: number;
|
|
2581
2573
|
static readonly COPY_SRC: number;
|
|
@@ -2587,7 +2579,7 @@ declare abstract class gpuGPUBufferUsage {
|
|
|
2587
2579
|
static readonly INDIRECT: number;
|
|
2588
2580
|
static readonly QUERY_RESOLVE: number;
|
|
2589
2581
|
}
|
|
2590
|
-
|
|
2582
|
+
interface GPUBuffer {
|
|
2591
2583
|
getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
|
|
2592
2584
|
unmap(): void;
|
|
2593
2585
|
destroy(): void;
|
|
@@ -2600,59 +2592,59 @@ declare interface gpuGPUBuffer {
|
|
|
2600
2592
|
get usage(): number;
|
|
2601
2593
|
get mapState(): string;
|
|
2602
2594
|
}
|
|
2603
|
-
declare abstract class
|
|
2595
|
+
declare abstract class GPUShaderStage {
|
|
2604
2596
|
static readonly VERTEX: number;
|
|
2605
2597
|
static readonly FRAGMENT: number;
|
|
2606
2598
|
static readonly COMPUTE: number;
|
|
2607
2599
|
}
|
|
2608
|
-
|
|
2600
|
+
interface GPUBindGroupLayoutDescriptor {
|
|
2609
2601
|
label?: string;
|
|
2610
|
-
entries:
|
|
2602
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
2611
2603
|
}
|
|
2612
|
-
|
|
2604
|
+
interface GPUBindGroupLayoutEntry {
|
|
2613
2605
|
binding: number;
|
|
2614
2606
|
visibility: number;
|
|
2615
|
-
buffer?:
|
|
2616
|
-
sampler?:
|
|
2617
|
-
texture?:
|
|
2618
|
-
storageTexture?:
|
|
2607
|
+
buffer?: GPUBufferBindingLayout;
|
|
2608
|
+
sampler?: GPUSamplerBindingLayout;
|
|
2609
|
+
texture?: GPUTextureBindingLayout;
|
|
2610
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
2619
2611
|
}
|
|
2620
|
-
|
|
2612
|
+
interface GPUStorageTextureBindingLayout {
|
|
2621
2613
|
access?: string;
|
|
2622
2614
|
format: string;
|
|
2623
2615
|
viewDimension?: string;
|
|
2624
2616
|
}
|
|
2625
|
-
|
|
2617
|
+
interface GPUTextureBindingLayout {
|
|
2626
2618
|
sampleType?: string;
|
|
2627
2619
|
viewDimension?: string;
|
|
2628
2620
|
multisampled?: boolean;
|
|
2629
2621
|
}
|
|
2630
|
-
|
|
2622
|
+
interface GPUSamplerBindingLayout {
|
|
2631
2623
|
type?: string;
|
|
2632
2624
|
}
|
|
2633
|
-
|
|
2625
|
+
interface GPUBufferBindingLayout {
|
|
2634
2626
|
type?: string;
|
|
2635
2627
|
hasDynamicOffset?: boolean;
|
|
2636
2628
|
minBindingSize?: number | bigint;
|
|
2637
2629
|
}
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2630
|
+
interface GPUBindGroupLayout {}
|
|
2631
|
+
interface GPUBindGroup {}
|
|
2632
|
+
interface GPUBindGroupDescriptor {
|
|
2641
2633
|
label?: string;
|
|
2642
|
-
layout:
|
|
2643
|
-
entries:
|
|
2634
|
+
layout: GPUBindGroupLayout;
|
|
2635
|
+
entries: GPUBindGroupEntry[];
|
|
2644
2636
|
}
|
|
2645
|
-
|
|
2637
|
+
interface GPUBindGroupEntry {
|
|
2646
2638
|
binding: number;
|
|
2647
|
-
resource:
|
|
2639
|
+
resource: GPUBufferBinding | GPUSampler;
|
|
2648
2640
|
}
|
|
2649
|
-
|
|
2650
|
-
buffer:
|
|
2641
|
+
interface GPUBufferBinding {
|
|
2642
|
+
buffer: GPUBuffer;
|
|
2651
2643
|
offset?: number | bigint;
|
|
2652
2644
|
size?: number | bigint;
|
|
2653
2645
|
}
|
|
2654
|
-
|
|
2655
|
-
|
|
2646
|
+
interface GPUSampler {}
|
|
2647
|
+
interface GPUSamplerDescriptor {
|
|
2656
2648
|
label?: string;
|
|
2657
2649
|
addressModeU?: string;
|
|
2658
2650
|
addressModeV?: string;
|
|
@@ -2665,76 +2657,74 @@ declare interface gpuGPUSamplerDescriptor {
|
|
|
2665
2657
|
compare: string;
|
|
2666
2658
|
maxAnisotropy?: number;
|
|
2667
2659
|
}
|
|
2668
|
-
|
|
2669
|
-
getCompilationInfo(): Promise<
|
|
2660
|
+
interface GPUShaderModule {
|
|
2661
|
+
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
2670
2662
|
}
|
|
2671
|
-
|
|
2663
|
+
interface GPUShaderModuleDescriptor {
|
|
2672
2664
|
label?: string;
|
|
2673
2665
|
code: string;
|
|
2674
2666
|
}
|
|
2675
|
-
|
|
2676
|
-
|
|
2667
|
+
interface GPUPipelineLayout {}
|
|
2668
|
+
interface GPUPipelineLayoutDescriptor {
|
|
2677
2669
|
label?: string;
|
|
2678
|
-
bindGroupLayouts:
|
|
2670
|
+
bindGroupLayouts: GPUBindGroupLayout[];
|
|
2679
2671
|
}
|
|
2680
|
-
|
|
2681
|
-
getBindGroupLayout(index: number):
|
|
2672
|
+
interface GPUComputePipeline {
|
|
2673
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2682
2674
|
}
|
|
2683
|
-
|
|
2675
|
+
interface GPUComputePipelineDescriptor {
|
|
2684
2676
|
label?: string;
|
|
2685
|
-
compute:
|
|
2686
|
-
layout: string |
|
|
2677
|
+
compute: GPUProgrammableStage;
|
|
2678
|
+
layout: string | GPUPipelineLayout;
|
|
2687
2679
|
}
|
|
2688
|
-
|
|
2689
|
-
module:
|
|
2680
|
+
interface GPUProgrammableStage {
|
|
2681
|
+
module: GPUShaderModule;
|
|
2690
2682
|
entryPoint: string;
|
|
2691
2683
|
constants?: Record<string, number>;
|
|
2692
2684
|
}
|
|
2693
|
-
|
|
2685
|
+
interface GPUCommandEncoder {
|
|
2694
2686
|
get label(): string;
|
|
2695
2687
|
beginComputePass(
|
|
2696
|
-
descriptor?:
|
|
2697
|
-
):
|
|
2698
|
-
beginRenderPass(
|
|
2699
|
-
descriptor: gpuGPURenderPassDescriptor,
|
|
2700
|
-
): gpuGPURenderPassEncoder;
|
|
2688
|
+
descriptor?: GPUComputePassDescriptor,
|
|
2689
|
+
): GPUComputePassEncoder;
|
|
2690
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
2701
2691
|
copyBufferToBuffer(
|
|
2702
|
-
source:
|
|
2692
|
+
source: GPUBuffer,
|
|
2703
2693
|
sourceOffset: number | bigint,
|
|
2704
|
-
destination:
|
|
2694
|
+
destination: GPUBuffer,
|
|
2705
2695
|
destinationOffset: number | bigint,
|
|
2706
2696
|
size: number | bigint,
|
|
2707
2697
|
): void;
|
|
2708
|
-
finish(param0?:
|
|
2698
|
+
finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
2709
2699
|
copyTextureToBuffer(
|
|
2710
|
-
source:
|
|
2711
|
-
destination:
|
|
2712
|
-
copySize: Iterable<number> |
|
|
2700
|
+
source: GPUImageCopyTexture,
|
|
2701
|
+
destination: GPUImageCopyBuffer,
|
|
2702
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2713
2703
|
): void;
|
|
2714
2704
|
copyBufferToTexture(
|
|
2715
|
-
source:
|
|
2716
|
-
destination:
|
|
2717
|
-
copySize: Iterable<number> |
|
|
2705
|
+
source: GPUImageCopyBuffer,
|
|
2706
|
+
destination: GPUImageCopyTexture,
|
|
2707
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2718
2708
|
): void;
|
|
2719
2709
|
copyTextureToTexture(
|
|
2720
|
-
source:
|
|
2721
|
-
destination:
|
|
2722
|
-
copySize: Iterable<number> |
|
|
2710
|
+
source: GPUImageCopyTexture,
|
|
2711
|
+
destination: GPUImageCopyTexture,
|
|
2712
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2723
2713
|
): void;
|
|
2724
2714
|
clearBuffer(
|
|
2725
|
-
buffer:
|
|
2715
|
+
buffer: GPUBuffer,
|
|
2726
2716
|
offset?: number | bigint,
|
|
2727
2717
|
size?: number | bigint,
|
|
2728
2718
|
): void;
|
|
2729
2719
|
}
|
|
2730
|
-
|
|
2720
|
+
interface GPUCommandEncoderDescriptor {
|
|
2731
2721
|
label?: string;
|
|
2732
2722
|
}
|
|
2733
|
-
|
|
2734
|
-
setPipeline(pipeline:
|
|
2723
|
+
interface GPUComputePassEncoder {
|
|
2724
|
+
setPipeline(pipeline: GPUComputePipeline): void;
|
|
2735
2725
|
setBindGroup(
|
|
2736
2726
|
index: number,
|
|
2737
|
-
bindGroup:
|
|
2727
|
+
bindGroup: GPUBindGroup | null,
|
|
2738
2728
|
dynamicOffsets?: Iterable<number>,
|
|
2739
2729
|
): void;
|
|
2740
2730
|
dispatchWorkgroups(
|
|
@@ -2744,52 +2734,52 @@ declare interface gpuGPUComputePassEncoder {
|
|
|
2744
2734
|
): void;
|
|
2745
2735
|
end(): void;
|
|
2746
2736
|
}
|
|
2747
|
-
|
|
2737
|
+
interface GPUComputePassDescriptor {
|
|
2748
2738
|
label?: string;
|
|
2749
|
-
timestampWrites?:
|
|
2739
|
+
timestampWrites?: GPUComputePassTimestampWrites;
|
|
2750
2740
|
}
|
|
2751
|
-
|
|
2752
|
-
|
|
2741
|
+
interface GPUQuerySet {}
|
|
2742
|
+
interface GPUQuerySetDescriptor {
|
|
2753
2743
|
label?: string;
|
|
2754
2744
|
}
|
|
2755
|
-
|
|
2756
|
-
querySet:
|
|
2745
|
+
interface GPUComputePassTimestampWrites {
|
|
2746
|
+
querySet: GPUQuerySet;
|
|
2757
2747
|
beginningOfPassWriteIndex?: number;
|
|
2758
2748
|
endOfPassWriteIndex?: number;
|
|
2759
2749
|
}
|
|
2760
|
-
|
|
2750
|
+
interface GPUCommandBufferDescriptor {
|
|
2761
2751
|
label?: string;
|
|
2762
2752
|
}
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
submit(commandBuffers:
|
|
2753
|
+
interface GPUCommandBuffer {}
|
|
2754
|
+
interface GPUQueue {
|
|
2755
|
+
submit(commandBuffers: GPUCommandBuffer[]): void;
|
|
2766
2756
|
writeBuffer(
|
|
2767
|
-
buffer:
|
|
2757
|
+
buffer: GPUBuffer,
|
|
2768
2758
|
bufferOffset: number | bigint,
|
|
2769
2759
|
data: ArrayBuffer | ArrayBufferView,
|
|
2770
2760
|
dataOffset?: number | bigint,
|
|
2771
2761
|
size?: number | bigint,
|
|
2772
2762
|
): void;
|
|
2773
2763
|
}
|
|
2774
|
-
declare abstract class
|
|
2764
|
+
declare abstract class GPUMapMode {
|
|
2775
2765
|
static readonly READ: number;
|
|
2776
2766
|
static readonly WRITE: number;
|
|
2777
2767
|
}
|
|
2778
|
-
|
|
2768
|
+
interface GPURequestAdapterOptions {
|
|
2779
2769
|
powerPreference: string;
|
|
2780
2770
|
forceFallbackAdapter?: boolean;
|
|
2781
2771
|
}
|
|
2782
|
-
|
|
2772
|
+
interface GPUAdapterInfo {
|
|
2783
2773
|
get vendor(): string;
|
|
2784
2774
|
get architecture(): string;
|
|
2785
2775
|
get device(): string;
|
|
2786
2776
|
get description(): string;
|
|
2787
2777
|
}
|
|
2788
|
-
|
|
2778
|
+
interface GPUSupportedFeatures {
|
|
2789
2779
|
has(name: string): boolean;
|
|
2790
2780
|
keys(): string[];
|
|
2791
2781
|
}
|
|
2792
|
-
|
|
2782
|
+
interface GPUSupportedLimits {
|
|
2793
2783
|
get maxTextureDimension1D(): number;
|
|
2794
2784
|
get maxTextureDimension2D(): number;
|
|
2795
2785
|
get maxTextureDimension3D(): number;
|
|
@@ -2822,17 +2812,17 @@ declare interface gpuGPUSupportedLimits {
|
|
|
2822
2812
|
get maxComputeWorkgroupSizeZ(): number;
|
|
2823
2813
|
get maxComputeWorkgroupsPerDimension(): number;
|
|
2824
2814
|
}
|
|
2825
|
-
declare abstract class
|
|
2815
|
+
declare abstract class GPUError {
|
|
2826
2816
|
get message(): string;
|
|
2827
2817
|
}
|
|
2828
|
-
declare abstract class
|
|
2829
|
-
declare abstract class
|
|
2830
|
-
declare abstract class
|
|
2831
|
-
declare abstract class
|
|
2818
|
+
declare abstract class GPUOutOfMemoryError extends GPUError {}
|
|
2819
|
+
declare abstract class GPUInternalError extends GPUError {}
|
|
2820
|
+
declare abstract class GPUValidationError extends GPUError {}
|
|
2821
|
+
declare abstract class GPUDeviceLostInfo {
|
|
2832
2822
|
get message(): string;
|
|
2833
2823
|
get reason(): string;
|
|
2834
2824
|
}
|
|
2835
|
-
|
|
2825
|
+
interface GPUCompilationMessage {
|
|
2836
2826
|
get message(): string;
|
|
2837
2827
|
get type(): string;
|
|
2838
2828
|
get lineNum(): number;
|
|
@@ -2840,19 +2830,19 @@ declare interface gpuGPUCompilationMessage {
|
|
|
2840
2830
|
get offset(): number;
|
|
2841
2831
|
get length(): number;
|
|
2842
2832
|
}
|
|
2843
|
-
|
|
2844
|
-
get messages():
|
|
2833
|
+
interface GPUCompilationInfo {
|
|
2834
|
+
get messages(): GPUCompilationMessage[];
|
|
2845
2835
|
}
|
|
2846
|
-
declare abstract class
|
|
2836
|
+
declare abstract class GPUTextureUsage {
|
|
2847
2837
|
static readonly COPY_SRC: number;
|
|
2848
2838
|
static readonly COPY_DST: number;
|
|
2849
2839
|
static readonly TEXTURE_BINDING: number;
|
|
2850
2840
|
static readonly STORAGE_BINDING: number;
|
|
2851
2841
|
static readonly RENDER_ATTACHMENT: number;
|
|
2852
2842
|
}
|
|
2853
|
-
|
|
2843
|
+
interface GPUTextureDescriptor {
|
|
2854
2844
|
label: string;
|
|
2855
|
-
size: number[] |
|
|
2845
|
+
size: number[] | GPUExtent3DDict;
|
|
2856
2846
|
mipLevelCount?: number;
|
|
2857
2847
|
sampleCount?: number;
|
|
2858
2848
|
dimension?: string;
|
|
@@ -2860,13 +2850,13 @@ declare interface gpuGPUTextureDescriptor {
|
|
|
2860
2850
|
usage: number;
|
|
2861
2851
|
viewFormats?: string[];
|
|
2862
2852
|
}
|
|
2863
|
-
|
|
2853
|
+
interface GPUExtent3DDict {
|
|
2864
2854
|
width: number;
|
|
2865
2855
|
height?: number;
|
|
2866
2856
|
depthOrArrayLayers?: number;
|
|
2867
2857
|
}
|
|
2868
|
-
|
|
2869
|
-
createView(descriptor?:
|
|
2858
|
+
interface GPUTexture {
|
|
2859
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
2870
2860
|
destroy(): void;
|
|
2871
2861
|
get width(): number;
|
|
2872
2862
|
get height(): number;
|
|
@@ -2876,8 +2866,8 @@ declare interface gpuGPUTexture {
|
|
|
2876
2866
|
get format(): string;
|
|
2877
2867
|
get usage(): number;
|
|
2878
2868
|
}
|
|
2879
|
-
|
|
2880
|
-
|
|
2869
|
+
interface GPUTextureView {}
|
|
2870
|
+
interface GPUTextureViewDescriptor {
|
|
2881
2871
|
label: string;
|
|
2882
2872
|
format: string;
|
|
2883
2873
|
dimension: string;
|
|
@@ -2887,91 +2877,91 @@ declare interface gpuGPUTextureViewDescriptor {
|
|
|
2887
2877
|
baseArrayLayer?: number;
|
|
2888
2878
|
arrayLayerCount: number;
|
|
2889
2879
|
}
|
|
2890
|
-
declare abstract class
|
|
2880
|
+
declare abstract class GPUColorWrite {
|
|
2891
2881
|
static readonly RED: number;
|
|
2892
2882
|
static readonly GREEN: number;
|
|
2893
2883
|
static readonly BLUE: number;
|
|
2894
2884
|
static readonly ALPHA: number;
|
|
2895
2885
|
static readonly ALL: number;
|
|
2896
2886
|
}
|
|
2897
|
-
|
|
2898
|
-
|
|
2887
|
+
interface GPURenderPipeline {}
|
|
2888
|
+
interface GPURenderPipelineDescriptor {
|
|
2899
2889
|
label?: string;
|
|
2900
|
-
layout: string |
|
|
2901
|
-
vertex:
|
|
2902
|
-
primitive?:
|
|
2903
|
-
depthStencil?:
|
|
2904
|
-
multisample?:
|
|
2905
|
-
fragment?:
|
|
2906
|
-
}
|
|
2907
|
-
|
|
2908
|
-
module:
|
|
2890
|
+
layout: string | GPUPipelineLayout;
|
|
2891
|
+
vertex: GPUVertexState;
|
|
2892
|
+
primitive?: GPUPrimitiveState;
|
|
2893
|
+
depthStencil?: GPUDepthStencilState;
|
|
2894
|
+
multisample?: GPUMultisampleState;
|
|
2895
|
+
fragment?: GPUFragmentState;
|
|
2896
|
+
}
|
|
2897
|
+
interface GPUVertexState {
|
|
2898
|
+
module: GPUShaderModule;
|
|
2909
2899
|
entryPoint: string;
|
|
2910
2900
|
constants?: Record<string, number>;
|
|
2911
|
-
buffers?:
|
|
2901
|
+
buffers?: GPUVertexBufferLayout[];
|
|
2912
2902
|
}
|
|
2913
|
-
|
|
2903
|
+
interface GPUVertexBufferLayout {
|
|
2914
2904
|
arrayStride: number | bigint;
|
|
2915
2905
|
stepMode?: string;
|
|
2916
|
-
attributes:
|
|
2906
|
+
attributes: GPUVertexAttribute[];
|
|
2917
2907
|
}
|
|
2918
|
-
|
|
2908
|
+
interface GPUVertexAttribute {
|
|
2919
2909
|
format: string;
|
|
2920
2910
|
offset: number | bigint;
|
|
2921
2911
|
shaderLocation: number;
|
|
2922
2912
|
}
|
|
2923
|
-
|
|
2913
|
+
interface GPUPrimitiveState {
|
|
2924
2914
|
topology?: string;
|
|
2925
2915
|
stripIndexFormat?: string;
|
|
2926
2916
|
frontFace?: string;
|
|
2927
2917
|
cullMode?: string;
|
|
2928
2918
|
unclippedDepth?: boolean;
|
|
2929
2919
|
}
|
|
2930
|
-
|
|
2920
|
+
interface GPUStencilFaceState {
|
|
2931
2921
|
compare?: string;
|
|
2932
2922
|
failOp?: string;
|
|
2933
2923
|
depthFailOp?: string;
|
|
2934
2924
|
passOp?: string;
|
|
2935
2925
|
}
|
|
2936
|
-
|
|
2926
|
+
interface GPUDepthStencilState {
|
|
2937
2927
|
format: string;
|
|
2938
2928
|
depthWriteEnabled: boolean;
|
|
2939
2929
|
depthCompare: string;
|
|
2940
|
-
stencilFront?:
|
|
2941
|
-
stencilBack?:
|
|
2930
|
+
stencilFront?: GPUStencilFaceState;
|
|
2931
|
+
stencilBack?: GPUStencilFaceState;
|
|
2942
2932
|
stencilReadMask?: number;
|
|
2943
2933
|
stencilWriteMask?: number;
|
|
2944
2934
|
depthBias?: number;
|
|
2945
2935
|
depthBiasSlopeScale?: number;
|
|
2946
2936
|
depthBiasClamp?: number;
|
|
2947
2937
|
}
|
|
2948
|
-
|
|
2938
|
+
interface GPUMultisampleState {
|
|
2949
2939
|
count?: number;
|
|
2950
2940
|
mask?: number;
|
|
2951
2941
|
alphaToCoverageEnabled?: boolean;
|
|
2952
2942
|
}
|
|
2953
|
-
|
|
2954
|
-
module:
|
|
2943
|
+
interface GPUFragmentState {
|
|
2944
|
+
module: GPUShaderModule;
|
|
2955
2945
|
entryPoint: string;
|
|
2956
2946
|
constants?: Record<string, number>;
|
|
2957
|
-
targets:
|
|
2947
|
+
targets: GPUColorTargetState[];
|
|
2958
2948
|
}
|
|
2959
|
-
|
|
2949
|
+
interface GPUColorTargetState {
|
|
2960
2950
|
format: string;
|
|
2961
|
-
blend:
|
|
2951
|
+
blend: GPUBlendState;
|
|
2962
2952
|
writeMask?: number;
|
|
2963
2953
|
}
|
|
2964
|
-
|
|
2965
|
-
color:
|
|
2966
|
-
alpha:
|
|
2954
|
+
interface GPUBlendState {
|
|
2955
|
+
color: GPUBlendComponent;
|
|
2956
|
+
alpha: GPUBlendComponent;
|
|
2967
2957
|
}
|
|
2968
|
-
|
|
2958
|
+
interface GPUBlendComponent {
|
|
2969
2959
|
operation?: string;
|
|
2970
2960
|
srcFactor?: string;
|
|
2971
2961
|
dstFactor?: string;
|
|
2972
2962
|
}
|
|
2973
|
-
|
|
2974
|
-
setPipeline(pipeline:
|
|
2963
|
+
interface GPURenderPassEncoder {
|
|
2964
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2975
2965
|
draw(
|
|
2976
2966
|
vertexCount: number,
|
|
2977
2967
|
instanceCount?: number,
|
|
@@ -2980,30 +2970,30 @@ declare interface gpuGPURenderPassEncoder {
|
|
|
2980
2970
|
): void;
|
|
2981
2971
|
end(): void;
|
|
2982
2972
|
}
|
|
2983
|
-
|
|
2973
|
+
interface GPURenderPassDescriptor {
|
|
2984
2974
|
label?: string;
|
|
2985
|
-
colorAttachments:
|
|
2986
|
-
depthStencilAttachment?:
|
|
2987
|
-
occlusionQuerySet?:
|
|
2988
|
-
timestampWrites?:
|
|
2975
|
+
colorAttachments: GPURenderPassColorAttachment[];
|
|
2976
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
2977
|
+
occlusionQuerySet?: GPUQuerySet;
|
|
2978
|
+
timestampWrites?: GPURenderPassTimestampWrites;
|
|
2989
2979
|
maxDrawCount?: number | bigint;
|
|
2990
2980
|
}
|
|
2991
|
-
|
|
2992
|
-
view:
|
|
2981
|
+
interface GPURenderPassColorAttachment {
|
|
2982
|
+
view: GPUTextureView;
|
|
2993
2983
|
depthSlice?: number;
|
|
2994
|
-
resolveTarget?:
|
|
2995
|
-
clearValue?: number[] |
|
|
2984
|
+
resolveTarget?: GPUTextureView;
|
|
2985
|
+
clearValue?: number[] | GPUColorDict;
|
|
2996
2986
|
loadOp: string;
|
|
2997
2987
|
storeOp: string;
|
|
2998
2988
|
}
|
|
2999
|
-
|
|
2989
|
+
interface GPUColorDict {
|
|
3000
2990
|
r: number;
|
|
3001
2991
|
g: number;
|
|
3002
2992
|
b: number;
|
|
3003
2993
|
a: number;
|
|
3004
2994
|
}
|
|
3005
|
-
|
|
3006
|
-
view:
|
|
2995
|
+
interface GPURenderPassDepthStencilAttachment {
|
|
2996
|
+
view: GPUTextureView;
|
|
3007
2997
|
depthClearValue?: number;
|
|
3008
2998
|
depthLoadOp?: string;
|
|
3009
2999
|
depthStoreOp?: string;
|
|
@@ -3013,24 +3003,24 @@ declare interface gpuGPURenderPassDepthStencilAttachment {
|
|
|
3013
3003
|
stencilStoreOp?: string;
|
|
3014
3004
|
stencilReadOnly?: boolean;
|
|
3015
3005
|
}
|
|
3016
|
-
|
|
3017
|
-
querySet:
|
|
3006
|
+
interface GPURenderPassTimestampWrites {
|
|
3007
|
+
querySet: GPUQuerySet;
|
|
3018
3008
|
beginningOfPassWriteIndex?: number;
|
|
3019
3009
|
endOfPassWriteIndex?: number;
|
|
3020
3010
|
}
|
|
3021
|
-
|
|
3022
|
-
texture:
|
|
3011
|
+
interface GPUImageCopyTexture {
|
|
3012
|
+
texture: GPUTexture;
|
|
3023
3013
|
mipLevel?: number;
|
|
3024
|
-
origin?: number[] |
|
|
3014
|
+
origin?: number[] | GPUOrigin3DDict;
|
|
3025
3015
|
aspect?: string;
|
|
3026
3016
|
}
|
|
3027
|
-
|
|
3028
|
-
buffer:
|
|
3017
|
+
interface GPUImageCopyBuffer {
|
|
3018
|
+
buffer: GPUBuffer;
|
|
3029
3019
|
offset?: number | bigint;
|
|
3030
3020
|
bytesPerRow?: number;
|
|
3031
3021
|
rowsPerImage?: number;
|
|
3032
3022
|
}
|
|
3033
|
-
|
|
3023
|
+
interface GPUOrigin3DDict {
|
|
3034
3024
|
x?: number;
|
|
3035
3025
|
y?: number;
|
|
3036
3026
|
z?: number;
|
|
@@ -3078,14 +3068,14 @@ declare class EventSource {
|
|
|
3078
3068
|
static readonly CLOSED: number;
|
|
3079
3069
|
static from(stream: ReadableStream): EventSource;
|
|
3080
3070
|
}
|
|
3081
|
-
|
|
3071
|
+
interface EventSourceEventSourceInit {
|
|
3082
3072
|
withCredentials?: boolean;
|
|
3083
3073
|
fetcher?: Fetcher;
|
|
3084
3074
|
}
|
|
3085
|
-
|
|
3075
|
+
type AiImageClassificationInput = {
|
|
3086
3076
|
image: number[];
|
|
3087
3077
|
};
|
|
3088
|
-
|
|
3078
|
+
type AiImageClassificationOutput = {
|
|
3089
3079
|
score?: number;
|
|
3090
3080
|
label?: string;
|
|
3091
3081
|
}[];
|
|
@@ -3093,7 +3083,7 @@ declare abstract class BaseAiImageClassification {
|
|
|
3093
3083
|
inputs: AiImageClassificationInput;
|
|
3094
3084
|
postProcessedOutputs: AiImageClassificationOutput;
|
|
3095
3085
|
}
|
|
3096
|
-
|
|
3086
|
+
type AiImageToTextInput = {
|
|
3097
3087
|
image: number[];
|
|
3098
3088
|
prompt?: string;
|
|
3099
3089
|
max_tokens?: number;
|
|
@@ -3107,17 +3097,17 @@ declare type AiImageToTextInput = {
|
|
|
3107
3097
|
raw?: boolean;
|
|
3108
3098
|
messages?: RoleScopedChatInput[];
|
|
3109
3099
|
};
|
|
3110
|
-
|
|
3100
|
+
type AiImageToTextOutput = {
|
|
3111
3101
|
description: string;
|
|
3112
3102
|
};
|
|
3113
3103
|
declare abstract class BaseAiImageToText {
|
|
3114
3104
|
inputs: AiImageToTextInput;
|
|
3115
3105
|
postProcessedOutputs: AiImageToTextOutput;
|
|
3116
3106
|
}
|
|
3117
|
-
|
|
3107
|
+
type AiObjectDetectionInput = {
|
|
3118
3108
|
image: number[];
|
|
3119
3109
|
};
|
|
3120
|
-
|
|
3110
|
+
type AiObjectDetectionOutput = {
|
|
3121
3111
|
score?: number;
|
|
3122
3112
|
label?: string;
|
|
3123
3113
|
}[];
|
|
@@ -3125,19 +3115,19 @@ declare abstract class BaseAiObjectDetection {
|
|
|
3125
3115
|
inputs: AiObjectDetectionInput;
|
|
3126
3116
|
postProcessedOutputs: AiObjectDetectionOutput;
|
|
3127
3117
|
}
|
|
3128
|
-
|
|
3118
|
+
type AiSentenceSimilarityInput = {
|
|
3129
3119
|
source: string;
|
|
3130
3120
|
sentences: string[];
|
|
3131
3121
|
};
|
|
3132
|
-
|
|
3122
|
+
type AiSentenceSimilarityOutput = number[];
|
|
3133
3123
|
declare abstract class BaseAiSentenceSimilarity {
|
|
3134
3124
|
inputs: AiSentenceSimilarityInput;
|
|
3135
3125
|
postProcessedOutputs: AiSentenceSimilarityOutput;
|
|
3136
3126
|
}
|
|
3137
|
-
|
|
3127
|
+
type AiSpeechRecognitionInput = {
|
|
3138
3128
|
audio: number[];
|
|
3139
3129
|
};
|
|
3140
|
-
|
|
3130
|
+
type AiSpeechRecognitionOutput = {
|
|
3141
3131
|
text?: string;
|
|
3142
3132
|
words?: {
|
|
3143
3133
|
word: string;
|
|
@@ -3150,21 +3140,21 @@ declare abstract class BaseAiSpeechRecognition {
|
|
|
3150
3140
|
inputs: AiSpeechRecognitionInput;
|
|
3151
3141
|
postProcessedOutputs: AiSpeechRecognitionOutput;
|
|
3152
3142
|
}
|
|
3153
|
-
|
|
3143
|
+
type AiSummarizationInput = {
|
|
3154
3144
|
input_text: string;
|
|
3155
3145
|
max_length?: number;
|
|
3156
3146
|
};
|
|
3157
|
-
|
|
3147
|
+
type AiSummarizationOutput = {
|
|
3158
3148
|
summary: string;
|
|
3159
3149
|
};
|
|
3160
3150
|
declare abstract class BaseAiSummarization {
|
|
3161
3151
|
inputs: AiSummarizationInput;
|
|
3162
3152
|
postProcessedOutputs: AiSummarizationOutput;
|
|
3163
3153
|
}
|
|
3164
|
-
|
|
3154
|
+
type AiTextClassificationInput = {
|
|
3165
3155
|
text: string;
|
|
3166
3156
|
};
|
|
3167
|
-
|
|
3157
|
+
type AiTextClassificationOutput = {
|
|
3168
3158
|
score?: number;
|
|
3169
3159
|
label?: string;
|
|
3170
3160
|
}[];
|
|
@@ -3172,10 +3162,10 @@ declare abstract class BaseAiTextClassification {
|
|
|
3172
3162
|
inputs: AiTextClassificationInput;
|
|
3173
3163
|
postProcessedOutputs: AiTextClassificationOutput;
|
|
3174
3164
|
}
|
|
3175
|
-
|
|
3165
|
+
type AiTextEmbeddingsInput = {
|
|
3176
3166
|
text: string | string[];
|
|
3177
3167
|
};
|
|
3178
|
-
|
|
3168
|
+
type AiTextEmbeddingsOutput = {
|
|
3179
3169
|
shape: number[];
|
|
3180
3170
|
data: number[][];
|
|
3181
3171
|
};
|
|
@@ -3183,11 +3173,11 @@ declare abstract class BaseAiTextEmbeddings {
|
|
|
3183
3173
|
inputs: AiTextEmbeddingsInput;
|
|
3184
3174
|
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3185
3175
|
}
|
|
3186
|
-
|
|
3176
|
+
type RoleScopedChatInput = {
|
|
3187
3177
|
role: "user" | "assistant" | "system" | "tool";
|
|
3188
3178
|
content: string;
|
|
3189
3179
|
};
|
|
3190
|
-
|
|
3180
|
+
type AiTextGenerationToolInput = {
|
|
3191
3181
|
type: "function";
|
|
3192
3182
|
function: {
|
|
3193
3183
|
name: string;
|
|
@@ -3204,7 +3194,7 @@ declare type AiTextGenerationToolInput = {
|
|
|
3204
3194
|
};
|
|
3205
3195
|
};
|
|
3206
3196
|
};
|
|
3207
|
-
|
|
3197
|
+
type AiTextGenerationInput = {
|
|
3208
3198
|
prompt?: string;
|
|
3209
3199
|
raw?: boolean;
|
|
3210
3200
|
stream?: boolean;
|
|
@@ -3219,7 +3209,7 @@ declare type AiTextGenerationInput = {
|
|
|
3219
3209
|
messages?: RoleScopedChatInput[];
|
|
3220
3210
|
tools?: AiTextGenerationToolInput[];
|
|
3221
3211
|
};
|
|
3222
|
-
|
|
3212
|
+
type AiTextGenerationOutput =
|
|
3223
3213
|
| {
|
|
3224
3214
|
response?: string;
|
|
3225
3215
|
tool_calls?: {
|
|
@@ -3232,7 +3222,7 @@ declare abstract class BaseAiTextGeneration {
|
|
|
3232
3222
|
inputs: AiTextGenerationInput;
|
|
3233
3223
|
postProcessedOutputs: AiTextGenerationOutput;
|
|
3234
3224
|
}
|
|
3235
|
-
|
|
3225
|
+
type AiTextToImageInput = {
|
|
3236
3226
|
prompt: string;
|
|
3237
3227
|
image?: number[];
|
|
3238
3228
|
mask?: number[];
|
|
@@ -3240,53 +3230,52 @@ declare type AiTextToImageInput = {
|
|
|
3240
3230
|
strength?: number;
|
|
3241
3231
|
guidance?: number;
|
|
3242
3232
|
};
|
|
3243
|
-
|
|
3233
|
+
type AiTextToImageOutput = Uint8Array;
|
|
3244
3234
|
declare abstract class BaseAiTextToImage {
|
|
3245
3235
|
inputs: AiTextToImageInput;
|
|
3246
3236
|
postProcessedOutputs: AiTextToImageOutput;
|
|
3247
3237
|
}
|
|
3248
|
-
|
|
3238
|
+
type AiTranslationInput = {
|
|
3249
3239
|
text: string;
|
|
3250
3240
|
target_lang: string;
|
|
3251
3241
|
source_lang?: string;
|
|
3252
3242
|
};
|
|
3253
|
-
|
|
3243
|
+
type AiTranslationOutput = {
|
|
3254
3244
|
translated_text?: string;
|
|
3255
3245
|
};
|
|
3256
3246
|
declare abstract class BaseAiTranslation {
|
|
3257
3247
|
inputs: AiTranslationInput;
|
|
3258
3248
|
postProcessedOutputs: AiTranslationOutput;
|
|
3259
3249
|
}
|
|
3260
|
-
|
|
3250
|
+
type GatewayOptions = {
|
|
3261
3251
|
id: string;
|
|
3262
3252
|
cacheTtl?: number;
|
|
3263
3253
|
skipCache?: boolean;
|
|
3264
3254
|
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
3265
3255
|
};
|
|
3266
|
-
|
|
3256
|
+
type AiOptions = {
|
|
3267
3257
|
gateway?: GatewayOptions;
|
|
3268
3258
|
prefix?: string;
|
|
3269
3259
|
extraHeaders?: object;
|
|
3270
3260
|
};
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
declare type BaseAiTextToImageModels =
|
|
3261
|
+
type BaseAiTextClassificationModels = "@cf/huggingface/distilbert-sst-2-int8";
|
|
3262
|
+
type BaseAiTextToImageModels =
|
|
3274
3263
|
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3275
3264
|
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3276
3265
|
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3277
3266
|
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3278
3267
|
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3279
|
-
|
|
3268
|
+
type BaseAiTextEmbeddingsModels =
|
|
3280
3269
|
| "@cf/baai/bge-small-en-v1.5"
|
|
3281
3270
|
| "@cf/baai/bge-base-en-v1.5"
|
|
3282
3271
|
| "@cf/baai/bge-large-en-v1.5";
|
|
3283
|
-
|
|
3272
|
+
type BaseAiSpeechRecognitionModels =
|
|
3284
3273
|
| "@cf/openai/whisper"
|
|
3285
3274
|
| "@cf/openai/whisper-tiny-en"
|
|
3286
3275
|
| "@cf/openai/whisper-sherpa";
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3276
|
+
type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3277
|
+
type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3278
|
+
type BaseAiTextGenerationModels =
|
|
3290
3279
|
| "@cf/meta/llama-3-8b-instruct"
|
|
3291
3280
|
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3292
3281
|
| "@cf/meta/llama-2-7b-chat-int8"
|
|
@@ -3322,9 +3311,9 @@ declare type BaseAiTextGenerationModels =
|
|
|
3322
3311
|
| "@cf/meta-llama/llama-2-7b-chat-hf-lora"
|
|
3323
3312
|
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3324
3313
|
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3314
|
+
type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3315
|
+
type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3316
|
+
type BaseAiImageToTextModels =
|
|
3328
3317
|
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3329
3318
|
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3330
3319
|
declare abstract class Ai {
|
|
@@ -3379,7 +3368,7 @@ declare abstract class Ai {
|
|
|
3379
3368
|
options?: AiOptions,
|
|
3380
3369
|
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
3381
3370
|
}
|
|
3382
|
-
|
|
3371
|
+
interface BasicImageTransformations {
|
|
3383
3372
|
/**
|
|
3384
3373
|
* Maximum width in image pixels. The value must be an integer.
|
|
3385
3374
|
*/
|
|
@@ -3445,7 +3434,7 @@ declare interface BasicImageTransformations {
|
|
|
3445
3434
|
*/
|
|
3446
3435
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
3447
3436
|
}
|
|
3448
|
-
|
|
3437
|
+
interface BasicImageTransformationsGravityCoordinates {
|
|
3449
3438
|
x: number;
|
|
3450
3439
|
y: number;
|
|
3451
3440
|
}
|
|
@@ -3458,7 +3447,7 @@ declare interface BasicImageTransformationsGravityCoordinates {
|
|
|
3458
3447
|
* Note: Currently, these properties cannot be tested in the
|
|
3459
3448
|
* playground.
|
|
3460
3449
|
*/
|
|
3461
|
-
|
|
3450
|
+
interface RequestInitCfProperties extends Record<string, unknown> {
|
|
3462
3451
|
cacheEverything?: boolean;
|
|
3463
3452
|
/**
|
|
3464
3453
|
* A request's cache key is what determines if two requests are
|
|
@@ -3509,8 +3498,7 @@ declare interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
3509
3498
|
*/
|
|
3510
3499
|
resolveOverride?: string;
|
|
3511
3500
|
}
|
|
3512
|
-
|
|
3513
|
-
extends BasicImageTransformations {
|
|
3501
|
+
interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
3514
3502
|
/**
|
|
3515
3503
|
* Absolute URL of the image file to use for the drawing. It can be any of
|
|
3516
3504
|
* the supported file formats. For drawing of watermarks or non-rectangular
|
|
@@ -3547,8 +3535,7 @@ declare interface RequestInitCfPropertiesImageDraw
|
|
|
3547
3535
|
bottom?: number;
|
|
3548
3536
|
right?: number;
|
|
3549
3537
|
}
|
|
3550
|
-
|
|
3551
|
-
extends BasicImageTransformations {
|
|
3538
|
+
interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
3552
3539
|
/**
|
|
3553
3540
|
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
3554
3541
|
* easier to specify higher-DPI sizes in <img srcset>.
|
|
@@ -3673,12 +3660,12 @@ declare interface RequestInitCfPropertiesImage
|
|
|
3673
3660
|
*/
|
|
3674
3661
|
compression?: "fast";
|
|
3675
3662
|
}
|
|
3676
|
-
|
|
3663
|
+
interface RequestInitCfPropertiesImageMinify {
|
|
3677
3664
|
javascript?: boolean;
|
|
3678
3665
|
css?: boolean;
|
|
3679
3666
|
html?: boolean;
|
|
3680
3667
|
}
|
|
3681
|
-
|
|
3668
|
+
interface RequestInitCfPropertiesR2 {
|
|
3682
3669
|
/**
|
|
3683
3670
|
* Colo id of bucket that an object is stored in
|
|
3684
3671
|
*/
|
|
@@ -3687,14 +3674,13 @@ declare interface RequestInitCfPropertiesR2 {
|
|
|
3687
3674
|
/**
|
|
3688
3675
|
* Request metadata provided by Cloudflare's edge.
|
|
3689
3676
|
*/
|
|
3690
|
-
|
|
3677
|
+
type IncomingRequestCfProperties<HostMetadata = unknown> =
|
|
3691
3678
|
IncomingRequestCfPropertiesBase &
|
|
3692
3679
|
IncomingRequestCfPropertiesBotManagementEnterprise &
|
|
3693
3680
|
IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> &
|
|
3694
3681
|
IncomingRequestCfPropertiesGeographicInformation &
|
|
3695
3682
|
IncomingRequestCfPropertiesCloudflareAccessOrApiShield;
|
|
3696
|
-
|
|
3697
|
-
extends Record<string, unknown> {
|
|
3683
|
+
interface IncomingRequestCfPropertiesBase extends Record<string, unknown> {
|
|
3698
3684
|
/**
|
|
3699
3685
|
* [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request.
|
|
3700
3686
|
*
|
|
@@ -3772,7 +3758,7 @@ declare interface IncomingRequestCfPropertiesBase
|
|
|
3772
3758
|
*/
|
|
3773
3759
|
tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata;
|
|
3774
3760
|
}
|
|
3775
|
-
|
|
3761
|
+
interface IncomingRequestCfPropertiesBotManagementBase {
|
|
3776
3762
|
/**
|
|
3777
3763
|
* Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot,
|
|
3778
3764
|
* represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human).
|
|
@@ -3799,7 +3785,7 @@ declare interface IncomingRequestCfPropertiesBotManagementBase {
|
|
|
3799
3785
|
*/
|
|
3800
3786
|
detectionIds: number[];
|
|
3801
3787
|
}
|
|
3802
|
-
|
|
3788
|
+
interface IncomingRequestCfPropertiesBotManagement {
|
|
3803
3789
|
/**
|
|
3804
3790
|
* Results of Cloudflare's Bot Management analysis
|
|
3805
3791
|
*/
|
|
@@ -3811,7 +3797,7 @@ declare interface IncomingRequestCfPropertiesBotManagement {
|
|
|
3811
3797
|
*/
|
|
3812
3798
|
clientTrustScore: number;
|
|
3813
3799
|
}
|
|
3814
|
-
|
|
3800
|
+
interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
3815
3801
|
extends IncomingRequestCfPropertiesBotManagement {
|
|
3816
3802
|
/**
|
|
3817
3803
|
* Results of Cloudflare's Bot Management analysis
|
|
@@ -3824,9 +3810,7 @@ declare interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
|
3824
3810
|
ja3Hash: string;
|
|
3825
3811
|
};
|
|
3826
3812
|
}
|
|
3827
|
-
|
|
3828
|
-
HostMetadata,
|
|
3829
|
-
> {
|
|
3813
|
+
interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> {
|
|
3830
3814
|
/**
|
|
3831
3815
|
* Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
|
|
3832
3816
|
*
|
|
@@ -3835,7 +3819,7 @@ declare interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
|
|
|
3835
3819
|
*/
|
|
3836
3820
|
hostMetadata: HostMetadata;
|
|
3837
3821
|
}
|
|
3838
|
-
|
|
3822
|
+
interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
|
|
3839
3823
|
/**
|
|
3840
3824
|
* Information about the client certificate presented to Cloudflare.
|
|
3841
3825
|
*
|
|
@@ -3857,7 +3841,7 @@ declare interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
|
|
|
3857
3841
|
/**
|
|
3858
3842
|
* Metadata about the request's TLS handshake
|
|
3859
3843
|
*/
|
|
3860
|
-
|
|
3844
|
+
interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
|
|
3861
3845
|
/**
|
|
3862
3846
|
* The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal
|
|
3863
3847
|
*
|
|
@@ -3886,7 +3870,7 @@ declare interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
|
|
|
3886
3870
|
/**
|
|
3887
3871
|
* Geographic data about the request's origin.
|
|
3888
3872
|
*/
|
|
3889
|
-
|
|
3873
|
+
interface IncomingRequestCfPropertiesGeographicInformation {
|
|
3890
3874
|
/**
|
|
3891
3875
|
* The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
|
|
3892
3876
|
*
|
|
@@ -3963,7 +3947,7 @@ declare interface IncomingRequestCfPropertiesGeographicInformation {
|
|
|
3963
3947
|
metroCode?: string;
|
|
3964
3948
|
}
|
|
3965
3949
|
/** Data about the incoming request's TLS certificate */
|
|
3966
|
-
|
|
3950
|
+
interface IncomingRequestCfPropertiesTLSClientAuth {
|
|
3967
3951
|
/** Always `"1"`, indicating that the certificate was presented */
|
|
3968
3952
|
certPresented: "1";
|
|
3969
3953
|
/**
|
|
@@ -4056,7 +4040,7 @@ declare interface IncomingRequestCfPropertiesTLSClientAuth {
|
|
|
4056
4040
|
certNotAfter: string;
|
|
4057
4041
|
}
|
|
4058
4042
|
/** Placeholder values for TLS Client Authorization */
|
|
4059
|
-
|
|
4043
|
+
interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
|
|
4060
4044
|
certPresented: "0";
|
|
4061
4045
|
certVerified: "NONE";
|
|
4062
4046
|
certRevoked: "0";
|
|
@@ -4354,10 +4338,10 @@ declare type Iso3166Alpha2Code =
|
|
|
4354
4338
|
| "ZW";
|
|
4355
4339
|
/** The 2-letter continent codes Cloudflare uses */
|
|
4356
4340
|
declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
|
|
4357
|
-
|
|
4341
|
+
type CfProperties<HostMetadata = unknown> =
|
|
4358
4342
|
| IncomingRequestCfProperties<HostMetadata>
|
|
4359
4343
|
| RequestInitCfProperties;
|
|
4360
|
-
|
|
4344
|
+
interface D1Meta {
|
|
4361
4345
|
duration: number;
|
|
4362
4346
|
size_after: number;
|
|
4363
4347
|
rows_read: number;
|
|
@@ -4366,15 +4350,15 @@ declare interface D1Meta {
|
|
|
4366
4350
|
changed_db: boolean;
|
|
4367
4351
|
changes: number;
|
|
4368
4352
|
}
|
|
4369
|
-
|
|
4353
|
+
interface D1Response {
|
|
4370
4354
|
success: true;
|
|
4371
4355
|
meta: D1Meta & Record<string, unknown>;
|
|
4372
4356
|
error?: never;
|
|
4373
4357
|
}
|
|
4374
|
-
|
|
4358
|
+
type D1Result<T = unknown> = D1Response & {
|
|
4375
4359
|
results: T[];
|
|
4376
4360
|
};
|
|
4377
|
-
|
|
4361
|
+
interface D1ExecResult {
|
|
4378
4362
|
count: number;
|
|
4379
4363
|
duration: number;
|
|
4380
4364
|
}
|
|
@@ -4401,11 +4385,11 @@ declare abstract class D1PreparedStatement {
|
|
|
4401
4385
|
// but this will ensure type checking on older versions still passes.
|
|
4402
4386
|
// TypeScript's interface merging will ensure our empty interface is effectively
|
|
4403
4387
|
// ignored when `Disposable` is included in the standard lib.
|
|
4404
|
-
|
|
4388
|
+
interface Disposable {}
|
|
4405
4389
|
/**
|
|
4406
4390
|
* An email message that can be sent from a Worker.
|
|
4407
4391
|
*/
|
|
4408
|
-
|
|
4392
|
+
interface EmailMessage {
|
|
4409
4393
|
/**
|
|
4410
4394
|
* Envelope From attribute of the email message.
|
|
4411
4395
|
*/
|
|
@@ -4418,7 +4402,7 @@ declare interface EmailMessage {
|
|
|
4418
4402
|
/**
|
|
4419
4403
|
* An email message that is sent to a consumer Worker and can be rejected/forwarded.
|
|
4420
4404
|
*/
|
|
4421
|
-
|
|
4405
|
+
interface ForwardableEmailMessage extends EmailMessage {
|
|
4422
4406
|
/**
|
|
4423
4407
|
* Stream of the email message content.
|
|
4424
4408
|
*/
|
|
@@ -4448,7 +4432,7 @@ declare interface ForwardableEmailMessage extends EmailMessage {
|
|
|
4448
4432
|
/**
|
|
4449
4433
|
* A binding that allows a Worker to send email messages.
|
|
4450
4434
|
*/
|
|
4451
|
-
|
|
4435
|
+
interface SendEmail {
|
|
4452
4436
|
send(message: EmailMessage): Promise<void>;
|
|
4453
4437
|
}
|
|
4454
4438
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
@@ -4466,7 +4450,7 @@ declare module "cloudflare:email" {
|
|
|
4466
4450
|
};
|
|
4467
4451
|
export { _EmailMessage as EmailMessage };
|
|
4468
4452
|
}
|
|
4469
|
-
|
|
4453
|
+
interface Hyperdrive {
|
|
4470
4454
|
/**
|
|
4471
4455
|
* Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
|
|
4472
4456
|
*
|
|
@@ -4513,8 +4497,8 @@ declare interface Hyperdrive {
|
|
|
4513
4497
|
*/
|
|
4514
4498
|
readonly database: string;
|
|
4515
4499
|
}
|
|
4516
|
-
|
|
4517
|
-
|
|
4500
|
+
type Params<P extends string = any> = Record<P, string | string[]>;
|
|
4501
|
+
type EventContext<Env, P extends string, Data> = {
|
|
4518
4502
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
4519
4503
|
functionPath: string;
|
|
4520
4504
|
waitUntil: (promise: Promise<any>) => void;
|
|
@@ -4528,12 +4512,12 @@ declare type EventContext<Env, P extends string, Data> = {
|
|
|
4528
4512
|
params: Params<P>;
|
|
4529
4513
|
data: Data;
|
|
4530
4514
|
};
|
|
4531
|
-
|
|
4515
|
+
type PagesFunction<
|
|
4532
4516
|
Env = unknown,
|
|
4533
4517
|
Params extends string = any,
|
|
4534
4518
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
4535
4519
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
4536
|
-
|
|
4520
|
+
type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
4537
4521
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
4538
4522
|
functionPath: string;
|
|
4539
4523
|
waitUntil: (promise: Promise<any>) => void;
|
|
@@ -4548,7 +4532,7 @@ declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
|
4548
4532
|
data: Data;
|
|
4549
4533
|
pluginArgs: PluginArgs;
|
|
4550
4534
|
};
|
|
4551
|
-
|
|
4535
|
+
type PagesPluginFunction<
|
|
4552
4536
|
Env = unknown,
|
|
4553
4537
|
Params extends string = any,
|
|
4554
4538
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
@@ -4563,7 +4547,7 @@ declare module "assets:*" {
|
|
|
4563
4547
|
// The message includes metadata about the broker, the client, and the payload
|
|
4564
4548
|
// itself.
|
|
4565
4549
|
// https://developers.cloudflare.com/pub-sub/
|
|
4566
|
-
|
|
4550
|
+
interface PubSubMessage {
|
|
4567
4551
|
// Message ID
|
|
4568
4552
|
readonly mid: number;
|
|
4569
4553
|
// MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
|
|
@@ -4589,10 +4573,24 @@ declare interface PubSubMessage {
|
|
|
4589
4573
|
payload: string | Uint8Array;
|
|
4590
4574
|
}
|
|
4591
4575
|
// JsonWebKey extended by kid parameter
|
|
4592
|
-
|
|
4576
|
+
interface JsonWebKeyWithKid extends JsonWebKey {
|
|
4593
4577
|
// Key Identifier of the JWK
|
|
4594
4578
|
readonly kid: string;
|
|
4595
4579
|
}
|
|
4580
|
+
interface RateLimitOptions {
|
|
4581
|
+
key: string;
|
|
4582
|
+
}
|
|
4583
|
+
interface RateLimitOutcome {
|
|
4584
|
+
success: boolean;
|
|
4585
|
+
}
|
|
4586
|
+
interface RateLimit {
|
|
4587
|
+
/**
|
|
4588
|
+
* Rate limit a request based on the provided options.
|
|
4589
|
+
* @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
|
|
4590
|
+
* @returns A promise that resolves with the outcome of the rate limit.
|
|
4591
|
+
*/
|
|
4592
|
+
limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
|
|
4593
|
+
}
|
|
4596
4594
|
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4597
4595
|
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4598
4596
|
// strips all `module` blocks.
|
|
@@ -4800,19 +4798,15 @@ declare module "cloudflare:sockets" {
|
|
|
4800
4798
|
/**
|
|
4801
4799
|
* Data types supported for holding vector metadata.
|
|
4802
4800
|
*/
|
|
4803
|
-
|
|
4804
|
-
| string
|
|
4805
|
-
| number
|
|
4806
|
-
| boolean
|
|
4807
|
-
| string[];
|
|
4801
|
+
type VectorizeVectorMetadataValue = string | number | boolean | string[];
|
|
4808
4802
|
/**
|
|
4809
4803
|
* Additional information to associate with a vector.
|
|
4810
4804
|
*/
|
|
4811
|
-
|
|
4805
|
+
type VectorizeVectorMetadata =
|
|
4812
4806
|
| VectorizeVectorMetadataValue
|
|
4813
4807
|
| Record<string, VectorizeVectorMetadataValue>;
|
|
4814
|
-
|
|
4815
|
-
|
|
4808
|
+
type VectorFloatArray = Float32Array | Float64Array;
|
|
4809
|
+
interface VectorizeError {
|
|
4816
4810
|
code?: number;
|
|
4817
4811
|
error: string;
|
|
4818
4812
|
}
|
|
@@ -4821,11 +4815,11 @@ declare interface VectorizeError {
|
|
|
4821
4815
|
*
|
|
4822
4816
|
* This list is expected to grow as support for more operations are released.
|
|
4823
4817
|
*/
|
|
4824
|
-
|
|
4818
|
+
type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
|
|
4825
4819
|
/**
|
|
4826
4820
|
* Filter criteria for vector metadata used to limit the retrieved query result set.
|
|
4827
4821
|
*/
|
|
4828
|
-
|
|
4822
|
+
type VectorizeVectorMetadataFilter = {
|
|
4829
4823
|
[field: string]:
|
|
4830
4824
|
| Exclude<VectorizeVectorMetadataValue, string[]>
|
|
4831
4825
|
| null
|
|
@@ -4840,8 +4834,8 @@ declare type VectorizeVectorMetadataFilter = {
|
|
|
4840
4834
|
* Supported distance metrics for an index.
|
|
4841
4835
|
* Distance metrics determine how other "similar" vectors are determined.
|
|
4842
4836
|
*/
|
|
4843
|
-
|
|
4844
|
-
|
|
4837
|
+
type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
4838
|
+
interface VectorizeQueryOptions {
|
|
4845
4839
|
topK?: number;
|
|
4846
4840
|
namespace?: string;
|
|
4847
4841
|
returnValues?: boolean;
|
|
@@ -4851,7 +4845,7 @@ declare interface VectorizeQueryOptions {
|
|
|
4851
4845
|
/**
|
|
4852
4846
|
* Information about the configuration of an index.
|
|
4853
4847
|
*/
|
|
4854
|
-
|
|
4848
|
+
type VectorizeIndexConfig =
|
|
4855
4849
|
| {
|
|
4856
4850
|
dimensions: number;
|
|
4857
4851
|
metric: VectorizeDistanceMetric;
|
|
@@ -4862,7 +4856,7 @@ declare type VectorizeIndexConfig =
|
|
|
4862
4856
|
/**
|
|
4863
4857
|
* Metadata about an existing index.
|
|
4864
4858
|
*/
|
|
4865
|
-
|
|
4859
|
+
interface VectorizeIndexDetails {
|
|
4866
4860
|
/** The unique ID of the index */
|
|
4867
4861
|
readonly id: string;
|
|
4868
4862
|
/** The name of the index. */
|
|
@@ -4877,7 +4871,7 @@ declare interface VectorizeIndexDetails {
|
|
|
4877
4871
|
/**
|
|
4878
4872
|
* Represents a single vector value set along with its associated metadata.
|
|
4879
4873
|
*/
|
|
4880
|
-
|
|
4874
|
+
interface VectorizeVector {
|
|
4881
4875
|
/** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */
|
|
4882
4876
|
id: string;
|
|
4883
4877
|
/** The vector values */
|
|
@@ -4890,7 +4884,7 @@ declare interface VectorizeVector {
|
|
|
4890
4884
|
/**
|
|
4891
4885
|
* Represents a matched vector for a query along with its score and (if specified) the matching vector information.
|
|
4892
4886
|
*/
|
|
4893
|
-
|
|
4887
|
+
type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
4894
4888
|
Omit<VectorizeVector, "values"> & {
|
|
4895
4889
|
/** The score or rank for similarity, when returned as a result */
|
|
4896
4890
|
score: number;
|
|
@@ -4898,7 +4892,7 @@ declare type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
|
4898
4892
|
/**
|
|
4899
4893
|
* A set of vector {@link VectorizeMatch} for a particular query.
|
|
4900
4894
|
*/
|
|
4901
|
-
|
|
4895
|
+
interface VectorizeMatches {
|
|
4902
4896
|
matches: VectorizeMatch[];
|
|
4903
4897
|
count: number;
|
|
4904
4898
|
}
|
|
@@ -4906,7 +4900,7 @@ declare interface VectorizeMatches {
|
|
|
4906
4900
|
* Results of an operation that performed a mutation on a set of vectors.
|
|
4907
4901
|
* Here, `ids` is a list of vectors that were successfully processed.
|
|
4908
4902
|
*/
|
|
4909
|
-
|
|
4903
|
+
interface VectorizeVectorMutation {
|
|
4910
4904
|
/* List of ids of vectors that were successfully processed. */
|
|
4911
4905
|
ids: string[];
|
|
4912
4906
|
/* Total count of the number of processed vectors. */
|
|
@@ -4917,7 +4911,7 @@ declare interface VectorizeVectorMutation {
|
|
|
4917
4911
|
* with the v2 version of Vectorize.
|
|
4918
4912
|
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
4919
4913
|
*/
|
|
4920
|
-
|
|
4914
|
+
interface VectorizeVectorMutationV2 {
|
|
4921
4915
|
/* The identifier for the last mutation processed by Vectorize. */
|
|
4922
4916
|
mutationId: string;
|
|
4923
4917
|
}
|
|
@@ -4966,7 +4960,7 @@ declare abstract class VectorizeIndex {
|
|
|
4966
4960
|
* The interface for "version_metadata" binding
|
|
4967
4961
|
* providing metadata about the Worker Version using this binding.
|
|
4968
4962
|
*/
|
|
4969
|
-
|
|
4963
|
+
type WorkerVersionMetadata = {
|
|
4970
4964
|
/** The ID of the Worker Version using this binding */
|
|
4971
4965
|
id: string;
|
|
4972
4966
|
/** The tag of the Worker Version using this binding */
|
|
@@ -4974,7 +4968,7 @@ declare type WorkerVersionMetadata = {
|
|
|
4974
4968
|
/** The timestamp of when the Worker Version was uploaded */
|
|
4975
4969
|
timestamp: string;
|
|
4976
4970
|
};
|
|
4977
|
-
|
|
4971
|
+
interface DynamicDispatchLimits {
|
|
4978
4972
|
/**
|
|
4979
4973
|
* Limit CPU time in milliseconds.
|
|
4980
4974
|
*/
|
|
@@ -4984,7 +4978,7 @@ declare interface DynamicDispatchLimits {
|
|
|
4984
4978
|
*/
|
|
4985
4979
|
subRequests?: number;
|
|
4986
4980
|
}
|
|
4987
|
-
|
|
4981
|
+
interface DynamicDispatchOptions {
|
|
4988
4982
|
/**
|
|
4989
4983
|
* Limit resources of invoked Worker script.
|
|
4990
4984
|
*/
|
|
@@ -4996,7 +4990,7 @@ declare interface DynamicDispatchOptions {
|
|
|
4996
4990
|
[key: string]: any;
|
|
4997
4991
|
};
|
|
4998
4992
|
}
|
|
4999
|
-
|
|
4993
|
+
interface DispatchNamespace {
|
|
5000
4994
|
/**
|
|
5001
4995
|
* @param name Name of the Worker script.
|
|
5002
4996
|
* @param args Arguments to Worker script.
|