@cloudflare/workers-types 5.20260804.1 → 5.20260808.1

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