1
+ // Extend this in your apps to properly type Env
2
+ interface Env { }
3
+
1
4
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
2
5
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
3
6
// strips all `module` blocks.
@@ -239,8 +242,15 @@ declare module "cloudflare:workers" {
239
242
} ;
240
243
241
244
export abstract class WorkflowStep {
242
- do < T extends Rpc . Serializable < T > > ( name : string , callback : ( ) => Promise < T > ) : Promise < T > ;
243
- do < T extends Rpc . Serializable < T > > ( name : string , config : WorkflowStepConfig , callback : ( ) => Promise < T > ) : Promise < T > ;
245
+ do < T extends Rpc . Serializable < T > > (
246
+ name : string ,
247
+ callback : ( ) => Promise < T >
248
+ ) : Promise < T > ;
249
+ do < T extends Rpc . Serializable < T > > (
250
+ name : string ,
251
+ config : WorkflowStepConfig ,
252
+ callback : ( ) => Promise < T >
253
+ ) : Promise < T > ;
244
254
sleep : ( name : string , duration : WorkflowSleepDuration ) => Promise < void > ;
245
255
sleepUntil : ( name : string , timestamp : Date | number ) => Promise < void > ;
246
256
}
@@ -257,6 +267,11 @@ declare module "cloudflare:workers" {
257
267
258
268
constructor ( ctx : ExecutionContext , env : Env ) ;
259
269
260
- run ( event : Readonly < WorkflowEvent < T > > , step : WorkflowStep ) : Promise < unknown > ;
270
+ run (
271
+ event : Readonly < WorkflowEvent < T > > ,
272
+ step : WorkflowStep
273
+ ) : Promise < unknown > ;
261
274
}
275
+
276
+ export const env : Env ;
262
277
}
0 commit comments