Skip to content

Commit

Permalink
Fix snapshots (#3196)
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa authored Dec 2, 2024
1 parent 847693f commit a27a73a
Show file tree
Hide file tree
Showing 21 changed files with 185 additions and 160 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/type-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ jobs:
- name: Check snapshot diff
run: |
diff -r bazel-bin/types/definitions/ types/generated-snapshot
- name: How to fix
if: failure()
run: |
echo "The generated output of @cloudflare/workers-types has been changed by this PR"
echo "If this is intentional, run 'rm -rf types/generated-snapshot && cp -r bazel-bin/types/definitions types/generated-snapshot' to update the snapshot"
20 changes: 11 additions & 9 deletions types/generated-snapshot/2021-11-03/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ declare class Blob {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
slice(start?: number, end?: number, type?: string): Blob;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1505,7 +1505,7 @@ declare abstract class Body {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
readonly bodyUsed: boolean;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1899,7 +1899,7 @@ declare abstract class R2Object {
interface R2ObjectBody extends R2Object {
get body(): ReadableStream;
get bodyUsed(): boolean;
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
text(): Promise<string>;
json<T>(): Promise<T>;
blob(): Promise<Blob>;
Expand Down Expand Up @@ -5290,14 +5290,16 @@ declare module "cloudflare:workers" {
export type WorkflowSleepDuration =
| `${number} ${WorkflowDurationLabel}${"s" | ""}`
| number;
export type WorkflowDelayDuration = WorkflowSleepDuration;
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
export type WorkflowBackoff = "constant" | "linear" | "exponential";
export type WorkflowStepConfig = {
retries?: {
limit: number;
delay: string | number;
delay: WorkflowDelayDuration | number;
backoff?: WorkflowBackoff;
};
timeout?: string | number;
timeout?: WorkflowTimeoutDuration | number;
};
export type WorkflowEvent<T> = {
payload: Readonly<T>;
Expand Down Expand Up @@ -5650,7 +5652,7 @@ declare module "cloudflare:workflows" {
public constructor(message: string, name?: string);
}
}
declare abstract class Workflow {
declare abstract class Workflow<PARAMS = unknown> {
/**
* Get a handle to an existing instance of the Workflow.
* @param id Id for the instance of this Workflow
Expand All @@ -5663,18 +5665,18 @@ declare abstract class Workflow {
* @returns A promise that resolves with a handle for the Instance
*/
public create(
options?: WorkflowInstanceCreateOptions,
options?: WorkflowInstanceCreateOptions<PARAMS>,
): Promise<WorkflowInstance>;
}
interface WorkflowInstanceCreateOptions {
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
/**
* An id for your Workflow instance. Must be unique within the Workflow.
*/
id?: string;
/**
* The event payload the Workflow instance is triggered with
*/
params?: unknown;
params?: PARAMS;
}
type InstanceStatus = {
status:
Expand Down
14 changes: 7 additions & 7 deletions types/generated-snapshot/2021-11-03/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ export declare class Blob {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
slice(start?: number, end?: number, type?: string): Blob;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1510,7 +1510,7 @@ export declare abstract class Body {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
readonly bodyUsed: boolean;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1908,7 +1908,7 @@ export declare abstract class R2Object {
export interface R2ObjectBody extends R2Object {
get body(): ReadableStream;
get bodyUsed(): boolean;
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
text(): Promise<string>;
json<T>(): Promise<T>;
blob(): Promise<Blob>;
Expand Down Expand Up @@ -5554,7 +5554,7 @@ export interface DispatchNamespace {
options?: DynamicDispatchOptions,
): Fetcher;
}
export declare abstract class Workflow {
export declare abstract class Workflow<PARAMS = unknown> {
/**
* Get a handle to an existing instance of the Workflow.
* @param id Id for the instance of this Workflow
Expand All @@ -5567,18 +5567,18 @@ export declare abstract class Workflow {
* @returns A promise that resolves with a handle for the Instance
*/
public create(
options?: WorkflowInstanceCreateOptions,
options?: WorkflowInstanceCreateOptions<PARAMS>,
): Promise<WorkflowInstance>;
}
export interface WorkflowInstanceCreateOptions {
export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
/**
* An id for your Workflow instance. Must be unique within the Workflow.
*/
id?: string;
/**
* The event payload the Workflow instance is triggered with
*/
params?: unknown;
params?: PARAMS;
}
export type InstanceStatus = {
status:
Expand Down
20 changes: 11 additions & 9 deletions types/generated-snapshot/2022-01-31/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ declare class Blob {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
slice(start?: number, end?: number, type?: string): Blob;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1511,7 +1511,7 @@ declare abstract class Body {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
get bodyUsed(): boolean;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1905,7 +1905,7 @@ declare abstract class R2Object {
interface R2ObjectBody extends R2Object {
get body(): ReadableStream;
get bodyUsed(): boolean;
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
text(): Promise<string>;
json<T>(): Promise<T>;
blob(): Promise<Blob>;
Expand Down Expand Up @@ -5316,14 +5316,16 @@ declare module "cloudflare:workers" {
export type WorkflowSleepDuration =
| `${number} ${WorkflowDurationLabel}${"s" | ""}`
| number;
export type WorkflowDelayDuration = WorkflowSleepDuration;
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
export type WorkflowBackoff = "constant" | "linear" | "exponential";
export type WorkflowStepConfig = {
retries?: {
limit: number;
delay: string | number;
delay: WorkflowDelayDuration | number;
backoff?: WorkflowBackoff;
};
timeout?: string | number;
timeout?: WorkflowTimeoutDuration | number;
};
export type WorkflowEvent<T> = {
payload: Readonly<T>;
Expand Down Expand Up @@ -5676,7 +5678,7 @@ declare module "cloudflare:workflows" {
public constructor(message: string, name?: string);
}
}
declare abstract class Workflow {
declare abstract class Workflow<PARAMS = unknown> {
/**
* Get a handle to an existing instance of the Workflow.
* @param id Id for the instance of this Workflow
Expand All @@ -5689,18 +5691,18 @@ declare abstract class Workflow {
* @returns A promise that resolves with a handle for the Instance
*/
public create(
options?: WorkflowInstanceCreateOptions,
options?: WorkflowInstanceCreateOptions<PARAMS>,
): Promise<WorkflowInstance>;
}
interface WorkflowInstanceCreateOptions {
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
/**
* An id for your Workflow instance. Must be unique within the Workflow.
*/
id?: string;
/**
* The event payload the Workflow instance is triggered with
*/
params?: unknown;
params?: PARAMS;
}
type InstanceStatus = {
status:
Expand Down
14 changes: 7 additions & 7 deletions types/generated-snapshot/2022-01-31/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ export declare class Blob {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
slice(start?: number, end?: number, type?: string): Blob;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1516,7 +1516,7 @@ export declare abstract class Body {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
get bodyUsed(): boolean;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1914,7 +1914,7 @@ export declare abstract class R2Object {
export interface R2ObjectBody extends R2Object {
get body(): ReadableStream;
get bodyUsed(): boolean;
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
text(): Promise<string>;
json<T>(): Promise<T>;
blob(): Promise<Blob>;
Expand Down Expand Up @@ -5580,7 +5580,7 @@ export interface DispatchNamespace {
options?: DynamicDispatchOptions,
): Fetcher;
}
export declare abstract class Workflow {
export declare abstract class Workflow<PARAMS = unknown> {
/**
* Get a handle to an existing instance of the Workflow.
* @param id Id for the instance of this Workflow
Expand All @@ -5593,18 +5593,18 @@ export declare abstract class Workflow {
* @returns A promise that resolves with a handle for the Instance
*/
public create(
options?: WorkflowInstanceCreateOptions,
options?: WorkflowInstanceCreateOptions<PARAMS>,
): Promise<WorkflowInstance>;
}
export interface WorkflowInstanceCreateOptions {
export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
/**
* An id for your Workflow instance. Must be unique within the Workflow.
*/
id?: string;
/**
* The event payload the Workflow instance is triggered with
*/
params?: unknown;
params?: PARAMS;
}
export type InstanceStatus = {
status:
Expand Down
20 changes: 11 additions & 9 deletions types/generated-snapshot/2022-03-21/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ declare class Blob {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
slice(start?: number, end?: number, type?: string): Blob;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1528,7 +1528,7 @@ declare abstract class Body {
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
get bodyUsed(): boolean;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
bytes(): Promise<Uint8Array>;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
text(): Promise<string>;
Expand Down Expand Up @@ -1922,7 +1922,7 @@ declare abstract class R2Object {
interface R2ObjectBody extends R2Object {
get body(): ReadableStream;
get bodyUsed(): boolean;
arrayBuffer(): Promise<ArrayBuffer | ArrayBufferView>;
arrayBuffer(): Promise<ArrayBuffer>;
text(): Promise<string>;
json<T>(): Promise<T>;
blob(): Promise<Blob>;
Expand Down Expand Up @@ -5340,14 +5340,16 @@ declare module "cloudflare:workers" {
export type WorkflowSleepDuration =
| `${number} ${WorkflowDurationLabel}${"s" | ""}`
| number;
export type WorkflowDelayDuration = WorkflowSleepDuration;
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
export type WorkflowBackoff = "constant" | "linear" | "exponential";
export type WorkflowStepConfig = {
retries?: {
limit: number;
delay: string | number;
delay: WorkflowDelayDuration | number;
backoff?: WorkflowBackoff;
};
timeout?: string | number;
timeout?: WorkflowTimeoutDuration | number;
};
export type WorkflowEvent<T> = {
payload: Readonly<T>;
Expand Down Expand Up @@ -5700,7 +5702,7 @@ declare module "cloudflare:workflows" {
public constructor(message: string, name?: string);
}
}
declare abstract class Workflow {
declare abstract class Workflow<PARAMS = unknown> {
/**
* Get a handle to an existing instance of the Workflow.
* @param id Id for the instance of this Workflow
Expand All @@ -5713,18 +5715,18 @@ declare abstract class Workflow {
* @returns A promise that resolves with a handle for the Instance
*/
public create(
options?: WorkflowInstanceCreateOptions,
options?: WorkflowInstanceCreateOptions<PARAMS>,
): Promise<WorkflowInstance>;
}
interface WorkflowInstanceCreateOptions {
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
/**
* An id for your Workflow instance. Must be unique within the Workflow.
*/
id?: string;
/**
* The event payload the Workflow instance is triggered with
*/
params?: unknown;
params?: PARAMS;
}
type InstanceStatus = {
status:
Expand Down
Loading

0 comments on commit a27a73a

Please sign in to comment.