@cloudflare/workers-types 4.20240909.0 → 4.20240924.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 +89 -18
- package/2021-11-03/index.ts +78 -20
- package/2022-01-31/index.d.ts +89 -18
- package/2022-01-31/index.ts +78 -20
- package/2022-03-21/index.d.ts +89 -18
- package/2022-03-21/index.ts +78 -20
- package/2022-08-04/index.d.ts +89 -18
- package/2022-08-04/index.ts +78 -20
- package/2022-10-31/index.d.ts +89 -18
- package/2022-10-31/index.ts +78 -20
- package/2022-11-30/index.d.ts +89 -18
- package/2022-11-30/index.ts +78 -20
- package/2023-03-01/index.d.ts +89 -18
- package/2023-03-01/index.ts +78 -20
- package/2023-07-01/index.d.ts +89 -18
- package/2023-07-01/index.ts +78 -20
- package/experimental/index.d.ts +89 -17
- package/experimental/index.ts +78 -19
- package/index.d.ts +89 -18
- package/index.ts +78 -20
- package/oldest/index.d.ts +89 -18
- package/oldest/index.ts +78 -20
- package/package.json +1 -1
package/2023-03-01/index.d.ts
CHANGED
|
@@ -2283,15 +2283,15 @@ declare class TransformStream<I = any, O = any> {
|
|
|
2283
2283
|
}
|
|
2284
2284
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
2285
2285
|
constructor(
|
|
2286
|
-
|
|
2287
|
-
|
|
2286
|
+
expectedLength: number | bigint,
|
|
2287
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2288
2288
|
);
|
|
2289
2289
|
}
|
|
2290
2290
|
declare class IdentityTransformStream extends TransformStream<
|
|
2291
2291
|
ArrayBuffer | ArrayBufferView,
|
|
2292
2292
|
Uint8Array
|
|
2293
2293
|
> {
|
|
2294
|
-
constructor(
|
|
2294
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2295
2295
|
}
|
|
2296
2296
|
interface IdentityTransformStreamQueuingStrategy {
|
|
2297
2297
|
highWaterMark?: number | bigint;
|
|
@@ -2769,21 +2769,35 @@ declare const WebSocketPair: {
|
|
|
2769
2769
|
};
|
|
2770
2770
|
};
|
|
2771
2771
|
interface SqlStorage {
|
|
2772
|
-
exec
|
|
2773
|
-
|
|
2772
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2773
|
+
query: string,
|
|
2774
|
+
...bindings: any[]
|
|
2775
|
+
): SqlStorageCursor<T>;
|
|
2774
2776
|
get databaseSize(): number;
|
|
2775
2777
|
Cursor: typeof SqlStorageCursor;
|
|
2776
2778
|
Statement: typeof SqlStorageStatement;
|
|
2777
2779
|
}
|
|
2778
2780
|
declare abstract class SqlStorageStatement {}
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
+
type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2782
|
+
declare abstract class SqlStorageCursor<
|
|
2783
|
+
T extends Record<string, SqlStorageValue>,
|
|
2784
|
+
> {
|
|
2785
|
+
next():
|
|
2786
|
+
| {
|
|
2787
|
+
done?: false;
|
|
2788
|
+
value: T;
|
|
2789
|
+
}
|
|
2790
|
+
| {
|
|
2791
|
+
done: true;
|
|
2792
|
+
value?: never;
|
|
2793
|
+
};
|
|
2794
|
+
toArray(): T[];
|
|
2795
|
+
one(): T;
|
|
2796
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2781
2797
|
get columnNames(): string[];
|
|
2782
2798
|
get rowsRead(): number;
|
|
2783
2799
|
get rowsWritten(): number;
|
|
2784
|
-
[Symbol.iterator](): IterableIterator<
|
|
2785
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2786
|
-
>;
|
|
2800
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2787
2801
|
}
|
|
2788
2802
|
interface Socket {
|
|
2789
2803
|
get readable(): ReadableStream;
|
|
@@ -3322,7 +3336,7 @@ interface GPUOrigin3DDict {
|
|
|
3322
3336
|
z?: number;
|
|
3323
3337
|
}
|
|
3324
3338
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3325
|
-
declare class EventSource {
|
|
3339
|
+
declare class EventSource extends EventTarget {
|
|
3326
3340
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3327
3341
|
/**
|
|
3328
3342
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5587,12 +5601,69 @@ interface DispatchNamespace {
|
|
|
5587
5601
|
): Fetcher;
|
|
5588
5602
|
}
|
|
5589
5603
|
/**
|
|
5590
|
-
* NonRetryableError allows for a
|
|
5591
|
-
*
|
|
5604
|
+
* NonRetryableError allows for a user to throw a fatal error
|
|
5605
|
+
* that makes a Workflow instance fail immediately without triggering a retry
|
|
5592
5606
|
*/
|
|
5593
|
-
declare
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5607
|
+
declare module "cloudflare:workflows" {
|
|
5608
|
+
export abstract class NonRetryableError extends Error {
|
|
5609
|
+
/**
|
|
5610
|
+
* `__brand` is used to differentiate between `NonRetryableError` and `Error`
|
|
5611
|
+
* and is omitted from the constructor because users should not set it
|
|
5612
|
+
*/
|
|
5613
|
+
public constructor(message: string, name?: string);
|
|
5614
|
+
}
|
|
5615
|
+
}
|
|
5616
|
+
declare abstract class Workflow {
|
|
5617
|
+
/**
|
|
5618
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5619
|
+
* @param id Id for the instance of this Workflow
|
|
5620
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5621
|
+
*/
|
|
5622
|
+
public get(id: string): Promise<Instance>;
|
|
5623
|
+
/**
|
|
5624
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5625
|
+
* @param id Id to create the instance of this Workflow with
|
|
5626
|
+
* @param params The payload to send over to this instance
|
|
5627
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5628
|
+
*/
|
|
5629
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5630
|
+
}
|
|
5631
|
+
type InstanceStatus = {
|
|
5632
|
+
status:
|
|
5633
|
+
| "queued"
|
|
5634
|
+
| "running"
|
|
5635
|
+
| "paused"
|
|
5636
|
+
| "errored"
|
|
5637
|
+
| "terminated"
|
|
5638
|
+
| "complete"
|
|
5639
|
+
| "unknown";
|
|
5640
|
+
error?: string;
|
|
5641
|
+
output?: object;
|
|
5642
|
+
};
|
|
5643
|
+
interface WorkflowError {
|
|
5644
|
+
code?: number;
|
|
5645
|
+
message: string;
|
|
5646
|
+
}
|
|
5647
|
+
declare abstract class Instance {
|
|
5648
|
+
public id: string;
|
|
5649
|
+
/**
|
|
5650
|
+
* Pause the instance.
|
|
5651
|
+
*/
|
|
5652
|
+
public pause(): Promise<void>;
|
|
5653
|
+
/**
|
|
5654
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5655
|
+
*/
|
|
5656
|
+
public resume(): Promise<void>;
|
|
5657
|
+
/**
|
|
5658
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5659
|
+
*/
|
|
5660
|
+
public abort(): Promise<void>;
|
|
5661
|
+
/**
|
|
5662
|
+
* Restart the instance.
|
|
5663
|
+
*/
|
|
5664
|
+
public restart(): Promise<void>;
|
|
5665
|
+
/**
|
|
5666
|
+
* Returns the current status of the instance.
|
|
5667
|
+
*/
|
|
5668
|
+
public status(): Promise<InstanceStatus>;
|
|
5598
5669
|
}
|
package/2023-03-01/index.ts
CHANGED
|
@@ -2289,15 +2289,15 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
2289
2289
|
}
|
|
2290
2290
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
2291
2291
|
constructor(
|
|
2292
|
-
|
|
2293
|
-
|
|
2292
|
+
expectedLength: number | bigint,
|
|
2293
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2294
2294
|
);
|
|
2295
2295
|
}
|
|
2296
2296
|
export declare class IdentityTransformStream extends TransformStream<
|
|
2297
2297
|
ArrayBuffer | ArrayBufferView,
|
|
2298
2298
|
Uint8Array
|
|
2299
2299
|
> {
|
|
2300
|
-
constructor(
|
|
2300
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2301
2301
|
}
|
|
2302
2302
|
export interface IdentityTransformStreamQueuingStrategy {
|
|
2303
2303
|
highWaterMark?: number | bigint;
|
|
@@ -2778,21 +2778,35 @@ export declare const WebSocketPair: {
|
|
|
2778
2778
|
};
|
|
2779
2779
|
};
|
|
2780
2780
|
export interface SqlStorage {
|
|
2781
|
-
exec
|
|
2782
|
-
|
|
2781
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2782
|
+
query: string,
|
|
2783
|
+
...bindings: any[]
|
|
2784
|
+
): SqlStorageCursor<T>;
|
|
2783
2785
|
get databaseSize(): number;
|
|
2784
2786
|
Cursor: typeof SqlStorageCursor;
|
|
2785
2787
|
Statement: typeof SqlStorageStatement;
|
|
2786
2788
|
}
|
|
2787
2789
|
export declare abstract class SqlStorageStatement {}
|
|
2788
|
-
export
|
|
2789
|
-
|
|
2790
|
+
export type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2791
|
+
export declare abstract class SqlStorageCursor<
|
|
2792
|
+
T extends Record<string, SqlStorageValue>,
|
|
2793
|
+
> {
|
|
2794
|
+
next():
|
|
2795
|
+
| {
|
|
2796
|
+
done?: false;
|
|
2797
|
+
value: T;
|
|
2798
|
+
}
|
|
2799
|
+
| {
|
|
2800
|
+
done: true;
|
|
2801
|
+
value?: never;
|
|
2802
|
+
};
|
|
2803
|
+
toArray(): T[];
|
|
2804
|
+
one(): T;
|
|
2805
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2790
2806
|
get columnNames(): string[];
|
|
2791
2807
|
get rowsRead(): number;
|
|
2792
2808
|
get rowsWritten(): number;
|
|
2793
|
-
[Symbol.iterator](): IterableIterator<
|
|
2794
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2795
|
-
>;
|
|
2809
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2796
2810
|
}
|
|
2797
2811
|
export interface Socket {
|
|
2798
2812
|
get readable(): ReadableStream;
|
|
@@ -3331,7 +3345,7 @@ export interface GPUOrigin3DDict {
|
|
|
3331
3345
|
z?: number;
|
|
3332
3346
|
}
|
|
3333
3347
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3334
|
-
export declare class EventSource {
|
|
3348
|
+
export declare class EventSource extends EventTarget {
|
|
3335
3349
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3336
3350
|
/**
|
|
3337
3351
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5501,13 +5515,57 @@ export interface DispatchNamespace {
|
|
|
5501
5515
|
options?: DynamicDispatchOptions,
|
|
5502
5516
|
): Fetcher;
|
|
5503
5517
|
}
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5518
|
+
export declare abstract class Workflow {
|
|
5519
|
+
/**
|
|
5520
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5521
|
+
* @param id Id for the instance of this Workflow
|
|
5522
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5523
|
+
*/
|
|
5524
|
+
public get(id: string): Promise<Instance>;
|
|
5525
|
+
/**
|
|
5526
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5527
|
+
* @param id Id to create the instance of this Workflow with
|
|
5528
|
+
* @param params The payload to send over to this instance
|
|
5529
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5530
|
+
*/
|
|
5531
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5532
|
+
}
|
|
5533
|
+
export type InstanceStatus = {
|
|
5534
|
+
status:
|
|
5535
|
+
| "queued"
|
|
5536
|
+
| "running"
|
|
5537
|
+
| "paused"
|
|
5538
|
+
| "errored"
|
|
5539
|
+
| "terminated"
|
|
5540
|
+
| "complete"
|
|
5541
|
+
| "unknown";
|
|
5542
|
+
error?: string;
|
|
5543
|
+
output?: object;
|
|
5544
|
+
};
|
|
5545
|
+
export interface WorkflowError {
|
|
5546
|
+
code?: number;
|
|
5547
|
+
message: string;
|
|
5548
|
+
}
|
|
5549
|
+
export declare abstract class Instance {
|
|
5550
|
+
public id: string;
|
|
5551
|
+
/**
|
|
5552
|
+
* Pause the instance.
|
|
5553
|
+
*/
|
|
5554
|
+
public pause(): Promise<void>;
|
|
5555
|
+
/**
|
|
5556
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5557
|
+
*/
|
|
5558
|
+
public resume(): Promise<void>;
|
|
5559
|
+
/**
|
|
5560
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5561
|
+
*/
|
|
5562
|
+
public abort(): Promise<void>;
|
|
5563
|
+
/**
|
|
5564
|
+
* Restart the instance.
|
|
5565
|
+
*/
|
|
5566
|
+
public restart(): Promise<void>;
|
|
5567
|
+
/**
|
|
5568
|
+
* Returns the current status of the instance.
|
|
5569
|
+
*/
|
|
5570
|
+
public status(): Promise<InstanceStatus>;
|
|
5513
5571
|
}
|
package/2023-07-01/index.d.ts
CHANGED
|
@@ -2283,15 +2283,15 @@ declare class TransformStream<I = any, O = any> {
|
|
|
2283
2283
|
}
|
|
2284
2284
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
2285
2285
|
constructor(
|
|
2286
|
-
|
|
2287
|
-
|
|
2286
|
+
expectedLength: number | bigint,
|
|
2287
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2288
2288
|
);
|
|
2289
2289
|
}
|
|
2290
2290
|
declare class IdentityTransformStream extends TransformStream<
|
|
2291
2291
|
ArrayBuffer | ArrayBufferView,
|
|
2292
2292
|
Uint8Array
|
|
2293
2293
|
> {
|
|
2294
|
-
constructor(
|
|
2294
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2295
2295
|
}
|
|
2296
2296
|
interface IdentityTransformStreamQueuingStrategy {
|
|
2297
2297
|
highWaterMark?: number | bigint;
|
|
@@ -2769,21 +2769,35 @@ declare const WebSocketPair: {
|
|
|
2769
2769
|
};
|
|
2770
2770
|
};
|
|
2771
2771
|
interface SqlStorage {
|
|
2772
|
-
exec
|
|
2773
|
-
|
|
2772
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2773
|
+
query: string,
|
|
2774
|
+
...bindings: any[]
|
|
2775
|
+
): SqlStorageCursor<T>;
|
|
2774
2776
|
get databaseSize(): number;
|
|
2775
2777
|
Cursor: typeof SqlStorageCursor;
|
|
2776
2778
|
Statement: typeof SqlStorageStatement;
|
|
2777
2779
|
}
|
|
2778
2780
|
declare abstract class SqlStorageStatement {}
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
+
type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2782
|
+
declare abstract class SqlStorageCursor<
|
|
2783
|
+
T extends Record<string, SqlStorageValue>,
|
|
2784
|
+
> {
|
|
2785
|
+
next():
|
|
2786
|
+
| {
|
|
2787
|
+
done?: false;
|
|
2788
|
+
value: T;
|
|
2789
|
+
}
|
|
2790
|
+
| {
|
|
2791
|
+
done: true;
|
|
2792
|
+
value?: never;
|
|
2793
|
+
};
|
|
2794
|
+
toArray(): T[];
|
|
2795
|
+
one(): T;
|
|
2796
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2781
2797
|
get columnNames(): string[];
|
|
2782
2798
|
get rowsRead(): number;
|
|
2783
2799
|
get rowsWritten(): number;
|
|
2784
|
-
[Symbol.iterator](): IterableIterator<
|
|
2785
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2786
|
-
>;
|
|
2800
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2787
2801
|
}
|
|
2788
2802
|
interface Socket {
|
|
2789
2803
|
get readable(): ReadableStream;
|
|
@@ -3322,7 +3336,7 @@ interface GPUOrigin3DDict {
|
|
|
3322
3336
|
z?: number;
|
|
3323
3337
|
}
|
|
3324
3338
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3325
|
-
declare class EventSource {
|
|
3339
|
+
declare class EventSource extends EventTarget {
|
|
3326
3340
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3327
3341
|
/**
|
|
3328
3342
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5587,12 +5601,69 @@ interface DispatchNamespace {
|
|
|
5587
5601
|
): Fetcher;
|
|
5588
5602
|
}
|
|
5589
5603
|
/**
|
|
5590
|
-
* NonRetryableError allows for a
|
|
5591
|
-
*
|
|
5604
|
+
* NonRetryableError allows for a user to throw a fatal error
|
|
5605
|
+
* that makes a Workflow instance fail immediately without triggering a retry
|
|
5592
5606
|
*/
|
|
5593
|
-
declare
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5607
|
+
declare module "cloudflare:workflows" {
|
|
5608
|
+
export abstract class NonRetryableError extends Error {
|
|
5609
|
+
/**
|
|
5610
|
+
* `__brand` is used to differentiate between `NonRetryableError` and `Error`
|
|
5611
|
+
* and is omitted from the constructor because users should not set it
|
|
5612
|
+
*/
|
|
5613
|
+
public constructor(message: string, name?: string);
|
|
5614
|
+
}
|
|
5615
|
+
}
|
|
5616
|
+
declare abstract class Workflow {
|
|
5617
|
+
/**
|
|
5618
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5619
|
+
* @param id Id for the instance of this Workflow
|
|
5620
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5621
|
+
*/
|
|
5622
|
+
public get(id: string): Promise<Instance>;
|
|
5623
|
+
/**
|
|
5624
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5625
|
+
* @param id Id to create the instance of this Workflow with
|
|
5626
|
+
* @param params The payload to send over to this instance
|
|
5627
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5628
|
+
*/
|
|
5629
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5630
|
+
}
|
|
5631
|
+
type InstanceStatus = {
|
|
5632
|
+
status:
|
|
5633
|
+
| "queued"
|
|
5634
|
+
| "running"
|
|
5635
|
+
| "paused"
|
|
5636
|
+
| "errored"
|
|
5637
|
+
| "terminated"
|
|
5638
|
+
| "complete"
|
|
5639
|
+
| "unknown";
|
|
5640
|
+
error?: string;
|
|
5641
|
+
output?: object;
|
|
5642
|
+
};
|
|
5643
|
+
interface WorkflowError {
|
|
5644
|
+
code?: number;
|
|
5645
|
+
message: string;
|
|
5646
|
+
}
|
|
5647
|
+
declare abstract class Instance {
|
|
5648
|
+
public id: string;
|
|
5649
|
+
/**
|
|
5650
|
+
* Pause the instance.
|
|
5651
|
+
*/
|
|
5652
|
+
public pause(): Promise<void>;
|
|
5653
|
+
/**
|
|
5654
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5655
|
+
*/
|
|
5656
|
+
public resume(): Promise<void>;
|
|
5657
|
+
/**
|
|
5658
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5659
|
+
*/
|
|
5660
|
+
public abort(): Promise<void>;
|
|
5661
|
+
/**
|
|
5662
|
+
* Restart the instance.
|
|
5663
|
+
*/
|
|
5664
|
+
public restart(): Promise<void>;
|
|
5665
|
+
/**
|
|
5666
|
+
* Returns the current status of the instance.
|
|
5667
|
+
*/
|
|
5668
|
+
public status(): Promise<InstanceStatus>;
|
|
5598
5669
|
}
|
package/2023-07-01/index.ts
CHANGED
|
@@ -2289,15 +2289,15 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
2289
2289
|
}
|
|
2290
2290
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
2291
2291
|
constructor(
|
|
2292
|
-
|
|
2293
|
-
|
|
2292
|
+
expectedLength: number | bigint,
|
|
2293
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2294
2294
|
);
|
|
2295
2295
|
}
|
|
2296
2296
|
export declare class IdentityTransformStream extends TransformStream<
|
|
2297
2297
|
ArrayBuffer | ArrayBufferView,
|
|
2298
2298
|
Uint8Array
|
|
2299
2299
|
> {
|
|
2300
|
-
constructor(
|
|
2300
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2301
2301
|
}
|
|
2302
2302
|
export interface IdentityTransformStreamQueuingStrategy {
|
|
2303
2303
|
highWaterMark?: number | bigint;
|
|
@@ -2778,21 +2778,35 @@ export declare const WebSocketPair: {
|
|
|
2778
2778
|
};
|
|
2779
2779
|
};
|
|
2780
2780
|
export interface SqlStorage {
|
|
2781
|
-
exec
|
|
2782
|
-
|
|
2781
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2782
|
+
query: string,
|
|
2783
|
+
...bindings: any[]
|
|
2784
|
+
): SqlStorageCursor<T>;
|
|
2783
2785
|
get databaseSize(): number;
|
|
2784
2786
|
Cursor: typeof SqlStorageCursor;
|
|
2785
2787
|
Statement: typeof SqlStorageStatement;
|
|
2786
2788
|
}
|
|
2787
2789
|
export declare abstract class SqlStorageStatement {}
|
|
2788
|
-
export
|
|
2789
|
-
|
|
2790
|
+
export type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2791
|
+
export declare abstract class SqlStorageCursor<
|
|
2792
|
+
T extends Record<string, SqlStorageValue>,
|
|
2793
|
+
> {
|
|
2794
|
+
next():
|
|
2795
|
+
| {
|
|
2796
|
+
done?: false;
|
|
2797
|
+
value: T;
|
|
2798
|
+
}
|
|
2799
|
+
| {
|
|
2800
|
+
done: true;
|
|
2801
|
+
value?: never;
|
|
2802
|
+
};
|
|
2803
|
+
toArray(): T[];
|
|
2804
|
+
one(): T;
|
|
2805
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2790
2806
|
get columnNames(): string[];
|
|
2791
2807
|
get rowsRead(): number;
|
|
2792
2808
|
get rowsWritten(): number;
|
|
2793
|
-
[Symbol.iterator](): IterableIterator<
|
|
2794
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2795
|
-
>;
|
|
2809
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2796
2810
|
}
|
|
2797
2811
|
export interface Socket {
|
|
2798
2812
|
get readable(): ReadableStream;
|
|
@@ -3331,7 +3345,7 @@ export interface GPUOrigin3DDict {
|
|
|
3331
3345
|
z?: number;
|
|
3332
3346
|
}
|
|
3333
3347
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3334
|
-
export declare class EventSource {
|
|
3348
|
+
export declare class EventSource extends EventTarget {
|
|
3335
3349
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3336
3350
|
/**
|
|
3337
3351
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5501,13 +5515,57 @@ export interface DispatchNamespace {
|
|
|
5501
5515
|
options?: DynamicDispatchOptions,
|
|
5502
5516
|
): Fetcher;
|
|
5503
5517
|
}
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5518
|
+
export declare abstract class Workflow {
|
|
5519
|
+
/**
|
|
5520
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5521
|
+
* @param id Id for the instance of this Workflow
|
|
5522
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5523
|
+
*/
|
|
5524
|
+
public get(id: string): Promise<Instance>;
|
|
5525
|
+
/**
|
|
5526
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5527
|
+
* @param id Id to create the instance of this Workflow with
|
|
5528
|
+
* @param params The payload to send over to this instance
|
|
5529
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5530
|
+
*/
|
|
5531
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5532
|
+
}
|
|
5533
|
+
export type InstanceStatus = {
|
|
5534
|
+
status:
|
|
5535
|
+
| "queued"
|
|
5536
|
+
| "running"
|
|
5537
|
+
| "paused"
|
|
5538
|
+
| "errored"
|
|
5539
|
+
| "terminated"
|
|
5540
|
+
| "complete"
|
|
5541
|
+
| "unknown";
|
|
5542
|
+
error?: string;
|
|
5543
|
+
output?: object;
|
|
5544
|
+
};
|
|
5545
|
+
export interface WorkflowError {
|
|
5546
|
+
code?: number;
|
|
5547
|
+
message: string;
|
|
5548
|
+
}
|
|
5549
|
+
export declare abstract class Instance {
|
|
5550
|
+
public id: string;
|
|
5551
|
+
/**
|
|
5552
|
+
* Pause the instance.
|
|
5553
|
+
*/
|
|
5554
|
+
public pause(): Promise<void>;
|
|
5555
|
+
/**
|
|
5556
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5557
|
+
*/
|
|
5558
|
+
public resume(): Promise<void>;
|
|
5559
|
+
/**
|
|
5560
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5561
|
+
*/
|
|
5562
|
+
public abort(): Promise<void>;
|
|
5563
|
+
/**
|
|
5564
|
+
* Restart the instance.
|
|
5565
|
+
*/
|
|
5566
|
+
public restart(): Promise<void>;
|
|
5567
|
+
/**
|
|
5568
|
+
* Returns the current status of the instance.
|
|
5569
|
+
*/
|
|
5570
|
+
public status(): Promise<InstanceStatus>;
|
|
5513
5571
|
}
|