@cloudflare/workers-types 5.20260801.1 → 5.20260807.2

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/index.ts CHANGED
@@ -350,6 +350,14 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
350
350
  ReadableByteStreamController: typeof ReadableByteStreamController;
351
351
  WritableStreamDefaultController: typeof WritableStreamDefaultController;
352
352
  TransformStreamDefaultController: typeof TransformStreamDefaultController;
353
+ Buffer: any;
354
+ process: any;
355
+ global: ServiceWorkerGlobalScope;
356
+ setImmediate(
357
+ $function: (...param0: any[]) => void,
358
+ ...args: any[]
359
+ ): Immediate;
360
+ clearImmediate(immediate: Immediate | null): void;
353
361
  CompressionStream: typeof CompressionStream;
354
362
  DecompressionStream: typeof DecompressionStream;
355
363
  TextEncoderStream: typeof TextEncoderStream;
@@ -381,6 +389,13 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
381
389
  FixedLengthStream: typeof FixedLengthStream;
382
390
  IdentityTransformStream: typeof IdentityTransformStream;
383
391
  HTMLRewriter: typeof HTMLRewriter;
392
+ Performance: typeof Performance;
393
+ PerformanceEntry: typeof PerformanceEntry;
394
+ PerformanceMark: typeof PerformanceMark;
395
+ PerformanceMeasure: typeof PerformanceMeasure;
396
+ PerformanceResourceTiming: typeof PerformanceResourceTiming;
397
+ PerformanceObserver: typeof PerformanceObserver;
398
+ PerformanceObserverEntryList: typeof PerformanceObserverEntryList;
384
399
  }
385
400
  export declare function addEventListener<
386
401
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -474,6 +489,14 @@ export declare const scheduler: Scheduler;
474
489
  export declare const performance: Performance;
475
490
  export declare const Cloudflare: Cloudflare;
476
491
  export declare const origin: string;
492
+ export declare const Buffer: any;
493
+ export declare const process: any;
494
+ export declare const global: ServiceWorkerGlobalScope;
495
+ export declare function setImmediate(
496
+ $function: (...param0: any[]) => void,
497
+ ...args: any[]
498
+ ): Immediate;
499
+ export declare function clearImmediate(immediate: Immediate | null): void;
477
500
  export declare const navigator: Navigator;
478
501
  export interface TestController {}
479
502
  export interface ExecutionContext<Props = unknown> {
@@ -565,6 +588,11 @@ export interface AlarmInvocationInfo {
565
588
  readonly retryCount: number;
566
589
  readonly scheduledTime: number;
567
590
  }
591
+ export interface Immediate {
592
+ ref(): void;
593
+ unref(): void;
594
+ hasRef(): boolean;
595
+ }
568
596
  export interface Cloudflare {
569
597
  readonly compatibilityFlags: Record<string, boolean>;
570
598
  }
@@ -3319,6 +3347,12 @@ export interface TraceLog {
3319
3347
  readonly timestamp: number;
3320
3348
  readonly level: string;
3321
3349
  readonly message: any;
3350
+ readonly errorInfo?: (TraceLogErrorInfo | null)[];
3351
+ }
3352
+ export interface TraceLogErrorInfo {
3353
+ name: string;
3354
+ message: string;
3355
+ stack?: string;
3322
3356
  }
3323
3357
  export interface TraceException {
3324
3358
  readonly timestamp: number;
@@ -3876,18 +3910,26 @@ export interface ContainerExecOptions {
3876
3910
  cwd?: string;
3877
3911
  env?: Record<string, string>;
3878
3912
  user?: string;
3913
+ signal?: AbortSignal;
3914
+ pty?: boolean | ContainerExecPtyOptions;
3879
3915
  stdin?: ReadableStream | "pipe";
3880
3916
  stdout?: "pipe" | "ignore";
3881
3917
  stderr?: "pipe" | "ignore" | "combined";
3882
3918
  }
3919
+ export interface ContainerExecPtyOptions {
3920
+ cols?: number;
3921
+ rows?: number;
3922
+ }
3883
3923
  export interface ExecProcess {
3884
3924
  readonly stdin: WritableStream | null;
3885
3925
  readonly stdout: ReadableStream | null;
3886
3926
  readonly stderr: ReadableStream | null;
3887
3927
  readonly pid: number;
3928
+ readonly isPty: boolean;
3888
3929
  readonly exitCode: Promise<number>;
3889
3930
  output(): Promise<ExecOutput>;
3890
3931
  kill(signal?: number): void;
3932
+ resize(cols: number, rows: number): void;
3891
3933
  }
3892
3934
  export interface Container {
3893
3935
  get running(): boolean;
@@ -3938,6 +3980,11 @@ export interface ContainerStartupOptions {
3938
3980
  directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3939
3981
  containerSnapshot?: ContainerSnapshot;
3940
3982
  }
3983
+ export interface ContainerStartResources {
3984
+ vcpu: number;
3985
+ memoryMib: number;
3986
+ diskMb: number;
3987
+ }
3941
3988
  /**
3942
3989
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
3943
3990
  *
@@ -4083,17 +4130,363 @@ export interface workerdResourceLimits {
4083
4130
  *
4084
4131
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
4085
4132
  */
4086
- export declare abstract class Performance {
4133
+ export declare abstract class Performance extends EventTarget {
4087
4134
  /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
4088
4135
  get timeOrigin(): number;
4089
4136
  /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
4090
4137
  now(): number;
4138
+ get eventCounts(): EventCounts;
4139
+ /**
4140
+ * The **`clearMarks()`** method removes all or specific PerformanceMark objects from the browser's performance timeline.
4141
+ *
4142
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks)
4143
+ */
4144
+ clearMarks(name?: string): void;
4145
+ /**
4146
+ * The **`clearMeasures()`** method removes all or specific PerformanceMeasure objects from the browser's performance timeline.
4147
+ *
4148
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures)
4149
+ */
4150
+ clearMeasures(name?: string): void;
4151
+ /**
4152
+ * The **`clearResourceTimings()`** method removes all performance entries with an PerformanceEntry.entryType of `'resource'` from the browser's performance timeline and sets the size of the performance resource data buffer to zero.
4153
+ *
4154
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings)
4155
+ */
4156
+ clearResourceTimings(): void;
4157
+ /**
4158
+ * The **`getEntries()`** method returns an array of all PerformanceEntry objects currently present in the performance timeline.
4159
+ *
4160
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries)
4161
+ */
4162
+ getEntries(): PerformanceEntry[];
4163
+ /**
4164
+ * The **`getEntriesByName()`** method returns an array of PerformanceEntry objects currently present in the performance timeline with the given _name_ and _type_.
4165
+ *
4166
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName)
4167
+ */
4168
+ getEntriesByName(name: string, type?: string): PerformanceEntry[];
4169
+ /**
4170
+ * The **`getEntriesByType()`** method returns an array of PerformanceEntry objects currently present in the performance timeline for a given _type_.
4171
+ *
4172
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType)
4173
+ */
4174
+ getEntriesByType(type: string): PerformanceEntry[];
4175
+ /**
4176
+ * The **`mark()`** method creates a named PerformanceMark object representing a high resolution timestamp marker in the browser's performance timeline.
4177
+ *
4178
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark)
4179
+ */
4180
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
4181
+ /**
4182
+ * The **`measure()`** method creates a named PerformanceMeasure object representing a time measurement between two marks in the browser's performance timeline.
4183
+ *
4184
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure)
4185
+ */
4186
+ measure(
4187
+ measureName: string,
4188
+ measureOptionsOrStartMark?: PerformanceMeasureOptions | string,
4189
+ maybeEndMark?: string,
4190
+ ): PerformanceMeasure;
4191
+ /**
4192
+ * The **`setResourceTimingBufferSize()`** method sets the desired size of the browser's resource timing buffer which stores the `'resource'` performance entries.
4193
+ *
4194
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize)
4195
+ */
4196
+ setResourceTimingBufferSize(size: number): void;
4091
4197
  /**
4092
4198
  * The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
4093
4199
  *
4094
4200
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
4095
4201
  */
4096
4202
  toJSON(): object;
4203
+ get nodeTiming(): PerformanceNodeTiming;
4204
+ eventLoopUtilization(): PerformanceEventLoopUtilization;
4205
+ markResourceTiming(): void;
4206
+ timerify(fn: () => void): () => void;
4207
+ }
4208
+ export interface PerformanceEventLoopUtilization {
4209
+ idle: number;
4210
+ active: number;
4211
+ utilization: number;
4212
+ }
4213
+ export interface PerformanceNodeTiming extends PerformanceEntry {
4214
+ readonly nodeStart: number;
4215
+ readonly v8Start: number;
4216
+ readonly bootstrapComplete: number;
4217
+ readonly environment: number;
4218
+ readonly loopStart: number;
4219
+ readonly loopExit: number;
4220
+ readonly idleTime: number;
4221
+ readonly uvMetricsInfo: UvMetricsInfo;
4222
+ toJSON(): object;
4223
+ }
4224
+ export interface UvMetricsInfo {
4225
+ loopCount: number;
4226
+ events: number;
4227
+ eventsWaiting: number;
4228
+ }
4229
+ /**
4230
+ * **`PerformanceMark`** is an interface for PerformanceEntry objects with an PerformanceEntry.entryType of `'mark'`.
4231
+ *
4232
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
4233
+ */
4234
+ export declare class PerformanceMark extends PerformanceEntry {
4235
+ constructor(name: string, maybeOptions?: PerformanceMarkOptions);
4236
+ /**
4237
+ * The read-only **`detail`** property returns arbitrary metadata that was included in the mark upon construction (either when using Performance.mark or the PerformanceMark.PerformanceMark constructor).
4238
+ *
4239
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail)
4240
+ */
4241
+ get detail(): any;
4242
+ toJSON(): object;
4243
+ }
4244
+ /**
4245
+ * **`PerformanceMeasure`** is an _abstract_ interface for PerformanceEntry objects with an PerformanceEntry.entryType of `'measure'`.
4246
+ *
4247
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
4248
+ */
4249
+ export declare abstract class PerformanceMeasure extends PerformanceEntry {
4250
+ /**
4251
+ * The read-only **`detail`** property returns arbitrary metadata that was included in the mark upon construction (when using Performance.measure.
4252
+ *
4253
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail)
4254
+ */
4255
+ get detail(): any;
4256
+ toJSON(): object;
4257
+ }
4258
+ export interface PerformanceMarkOptions {
4259
+ detail?: any;
4260
+ startTime?: number;
4261
+ }
4262
+ export interface PerformanceMeasureOptions {
4263
+ detail?: any;
4264
+ start?: number;
4265
+ duration?: number;
4266
+ end?: number;
4267
+ }
4268
+ /**
4269
+ * The **`PerformanceObserverEntryList`** interface is a list of PerformanceEntry that were explicitly observed via the PerformanceObserver.observe method.
4270
+ *
4271
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList)
4272
+ */
4273
+ export declare abstract class PerformanceObserverEntryList {
4274
+ /**
4275
+ * The **`getEntries()`** method of the PerformanceObserverEntryList interface returns a list of explicitly observed PerformanceEntry objects.
4276
+ *
4277
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries)
4278
+ */
4279
+ getEntries(): PerformanceEntry[];
4280
+ /**
4281
+ * The **`getEntriesByType()`** method of the PerformanceObserverEntryList returns a list of explicitly _observed_ PerformanceEntry objects for a given PerformanceEntry.entryType.
4282
+ *
4283
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType)
4284
+ */
4285
+ getEntriesByType(type: string): PerformanceEntry[];
4286
+ /**
4287
+ * The **`getEntriesByName()`** method of the PerformanceObserverEntryList interface returns a list of explicitly observed PerformanceEntry objects for a given PerformanceEntry.name and PerformanceEntry.entryType.
4288
+ *
4289
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName)
4290
+ */
4291
+ getEntriesByName(name: string, type?: string): PerformanceEntry[];
4292
+ }
4293
+ /**
4294
+ * The **`PerformanceEntry`** object encapsulates a single performance metric that is part of the browser's performance timeline.
4295
+ *
4296
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
4297
+ */
4298
+ export declare abstract class PerformanceEntry {
4299
+ /**
4300
+ * The read-only **`name`** property of the PerformanceEntry interface is a string representing the name for a performance entry.
4301
+ *
4302
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name)
4303
+ */
4304
+ get name(): string;
4305
+ /**
4306
+ * The read-only **`entryType`** property returns a string representing the type of performance metric that this entry represents.
4307
+ *
4308
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType)
4309
+ */
4310
+ get entryType(): string;
4311
+ /**
4312
+ * The read-only **`startTime`** property returns the first DOMHighResTimeStamp recorded for this PerformanceEntry.
4313
+ *
4314
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime)
4315
+ */
4316
+ get startTime(): number;
4317
+ /**
4318
+ * The read-only **`duration`** property returns a DOMHighResTimeStamp that is the duration of the PerformanceEntry.
4319
+ *
4320
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration)
4321
+ */
4322
+ get duration(): number;
4323
+ /**
4324
+ * The **`toJSON()`** method is a Serialization; it returns a JSON representation of the PerformanceEntry object.
4325
+ *
4326
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON)
4327
+ */
4328
+ toJSON(): object;
4329
+ }
4330
+ /**
4331
+ * The **`PerformanceResourceTiming`** interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources.
4332
+ *
4333
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
4334
+ */
4335
+ export declare abstract class PerformanceResourceTiming extends PerformanceEntry {
4336
+ /**
4337
+ * The **`connectEnd`** read-only property returns the DOMHighResTimeStamp immediately after the browser finishes establishing the connection to the server to retrieve the resource.
4338
+ *
4339
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd)
4340
+ */
4341
+ get connectEnd(): number;
4342
+ /**
4343
+ * The **`connectStart`** read-only property returns the DOMHighResTimeStamp immediately before the user agent starts establishing the connection to the server to retrieve the resource.
4344
+ *
4345
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart)
4346
+ */
4347
+ get connectStart(): number;
4348
+ /**
4349
+ * The **`decodedBodySize`** read-only property returns the size (in octets) received from the fetch (HTTP or cache) of the message body after removing any applied content encoding (like gzip or Brotli).
4350
+ *
4351
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize)
4352
+ */
4353
+ get decodedBodySize(): number;
4354
+ /**
4355
+ * The **`domainLookupEnd`** read-only property returns the DOMHighResTimeStamp immediately after the browser finishes the domain-name lookup for the resource.
4356
+ *
4357
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd)
4358
+ */
4359
+ get domainLookupEnd(): number;
4360
+ /**
4361
+ * The **`domainLookupStart`** read-only property returns the DOMHighResTimeStamp immediately before the browser starts the domain name lookup for the resource.
4362
+ *
4363
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart)
4364
+ */
4365
+ get domainLookupStart(): number;
4366
+ /**
4367
+ * The **`encodedBodySize`** read-only property represents the size (in octets) received from the fetch (HTTP or cache) of the payload body before removing any applied content encodings (like gzip or Brotli).
4368
+ *
4369
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize)
4370
+ */
4371
+ get encodedBodySize(): number;
4372
+ /**
4373
+ * The **`fetchStart`** read-only property represents a DOMHighResTimeStamp immediately before the browser starts to fetch the resource.
4374
+ *
4375
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart)
4376
+ */
4377
+ get fetchStart(): number;
4378
+ /**
4379
+ * The **`initiatorType`** read-only property is a string representing web platform feature that initiated the resource load.
4380
+ *
4381
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType)
4382
+ */
4383
+ get initiatorType(): string;
4384
+ /**
4385
+ * The **`nextHopProtocol`** read-only property is a string representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).
4386
+ *
4387
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol)
4388
+ */
4389
+ get nextHopProtocol(): string;
4390
+ /**
4391
+ * The **`redirectEnd`** read-only property returns a DOMHighResTimeStamp immediately after receiving the last byte of the response of the last redirect.
4392
+ *
4393
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd)
4394
+ */
4395
+ get redirectEnd(): number;
4396
+ /**
4397
+ * The **`redirectStart`** read-only property returns a DOMHighResTimeStamp representing the start time of the fetch which that initiates the redirect.
4398
+ *
4399
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart)
4400
+ */
4401
+ get redirectStart(): number;
4402
+ /**
4403
+ * The **`requestStart`** read-only property returns a DOMHighResTimeStamp of the time immediately before the browser starts requesting the resource from the server, cache, or local resource.
4404
+ *
4405
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart)
4406
+ */
4407
+ get requestStart(): number;
4408
+ /**
4409
+ * The **`responseEnd`** read-only property returns a DOMHighResTimeStamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.
4410
+ *
4411
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd)
4412
+ */
4413
+ get responseEnd(): number;
4414
+ /**
4415
+ * The **`responseStart`** read-only property returns a DOMHighResTimeStamp immediately after the browser receives the first byte of the response from the server, cache, or local resource.
4416
+ *
4417
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart)
4418
+ */
4419
+ get responseStart(): number;
4420
+ /**
4421
+ * The **`responseStatus`** read-only property represents the HTTP response status code returned when fetching the resource.
4422
+ *
4423
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus)
4424
+ */
4425
+ get responseStatus(): number;
4426
+ /**
4427
+ * The **`secureConnectionStart`** read-only property returns a DOMHighResTimeStamp immediately before the browser starts the handshake process to secure the current connection.
4428
+ *
4429
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart)
4430
+ */
4431
+ get secureConnectionStart(): number | undefined;
4432
+ /**
4433
+ * The **`transferSize`** read-only property represents the size (in octets) of the fetched resource.
4434
+ *
4435
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize)
4436
+ */
4437
+ get transferSize(): number;
4438
+ /**
4439
+ * The **`workerStart`** read-only property of the PerformanceResourceTiming interface returns a The `workerStart` property can have the following values: - A DOMHighResTimeStamp.
4440
+ *
4441
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart)
4442
+ */
4443
+ get workerStart(): number;
4444
+ }
4445
+ /**
4446
+ * The **`PerformanceObserver`** interface is used to observe performance measurement events and be notified of new PerformanceEntry as they are recorded in the browser's _performance timeline_.
4447
+ *
4448
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver)
4449
+ */
4450
+ export declare class PerformanceObserver {
4451
+ constructor(callback: any);
4452
+ /**
4453
+ * The **`disconnect()`** method of the PerformanceObserver interface is used to stop the performance observer from receiving any PerformanceEntry events.
4454
+ *
4455
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect)
4456
+ */
4457
+ disconnect(): void;
4458
+ /**
4459
+ * The **`observe()`** method of the **PerformanceObserver** interface is used to specify the set of performance entry types to observe.
4460
+ *
4461
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe)
4462
+ */
4463
+ observe(options?: PerformanceObserverObserveOptions): void;
4464
+ /**
4465
+ * The **`takeRecords()`** method of the PerformanceObserver interface returns the current list of PerformanceEntry objects stored in the performance observer, emptying it out.
4466
+ *
4467
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords)
4468
+ */
4469
+ takeRecords(): PerformanceEntry[];
4470
+ readonly supportedEntryTypes: string[];
4471
+ }
4472
+ export interface PerformanceObserverObserveOptions {
4473
+ buffered?: boolean;
4474
+ durationThreshold?: number;
4475
+ entryTypes?: string[];
4476
+ type?: string;
4477
+ }
4478
+ export interface EventCounts {
4479
+ get size(): number;
4480
+ get(eventType: string): number | undefined;
4481
+ has(eventType: string): boolean;
4482
+ entries(): IterableIterator<string[]>;
4483
+ keys(): IterableIterator<string>;
4484
+ values(): IterableIterator<number>;
4485
+ forEach(
4486
+ param1: (param0: number, param1: string, param2: EventCounts) => void,
4487
+ param2?: any,
4488
+ ): void;
4489
+ [Symbol.iterator](): IterableIterator<string[]>;
4097
4490
  }
4098
4491
  export interface Tracing {
4099
4492
  enterSpan<T, A extends unknown[]>(
@@ -4106,11 +4499,15 @@ export interface Tracing {
4106
4499
  callback: (span: Span, ...args: A) => T,
4107
4500
  ...args: A
4108
4501
  ): T;
4502
+ startSpan(name: string): Span;
4109
4503
  Span: typeof Span;
4110
4504
  }
4111
4505
  export declare abstract class Span {
4112
4506
  get isTraced(): boolean;
4113
- setAttribute(key: string, value?: boolean | number | string): void;
4507
+ setAttribute(key: string, value: boolean | number | string): this;
4508
+ setAttributes(
4509
+ attributes: Record<string, boolean | number | string | undefined>,
4510
+ ): this;
4114
4511
  end(): void;
4115
4512
  }
4116
4513
  /**
@@ -4787,6 +5184,13 @@ export type AiSearchListItemsParams = {
4787
5184
  source?: string;
4788
5185
  /** JSON-encoded Vectorize filter for metadata filtering. */
4789
5186
  metadata_filter?: string;
5187
+ /** Filter items by their unique ID. Returns at most one item. */
5188
+ item_id?: string;
5189
+ /**
5190
+ * Filter items by their exact key (object key / filename). Keys are unique
5191
+ * per source, so combine with `source` to disambiguate across data sources.
5192
+ */
5193
+ key?: string;
4790
5194
  };
4791
5195
  export type AiSearchListItemsResponse = {
4792
5196
  result: AiSearchItemInfo[];
@@ -13951,6 +14355,15 @@ export interface Hyperdrive {
13951
14355
  * for your database.
13952
14356
  */
13953
14357
  readonly host: string;
14358
+ /*
14359
+ * A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
14360
+ * host field, is only valid within the context of the currently running
14361
+ * Worker and, when passed into the `connect()` function from the
14362
+ * "cloudflare:sockets" module, will connect to the Hyperdrive instance for
14363
+ * your database. This is provided for database drivers that require the host
14364
+ * to be an IP literal rather than a hostname.
14365
+ */
14366
+ readonly ip: string;
13954
14367
  /*
13955
14368
  * The port that must be paired the the host field when connecting.
13956
14369
  */
@@ -14740,6 +15153,32 @@ export declare namespace CloudflareWorkersModule {
14740
15153
  timeout?: WorkflowTimeoutDuration | number;
14741
15154
  sensitive?: WorkflowStepSensitivity;
14742
15155
  };
15156
+ // Internal discriminators used only for `WorkflowStep.do` overload
15157
+ // resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
15158
+ // single kind so the callback context can be narrowed based on the shape of
15159
+ // the config argument (rather than on an inferred type parameter, which is
15160
+ // lost when the caller supplies an explicit return-type argument). Not
15161
+ // exported: they must not widen the public type surface.
15162
+ type WorkflowStepConfigWithStaticDelay = Omit<
15163
+ WorkflowStepConfig,
15164
+ "retries"
15165
+ > & {
15166
+ retries?: {
15167
+ limit: number;
15168
+ delay: WorkflowDelayDuration | number;
15169
+ backoff?: WorkflowBackoff;
15170
+ };
15171
+ };
15172
+ type WorkflowStepConfigWithDelayFunction = Omit<
15173
+ WorkflowStepConfig,
15174
+ "retries"
15175
+ > & {
15176
+ retries: {
15177
+ limit: number;
15178
+ delay: WorkflowDelayFunction;
15179
+ backoff?: WorkflowBackoff;
15180
+ };
15181
+ };
14743
15182
  export type WorkflowStepRollbackConfig = Pick<
14744
15183
  WorkflowStepConfig,
14745
15184
  "retries" | "timeout"
@@ -14782,18 +15221,30 @@ export declare namespace CloudflareWorkersModule {
14782
15221
  sensitive?: WorkflowStepSensitivity;
14783
15222
  };
14784
15223
  };
14785
- export type WorkflowRollbackContext<T = unknown> = {
14786
- ctx: WorkflowStepContext;
15224
+ // The rollback handler receives the step context, so it mirrors the same
15225
+ // delay discriminant as the step callback: when the step was configured with
15226
+ // a dynamic delay function the resolved `config.retries.delay` is omitted,
15227
+ // otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
15228
+ // overload that matched the step config.
15229
+ export type WorkflowRollbackContext<
15230
+ T = unknown,
15231
+ Delay = WorkflowDelayDuration | number,
15232
+ > = {
15233
+ ctx: WorkflowStepContext<Delay>;
14787
15234
  error: Error;
14788
15235
  output: T | undefined;
14789
15236
  /** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
14790
15237
  stepName: string;
14791
15238
  };
14792
- export type WorkflowRollbackHandler<T = unknown> = (
14793
- ctx: WorkflowRollbackContext<T>,
14794
- ) => Promise<void>;
14795
- export type WorkflowStepRollbackOptions<T = unknown> = {
14796
- rollback: WorkflowRollbackHandler<T>;
15239
+ export type WorkflowRollbackHandler<
15240
+ T = unknown,
15241
+ Delay = WorkflowDelayDuration | number,
15242
+ > = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
15243
+ export type WorkflowStepRollbackOptions<
15244
+ T = unknown,
15245
+ Delay = WorkflowDelayDuration | number,
15246
+ > = {
15247
+ rollback: WorkflowRollbackHandler<T, Delay>;
14797
15248
  rollbackConfig?: WorkflowStepRollbackConfig;
14798
15249
  };
14799
15250
  export abstract class WorkflowStep {
@@ -14802,18 +15253,34 @@ export declare namespace CloudflareWorkersModule {
14802
15253
  callback: (ctx: WorkflowStepContext) => Promise<T>,
14803
15254
  rollbackOptions?: WorkflowStepRollbackOptions<T>,
14804
15255
  ): Promise<T>;
14805
- do<T extends Rpc.Serializable<T>, const C extends WorkflowStepConfig>(
15256
+ // The config overloads discriminate on the shape of `config.retries.delay`
15257
+ // so the callback context reflects whether the resolved delay is present
15258
+ // (static delay) or omitted (dynamic delay function). Each has a single
15259
+ // type parameter, so an explicit return-type argument (`do<T>(...)`) still
15260
+ // resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
15261
+ // fallback MUST remain last, otherwise it shadows the discriminating
15262
+ // overloads and narrowing is silently lost.
15263
+ do<T extends Rpc.Serializable<T>>(
15264
+ name: string,
15265
+ config: WorkflowStepConfigWithDelayFunction,
15266
+ callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>,
15267
+ rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>,
15268
+ ): Promise<T>;
15269
+ do<T extends Rpc.Serializable<T>>(
14806
15270
  name: string,
14807
- config: C,
15271
+ config: WorkflowStepConfigWithStaticDelay,
14808
15272
  callback: (
14809
- ctx: WorkflowStepContext<
14810
- C["retries"] extends {
14811
- delay: infer D;
14812
- }
14813
- ? D
14814
- : WorkflowDelayDuration | number
14815
- >,
15273
+ ctx: WorkflowStepContext<WorkflowDelayDuration | number>,
14816
15274
  ) => Promise<T>,
15275
+ rollbackOptions?: WorkflowStepRollbackOptions<
15276
+ T,
15277
+ WorkflowDelayDuration | number
15278
+ >,
15279
+ ): Promise<T>;
15280
+ do<T extends Rpc.Serializable<T>>(
15281
+ name: string,
15282
+ config: WorkflowStepConfig,
15283
+ callback: (ctx: WorkflowStepContext) => Promise<T>,
14817
15284
  rollbackOptions?: WorkflowStepRollbackOptions<T>,
14818
15285
  ): Promise<T>;
14819
15286
  sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
@@ -15622,12 +16089,13 @@ export type MarkdownDocument = {
15622
16089
  name: string;
15623
16090
  blob: Blob;
15624
16091
  };
16092
+ export type OutputFormat = "markdown" | "text";
15625
16093
  export type ConversionResponse =
15626
16094
  | {
15627
16095
  id: string;
15628
16096
  name: string;
15629
16097
  mimeType: string;
15630
- format: "markdown";
16098
+ format: OutputFormat;
15631
16099
  tokens: number;
15632
16100
  data: string;
15633
16101
  }
@@ -15645,7 +16113,11 @@ export type EmbeddedImageConversionOptions = ImageConversionOptions & {
15645
16113
  convert?: boolean;
15646
16114
  maxConvertedImages?: number;
15647
16115
  };
16116
+ export type ConversionOutputOptions = {
16117
+ format?: OutputFormat;
16118
+ };
15648
16119
  export type ConversionOptions = {
16120
+ output?: ConversionOutputOptions;
15649
16121
  html?: {
15650
16122
  images?: EmbeddedImageConversionOptions & {
15651
16123
  convertOGImage?: boolean;
@@ -15826,11 +16298,25 @@ export declare namespace TailStream {
15826
16298
  readonly message: string;
15827
16299
  readonly stack?: string;
15828
16300
  }
15829
- interface Log {
16301
+ interface TailStreamErrorInfo {
16302
+ readonly name: string;
16303
+ readonly message: string;
16304
+ readonly stack?: string;
16305
+ }
16306
+ type Log = {
15830
16307
  readonly type: "log";
15831
16308
  readonly level: "debug" | "error" | "info" | "log" | "warn";
15832
- readonly message: object;
15833
- }
16309
+ readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
16310
+ } & (
16311
+ | {
16312
+ readonly message: object;
16313
+ readonly truncated?: false;
16314
+ }
16315
+ | {
16316
+ readonly message: string;
16317
+ readonly truncated: true;
16318
+ }
16319
+ );
15834
16320
  interface DroppedEventsDiagnostic {
15835
16321
  readonly diagnosticsType: "droppedEvents";
15836
16322
  readonly count: number;
@@ -16357,7 +16843,25 @@ export declare abstract class Workflow<PARAMS = unknown> {
16357
16843
  public createBatch(
16358
16844
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
16359
16845
  ): Promise<WorkflowInstance[]>;
16846
+ /**
16847
+ * Delete a batch of Workflow instances and their stored state.
16848
+ * `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
16849
+ * The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
16850
+ * @param instanceIds IDs of the Workflow instances to delete
16851
+ * @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
16852
+ */
16853
+ public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
16360
16854
  }
16855
+ export type WorkflowBatchDeleteResult = {
16856
+ deleted: {
16857
+ id: string;
16858
+ }[];
16859
+ errors: {
16860
+ id: string;
16861
+ code: number;
16862
+ message: string;
16863
+ }[];
16864
+ };
16361
16865
  export type WorkflowDurationLabel =
16362
16866
  | "second"
16363
16867
  | "minute"
@@ -16458,6 +16962,10 @@ export declare abstract class WorkflowInstance {
16458
16962
  * @param options Options for the restart, including an optional step to restart from.
16459
16963
  */
16460
16964
  public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
16965
+ /**
16966
+ * Delete the instance and its stored state.
16967
+ */
16968
+ public delete(): Promise<void>;
16461
16969
  /**
16462
16970
  * Returns the current status of the instance.
16463
16971
  */