@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.
package/index.ts CHANGED
@@ -287,6 +287,7 @@ export 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
  export declare function addEventListener<
292
293
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -448,18 +449,6 @@ export declare abstract class PromiseRejectionEvent extends Event {
448
449
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
449
450
  readonly reason: any;
450
451
  }
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
- }
463
452
  export interface AlarmInvocationInfo {
464
453
  readonly isRetry: boolean;
465
454
  readonly retryCount: number;
@@ -3060,6 +3049,99 @@ export interface SyncKvListOptions {
3060
3049
  reverse?: boolean;
3061
3050
  limit?: number;
3062
3051
  }
3052
+ /**
3053
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3054
+ * as well as timing of subrequests and other operations.
3055
+ *
3056
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3057
+ */
3058
+ export declare abstract class Performance extends EventTarget {
3059
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3060
+ get timeOrigin(): number;
3061
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3062
+ now(): number;
3063
+ get eventCounts(): EventCounts;
3064
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3065
+ clearMarks(name?: string): void;
3066
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3067
+ clearMeasures(name?: string): void;
3068
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3069
+ clearResourceTimings(): void;
3070
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3071
+ getEntries(): PerformanceEntry[];
3072
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3073
+ getEntriesByName(name: string, type: string): PerformanceEntry[];
3074
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3075
+ getEntriesByType(type: string): PerformanceEntry[];
3076
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3077
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3078
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3079
+ measure(
3080
+ measureName: string,
3081
+ measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3082
+ maybeEndMark?: string,
3083
+ ): PerformanceMeasure;
3084
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3085
+ setResourceTimingBufferSize(size: number): void;
3086
+ }
3087
+ /**
3088
+ * 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.
3089
+ *
3090
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3091
+ */
3092
+ export interface PerformanceMark extends PerformanceEntry {
3093
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3094
+ get detail(): any;
3095
+ }
3096
+ /**
3097
+ * 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.
3098
+ *
3099
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3100
+ */
3101
+ export interface PerformanceMeasure extends PerformanceEntry {
3102
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3103
+ get detail(): any;
3104
+ }
3105
+ export interface PerformanceMarkOptions {
3106
+ detail?: any;
3107
+ startTime?: number;
3108
+ }
3109
+ export interface PerformanceMeasureOptions {
3110
+ detail?: any;
3111
+ start?: number;
3112
+ duration?: number;
3113
+ end?: number;
3114
+ }
3115
+ /**
3116
+ * 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).
3117
+ *
3118
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3119
+ */
3120
+ export declare abstract class PerformanceEntry {
3121
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3122
+ get name(): string;
3123
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3124
+ get entryType(): string;
3125
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3126
+ get startTime(): number;
3127
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3128
+ get duration(): number;
3129
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3130
+ toJSON(): any;
3131
+ }
3132
+ export interface EventCounts {
3133
+ get size(): number;
3134
+ get(eventType: string): number | undefined;
3135
+ has(eventType: string): boolean;
3136
+ entries(): IterableIterator<string[]>;
3137
+ keys(): IterableIterator<string>;
3138
+ values(): IterableIterator<number>;
3139
+ forEach(
3140
+ param1: (param0: number, param1: string, param2: EventCounts) => void,
3141
+ param2?: any,
3142
+ ): void;
3143
+ [Symbol.iterator](): IterableIterator<string[]>;
3144
+ }
3063
3145
  export type AiImageClassificationInput = {
3064
3146
  image: number[];
3065
3147
  };
package/latest/index.d.ts CHANGED
@@ -296,6 +296,13 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
296
296
  FixedLengthStream: typeof FixedLengthStream;
297
297
  IdentityTransformStream: typeof IdentityTransformStream;
298
298
  HTMLRewriter: typeof HTMLRewriter;
299
+ Performance: typeof Performance;
300
+ PerformanceEntry: typeof PerformanceEntry;
301
+ PerformanceMark: typeof PerformanceMark;
302
+ PerformanceMeasure: typeof PerformanceMeasure;
303
+ PerformanceResourceTiming: typeof PerformanceResourceTiming;
304
+ PerformanceObserver: typeof PerformanceObserver;
305
+ PerformanceObserverEntryList: typeof PerformanceObserverEntryList;
299
306
  }
300
307
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
301
308
  type: Type,
@@ -470,18 +477,6 @@ declare abstract class Navigator {
470
477
  readonly language: string;
471
478
  readonly languages: string[];
472
479
  }
473
- /**
474
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
475
- * as well as timing of subrequests and other operations.
476
- *
477
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
478
- */
479
- interface Performance {
480
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
481
- readonly timeOrigin: number;
482
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
483
- now(): number;
484
- }
485
480
  interface AlarmInvocationInfo {
486
481
  readonly isRetry: boolean;
487
482
  readonly retryCount: number;
@@ -3134,6 +3129,169 @@ interface SyncKvListOptions {
3134
3129
  reverse?: boolean;
3135
3130
  limit?: number;
3136
3131
  }
3132
+ /**
3133
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3134
+ * as well as timing of subrequests and other operations.
3135
+ *
3136
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3137
+ */
3138
+ declare abstract class Performance extends EventTarget {
3139
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3140
+ get timeOrigin(): number;
3141
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3142
+ now(): number;
3143
+ get eventCounts(): EventCounts;
3144
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3145
+ clearMarks(name?: string): void;
3146
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3147
+ clearMeasures(name?: string): void;
3148
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3149
+ clearResourceTimings(): void;
3150
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3151
+ getEntries(): PerformanceEntry[];
3152
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3153
+ getEntriesByName(name: string, type: string): PerformanceEntry[];
3154
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3155
+ getEntriesByType(type: string): PerformanceEntry[];
3156
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3157
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3158
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3159
+ measure(
3160
+ measureName: string,
3161
+ measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3162
+ maybeEndMark?: string,
3163
+ ): PerformanceMeasure;
3164
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3165
+ setResourceTimingBufferSize(size: number): void;
3166
+ }
3167
+ /**
3168
+ * 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.
3169
+ *
3170
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3171
+ */
3172
+ declare abstract class PerformanceMark extends PerformanceEntry {
3173
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3174
+ get detail(): any;
3175
+ }
3176
+ /**
3177
+ * 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.
3178
+ *
3179
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3180
+ */
3181
+ declare abstract class PerformanceMeasure extends PerformanceEntry {
3182
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3183
+ get detail(): any;
3184
+ }
3185
+ interface PerformanceMarkOptions {
3186
+ detail?: any;
3187
+ startTime?: number;
3188
+ }
3189
+ interface PerformanceMeasureOptions {
3190
+ detail?: any;
3191
+ start?: number;
3192
+ duration?: number;
3193
+ end?: number;
3194
+ }
3195
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList) */
3196
+ declare abstract class PerformanceObserverEntryList {
3197
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries) */
3198
+ getEntries(): PerformanceEntry[];
3199
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType) */
3200
+ getEntriesByType(type: string): PerformanceEntry[];
3201
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName) */
3202
+ getEntriesByName(name: string, type?: string): PerformanceEntry[];
3203
+ }
3204
+ /**
3205
+ * 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).
3206
+ *
3207
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3208
+ */
3209
+ declare abstract class PerformanceEntry {
3210
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3211
+ get name(): string;
3212
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3213
+ get entryType(): string;
3214
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3215
+ get startTime(): number;
3216
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3217
+ get duration(): number;
3218
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3219
+ toJSON(): any;
3220
+ }
3221
+ /**
3222
+ * 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.
3223
+ *
3224
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
3225
+ */
3226
+ declare abstract class PerformanceResourceTiming extends PerformanceEntry {
3227
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd) */
3228
+ get connectEnd(): number;
3229
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart) */
3230
+ get connectStart(): number;
3231
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize) */
3232
+ get decodedBodySize(): number;
3233
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd) */
3234
+ get domainLookupEnd(): number;
3235
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart) */
3236
+ get domainLookupStart(): number;
3237
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize) */
3238
+ get encodedBodySize(): number;
3239
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart) */
3240
+ get fetchStart(): number;
3241
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType) */
3242
+ get initiatorType(): string;
3243
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol) */
3244
+ get nextHopProtocol(): string;
3245
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd) */
3246
+ get redirectEnd(): number;
3247
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart) */
3248
+ get redirectStart(): number;
3249
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart) */
3250
+ get requestStart(): number;
3251
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd) */
3252
+ get responseEnd(): number;
3253
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart) */
3254
+ get responseStart(): number;
3255
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus) */
3256
+ get responseStatus(): number;
3257
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart) */
3258
+ get secureConnectionStart(): number | undefined;
3259
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize) */
3260
+ get transferSize(): number;
3261
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart) */
3262
+ get workerStart(): number;
3263
+ }
3264
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) */
3265
+ declare class PerformanceObserver {
3266
+ constructor(callback: any);
3267
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect) */
3268
+ disconnect(): void;
3269
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe) */
3270
+ observe(options?: PerformanceObserverObserveOptions): void;
3271
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords) */
3272
+ takeRecords(): PerformanceEntry[];
3273
+ readonly supportedEntryTypes: string[];
3274
+ }
3275
+ interface PerformanceObserverObserveOptions {
3276
+ buffered: boolean;
3277
+ durationThreshold: number;
3278
+ entryTypes: string[];
3279
+ type?: string;
3280
+ name?: string;
3281
+ }
3282
+ interface EventCounts {
3283
+ get size(): number;
3284
+ get(eventType: string): number | undefined;
3285
+ has(eventType: string): boolean;
3286
+ entries(): IterableIterator<string[]>;
3287
+ keys(): IterableIterator<string>;
3288
+ values(): IterableIterator<number>;
3289
+ forEach(
3290
+ param1: (param0: number, param1: string, param2: EventCounts) => void,
3291
+ param2?: any,
3292
+ ): void;
3293
+ [Symbol.iterator](): IterableIterator<string[]>;
3294
+ }
3137
3295
  type AiImageClassificationInput = {
3138
3296
  image: number[];
3139
3297
  };
package/latest/index.ts CHANGED
@@ -296,6 +296,13 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
296
296
  FixedLengthStream: typeof FixedLengthStream;
297
297
  IdentityTransformStream: typeof IdentityTransformStream;
298
298
  HTMLRewriter: typeof HTMLRewriter;
299
+ Performance: typeof Performance;
300
+ PerformanceEntry: typeof PerformanceEntry;
301
+ PerformanceMark: typeof PerformanceMark;
302
+ PerformanceMeasure: typeof PerformanceMeasure;
303
+ PerformanceResourceTiming: typeof PerformanceResourceTiming;
304
+ PerformanceObserver: typeof PerformanceObserver;
305
+ PerformanceObserverEntryList: typeof PerformanceObserverEntryList;
299
306
  }
300
307
  export declare function addEventListener<
301
308
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -475,18 +482,6 @@ export declare abstract class Navigator {
475
482
  readonly language: string;
476
483
  readonly languages: string[];
477
484
  }
478
- /**
479
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
480
- * as well as timing of subrequests and other operations.
481
- *
482
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
483
- */
484
- export interface Performance {
485
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
486
- readonly timeOrigin: number;
487
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
488
- now(): number;
489
- }
490
485
  export interface AlarmInvocationInfo {
491
486
  readonly isRetry: boolean;
492
487
  readonly retryCount: number;
@@ -3145,6 +3140,169 @@ export interface SyncKvListOptions {
3145
3140
  reverse?: boolean;
3146
3141
  limit?: number;
3147
3142
  }
3143
+ /**
3144
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3145
+ * as well as timing of subrequests and other operations.
3146
+ *
3147
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3148
+ */
3149
+ export declare abstract class Performance extends EventTarget {
3150
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3151
+ get timeOrigin(): number;
3152
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3153
+ now(): number;
3154
+ get eventCounts(): EventCounts;
3155
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3156
+ clearMarks(name?: string): void;
3157
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3158
+ clearMeasures(name?: string): void;
3159
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3160
+ clearResourceTimings(): void;
3161
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3162
+ getEntries(): PerformanceEntry[];
3163
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3164
+ getEntriesByName(name: string, type: string): PerformanceEntry[];
3165
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3166
+ getEntriesByType(type: string): PerformanceEntry[];
3167
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3168
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3169
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3170
+ measure(
3171
+ measureName: string,
3172
+ measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3173
+ maybeEndMark?: string,
3174
+ ): PerformanceMeasure;
3175
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3176
+ setResourceTimingBufferSize(size: number): void;
3177
+ }
3178
+ /**
3179
+ * 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.
3180
+ *
3181
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3182
+ */
3183
+ export declare abstract class PerformanceMark extends PerformanceEntry {
3184
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3185
+ get detail(): any;
3186
+ }
3187
+ /**
3188
+ * 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.
3189
+ *
3190
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3191
+ */
3192
+ export declare abstract class PerformanceMeasure extends PerformanceEntry {
3193
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3194
+ get detail(): any;
3195
+ }
3196
+ export interface PerformanceMarkOptions {
3197
+ detail?: any;
3198
+ startTime?: number;
3199
+ }
3200
+ export interface PerformanceMeasureOptions {
3201
+ detail?: any;
3202
+ start?: number;
3203
+ duration?: number;
3204
+ end?: number;
3205
+ }
3206
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList) */
3207
+ export declare abstract class PerformanceObserverEntryList {
3208
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries) */
3209
+ getEntries(): PerformanceEntry[];
3210
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType) */
3211
+ getEntriesByType(type: string): PerformanceEntry[];
3212
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName) */
3213
+ getEntriesByName(name: string, type?: string): PerformanceEntry[];
3214
+ }
3215
+ /**
3216
+ * 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).
3217
+ *
3218
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3219
+ */
3220
+ export declare abstract class PerformanceEntry {
3221
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3222
+ get name(): string;
3223
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3224
+ get entryType(): string;
3225
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3226
+ get startTime(): number;
3227
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3228
+ get duration(): number;
3229
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3230
+ toJSON(): any;
3231
+ }
3232
+ /**
3233
+ * 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.
3234
+ *
3235
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
3236
+ */
3237
+ export declare abstract class PerformanceResourceTiming extends PerformanceEntry {
3238
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd) */
3239
+ get connectEnd(): number;
3240
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart) */
3241
+ get connectStart(): number;
3242
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize) */
3243
+ get decodedBodySize(): number;
3244
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd) */
3245
+ get domainLookupEnd(): number;
3246
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart) */
3247
+ get domainLookupStart(): number;
3248
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize) */
3249
+ get encodedBodySize(): number;
3250
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart) */
3251
+ get fetchStart(): number;
3252
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType) */
3253
+ get initiatorType(): string;
3254
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol) */
3255
+ get nextHopProtocol(): string;
3256
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd) */
3257
+ get redirectEnd(): number;
3258
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart) */
3259
+ get redirectStart(): number;
3260
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart) */
3261
+ get requestStart(): number;
3262
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd) */
3263
+ get responseEnd(): number;
3264
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart) */
3265
+ get responseStart(): number;
3266
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus) */
3267
+ get responseStatus(): number;
3268
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart) */
3269
+ get secureConnectionStart(): number | undefined;
3270
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize) */
3271
+ get transferSize(): number;
3272
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart) */
3273
+ get workerStart(): number;
3274
+ }
3275
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) */
3276
+ export declare class PerformanceObserver {
3277
+ constructor(callback: any);
3278
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect) */
3279
+ disconnect(): void;
3280
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe) */
3281
+ observe(options?: PerformanceObserverObserveOptions): void;
3282
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords) */
3283
+ takeRecords(): PerformanceEntry[];
3284
+ readonly supportedEntryTypes: string[];
3285
+ }
3286
+ export interface PerformanceObserverObserveOptions {
3287
+ buffered: boolean;
3288
+ durationThreshold: number;
3289
+ entryTypes: string[];
3290
+ type?: string;
3291
+ name?: string;
3292
+ }
3293
+ export interface EventCounts {
3294
+ get size(): number;
3295
+ get(eventType: string): number | undefined;
3296
+ has(eventType: string): boolean;
3297
+ entries(): IterableIterator<string[]>;
3298
+ keys(): IterableIterator<string>;
3299
+ values(): IterableIterator<number>;
3300
+ forEach(
3301
+ param1: (param0: number, param1: string, param2: EventCounts) => void,
3302
+ param2?: any,
3303
+ ): void;
3304
+ [Symbol.iterator](): IterableIterator<string[]>;
3305
+ }
3148
3306
  export type AiImageClassificationInput = {
3149
3307
  image: number[];
3150
3308
  };
package/oldest/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
  };