@cloudflare/workers-types 4.20240620.0 → 4.20240712.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.
@@ -249,6 +249,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -278,16 +279,16 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
278
279
  FixedLengthStream: typeof FixedLengthStream;
279
280
  IdentityTransformStream: typeof IdentityTransformStream;
280
281
  HTMLRewriter: typeof HTMLRewriter;
281
- GPUAdapter: typeof gpuGPUAdapter;
282
- GPUOutOfMemoryError: typeof gpuGPUOutOfMemoryError;
283
- GPUValidationError: typeof gpuGPUValidationError;
284
- GPUInternalError: typeof gpuGPUInternalError;
285
- GPUDeviceLostInfo: typeof gpuGPUDeviceLostInfo;
286
- GPUBufferUsage: typeof gpuGPUBufferUsage;
287
- GPUShaderStage: typeof gpuGPUShaderStage;
288
- GPUMapMode: typeof gpuGPUMapMode;
289
- GPUTextureUsage: typeof gpuGPUTextureUsage;
290
- GPUColorWrite: typeof gpuGPUColorWrite;
282
+ GPUAdapter: typeof GPUAdapter;
283
+ GPUOutOfMemoryError: typeof GPUOutOfMemoryError;
284
+ GPUValidationError: typeof GPUValidationError;
285
+ GPUInternalError: typeof GPUInternalError;
286
+ GPUDeviceLostInfo: typeof GPUDeviceLostInfo;
287
+ GPUBufferUsage: typeof GPUBufferUsage;
288
+ GPUShaderStage: typeof GPUShaderStage;
289
+ GPUMapMode: typeof GPUMapMode;
290
+ GPUTextureUsage: typeof GPUTextureUsage;
291
+ GPUColorWrite: typeof GPUColorWrite;
291
292
  }
292
293
  export declare function addEventListener<
293
294
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -2482,60 +2483,58 @@ export interface SocketInfo {
2482
2483
  remoteAddress?: string;
2483
2484
  localAddress?: string;
2484
2485
  }
2485
- export declare abstract class gpuGPUAdapter {
2486
- requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
2487
- requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
2488
- get features(): gpuGPUSupportedFeatures;
2489
- get limits(): gpuGPUSupportedLimits;
2486
+ export declare abstract class GPUAdapter {
2487
+ requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
2488
+ requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
2489
+ get features(): GPUSupportedFeatures;
2490
+ get limits(): GPUSupportedLimits;
2490
2491
  }
2491
- export interface gpuGPUDevice extends EventTarget {
2492
- createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
2492
+ export interface GPUDevice extends EventTarget {
2493
+ createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
2493
2494
  createBindGroupLayout(
2494
- descriptor: gpuGPUBindGroupLayoutDescriptor,
2495
- ): gpuGPUBindGroupLayout;
2496
- createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
2497
- createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
2498
- createShaderModule(
2499
- descriptor: gpuGPUShaderModuleDescriptor,
2500
- ): gpuGPUShaderModule;
2495
+ descriptor: GPUBindGroupLayoutDescriptor,
2496
+ ): GPUBindGroupLayout;
2497
+ createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
2498
+ createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
2499
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
2501
2500
  createPipelineLayout(
2502
- descriptor: gpuGPUPipelineLayoutDescriptor,
2503
- ): gpuGPUPipelineLayout;
2501
+ descriptor: GPUPipelineLayoutDescriptor,
2502
+ ): GPUPipelineLayout;
2504
2503
  createComputePipeline(
2505
- descriptor: gpuGPUComputePipelineDescriptor,
2506
- ): gpuGPUComputePipeline;
2504
+ descriptor: GPUComputePipelineDescriptor,
2505
+ ): GPUComputePipeline;
2507
2506
  createRenderPipeline(
2508
- descriptor: gpuGPURenderPipelineDescriptor,
2509
- ): gpuGPURenderPipeline;
2507
+ descriptor: GPURenderPipelineDescriptor,
2508
+ ): GPURenderPipeline;
2510
2509
  createCommandEncoder(
2511
- descriptor?: gpuGPUCommandEncoderDescriptor,
2512
- ): gpuGPUCommandEncoder;
2513
- createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
2510
+ descriptor?: GPUCommandEncoderDescriptor,
2511
+ ): GPUCommandEncoder;
2512
+ createTexture(param1: GPUTextureDescriptor): GPUTexture;
2514
2513
  destroy(): void;
2515
- createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
2514
+ createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
2516
2515
  pushErrorScope(filter: string): void;
2517
- popErrorScope(): Promise<gpuGPUError | null>;
2518
- get queue(): gpuGPUQueue;
2519
- get lost(): Promise<gpuGPUDeviceLostInfo>;
2520
- get features(): gpuGPUSupportedFeatures;
2521
- get limits(): gpuGPUSupportedLimits;
2516
+ popErrorScope(): Promise<GPUError | null>;
2517
+ get queue(): GPUQueue;
2518
+ get lost(): Promise<GPUDeviceLostInfo>;
2519
+ get features(): GPUSupportedFeatures;
2520
+ get limits(): GPUSupportedLimits;
2522
2521
  }
2523
- export interface gpuGPUDeviceDescriptor {
2522
+ export interface GPUDeviceDescriptor {
2524
2523
  label?: string;
2525
2524
  requiredFeatures?: string[];
2526
2525
  requiredLimits?: Record<string, number | bigint>;
2527
- defaultQueue?: gpuGPUQueueDescriptor;
2526
+ defaultQueue?: GPUQueueDescriptor;
2528
2527
  }
2529
- export interface gpuGPUBufferDescriptor {
2528
+ export interface GPUBufferDescriptor {
2530
2529
  label: string;
2531
2530
  size: number | bigint;
2532
2531
  usage: number;
2533
2532
  mappedAtCreation: boolean;
2534
2533
  }
2535
- export interface gpuGPUQueueDescriptor {
2534
+ export interface GPUQueueDescriptor {
2536
2535
  label?: string;
2537
2536
  }
2538
- export declare abstract class gpuGPUBufferUsage {
2537
+ export declare abstract class GPUBufferUsage {
2539
2538
  static readonly MAP_READ: number;
2540
2539
  static readonly MAP_WRITE: number;
2541
2540
  static readonly COPY_SRC: number;
@@ -2547,7 +2546,7 @@ export declare abstract class gpuGPUBufferUsage {
2547
2546
  static readonly INDIRECT: number;
2548
2547
  static readonly QUERY_RESOLVE: number;
2549
2548
  }
2550
- export interface gpuGPUBuffer {
2549
+ export interface GPUBuffer {
2551
2550
  getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
2552
2551
  unmap(): void;
2553
2552
  destroy(): void;
@@ -2560,59 +2559,59 @@ export interface gpuGPUBuffer {
2560
2559
  get usage(): number;
2561
2560
  get mapState(): string;
2562
2561
  }
2563
- export declare abstract class gpuGPUShaderStage {
2562
+ export declare abstract class GPUShaderStage {
2564
2563
  static readonly VERTEX: number;
2565
2564
  static readonly FRAGMENT: number;
2566
2565
  static readonly COMPUTE: number;
2567
2566
  }
2568
- export interface gpuGPUBindGroupLayoutDescriptor {
2567
+ export interface GPUBindGroupLayoutDescriptor {
2569
2568
  label?: string;
2570
- entries: gpuGPUBindGroupLayoutEntry[];
2569
+ entries: GPUBindGroupLayoutEntry[];
2571
2570
  }
2572
- export interface gpuGPUBindGroupLayoutEntry {
2571
+ export interface GPUBindGroupLayoutEntry {
2573
2572
  binding: number;
2574
2573
  visibility: number;
2575
- buffer?: gpuGPUBufferBindingLayout;
2576
- sampler?: gpuGPUSamplerBindingLayout;
2577
- texture?: gpuGPUTextureBindingLayout;
2578
- storageTexture?: gpuGPUStorageTextureBindingLayout;
2574
+ buffer?: GPUBufferBindingLayout;
2575
+ sampler?: GPUSamplerBindingLayout;
2576
+ texture?: GPUTextureBindingLayout;
2577
+ storageTexture?: GPUStorageTextureBindingLayout;
2579
2578
  }
2580
- export interface gpuGPUStorageTextureBindingLayout {
2579
+ export interface GPUStorageTextureBindingLayout {
2581
2580
  access?: string;
2582
2581
  format: string;
2583
2582
  viewDimension?: string;
2584
2583
  }
2585
- export interface gpuGPUTextureBindingLayout {
2584
+ export interface GPUTextureBindingLayout {
2586
2585
  sampleType?: string;
2587
2586
  viewDimension?: string;
2588
2587
  multisampled?: boolean;
2589
2588
  }
2590
- export interface gpuGPUSamplerBindingLayout {
2589
+ export interface GPUSamplerBindingLayout {
2591
2590
  type?: string;
2592
2591
  }
2593
- export interface gpuGPUBufferBindingLayout {
2592
+ export interface GPUBufferBindingLayout {
2594
2593
  type?: string;
2595
2594
  hasDynamicOffset?: boolean;
2596
2595
  minBindingSize?: number | bigint;
2597
2596
  }
2598
- export interface gpuGPUBindGroupLayout {}
2599
- export interface gpuGPUBindGroup {}
2600
- export interface gpuGPUBindGroupDescriptor {
2597
+ export interface GPUBindGroupLayout {}
2598
+ export interface GPUBindGroup {}
2599
+ export interface GPUBindGroupDescriptor {
2601
2600
  label?: string;
2602
- layout: gpuGPUBindGroupLayout;
2603
- entries: gpuGPUBindGroupEntry[];
2601
+ layout: GPUBindGroupLayout;
2602
+ entries: GPUBindGroupEntry[];
2604
2603
  }
2605
- export interface gpuGPUBindGroupEntry {
2604
+ export interface GPUBindGroupEntry {
2606
2605
  binding: number;
2607
- resource: gpuGPUBufferBinding | gpuGPUSampler;
2606
+ resource: GPUBufferBinding | GPUSampler;
2608
2607
  }
2609
- export interface gpuGPUBufferBinding {
2610
- buffer: gpuGPUBuffer;
2608
+ export interface GPUBufferBinding {
2609
+ buffer: GPUBuffer;
2611
2610
  offset?: number | bigint;
2612
2611
  size?: number | bigint;
2613
2612
  }
2614
- export interface gpuGPUSampler {}
2615
- export interface gpuGPUSamplerDescriptor {
2613
+ export interface GPUSampler {}
2614
+ export interface GPUSamplerDescriptor {
2616
2615
  label?: string;
2617
2616
  addressModeU?: string;
2618
2617
  addressModeV?: string;
@@ -2625,76 +2624,74 @@ export interface gpuGPUSamplerDescriptor {
2625
2624
  compare: string;
2626
2625
  maxAnisotropy?: number;
2627
2626
  }
2628
- export interface gpuGPUShaderModule {
2629
- getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
2627
+ export interface GPUShaderModule {
2628
+ getCompilationInfo(): Promise<GPUCompilationInfo>;
2630
2629
  }
2631
- export interface gpuGPUShaderModuleDescriptor {
2630
+ export interface GPUShaderModuleDescriptor {
2632
2631
  label?: string;
2633
2632
  code: string;
2634
2633
  }
2635
- export interface gpuGPUPipelineLayout {}
2636
- export interface gpuGPUPipelineLayoutDescriptor {
2634
+ export interface GPUPipelineLayout {}
2635
+ export interface GPUPipelineLayoutDescriptor {
2637
2636
  label?: string;
2638
- bindGroupLayouts: gpuGPUBindGroupLayout[];
2637
+ bindGroupLayouts: GPUBindGroupLayout[];
2639
2638
  }
2640
- export interface gpuGPUComputePipeline {
2641
- getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
2639
+ export interface GPUComputePipeline {
2640
+ getBindGroupLayout(index: number): GPUBindGroupLayout;
2642
2641
  }
2643
- export interface gpuGPUComputePipelineDescriptor {
2642
+ export interface GPUComputePipelineDescriptor {
2644
2643
  label?: string;
2645
- compute: gpuGPUProgrammableStage;
2646
- layout: string | gpuGPUPipelineLayout;
2644
+ compute: GPUProgrammableStage;
2645
+ layout: string | GPUPipelineLayout;
2647
2646
  }
2648
- export interface gpuGPUProgrammableStage {
2649
- module: gpuGPUShaderModule;
2647
+ export interface GPUProgrammableStage {
2648
+ module: GPUShaderModule;
2650
2649
  entryPoint: string;
2651
2650
  constants?: Record<string, number>;
2652
2651
  }
2653
- export interface gpuGPUCommandEncoder {
2652
+ export interface GPUCommandEncoder {
2654
2653
  get label(): string;
2655
2654
  beginComputePass(
2656
- descriptor?: gpuGPUComputePassDescriptor,
2657
- ): gpuGPUComputePassEncoder;
2658
- beginRenderPass(
2659
- descriptor: gpuGPURenderPassDescriptor,
2660
- ): gpuGPURenderPassEncoder;
2655
+ descriptor?: GPUComputePassDescriptor,
2656
+ ): GPUComputePassEncoder;
2657
+ beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
2661
2658
  copyBufferToBuffer(
2662
- source: gpuGPUBuffer,
2659
+ source: GPUBuffer,
2663
2660
  sourceOffset: number | bigint,
2664
- destination: gpuGPUBuffer,
2661
+ destination: GPUBuffer,
2665
2662
  destinationOffset: number | bigint,
2666
2663
  size: number | bigint,
2667
2664
  ): void;
2668
- finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2665
+ finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
2669
2666
  copyTextureToBuffer(
2670
- source: gpuGPUImageCopyTexture,
2671
- destination: gpuGPUImageCopyBuffer,
2672
- copySize: Iterable<number> | gpuGPUExtent3DDict,
2667
+ source: GPUImageCopyTexture,
2668
+ destination: GPUImageCopyBuffer,
2669
+ copySize: Iterable<number> | GPUExtent3DDict,
2673
2670
  ): void;
2674
2671
  copyBufferToTexture(
2675
- source: gpuGPUImageCopyBuffer,
2676
- destination: gpuGPUImageCopyTexture,
2677
- copySize: Iterable<number> | gpuGPUExtent3DDict,
2672
+ source: GPUImageCopyBuffer,
2673
+ destination: GPUImageCopyTexture,
2674
+ copySize: Iterable<number> | GPUExtent3DDict,
2678
2675
  ): void;
2679
2676
  copyTextureToTexture(
2680
- source: gpuGPUImageCopyTexture,
2681
- destination: gpuGPUImageCopyTexture,
2682
- copySize: Iterable<number> | gpuGPUExtent3DDict,
2677
+ source: GPUImageCopyTexture,
2678
+ destination: GPUImageCopyTexture,
2679
+ copySize: Iterable<number> | GPUExtent3DDict,
2683
2680
  ): void;
2684
2681
  clearBuffer(
2685
- buffer: gpuGPUBuffer,
2682
+ buffer: GPUBuffer,
2686
2683
  offset?: number | bigint,
2687
2684
  size?: number | bigint,
2688
2685
  ): void;
2689
2686
  }
2690
- export interface gpuGPUCommandEncoderDescriptor {
2687
+ export interface GPUCommandEncoderDescriptor {
2691
2688
  label?: string;
2692
2689
  }
2693
- export interface gpuGPUComputePassEncoder {
2694
- setPipeline(pipeline: gpuGPUComputePipeline): void;
2690
+ export interface GPUComputePassEncoder {
2691
+ setPipeline(pipeline: GPUComputePipeline): void;
2695
2692
  setBindGroup(
2696
2693
  index: number,
2697
- bindGroup: gpuGPUBindGroup | null,
2694
+ bindGroup: GPUBindGroup | null,
2698
2695
  dynamicOffsets?: Iterable<number>,
2699
2696
  ): void;
2700
2697
  dispatchWorkgroups(
@@ -2704,48 +2701,48 @@ export interface gpuGPUComputePassEncoder {
2704
2701
  ): void;
2705
2702
  end(): void;
2706
2703
  }
2707
- export interface gpuGPUComputePassDescriptor {
2704
+ export interface GPUComputePassDescriptor {
2708
2705
  label?: string;
2709
- timestampWrites?: gpuGPUComputePassTimestampWrites;
2706
+ timestampWrites?: GPUComputePassTimestampWrites;
2710
2707
  }
2711
- export interface gpuGPUQuerySet {}
2712
- export interface gpuGPUQuerySetDescriptor {
2708
+ export interface GPUQuerySet {}
2709
+ export interface GPUQuerySetDescriptor {
2713
2710
  label?: string;
2714
2711
  }
2715
- export interface gpuGPUComputePassTimestampWrites {
2716
- querySet: gpuGPUQuerySet;
2712
+ export interface GPUComputePassTimestampWrites {
2713
+ querySet: GPUQuerySet;
2717
2714
  beginningOfPassWriteIndex?: number;
2718
2715
  endOfPassWriteIndex?: number;
2719
2716
  }
2720
- export interface gpuGPUCommandBufferDescriptor {
2717
+ export interface GPUCommandBufferDescriptor {
2721
2718
  label?: string;
2722
2719
  }
2723
- export interface gpuGPUCommandBuffer {}
2724
- export interface gpuGPUQueue {
2725
- submit(commandBuffers: gpuGPUCommandBuffer[]): void;
2720
+ export interface GPUCommandBuffer {}
2721
+ export interface GPUQueue {
2722
+ submit(commandBuffers: GPUCommandBuffer[]): void;
2726
2723
  writeBuffer(
2727
- buffer: gpuGPUBuffer,
2724
+ buffer: GPUBuffer,
2728
2725
  bufferOffset: number | bigint,
2729
2726
  data: ArrayBuffer | ArrayBufferView,
2730
2727
  dataOffset?: number | bigint,
2731
2728
  size?: number | bigint,
2732
2729
  ): void;
2733
2730
  }
2734
- export declare abstract class gpuGPUMapMode {
2731
+ export declare abstract class GPUMapMode {
2735
2732
  static readonly READ: number;
2736
2733
  static readonly WRITE: number;
2737
2734
  }
2738
- export interface gpuGPUAdapterInfo {
2735
+ export interface GPUAdapterInfo {
2739
2736
  get vendor(): string;
2740
2737
  get architecture(): string;
2741
2738
  get device(): string;
2742
2739
  get description(): string;
2743
2740
  }
2744
- export interface gpuGPUSupportedFeatures {
2741
+ export interface GPUSupportedFeatures {
2745
2742
  has(name: string): boolean;
2746
2743
  keys(): string[];
2747
2744
  }
2748
- export interface gpuGPUSupportedLimits {
2745
+ export interface GPUSupportedLimits {
2749
2746
  get maxTextureDimension1D(): number;
2750
2747
  get maxTextureDimension2D(): number;
2751
2748
  get maxTextureDimension3D(): number;
@@ -2778,17 +2775,17 @@ export interface gpuGPUSupportedLimits {
2778
2775
  get maxComputeWorkgroupSizeZ(): number;
2779
2776
  get maxComputeWorkgroupsPerDimension(): number;
2780
2777
  }
2781
- export declare abstract class gpuGPUError {
2778
+ export declare abstract class GPUError {
2782
2779
  get message(): string;
2783
2780
  }
2784
- export declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
2785
- export declare abstract class gpuGPUInternalError extends gpuGPUError {}
2786
- export declare abstract class gpuGPUValidationError extends gpuGPUError {}
2787
- export declare abstract class gpuGPUDeviceLostInfo {
2781
+ export declare abstract class GPUOutOfMemoryError extends GPUError {}
2782
+ export declare abstract class GPUInternalError extends GPUError {}
2783
+ export declare abstract class GPUValidationError extends GPUError {}
2784
+ export declare abstract class GPUDeviceLostInfo {
2788
2785
  get message(): string;
2789
2786
  get reason(): string;
2790
2787
  }
2791
- export interface gpuGPUCompilationMessage {
2788
+ export interface GPUCompilationMessage {
2792
2789
  get message(): string;
2793
2790
  get type(): string;
2794
2791
  get lineNum(): number;
@@ -2796,19 +2793,19 @@ export interface gpuGPUCompilationMessage {
2796
2793
  get offset(): number;
2797
2794
  get length(): number;
2798
2795
  }
2799
- export interface gpuGPUCompilationInfo {
2800
- get messages(): gpuGPUCompilationMessage[];
2796
+ export interface GPUCompilationInfo {
2797
+ get messages(): GPUCompilationMessage[];
2801
2798
  }
2802
- export declare abstract class gpuGPUTextureUsage {
2799
+ export declare abstract class GPUTextureUsage {
2803
2800
  static readonly COPY_SRC: number;
2804
2801
  static readonly COPY_DST: number;
2805
2802
  static readonly TEXTURE_BINDING: number;
2806
2803
  static readonly STORAGE_BINDING: number;
2807
2804
  static readonly RENDER_ATTACHMENT: number;
2808
2805
  }
2809
- export interface gpuGPUTextureDescriptor {
2806
+ export interface GPUTextureDescriptor {
2810
2807
  label: string;
2811
- size: number[] | gpuGPUExtent3DDict;
2808
+ size: number[] | GPUExtent3DDict;
2812
2809
  mipLevelCount?: number;
2813
2810
  sampleCount?: number;
2814
2811
  dimension?: string;
@@ -2816,13 +2813,13 @@ export interface gpuGPUTextureDescriptor {
2816
2813
  usage: number;
2817
2814
  viewFormats?: string[];
2818
2815
  }
2819
- export interface gpuGPUExtent3DDict {
2816
+ export interface GPUExtent3DDict {
2820
2817
  width: number;
2821
2818
  height?: number;
2822
2819
  depthOrArrayLayers?: number;
2823
2820
  }
2824
- export interface gpuGPUTexture {
2825
- createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
2821
+ export interface GPUTexture {
2822
+ createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
2826
2823
  destroy(): void;
2827
2824
  get width(): number;
2828
2825
  get height(): number;
@@ -2832,8 +2829,8 @@ export interface gpuGPUTexture {
2832
2829
  get format(): string;
2833
2830
  get usage(): number;
2834
2831
  }
2835
- export interface gpuGPUTextureView {}
2836
- export interface gpuGPUTextureViewDescriptor {
2832
+ export interface GPUTextureView {}
2833
+ export interface GPUTextureViewDescriptor {
2837
2834
  label: string;
2838
2835
  format: string;
2839
2836
  dimension: string;
@@ -2843,91 +2840,91 @@ export interface gpuGPUTextureViewDescriptor {
2843
2840
  baseArrayLayer?: number;
2844
2841
  arrayLayerCount: number;
2845
2842
  }
2846
- export declare abstract class gpuGPUColorWrite {
2843
+ export declare abstract class GPUColorWrite {
2847
2844
  static readonly RED: number;
2848
2845
  static readonly GREEN: number;
2849
2846
  static readonly BLUE: number;
2850
2847
  static readonly ALPHA: number;
2851
2848
  static readonly ALL: number;
2852
2849
  }
2853
- export interface gpuGPURenderPipeline {}
2854
- export interface gpuGPURenderPipelineDescriptor {
2850
+ export interface GPURenderPipeline {}
2851
+ export interface GPURenderPipelineDescriptor {
2855
2852
  label?: string;
2856
- layout: string | gpuGPUPipelineLayout;
2857
- vertex: gpuGPUVertexState;
2858
- primitive?: gpuGPUPrimitiveState;
2859
- depthStencil?: gpuGPUDepthStencilState;
2860
- multisample?: gpuGPUMultisampleState;
2861
- fragment?: gpuGPUFragmentState;
2862
- }
2863
- export interface gpuGPUVertexState {
2864
- module: gpuGPUShaderModule;
2853
+ layout: string | GPUPipelineLayout;
2854
+ vertex: GPUVertexState;
2855
+ primitive?: GPUPrimitiveState;
2856
+ depthStencil?: GPUDepthStencilState;
2857
+ multisample?: GPUMultisampleState;
2858
+ fragment?: GPUFragmentState;
2859
+ }
2860
+ export interface GPUVertexState {
2861
+ module: GPUShaderModule;
2865
2862
  entryPoint: string;
2866
2863
  constants?: Record<string, number>;
2867
- buffers?: gpuGPUVertexBufferLayout[];
2864
+ buffers?: GPUVertexBufferLayout[];
2868
2865
  }
2869
- export interface gpuGPUVertexBufferLayout {
2866
+ export interface GPUVertexBufferLayout {
2870
2867
  arrayStride: number | bigint;
2871
2868
  stepMode?: string;
2872
- attributes: gpuGPUVertexAttribute[];
2869
+ attributes: GPUVertexAttribute[];
2873
2870
  }
2874
- export interface gpuGPUVertexAttribute {
2871
+ export interface GPUVertexAttribute {
2875
2872
  format: string;
2876
2873
  offset: number | bigint;
2877
2874
  shaderLocation: number;
2878
2875
  }
2879
- export interface gpuGPUPrimitiveState {
2876
+ export interface GPUPrimitiveState {
2880
2877
  topology?: string;
2881
2878
  stripIndexFormat?: string;
2882
2879
  frontFace?: string;
2883
2880
  cullMode?: string;
2884
2881
  unclippedDepth?: boolean;
2885
2882
  }
2886
- export interface gpuGPUStencilFaceState {
2883
+ export interface GPUStencilFaceState {
2887
2884
  compare?: string;
2888
2885
  failOp?: string;
2889
2886
  depthFailOp?: string;
2890
2887
  passOp?: string;
2891
2888
  }
2892
- export interface gpuGPUDepthStencilState {
2889
+ export interface GPUDepthStencilState {
2893
2890
  format: string;
2894
2891
  depthWriteEnabled: boolean;
2895
2892
  depthCompare: string;
2896
- stencilFront?: gpuGPUStencilFaceState;
2897
- stencilBack?: gpuGPUStencilFaceState;
2893
+ stencilFront?: GPUStencilFaceState;
2894
+ stencilBack?: GPUStencilFaceState;
2898
2895
  stencilReadMask?: number;
2899
2896
  stencilWriteMask?: number;
2900
2897
  depthBias?: number;
2901
2898
  depthBiasSlopeScale?: number;
2902
2899
  depthBiasClamp?: number;
2903
2900
  }
2904
- export interface gpuGPUMultisampleState {
2901
+ export interface GPUMultisampleState {
2905
2902
  count?: number;
2906
2903
  mask?: number;
2907
2904
  alphaToCoverageEnabled?: boolean;
2908
2905
  }
2909
- export interface gpuGPUFragmentState {
2910
- module: gpuGPUShaderModule;
2906
+ export interface GPUFragmentState {
2907
+ module: GPUShaderModule;
2911
2908
  entryPoint: string;
2912
2909
  constants?: Record<string, number>;
2913
- targets: gpuGPUColorTargetState[];
2910
+ targets: GPUColorTargetState[];
2914
2911
  }
2915
- export interface gpuGPUColorTargetState {
2912
+ export interface GPUColorTargetState {
2916
2913
  format: string;
2917
- blend: gpuGPUBlendState;
2914
+ blend: GPUBlendState;
2918
2915
  writeMask?: number;
2919
2916
  }
2920
- export interface gpuGPUBlendState {
2921
- color: gpuGPUBlendComponent;
2922
- alpha: gpuGPUBlendComponent;
2917
+ export interface GPUBlendState {
2918
+ color: GPUBlendComponent;
2919
+ alpha: GPUBlendComponent;
2923
2920
  }
2924
- export interface gpuGPUBlendComponent {
2921
+ export interface GPUBlendComponent {
2925
2922
  operation?: string;
2926
2923
  srcFactor?: string;
2927
2924
  dstFactor?: string;
2928
2925
  }
2929
- export interface gpuGPURenderPassEncoder {
2930
- setPipeline(pipeline: gpuGPURenderPipeline): void;
2926
+ export interface GPURenderPassEncoder {
2927
+ setPipeline(pipeline: GPURenderPipeline): void;
2931
2928
  draw(
2932
2929
  vertexCount: number,
2933
2930
  instanceCount?: number,
@@ -2936,30 +2933,30 @@ export interface gpuGPURenderPassEncoder {
2936
2933
  ): void;
2937
2934
  end(): void;
2938
2935
  }
2939
- export interface gpuGPURenderPassDescriptor {
2936
+ export interface GPURenderPassDescriptor {
2940
2937
  label?: string;
2941
- colorAttachments: gpuGPURenderPassColorAttachment[];
2942
- depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2943
- occlusionQuerySet?: gpuGPUQuerySet;
2944
- timestampWrites?: gpuGPURenderPassTimestampWrites;
2938
+ colorAttachments: GPURenderPassColorAttachment[];
2939
+ depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
2940
+ occlusionQuerySet?: GPUQuerySet;
2941
+ timestampWrites?: GPURenderPassTimestampWrites;
2945
2942
  maxDrawCount?: number | bigint;
2946
2943
  }
2947
- export interface gpuGPURenderPassColorAttachment {
2948
- view: gpuGPUTextureView;
2944
+ export interface GPURenderPassColorAttachment {
2945
+ view: GPUTextureView;
2949
2946
  depthSlice?: number;
2950
- resolveTarget?: gpuGPUTextureView;
2951
- clearValue?: number[] | gpuGPUColorDict;
2947
+ resolveTarget?: GPUTextureView;
2948
+ clearValue?: number[] | GPUColorDict;
2952
2949
  loadOp: string;
2953
2950
  storeOp: string;
2954
2951
  }
2955
- export interface gpuGPUColorDict {
2952
+ export interface GPUColorDict {
2956
2953
  r: number;
2957
2954
  g: number;
2958
2955
  b: number;
2959
2956
  a: number;
2960
2957
  }
2961
- export interface gpuGPURenderPassDepthStencilAttachment {
2962
- view: gpuGPUTextureView;
2958
+ export interface GPURenderPassDepthStencilAttachment {
2959
+ view: GPUTextureView;
2963
2960
  depthClearValue?: number;
2964
2961
  depthLoadOp?: string;
2965
2962
  depthStoreOp?: string;
@@ -2969,28 +2966,75 @@ export interface gpuGPURenderPassDepthStencilAttachment {
2969
2966
  stencilStoreOp?: string;
2970
2967
  stencilReadOnly?: boolean;
2971
2968
  }
2972
- export interface gpuGPURenderPassTimestampWrites {
2973
- querySet: gpuGPUQuerySet;
2969
+ export interface GPURenderPassTimestampWrites {
2970
+ querySet: GPUQuerySet;
2974
2971
  beginningOfPassWriteIndex?: number;
2975
2972
  endOfPassWriteIndex?: number;
2976
2973
  }
2977
- export interface gpuGPUImageCopyTexture {
2978
- texture: gpuGPUTexture;
2974
+ export interface GPUImageCopyTexture {
2975
+ texture: GPUTexture;
2979
2976
  mipLevel?: number;
2980
- origin?: number[] | gpuGPUOrigin3DDict;
2977
+ origin?: number[] | GPUOrigin3DDict;
2981
2978
  aspect?: string;
2982
2979
  }
2983
- export interface gpuGPUImageCopyBuffer {
2984
- buffer: gpuGPUBuffer;
2980
+ export interface GPUImageCopyBuffer {
2981
+ buffer: GPUBuffer;
2985
2982
  offset?: number | bigint;
2986
2983
  bytesPerRow?: number;
2987
2984
  rowsPerImage?: number;
2988
2985
  }
2989
- export interface gpuGPUOrigin3DDict {
2986
+ export interface GPUOrigin3DDict {
2990
2987
  x?: number;
2991
2988
  y?: number;
2992
2989
  z?: number;
2993
2990
  }
2991
+ export declare class EventSource {
2992
+ constructor(url: string, init?: EventSourceEventSourceInit);
2993
+ /**
2994
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
2995
+ *
2996
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
2997
+ */
2998
+ close(): void;
2999
+ /**
3000
+ * Returns the URL providing the event stream.
3001
+ *
3002
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3003
+ */
3004
+ get url(): string;
3005
+ /**
3006
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3007
+ *
3008
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3009
+ */
3010
+ get withCredentials(): boolean;
3011
+ /**
3012
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3013
+ *
3014
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3015
+ */
3016
+ get readyState(): number;
3017
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3018
+ get onopen(): any | null;
3019
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3020
+ set onopen(value: any | null);
3021
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3022
+ get onmessage(): any | null;
3023
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3024
+ set onmessage(value: any | null);
3025
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3026
+ get onerror(): any | null;
3027
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3028
+ set onerror(value: any | null);
3029
+ static readonly CONNECTING: number;
3030
+ static readonly OPEN: number;
3031
+ static readonly CLOSED: number;
3032
+ static from(stream: ReadableStream): EventSource;
3033
+ }
3034
+ export interface EventSourceEventSourceInit {
3035
+ withCredentials?: boolean;
3036
+ fetcher?: Fetcher;
3037
+ }
2994
3038
  export type AiImageClassificationInput = {
2995
3039
  image: number[];
2996
3040
  };
@@ -3985,7 +4029,7 @@ export interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
3985
4029
  certNotAfter: "";
3986
4030
  }
3987
4031
  /** Possible outcomes of TLS verification */
3988
- export type CertVerificationStatus =
4032
+ export declare type CertVerificationStatus =
3989
4033
  /** Authentication succeeded */
3990
4034
  | "SUCCESS"
3991
4035
  /** No certificate was presented */
@@ -4003,7 +4047,7 @@ export type CertVerificationStatus =
4003
4047
  /**
4004
4048
  * An upstream endpoint's response to a TCP `keepalive` message from Cloudflare.
4005
4049
  */
4006
- export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
4050
+ export declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
4007
4051
  | 0 /** Unknown */
4008
4052
  | 1 /** no keepalives (not found) */
4009
4053
  | 2 /** no connection re-use, opening keepalive connection failed */
@@ -4011,7 +4055,7 @@ export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
4011
4055
  | 4 /** connection re-use, refused by the origin server (`TCP FIN`) */
4012
4056
  | 5; /** connection re-use, accepted by the origin server */
4013
4057
  /** ISO 3166-1 Alpha-2 codes */
4014
- export type Iso3166Alpha2Code =
4058
+ export declare type Iso3166Alpha2Code =
4015
4059
  | "AD"
4016
4060
  | "AE"
4017
4061
  | "AF"
@@ -4262,7 +4306,14 @@ export type Iso3166Alpha2Code =
4262
4306
  | "ZM"
4263
4307
  | "ZW";
4264
4308
  /** The 2-letter continent codes Cloudflare uses */
4265
- export type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
4309
+ export declare type ContinentCode =
4310
+ | "AF"
4311
+ | "AN"
4312
+ | "AS"
4313
+ | "EU"
4314
+ | "NA"
4315
+ | "OC"
4316
+ | "SA";
4266
4317
  export type CfProperties<HostMetadata = unknown> =
4267
4318
  | IncomingRequestCfProperties<HostMetadata>
4268
4319
  | RequestInitCfProperties;
@@ -4363,7 +4414,7 @@ export interface SendEmail {
4363
4414
  export declare abstract class EmailEvent extends ExtendableEvent {
4364
4415
  readonly message: ForwardableEmailMessage;
4365
4416
  }
4366
- export type EmailExportedHandler<Env = unknown> = (
4417
+ export declare type EmailExportedHandler<Env = unknown> = (
4367
4418
  message: ForwardableEmailMessage,
4368
4419
  env: Env,
4369
4420
  ctx: ExecutionContext,
@@ -4492,6 +4543,20 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
4492
4543
  // Key Identifier of the JWK
4493
4544
  readonly kid: string;
4494
4545
  }
4546
+ export interface RateLimitOptions {
4547
+ key: string;
4548
+ }
4549
+ export interface RateLimitOutcome {
4550
+ success: boolean;
4551
+ }
4552
+ export interface RateLimit {
4553
+ /**
4554
+ * Rate limit a request based on the provided options.
4555
+ * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
4556
+ * @returns A promise that resolves with the outcome of the rate limit.
4557
+ */
4558
+ limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
4559
+ }
4495
4560
  // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
4496
4561
  // to referenced by `Fetcher`. This is included in the "importable" version of the types which
4497
4562
  // strips all `module` blocks.