@cloudflare/workers-types 4.20240909.0 → 4.20240919.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 +84 -20
- package/2021-11-03/index.ts +73 -22
- package/2022-01-31/index.d.ts +84 -20
- package/2022-01-31/index.ts +73 -22
- package/2022-03-21/index.d.ts +84 -20
- package/2022-03-21/index.ts +73 -22
- package/2022-08-04/index.d.ts +84 -20
- package/2022-08-04/index.ts +73 -22
- package/2022-10-31/index.d.ts +84 -20
- package/2022-10-31/index.ts +73 -22
- package/2022-11-30/index.d.ts +84 -20
- package/2022-11-30/index.ts +73 -22
- package/2023-03-01/index.d.ts +84 -20
- package/2023-03-01/index.ts +73 -22
- package/2023-07-01/index.d.ts +84 -20
- package/2023-07-01/index.ts +73 -22
- package/experimental/index.d.ts +84 -19
- package/experimental/index.ts +73 -21
- package/index.d.ts +84 -20
- package/index.ts +73 -22
- package/oldest/index.d.ts +84 -20
- package/oldest/index.ts +73 -22
- package/package.json +1 -1
package/oldest/index.d.ts
CHANGED
|
@@ -1518,7 +1518,11 @@ declare abstract class Body {
|
|
|
1518
1518
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1519
1519
|
*/
|
|
1520
1520
|
declare class Response extends Body {
|
|
1521
|
-
constructor(
|
|
1521
|
+
constructor(
|
|
1522
|
+
body?: BodyInit | null,
|
|
1523
|
+
init?: ResponseInit,
|
|
1524
|
+
webSocket?: WebSocket,
|
|
1525
|
+
);
|
|
1522
1526
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1523
1527
|
static redirect(url: string, status?: number): Response;
|
|
1524
1528
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
@@ -1545,7 +1549,7 @@ interface ResponseInit {
|
|
|
1545
1549
|
statusText?: string;
|
|
1546
1550
|
headers?: HeadersInit;
|
|
1547
1551
|
cf?: any;
|
|
1548
|
-
webSocket?: WebSocket
|
|
1552
|
+
webSocket?: WebSocket;
|
|
1549
1553
|
encodeBody?: "automatic" | "manual";
|
|
1550
1554
|
}
|
|
1551
1555
|
type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
@@ -2252,15 +2256,15 @@ declare class TransformStream<I = any, O = any> {
|
|
|
2252
2256
|
}
|
|
2253
2257
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
2254
2258
|
constructor(
|
|
2255
|
-
|
|
2256
|
-
|
|
2259
|
+
expectedLength: number | bigint,
|
|
2260
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2257
2261
|
);
|
|
2258
2262
|
}
|
|
2259
2263
|
declare class IdentityTransformStream extends TransformStream<
|
|
2260
2264
|
ArrayBuffer | ArrayBufferView,
|
|
2261
2265
|
Uint8Array
|
|
2262
2266
|
> {
|
|
2263
|
-
constructor(
|
|
2267
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2264
2268
|
}
|
|
2265
2269
|
interface IdentityTransformStreamQueuingStrategy {
|
|
2266
2270
|
highWaterMark?: number | bigint;
|
|
@@ -2719,21 +2723,24 @@ declare const WebSocketPair: {
|
|
|
2719
2723
|
};
|
|
2720
2724
|
};
|
|
2721
2725
|
interface SqlStorage {
|
|
2722
|
-
exec
|
|
2723
|
-
|
|
2726
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2727
|
+
query: string,
|
|
2728
|
+
...bindings: any[]
|
|
2729
|
+
): SqlStorageCursor<T>;
|
|
2724
2730
|
get databaseSize(): number;
|
|
2725
2731
|
Cursor: typeof SqlStorageCursor;
|
|
2726
2732
|
Statement: typeof SqlStorageStatement;
|
|
2727
2733
|
}
|
|
2728
2734
|
declare abstract class SqlStorageStatement {}
|
|
2729
|
-
|
|
2730
|
-
|
|
2735
|
+
type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2736
|
+
declare abstract class SqlStorageCursor<
|
|
2737
|
+
T extends Record<string, SqlStorageValue>,
|
|
2738
|
+
> {
|
|
2739
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2731
2740
|
get columnNames(): string[];
|
|
2732
2741
|
get rowsRead(): number;
|
|
2733
2742
|
get rowsWritten(): number;
|
|
2734
|
-
[Symbol.iterator](): IterableIterator<
|
|
2735
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2736
|
-
>;
|
|
2743
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2737
2744
|
}
|
|
2738
2745
|
interface Socket {
|
|
2739
2746
|
get readable(): ReadableStream;
|
|
@@ -3265,7 +3272,7 @@ interface GPUOrigin3DDict {
|
|
|
3265
3272
|
z?: number;
|
|
3266
3273
|
}
|
|
3267
3274
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3268
|
-
declare class EventSource {
|
|
3275
|
+
declare class EventSource extends EventTarget {
|
|
3269
3276
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3270
3277
|
/**
|
|
3271
3278
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5530,12 +5537,69 @@ interface DispatchNamespace {
|
|
|
5530
5537
|
): Fetcher;
|
|
5531
5538
|
}
|
|
5532
5539
|
/**
|
|
5533
|
-
* NonRetryableError allows for a
|
|
5534
|
-
*
|
|
5540
|
+
* NonRetryableError allows for a user to throw a fatal error
|
|
5541
|
+
* that makes a Workflow instance fail immediately without triggering a retry
|
|
5535
5542
|
*/
|
|
5536
|
-
declare
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5543
|
+
declare module "cloudflare:workflows" {
|
|
5544
|
+
export abstract class NonRetryableError extends Error {
|
|
5545
|
+
/**
|
|
5546
|
+
* `__brand` is used to differentiate between `NonRetryableError` and `Error`
|
|
5547
|
+
* and is omitted from the constructor because users should not set it
|
|
5548
|
+
*/
|
|
5549
|
+
public constructor(message: string, name?: string);
|
|
5550
|
+
}
|
|
5551
|
+
}
|
|
5552
|
+
declare abstract class Workflow {
|
|
5553
|
+
/**
|
|
5554
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5555
|
+
* @param id Id for the instance of this Workflow
|
|
5556
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5557
|
+
*/
|
|
5558
|
+
public get(id: string): Promise<Instance>;
|
|
5559
|
+
/**
|
|
5560
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5561
|
+
* @param id Id to create the instance of this Workflow with
|
|
5562
|
+
* @param params The payload to send over to this instance
|
|
5563
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5564
|
+
*/
|
|
5565
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5566
|
+
}
|
|
5567
|
+
type InstanceStatus = {
|
|
5568
|
+
status:
|
|
5569
|
+
| "queued"
|
|
5570
|
+
| "running"
|
|
5571
|
+
| "paused"
|
|
5572
|
+
| "errored"
|
|
5573
|
+
| "terminated"
|
|
5574
|
+
| "complete"
|
|
5575
|
+
| "unknown";
|
|
5576
|
+
error?: string;
|
|
5577
|
+
output?: object;
|
|
5578
|
+
};
|
|
5579
|
+
interface WorkflowError {
|
|
5580
|
+
code?: number;
|
|
5581
|
+
message: string;
|
|
5582
|
+
}
|
|
5583
|
+
declare abstract class Instance {
|
|
5584
|
+
public id: string;
|
|
5585
|
+
/**
|
|
5586
|
+
* Pause the instance.
|
|
5587
|
+
*/
|
|
5588
|
+
public pause(): Promise<void>;
|
|
5589
|
+
/**
|
|
5590
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5591
|
+
*/
|
|
5592
|
+
public resume(): Promise<void>;
|
|
5593
|
+
/**
|
|
5594
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5595
|
+
*/
|
|
5596
|
+
public abort(): Promise<void>;
|
|
5597
|
+
/**
|
|
5598
|
+
* Restart the instance.
|
|
5599
|
+
*/
|
|
5600
|
+
public restart(): Promise<void>;
|
|
5601
|
+
/**
|
|
5602
|
+
* Returns the current status of the instance.
|
|
5603
|
+
*/
|
|
5604
|
+
public status(): Promise<InstanceStatus>;
|
|
5541
5605
|
}
|
package/oldest/index.ts
CHANGED
|
@@ -1523,7 +1523,11 @@ export declare abstract class Body {
|
|
|
1523
1523
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1524
1524
|
*/
|
|
1525
1525
|
export declare class Response extends Body {
|
|
1526
|
-
constructor(
|
|
1526
|
+
constructor(
|
|
1527
|
+
body?: BodyInit | null,
|
|
1528
|
+
init?: ResponseInit,
|
|
1529
|
+
webSocket?: WebSocket,
|
|
1530
|
+
);
|
|
1527
1531
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1528
1532
|
static redirect(url: string, status?: number): Response;
|
|
1529
1533
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
@@ -1550,7 +1554,7 @@ export interface ResponseInit {
|
|
|
1550
1554
|
statusText?: string;
|
|
1551
1555
|
headers?: HeadersInit;
|
|
1552
1556
|
cf?: any;
|
|
1553
|
-
webSocket?: WebSocket
|
|
1557
|
+
webSocket?: WebSocket;
|
|
1554
1558
|
encodeBody?: "automatic" | "manual";
|
|
1555
1559
|
}
|
|
1556
1560
|
export type RequestInfo<
|
|
@@ -2258,15 +2262,15 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
2258
2262
|
}
|
|
2259
2263
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
2260
2264
|
constructor(
|
|
2261
|
-
|
|
2262
|
-
|
|
2265
|
+
expectedLength: number | bigint,
|
|
2266
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2263
2267
|
);
|
|
2264
2268
|
}
|
|
2265
2269
|
export declare class IdentityTransformStream extends TransformStream<
|
|
2266
2270
|
ArrayBuffer | ArrayBufferView,
|
|
2267
2271
|
Uint8Array
|
|
2268
2272
|
> {
|
|
2269
|
-
constructor(
|
|
2273
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2270
2274
|
}
|
|
2271
2275
|
export interface IdentityTransformStreamQueuingStrategy {
|
|
2272
2276
|
highWaterMark?: number | bigint;
|
|
@@ -2728,21 +2732,24 @@ export declare const WebSocketPair: {
|
|
|
2728
2732
|
};
|
|
2729
2733
|
};
|
|
2730
2734
|
export interface SqlStorage {
|
|
2731
|
-
exec
|
|
2732
|
-
|
|
2735
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2736
|
+
query: string,
|
|
2737
|
+
...bindings: any[]
|
|
2738
|
+
): SqlStorageCursor<T>;
|
|
2733
2739
|
get databaseSize(): number;
|
|
2734
2740
|
Cursor: typeof SqlStorageCursor;
|
|
2735
2741
|
Statement: typeof SqlStorageStatement;
|
|
2736
2742
|
}
|
|
2737
2743
|
export declare abstract class SqlStorageStatement {}
|
|
2738
|
-
export
|
|
2739
|
-
|
|
2744
|
+
export type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2745
|
+
export declare abstract class SqlStorageCursor<
|
|
2746
|
+
T extends Record<string, SqlStorageValue>,
|
|
2747
|
+
> {
|
|
2748
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2740
2749
|
get columnNames(): string[];
|
|
2741
2750
|
get rowsRead(): number;
|
|
2742
2751
|
get rowsWritten(): number;
|
|
2743
|
-
[Symbol.iterator](): IterableIterator<
|
|
2744
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2745
|
-
>;
|
|
2752
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2746
2753
|
}
|
|
2747
2754
|
export interface Socket {
|
|
2748
2755
|
get readable(): ReadableStream;
|
|
@@ -3274,7 +3281,7 @@ export interface GPUOrigin3DDict {
|
|
|
3274
3281
|
z?: number;
|
|
3275
3282
|
}
|
|
3276
3283
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3277
|
-
export declare class EventSource {
|
|
3284
|
+
export declare class EventSource extends EventTarget {
|
|
3278
3285
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3279
3286
|
/**
|
|
3280
3287
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5444,13 +5451,57 @@ export interface DispatchNamespace {
|
|
|
5444
5451
|
options?: DynamicDispatchOptions,
|
|
5445
5452
|
): Fetcher;
|
|
5446
5453
|
}
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5454
|
+
export declare abstract class Workflow {
|
|
5455
|
+
/**
|
|
5456
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5457
|
+
* @param id Id for the instance of this Workflow
|
|
5458
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5459
|
+
*/
|
|
5460
|
+
public get(id: string): Promise<Instance>;
|
|
5461
|
+
/**
|
|
5462
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5463
|
+
* @param id Id to create the instance of this Workflow with
|
|
5464
|
+
* @param params The payload to send over to this instance
|
|
5465
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5466
|
+
*/
|
|
5467
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5468
|
+
}
|
|
5469
|
+
export type InstanceStatus = {
|
|
5470
|
+
status:
|
|
5471
|
+
| "queued"
|
|
5472
|
+
| "running"
|
|
5473
|
+
| "paused"
|
|
5474
|
+
| "errored"
|
|
5475
|
+
| "terminated"
|
|
5476
|
+
| "complete"
|
|
5477
|
+
| "unknown";
|
|
5478
|
+
error?: string;
|
|
5479
|
+
output?: object;
|
|
5480
|
+
};
|
|
5481
|
+
export interface WorkflowError {
|
|
5482
|
+
code?: number;
|
|
5483
|
+
message: string;
|
|
5484
|
+
}
|
|
5485
|
+
export declare abstract class Instance {
|
|
5486
|
+
public id: string;
|
|
5487
|
+
/**
|
|
5488
|
+
* Pause the instance.
|
|
5489
|
+
*/
|
|
5490
|
+
public pause(): Promise<void>;
|
|
5491
|
+
/**
|
|
5492
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5493
|
+
*/
|
|
5494
|
+
public resume(): Promise<void>;
|
|
5495
|
+
/**
|
|
5496
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5497
|
+
*/
|
|
5498
|
+
public abort(): Promise<void>;
|
|
5499
|
+
/**
|
|
5500
|
+
* Restart the instance.
|
|
5501
|
+
*/
|
|
5502
|
+
public restart(): Promise<void>;
|
|
5503
|
+
/**
|
|
5504
|
+
* Returns the current status of the instance.
|
|
5505
|
+
*/
|
|
5506
|
+
public status(): Promise<InstanceStatus>;
|
|
5456
5507
|
}
|
package/package.json
CHANGED