@cloudflare/workers-types 4.20250909.0 → 4.20250911.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.
@@ -294,6 +294,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
294
294
  FixedLengthStream: typeof FixedLengthStream;
295
295
  IdentityTransformStream: typeof IdentityTransformStream;
296
296
  HTMLRewriter: typeof HTMLRewriter;
297
+ Performance: typeof Performance;
297
298
  }
298
299
  export declare function addEventListener<
299
300
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -471,18 +472,6 @@ export declare abstract class Navigator {
471
472
  readonly userAgent: string;
472
473
  readonly hardwareConcurrency: number;
473
474
  }
474
- /**
475
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
476
- * as well as timing of subrequests and other operations.
477
- *
478
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
479
- */
480
- export interface Performance {
481
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
482
- readonly timeOrigin: number;
483
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
484
- now(): number;
485
- }
486
475
  export interface AlarmInvocationInfo {
487
476
  readonly isRetry: boolean;
488
477
  readonly retryCount: number;
@@ -3116,6 +3105,99 @@ export interface SyncKvListOptions {
3116
3105
  reverse?: boolean;
3117
3106
  limit?: number;
3118
3107
  }
3108
+ /**
3109
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3110
+ * as well as timing of subrequests and other operations.
3111
+ *
3112
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3113
+ */
3114
+ export declare abstract class Performance extends EventTarget {
3115
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3116
+ get timeOrigin(): number;
3117
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3118
+ now(): number;
3119
+ get eventCounts(): EventCounts;
3120
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3121
+ clearMarks(name?: string): void;
3122
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3123
+ clearMeasures(name?: string): void;
3124
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3125
+ clearResourceTimings(): void;
3126
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3127
+ getEntries(): PerformanceEntry[];
3128
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3129
+ getEntriesByName(name: string, type: string): PerformanceEntry[];
3130
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3131
+ getEntriesByType(type: string): PerformanceEntry[];
3132
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3133
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3134
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3135
+ measure(
3136
+ measureName: string,
3137
+ measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3138
+ maybeEndMark?: string,
3139
+ ): PerformanceMeasure;
3140
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3141
+ setResourceTimingBufferSize(size: number): void;
3142
+ }
3143
+ /**
3144
+ * PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline.
3145
+ *
3146
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3147
+ */
3148
+ export interface PerformanceMark extends PerformanceEntry {
3149
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3150
+ get detail(): any;
3151
+ }
3152
+ /**
3153
+ * PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline.
3154
+ *
3155
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3156
+ */
3157
+ export interface PerformanceMeasure extends PerformanceEntry {
3158
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3159
+ get detail(): any;
3160
+ }
3161
+ export interface PerformanceMarkOptions {
3162
+ detail?: any;
3163
+ startTime?: number;
3164
+ }
3165
+ export interface PerformanceMeasureOptions {
3166
+ detail?: any;
3167
+ start?: number;
3168
+ duration?: number;
3169
+ end?: number;
3170
+ }
3171
+ /**
3172
+ * Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image).
3173
+ *
3174
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3175
+ */
3176
+ export declare abstract class PerformanceEntry {
3177
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3178
+ get name(): string;
3179
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3180
+ get entryType(): string;
3181
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3182
+ get startTime(): number;
3183
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3184
+ get duration(): number;
3185
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3186
+ toJSON(): any;
3187
+ }
3188
+ export interface EventCounts {
3189
+ get size(): number;
3190
+ get(eventType: string): number | undefined;
3191
+ has(eventType: string): boolean;
3192
+ entries(): IterableIterator<string[]>;
3193
+ keys(): IterableIterator<string>;
3194
+ values(): IterableIterator<number>;
3195
+ forEach(
3196
+ param1: (param0: number, param1: string, param2: EventCounts) => void,
3197
+ param2?: any,
3198
+ ): void;
3199
+ [Symbol.iterator](): IterableIterator<string[]>;
3200
+ }
3119
3201
  export type AiImageClassificationInput = {
3120
3202
  image: number[];
3121
3203
  };
@@ -301,6 +301,13 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
301
301
  FixedLengthStream: typeof FixedLengthStream;
302
302
  IdentityTransformStream: typeof IdentityTransformStream;
303
303
  HTMLRewriter: typeof HTMLRewriter;
304
+ Performance: typeof Performance;
305
+ PerformanceEntry: typeof PerformanceEntry;
306
+ PerformanceMark: typeof PerformanceMark;
307
+ PerformanceMeasure: typeof PerformanceMeasure;
308
+ PerformanceResourceTiming: typeof PerformanceResourceTiming;
309
+ PerformanceObserver: typeof PerformanceObserver;
310
+ PerformanceObserverEntryList: typeof PerformanceObserverEntryList;
304
311
  }
305
312
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
306
313
  type: Type,
@@ -478,18 +485,6 @@ declare abstract class Navigator {
478
485
  readonly languages: string[];
479
486
  readonly storage: StorageManager;
480
487
  }
481
- /**
482
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
483
- * as well as timing of subrequests and other operations.
484
- *
485
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
486
- */
487
- interface Performance {
488
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
489
- readonly timeOrigin: number;
490
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
491
- now(): number;
492
- }
493
488
  interface AlarmInvocationInfo {
494
489
  readonly isRetry: boolean;
495
490
  readonly retryCount: number;
@@ -3363,6 +3358,169 @@ interface SyncKvListOptions {
3363
3358
  reverse?: boolean;
3364
3359
  limit?: number;
3365
3360
  }
3361
+ /**
3362
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3363
+ * as well as timing of subrequests and other operations.
3364
+ *
3365
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3366
+ */
3367
+ declare abstract class Performance extends EventTarget {
3368
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3369
+ get timeOrigin(): number;
3370
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3371
+ now(): number;
3372
+ get eventCounts(): EventCounts;
3373
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3374
+ clearMarks(name?: string): void;
3375
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3376
+ clearMeasures(name?: string): void;
3377
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3378
+ clearResourceTimings(): void;
3379
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3380
+ getEntries(): PerformanceEntry[];
3381
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3382
+ getEntriesByName(name: string, type: string): PerformanceEntry[];
3383
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3384
+ getEntriesByType(type: string): PerformanceEntry[];
3385
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3386
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3387
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3388
+ measure(
3389
+ measureName: string,
3390
+ measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3391
+ maybeEndMark?: string,
3392
+ ): PerformanceMeasure;
3393
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3394
+ setResourceTimingBufferSize(size: number): void;
3395
+ }
3396
+ /**
3397
+ * PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline.
3398
+ *
3399
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3400
+ */
3401
+ declare abstract class PerformanceMark extends PerformanceEntry {
3402
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3403
+ get detail(): any;
3404
+ }
3405
+ /**
3406
+ * PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline.
3407
+ *
3408
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3409
+ */
3410
+ declare abstract class PerformanceMeasure extends PerformanceEntry {
3411
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3412
+ get detail(): any;
3413
+ }
3414
+ interface PerformanceMarkOptions {
3415
+ detail?: any;
3416
+ startTime?: number;
3417
+ }
3418
+ interface PerformanceMeasureOptions {
3419
+ detail?: any;
3420
+ start?: number;
3421
+ duration?: number;
3422
+ end?: number;
3423
+ }
3424
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList) */
3425
+ declare abstract class PerformanceObserverEntryList {
3426
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries) */
3427
+ getEntries(): PerformanceEntry[];
3428
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType) */
3429
+ getEntriesByType(type: string): PerformanceEntry[];
3430
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName) */
3431
+ getEntriesByName(name: string, type?: string): PerformanceEntry[];
3432
+ }
3433
+ /**
3434
+ * Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image).
3435
+ *
3436
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3437
+ */
3438
+ declare abstract class PerformanceEntry {
3439
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3440
+ get name(): string;
3441
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3442
+ get entryType(): string;
3443
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3444
+ get startTime(): number;
3445
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3446
+ get duration(): number;
3447
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3448
+ toJSON(): any;
3449
+ }
3450
+ /**
3451
+ * Enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script.
3452
+ *
3453
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
3454
+ */
3455
+ declare abstract class PerformanceResourceTiming extends PerformanceEntry {
3456
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd) */
3457
+ get connectEnd(): number;
3458
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart) */
3459
+ get connectStart(): number;
3460
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize) */
3461
+ get decodedBodySize(): number;
3462
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd) */
3463
+ get domainLookupEnd(): number;
3464
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart) */
3465
+ get domainLookupStart(): number;
3466
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize) */
3467
+ get encodedBodySize(): number;
3468
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart) */
3469
+ get fetchStart(): number;
3470
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType) */
3471
+ get initiatorType(): string;
3472
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol) */
3473
+ get nextHopProtocol(): string;
3474
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd) */
3475
+ get redirectEnd(): number;
3476
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart) */
3477
+ get redirectStart(): number;
3478
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart) */
3479
+ get requestStart(): number;
3480
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd) */
3481
+ get responseEnd(): number;
3482
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart) */
3483
+ get responseStart(): number;
3484
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus) */
3485
+ get responseStatus(): number;
3486
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart) */
3487
+ get secureConnectionStart(): number | undefined;
3488
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize) */
3489
+ get transferSize(): number;
3490
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart) */
3491
+ get workerStart(): number;
3492
+ }
3493
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) */
3494
+ declare class PerformanceObserver {
3495
+ constructor(callback: any);
3496
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect) */
3497
+ disconnect(): void;
3498
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe) */
3499
+ observe(options?: PerformanceObserverObserveOptions): void;
3500
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords) */
3501
+ takeRecords(): PerformanceEntry[];
3502
+ readonly supportedEntryTypes: string[];
3503
+ }
3504
+ interface PerformanceObserverObserveOptions {
3505
+ buffered: boolean;
3506
+ durationThreshold: number;
3507
+ entryTypes: string[];
3508
+ type?: string;
3509
+ name?: string;
3510
+ }
3511
+ interface EventCounts {
3512
+ get size(): number;
3513
+ get(eventType: string): number | undefined;
3514
+ has(eventType: string): boolean;
3515
+ entries(): IterableIterator<string[]>;
3516
+ keys(): IterableIterator<string>;
3517
+ values(): IterableIterator<number>;
3518
+ forEach(
3519
+ param1: (param0: number, param1: string, param2: EventCounts) => void,
3520
+ param2?: any,
3521
+ ): void;
3522
+ [Symbol.iterator](): IterableIterator<string[]>;
3523
+ }
3366
3524
  type AiImageClassificationInput = {
3367
3525
  image: number[];
3368
3526
  };
@@ -301,6 +301,13 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
301
301
  FixedLengthStream: typeof FixedLengthStream;
302
302
  IdentityTransformStream: typeof IdentityTransformStream;
303
303
  HTMLRewriter: typeof HTMLRewriter;
304
+ Performance: typeof Performance;
305
+ PerformanceEntry: typeof PerformanceEntry;
306
+ PerformanceMark: typeof PerformanceMark;
307
+ PerformanceMeasure: typeof PerformanceMeasure;
308
+ PerformanceResourceTiming: typeof PerformanceResourceTiming;
309
+ PerformanceObserver: typeof PerformanceObserver;
310
+ PerformanceObserverEntryList: typeof PerformanceObserverEntryList;
304
311
  }
305
312
  export declare function addEventListener<
306
313
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -483,18 +490,6 @@ export declare abstract class Navigator {
483
490
  readonly languages: string[];
484
491
  readonly storage: StorageManager;
485
492
  }
486
- /**
487
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
488
- * as well as timing of subrequests and other operations.
489
- *
490
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
491
- */
492
- export interface Performance {
493
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
494
- readonly timeOrigin: number;
495
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
496
- now(): number;
497
- }
498
493
  export interface AlarmInvocationInfo {
499
494
  readonly isRetry: boolean;
500
495
  readonly retryCount: number;
@@ -3376,6 +3371,169 @@ export interface SyncKvListOptions {
3376
3371
  reverse?: boolean;
3377
3372
  limit?: number;
3378
3373
  }
3374
+ /**
3375
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3376
+ * as well as timing of subrequests and other operations.
3377
+ *
3378
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3379
+ */
3380
+ export declare abstract class Performance extends EventTarget {
3381
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3382
+ get timeOrigin(): number;
3383
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3384
+ now(): number;
3385
+ get eventCounts(): EventCounts;
3386
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3387
+ clearMarks(name?: string): void;
3388
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3389
+ clearMeasures(name?: string): void;
3390
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3391
+ clearResourceTimings(): void;
3392
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3393
+ getEntries(): PerformanceEntry[];
3394
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3395
+ getEntriesByName(name: string, type: string): PerformanceEntry[];
3396
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3397
+ getEntriesByType(type: string): PerformanceEntry[];
3398
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3399
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3400
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3401
+ measure(
3402
+ measureName: string,
3403
+ measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3404
+ maybeEndMark?: string,
3405
+ ): PerformanceMeasure;
3406
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3407
+ setResourceTimingBufferSize(size: number): void;
3408
+ }
3409
+ /**
3410
+ * PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline.
3411
+ *
3412
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3413
+ */
3414
+ export declare abstract class PerformanceMark extends PerformanceEntry {
3415
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3416
+ get detail(): any;
3417
+ }
3418
+ /**
3419
+ * PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline.
3420
+ *
3421
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3422
+ */
3423
+ export declare abstract class PerformanceMeasure extends PerformanceEntry {
3424
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3425
+ get detail(): any;
3426
+ }
3427
+ export interface PerformanceMarkOptions {
3428
+ detail?: any;
3429
+ startTime?: number;
3430
+ }
3431
+ export interface PerformanceMeasureOptions {
3432
+ detail?: any;
3433
+ start?: number;
3434
+ duration?: number;
3435
+ end?: number;
3436
+ }
3437
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList) */
3438
+ export declare abstract class PerformanceObserverEntryList {
3439
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries) */
3440
+ getEntries(): PerformanceEntry[];
3441
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType) */
3442
+ getEntriesByType(type: string): PerformanceEntry[];
3443
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName) */
3444
+ getEntriesByName(name: string, type?: string): PerformanceEntry[];
3445
+ }
3446
+ /**
3447
+ * Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image).
3448
+ *
3449
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3450
+ */
3451
+ export declare abstract class PerformanceEntry {
3452
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3453
+ get name(): string;
3454
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3455
+ get entryType(): string;
3456
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3457
+ get startTime(): number;
3458
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3459
+ get duration(): number;
3460
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3461
+ toJSON(): any;
3462
+ }
3463
+ /**
3464
+ * Enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script.
3465
+ *
3466
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
3467
+ */
3468
+ export declare abstract class PerformanceResourceTiming extends PerformanceEntry {
3469
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd) */
3470
+ get connectEnd(): number;
3471
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart) */
3472
+ get connectStart(): number;
3473
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize) */
3474
+ get decodedBodySize(): number;
3475
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd) */
3476
+ get domainLookupEnd(): number;
3477
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart) */
3478
+ get domainLookupStart(): number;
3479
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize) */
3480
+ get encodedBodySize(): number;
3481
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart) */
3482
+ get fetchStart(): number;
3483
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType) */
3484
+ get initiatorType(): string;
3485
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol) */
3486
+ get nextHopProtocol(): string;
3487
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd) */
3488
+ get redirectEnd(): number;
3489
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart) */
3490
+ get redirectStart(): number;
3491
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart) */
3492
+ get requestStart(): number;
3493
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd) */
3494
+ get responseEnd(): number;
3495
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart) */
3496
+ get responseStart(): number;
3497
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus) */
3498
+ get responseStatus(): number;
3499
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart) */
3500
+ get secureConnectionStart(): number | undefined;
3501
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize) */
3502
+ get transferSize(): number;
3503
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart) */
3504
+ get workerStart(): number;
3505
+ }
3506
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) */
3507
+ export declare class PerformanceObserver {
3508
+ constructor(callback: any);
3509
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect) */
3510
+ disconnect(): void;
3511
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe) */
3512
+ observe(options?: PerformanceObserverObserveOptions): void;
3513
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords) */
3514
+ takeRecords(): PerformanceEntry[];
3515
+ readonly supportedEntryTypes: string[];
3516
+ }
3517
+ export interface PerformanceObserverObserveOptions {
3518
+ buffered: boolean;
3519
+ durationThreshold: number;
3520
+ entryTypes: string[];
3521
+ type?: string;
3522
+ name?: string;
3523
+ }
3524
+ export interface EventCounts {
3525
+ get size(): number;
3526
+ get(eventType: string): number | undefined;
3527
+ has(eventType: string): boolean;
3528
+ entries(): IterableIterator<string[]>;
3529
+ keys(): IterableIterator<string>;
3530
+ values(): IterableIterator<number>;
3531
+ forEach(
3532
+ param1: (param0: number, param1: string, param2: EventCounts) => void,
3533
+ param2?: any,
3534
+ ): void;
3535
+ [Symbol.iterator](): IterableIterator<string[]>;
3536
+ }
3379
3537
  export type AiImageClassificationInput = {
3380
3538
  image: number[];
3381
3539
  };
package/index.d.ts CHANGED
@@ -287,6 +287,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
287
287
  FixedLengthStream: typeof FixedLengthStream;
288
288
  IdentityTransformStream: typeof IdentityTransformStream;
289
289
  HTMLRewriter: typeof HTMLRewriter;
290
+ Performance: typeof Performance;
290
291
  }
291
292
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
292
293
  type: Type,
@@ -443,18 +444,6 @@ declare abstract class PromiseRejectionEvent extends Event {
443
444
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
444
445
  readonly reason: any;
445
446
  }
446
- /**
447
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
448
- * as well as timing of subrequests and other operations.
449
- *
450
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
451
- */
452
- interface Performance {
453
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
454
- readonly timeOrigin: number;
455
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
456
- now(): number;
457
- }
458
447
  interface AlarmInvocationInfo {
459
448
  readonly isRetry: boolean;
460
449
  readonly retryCount: number;
@@ -3049,6 +3038,99 @@ interface SyncKvListOptions {
3049
3038
  reverse?: boolean;
3050
3039
  limit?: number;
3051
3040
  }
3041
+ /**
3042
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3043
+ * as well as timing of subrequests and other operations.
3044
+ *
3045
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3046
+ */
3047
+ declare abstract class Performance extends EventTarget {
3048
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3049
+ get timeOrigin(): number;
3050
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3051
+ now(): number;
3052
+ get eventCounts(): EventCounts;
3053
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3054
+ clearMarks(name?: string): void;
3055
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3056
+ clearMeasures(name?: string): void;
3057
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3058
+ clearResourceTimings(): void;
3059
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3060
+ getEntries(): PerformanceEntry[];
3061
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3062
+ getEntriesByName(name: string, type: string): PerformanceEntry[];
3063
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3064
+ getEntriesByType(type: string): PerformanceEntry[];
3065
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3066
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3067
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3068
+ measure(
3069
+ measureName: string,
3070
+ measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3071
+ maybeEndMark?: string,
3072
+ ): PerformanceMeasure;
3073
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3074
+ setResourceTimingBufferSize(size: number): void;
3075
+ }
3076
+ /**
3077
+ * PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline.
3078
+ *
3079
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3080
+ */
3081
+ interface PerformanceMark extends PerformanceEntry {
3082
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3083
+ get detail(): any;
3084
+ }
3085
+ /**
3086
+ * PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline.
3087
+ *
3088
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3089
+ */
3090
+ interface PerformanceMeasure extends PerformanceEntry {
3091
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3092
+ get detail(): any;
3093
+ }
3094
+ interface PerformanceMarkOptions {
3095
+ detail?: any;
3096
+ startTime?: number;
3097
+ }
3098
+ interface PerformanceMeasureOptions {
3099
+ detail?: any;
3100
+ start?: number;
3101
+ duration?: number;
3102
+ end?: number;
3103
+ }
3104
+ /**
3105
+ * Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image).
3106
+ *
3107
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3108
+ */
3109
+ declare abstract class PerformanceEntry {
3110
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3111
+ get name(): string;
3112
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3113
+ get entryType(): string;
3114
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3115
+ get startTime(): number;
3116
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3117
+ get duration(): number;
3118
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3119
+ toJSON(): any;
3120
+ }
3121
+ interface EventCounts {
3122
+ get size(): number;
3123
+ get(eventType: string): number | undefined;
3124
+ has(eventType: string): boolean;
3125
+ entries(): IterableIterator<string[]>;
3126
+ keys(): IterableIterator<string>;
3127
+ values(): IterableIterator<number>;
3128
+ forEach(
3129
+ param1: (param0: number, param1: string, param2: EventCounts) => void,
3130
+ param2?: any,
3131
+ ): void;
3132
+ [Symbol.iterator](): IterableIterator<string[]>;
3133
+ }
3052
3134
  type AiImageClassificationInput = {
3053
3135
  image: number[];
3054
3136
  };