@cloudflare/workers-types 4.20250913.0 → 4.20250917.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,7 +294,6 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
294
294
  FixedLengthStream: typeof FixedLengthStream;
295
295
  IdentityTransformStream: typeof IdentityTransformStream;
296
296
  HTMLRewriter: typeof HTMLRewriter;
297
- Performance: typeof Performance;
298
297
  }
299
298
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
300
299
  type: Type,
@@ -467,6 +466,18 @@ declare abstract class Navigator {
467
466
  readonly userAgent: string;
468
467
  readonly hardwareConcurrency: number;
469
468
  }
469
+ /**
470
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
471
+ * as well as timing of subrequests and other operations.
472
+ *
473
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
474
+ */
475
+ interface Performance {
476
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
477
+ readonly timeOrigin: number;
478
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
479
+ now(): number;
480
+ }
470
481
  interface AlarmInvocationInfo {
471
482
  readonly isRetry: boolean;
472
483
  readonly retryCount: number;
@@ -3155,18 +3166,6 @@ interface WorkerLoaderWorkerCode {
3155
3166
  tails?: Fetcher[];
3156
3167
  streamingTails?: Fetcher[];
3157
3168
  }
3158
- /**
3159
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3160
- * as well as timing of subrequests and other operations.
3161
- *
3162
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3163
- */
3164
- declare abstract class Performance {
3165
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3166
- get timeOrigin(): number;
3167
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3168
- now(): number;
3169
- }
3170
3169
  type AiImageClassificationInput = {
3171
3170
  image: number[];
3172
3171
  };
@@ -294,7 +294,6 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
294
294
  FixedLengthStream: typeof FixedLengthStream;
295
295
  IdentityTransformStream: typeof IdentityTransformStream;
296
296
  HTMLRewriter: typeof HTMLRewriter;
297
- Performance: typeof Performance;
298
297
  }
299
298
  export declare function addEventListener<
300
299
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -472,6 +471,18 @@ export declare abstract class Navigator {
472
471
  readonly userAgent: string;
473
472
  readonly hardwareConcurrency: number;
474
473
  }
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
+ }
475
486
  export interface AlarmInvocationInfo {
476
487
  readonly isRetry: boolean;
477
488
  readonly retryCount: number;
@@ -3166,18 +3177,6 @@ export interface WorkerLoaderWorkerCode {
3166
3177
  tails?: Fetcher[];
3167
3178
  streamingTails?: Fetcher[];
3168
3179
  }
3169
- /**
3170
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3171
- * as well as timing of subrequests and other operations.
3172
- *
3173
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3174
- */
3175
- export declare abstract class Performance {
3176
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3177
- get timeOrigin(): number;
3178
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3179
- now(): number;
3180
- }
3181
3180
  export type AiImageClassificationInput = {
3182
3181
  image: number[];
3183
3182
  };
@@ -301,13 +301,6 @@ 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;
311
304
  }
312
305
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
313
306
  type: Type,
@@ -485,6 +478,18 @@ declare abstract class Navigator {
485
478
  readonly languages: string[];
486
479
  readonly storage: StorageManager;
487
480
  }
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
+ }
488
493
  interface AlarmInvocationInfo {
489
494
  readonly isRetry: boolean;
490
495
  readonly retryCount: number;
@@ -3421,174 +3426,6 @@ interface WorkerLoaderWorkerCode {
3421
3426
  tails?: Fetcher[];
3422
3427
  streamingTails?: Fetcher[];
3423
3428
  }
3424
- /**
3425
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3426
- * as well as timing of subrequests and other operations.
3427
- *
3428
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3429
- */
3430
- declare abstract class Performance extends EventTarget {
3431
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3432
- get timeOrigin(): number;
3433
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3434
- now(): number;
3435
- get eventCounts(): EventCounts;
3436
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3437
- clearMarks(name?: string): void;
3438
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3439
- clearMeasures(name?: string): void;
3440
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3441
- clearResourceTimings(): void;
3442
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3443
- getEntries(): PerformanceEntry[];
3444
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3445
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
3446
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3447
- getEntriesByType(type: string): PerformanceEntry[];
3448
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3449
- mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3450
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3451
- measure(
3452
- measureName: string,
3453
- measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3454
- maybeEndMark?: string,
3455
- ): PerformanceMeasure;
3456
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3457
- setResourceTimingBufferSize(size: number): void;
3458
- eventLoopUtilization(): void;
3459
- markResourceTiming(): void;
3460
- timerify(fn: () => void): () => void;
3461
- }
3462
- /**
3463
- * 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.
3464
- *
3465
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3466
- */
3467
- declare class PerformanceMark extends PerformanceEntry {
3468
- constructor(name: string, maybeOptions?: PerformanceMarkOptions);
3469
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3470
- get detail(): any | undefined;
3471
- toJSON(): any;
3472
- }
3473
- /**
3474
- * 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.
3475
- *
3476
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3477
- */
3478
- declare abstract class PerformanceMeasure extends PerformanceEntry {
3479
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3480
- get detail(): any | undefined;
3481
- toJSON(): any;
3482
- }
3483
- interface PerformanceMarkOptions {
3484
- detail?: any;
3485
- startTime?: number;
3486
- }
3487
- interface PerformanceMeasureOptions {
3488
- detail?: any;
3489
- start?: number;
3490
- duration?: number;
3491
- end?: number;
3492
- }
3493
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList) */
3494
- declare abstract class PerformanceObserverEntryList {
3495
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries) */
3496
- getEntries(): PerformanceEntry[];
3497
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType) */
3498
- getEntriesByType(type: string): PerformanceEntry[];
3499
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName) */
3500
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
3501
- }
3502
- /**
3503
- * 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).
3504
- *
3505
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3506
- */
3507
- declare abstract class PerformanceEntry {
3508
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3509
- get name(): string;
3510
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3511
- get entryType(): string;
3512
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3513
- get startTime(): number;
3514
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3515
- get duration(): number;
3516
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3517
- toJSON(): any;
3518
- }
3519
- /**
3520
- * 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.
3521
- *
3522
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
3523
- */
3524
- declare abstract class PerformanceResourceTiming extends PerformanceEntry {
3525
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd) */
3526
- get connectEnd(): number;
3527
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart) */
3528
- get connectStart(): number;
3529
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize) */
3530
- get decodedBodySize(): number;
3531
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd) */
3532
- get domainLookupEnd(): number;
3533
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart) */
3534
- get domainLookupStart(): number;
3535
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize) */
3536
- get encodedBodySize(): number;
3537
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart) */
3538
- get fetchStart(): number;
3539
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType) */
3540
- get initiatorType(): string;
3541
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol) */
3542
- get nextHopProtocol(): string;
3543
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd) */
3544
- get redirectEnd(): number;
3545
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart) */
3546
- get redirectStart(): number;
3547
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart) */
3548
- get requestStart(): number;
3549
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd) */
3550
- get responseEnd(): number;
3551
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart) */
3552
- get responseStart(): number;
3553
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus) */
3554
- get responseStatus(): number;
3555
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart) */
3556
- get secureConnectionStart(): number | undefined;
3557
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize) */
3558
- get transferSize(): number;
3559
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart) */
3560
- get workerStart(): number;
3561
- }
3562
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) */
3563
- declare class PerformanceObserver {
3564
- constructor(callback: any);
3565
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect) */
3566
- disconnect(): void;
3567
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe) */
3568
- observe(options?: PerformanceObserverObserveOptions): void;
3569
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords) */
3570
- takeRecords(): PerformanceEntry[];
3571
- readonly supportedEntryTypes: string[];
3572
- }
3573
- interface PerformanceObserverObserveOptions {
3574
- buffered?: boolean;
3575
- durationThreshold?: number;
3576
- entryTypes?: string[];
3577
- type?: string;
3578
- }
3579
- interface EventCounts {
3580
- get size(): number;
3581
- get(eventType: string): number | undefined;
3582
- has(eventType: string): boolean;
3583
- entries(): IterableIterator<string[]>;
3584
- keys(): IterableIterator<string>;
3585
- values(): IterableIterator<number>;
3586
- forEach(
3587
- param1: (param0: number, param1: string, param2: EventCounts) => void,
3588
- param2?: any,
3589
- ): void;
3590
- [Symbol.iterator](): IterableIterator<string[]>;
3591
- }
3592
3429
  type AiImageClassificationInput = {
3593
3430
  image: number[];
3594
3431
  };
@@ -301,13 +301,6 @@ 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;
311
304
  }
312
305
  export declare function addEventListener<
313
306
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -490,6 +483,18 @@ export declare abstract class Navigator {
490
483
  readonly languages: string[];
491
484
  readonly storage: StorageManager;
492
485
  }
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
+ }
493
498
  export interface AlarmInvocationInfo {
494
499
  readonly isRetry: boolean;
495
500
  readonly retryCount: number;
@@ -3434,174 +3439,6 @@ export interface WorkerLoaderWorkerCode {
3434
3439
  tails?: Fetcher[];
3435
3440
  streamingTails?: Fetcher[];
3436
3441
  }
3437
- /**
3438
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3439
- * as well as timing of subrequests and other operations.
3440
- *
3441
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3442
- */
3443
- export declare abstract class Performance extends EventTarget {
3444
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3445
- get timeOrigin(): number;
3446
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3447
- now(): number;
3448
- get eventCounts(): EventCounts;
3449
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3450
- clearMarks(name?: string): void;
3451
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3452
- clearMeasures(name?: string): void;
3453
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3454
- clearResourceTimings(): void;
3455
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3456
- getEntries(): PerformanceEntry[];
3457
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3458
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
3459
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3460
- getEntriesByType(type: string): PerformanceEntry[];
3461
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3462
- mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3463
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3464
- measure(
3465
- measureName: string,
3466
- measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3467
- maybeEndMark?: string,
3468
- ): PerformanceMeasure;
3469
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3470
- setResourceTimingBufferSize(size: number): void;
3471
- eventLoopUtilization(): void;
3472
- markResourceTiming(): void;
3473
- timerify(fn: () => void): () => void;
3474
- }
3475
- /**
3476
- * 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.
3477
- *
3478
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3479
- */
3480
- export declare class PerformanceMark extends PerformanceEntry {
3481
- constructor(name: string, maybeOptions?: PerformanceMarkOptions);
3482
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3483
- get detail(): any | undefined;
3484
- toJSON(): any;
3485
- }
3486
- /**
3487
- * 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.
3488
- *
3489
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3490
- */
3491
- export declare abstract class PerformanceMeasure extends PerformanceEntry {
3492
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3493
- get detail(): any | undefined;
3494
- toJSON(): any;
3495
- }
3496
- export interface PerformanceMarkOptions {
3497
- detail?: any;
3498
- startTime?: number;
3499
- }
3500
- export interface PerformanceMeasureOptions {
3501
- detail?: any;
3502
- start?: number;
3503
- duration?: number;
3504
- end?: number;
3505
- }
3506
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList) */
3507
- export declare abstract class PerformanceObserverEntryList {
3508
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries) */
3509
- getEntries(): PerformanceEntry[];
3510
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType) */
3511
- getEntriesByType(type: string): PerformanceEntry[];
3512
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName) */
3513
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
3514
- }
3515
- /**
3516
- * 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).
3517
- *
3518
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3519
- */
3520
- export declare abstract class PerformanceEntry {
3521
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3522
- get name(): string;
3523
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3524
- get entryType(): string;
3525
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3526
- get startTime(): number;
3527
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3528
- get duration(): number;
3529
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3530
- toJSON(): any;
3531
- }
3532
- /**
3533
- * 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.
3534
- *
3535
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
3536
- */
3537
- export declare abstract class PerformanceResourceTiming extends PerformanceEntry {
3538
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd) */
3539
- get connectEnd(): number;
3540
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart) */
3541
- get connectStart(): number;
3542
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize) */
3543
- get decodedBodySize(): number;
3544
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd) */
3545
- get domainLookupEnd(): number;
3546
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart) */
3547
- get domainLookupStart(): number;
3548
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize) */
3549
- get encodedBodySize(): number;
3550
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart) */
3551
- get fetchStart(): number;
3552
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType) */
3553
- get initiatorType(): string;
3554
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol) */
3555
- get nextHopProtocol(): string;
3556
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd) */
3557
- get redirectEnd(): number;
3558
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart) */
3559
- get redirectStart(): number;
3560
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart) */
3561
- get requestStart(): number;
3562
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd) */
3563
- get responseEnd(): number;
3564
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart) */
3565
- get responseStart(): number;
3566
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus) */
3567
- get responseStatus(): number;
3568
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart) */
3569
- get secureConnectionStart(): number | undefined;
3570
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize) */
3571
- get transferSize(): number;
3572
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart) */
3573
- get workerStart(): number;
3574
- }
3575
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) */
3576
- export declare class PerformanceObserver {
3577
- constructor(callback: any);
3578
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect) */
3579
- disconnect(): void;
3580
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe) */
3581
- observe(options?: PerformanceObserverObserveOptions): void;
3582
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords) */
3583
- takeRecords(): PerformanceEntry[];
3584
- readonly supportedEntryTypes: string[];
3585
- }
3586
- export interface PerformanceObserverObserveOptions {
3587
- buffered?: boolean;
3588
- durationThreshold?: number;
3589
- entryTypes?: string[];
3590
- type?: string;
3591
- }
3592
- export interface EventCounts {
3593
- get size(): number;
3594
- get(eventType: string): number | undefined;
3595
- has(eventType: string): boolean;
3596
- entries(): IterableIterator<string[]>;
3597
- keys(): IterableIterator<string>;
3598
- values(): IterableIterator<number>;
3599
- forEach(
3600
- param1: (param0: number, param1: string, param2: EventCounts) => void,
3601
- param2?: any,
3602
- ): void;
3603
- [Symbol.iterator](): IterableIterator<string[]>;
3604
- }
3605
3442
  export type AiImageClassificationInput = {
3606
3443
  image: number[];
3607
3444
  };
package/index.d.ts CHANGED
@@ -287,7 +287,6 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
287
287
  FixedLengthStream: typeof FixedLengthStream;
288
288
  IdentityTransformStream: typeof IdentityTransformStream;
289
289
  HTMLRewriter: typeof HTMLRewriter;
290
- Performance: typeof Performance;
291
290
  }
292
291
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
293
292
  type: Type,
@@ -444,6 +443,18 @@ declare abstract class PromiseRejectionEvent extends Event {
444
443
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
445
444
  readonly reason: any;
446
445
  }
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
+ }
447
458
  interface AlarmInvocationInfo {
448
459
  readonly isRetry: boolean;
449
460
  readonly retryCount: number;
@@ -3099,18 +3110,6 @@ interface WorkerLoaderWorkerCode {
3099
3110
  tails?: Fetcher[];
3100
3111
  streamingTails?: Fetcher[];
3101
3112
  }
3102
- /**
3103
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3104
- * as well as timing of subrequests and other operations.
3105
- *
3106
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3107
- */
3108
- declare abstract class Performance {
3109
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3110
- get timeOrigin(): number;
3111
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3112
- now(): number;
3113
- }
3114
3113
  type AiImageClassificationInput = {
3115
3114
  image: number[];
3116
3115
  };
package/index.ts CHANGED
@@ -287,7 +287,6 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
287
287
  FixedLengthStream: typeof FixedLengthStream;
288
288
  IdentityTransformStream: typeof IdentityTransformStream;
289
289
  HTMLRewriter: typeof HTMLRewriter;
290
- Performance: typeof Performance;
291
290
  }
292
291
  export declare function addEventListener<
293
292
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -449,6 +448,18 @@ export declare abstract class PromiseRejectionEvent extends Event {
449
448
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
450
449
  readonly reason: any;
451
450
  }
451
+ /**
452
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
453
+ * as well as timing of subrequests and other operations.
454
+ *
455
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
456
+ */
457
+ export interface Performance {
458
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
459
+ readonly timeOrigin: number;
460
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
461
+ now(): number;
462
+ }
452
463
  export interface AlarmInvocationInfo {
453
464
  readonly isRetry: boolean;
454
465
  readonly retryCount: number;
@@ -3110,18 +3121,6 @@ export interface WorkerLoaderWorkerCode {
3110
3121
  tails?: Fetcher[];
3111
3122
  streamingTails?: Fetcher[];
3112
3123
  }
3113
- /**
3114
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3115
- * as well as timing of subrequests and other operations.
3116
- *
3117
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3118
- */
3119
- export declare abstract class Performance {
3120
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3121
- get timeOrigin(): number;
3122
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3123
- now(): number;
3124
- }
3125
3124
  export type AiImageClassificationInput = {
3126
3125
  image: number[];
3127
3126
  };