@cloudflare/workers-types 4.20240925.0 → 4.20241004.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.
@@ -14,6 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
  /* eslint-disable */
16
16
  // noinspection JSUnusedGlobalSymbols
17
+ declare var onmessage: never;
17
18
  /**
18
19
  * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
19
20
  *
@@ -1517,12 +1518,18 @@ declare abstract class Body {
1517
1518
  *
1518
1519
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1519
1520
  */
1520
- declare class Response extends Body {
1521
- constructor(body?: BodyInit | null, init?: ResponseInit);
1522
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
1523
- static redirect(url: string, status?: number): Response;
1524
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
1525
- static json(any: any, maybeInit?: ResponseInit | Response): Response;
1521
+ declare var Response: {
1522
+ prototype: Response;
1523
+ new (body?: BodyInit | null, init?: ResponseInit): Response;
1524
+ redirect(url: string, status?: number): Response;
1525
+ json(any: any, maybeInit?: ResponseInit | Response): Response;
1526
+ };
1527
+ /**
1528
+ * This Fetch API interface represents the response to a request.
1529
+ *
1530
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1531
+ */
1532
+ interface Response extends Body {
1526
1533
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1527
1534
  clone(): Response;
1528
1535
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
@@ -1557,11 +1564,20 @@ type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
1557
1564
  *
1558
1565
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1559
1566
  */
1560
- declare class Request<
1561
- CfHostMetadata = unknown,
1562
- Cf = CfProperties<CfHostMetadata>,
1563
- > extends Body {
1564
- constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
1567
+ declare var Request: {
1568
+ prototype: Request;
1569
+ new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
1570
+ input: RequestInfo<CfProperties>,
1571
+ init?: RequestInit<Cf>,
1572
+ ): Request<CfHostMetadata, Cf>;
1573
+ };
1574
+ /**
1575
+ * This Fetch API interface represents a resource request.
1576
+ *
1577
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1578
+ */
1579
+ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>
1580
+ extends Body {
1565
1581
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1566
1582
  clone(): Request<CfHostMetadata, Cf>;
1567
1583
  /**
@@ -2292,7 +2308,7 @@ declare class TextDecoderStream extends TransformStream<
2292
2308
  ArrayBuffer | ArrayBufferView,
2293
2309
  string
2294
2310
  > {
2295
- constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2311
+ constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2296
2312
  get encoding(): string;
2297
2313
  get fatal(): boolean;
2298
2314
  get ignoreBOM(): boolean;
@@ -2662,8 +2678,24 @@ type WebSocketEventMap = {
2662
2678
  *
2663
2679
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2664
2680
  */
2665
- declare class WebSocket extends EventTarget<WebSocketEventMap> {
2666
- constructor(url: string, protocols?: string[] | string);
2681
+ declare var WebSocket: {
2682
+ prototype: WebSocket;
2683
+ new (url: string, protocols?: string[] | string): WebSocket;
2684
+ readonly READY_STATE_CONNECTING: number;
2685
+ readonly CONNECTING: number;
2686
+ readonly READY_STATE_OPEN: number;
2687
+ readonly OPEN: number;
2688
+ readonly READY_STATE_CLOSING: number;
2689
+ readonly CLOSING: number;
2690
+ readonly READY_STATE_CLOSED: number;
2691
+ readonly CLOSED: number;
2692
+ };
2693
+ /**
2694
+ * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2695
+ *
2696
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2697
+ */
2698
+ interface WebSocket extends EventTarget<WebSocketEventMap> {
2667
2699
  accept(): void;
2668
2700
  /**
2669
2701
  * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
@@ -2679,14 +2711,6 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
2679
2711
  close(code?: number, reason?: string): void;
2680
2712
  serializeAttachment(attachment: any): void;
2681
2713
  deserializeAttachment(): any | null;
2682
- static readonly READY_STATE_CONNECTING: number;
2683
- static readonly CONNECTING: number;
2684
- static readonly READY_STATE_OPEN: number;
2685
- static readonly OPEN: number;
2686
- static readonly READY_STATE_CLOSING: number;
2687
- static readonly CLOSING: number;
2688
- static readonly READY_STATE_CLOSED: number;
2689
- static readonly CLOSED: number;
2690
2714
  /**
2691
2715
  * Returns the state of the WebSocket object's connection. It can have the values described below.
2692
2716
  *
@@ -3484,7 +3508,7 @@ type AiTextToImageInput = {
3484
3508
  strength?: number;
3485
3509
  guidance?: number;
3486
3510
  };
3487
- type AiTextToImageOutput = Uint8Array;
3511
+ type AiTextToImageOutput = ReadableStream<Uint8Array>;
3488
3512
  declare abstract class BaseAiTextToImage {
3489
3513
  inputs: AiTextToImageInput;
3490
3514
  postProcessedOutputs: AiTextToImageOutput;
@@ -4761,7 +4785,7 @@ interface Hyperdrive {
4761
4785
  // Copyright (c) 2024 Cloudflare, Inc.
4762
4786
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4763
4787
  // https://opensource.org/licenses/Apache-2.0
4764
- type InfoResponse =
4788
+ type ImageInfoResponse =
4765
4789
  | {
4766
4790
  format: "image/svg+xml";
4767
4791
  }
@@ -4771,7 +4795,7 @@ type InfoResponse =
4771
4795
  width: number;
4772
4796
  height: number;
4773
4797
  };
4774
- type Transform = {
4798
+ type ImageTransform = {
4775
4799
  fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
4776
4800
  gravity?:
4777
4801
  | "left"
@@ -4821,7 +4845,7 @@ type Transform = {
4821
4845
  };
4822
4846
  zoom?: number;
4823
4847
  };
4824
- type OutputOptions = {
4848
+ type ImageOutputOptions = {
4825
4849
  format:
4826
4850
  | "image/jpeg"
4827
4851
  | "image/png"
@@ -4839,7 +4863,7 @@ interface ImagesBinding {
4839
4863
  * @throws {@link ImagesError} with code 9412 if input is not an image
4840
4864
  * @param stream The image bytes
4841
4865
  */
4842
- info(stream: ReadableStream<Uint8Array>): Promise<InfoResponse>;
4866
+ info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
4843
4867
  /**
4844
4868
  * Begin applying a series of transformations to an image
4845
4869
  * @param stream The image bytes
@@ -4853,15 +4877,15 @@ interface ImageTransformer {
4853
4877
  * You can then apply more transformations or retrieve the output.
4854
4878
  * @param transform
4855
4879
  */
4856
- transform(transform: Transform): ImageTransformer;
4880
+ transform(transform: ImageTransform): ImageTransformer;
4857
4881
  /**
4858
4882
  * Retrieve the image that results from applying the transforms to the
4859
4883
  * provided input
4860
4884
  * @param options Options that apply to the output e.g. output format
4861
4885
  */
4862
- output(options: OutputOptions): Promise<TransformationResult>;
4886
+ output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
4863
4887
  }
4864
- interface TransformationResult {
4888
+ interface ImageTransformationResult {
4865
4889
  /**
4866
4890
  * The image as a response, ready to store in cache or return to users
4867
4891
  */
@@ -14,6 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
  /* eslint-disable */
16
16
  // noinspection JSUnusedGlobalSymbols
17
+ export declare var onmessage: never;
17
18
  /**
18
19
  * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
19
20
  *
@@ -1522,12 +1523,18 @@ export declare abstract class Body {
1522
1523
  *
1523
1524
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1524
1525
  */
1525
- export declare class Response extends Body {
1526
- constructor(body?: BodyInit | null, init?: ResponseInit);
1527
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
1528
- static redirect(url: string, status?: number): Response;
1529
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
1530
- static json(any: any, maybeInit?: ResponseInit | Response): Response;
1526
+ export declare var Response: {
1527
+ prototype: Response;
1528
+ new (body?: BodyInit | null, init?: ResponseInit): Response;
1529
+ redirect(url: string, status?: number): Response;
1530
+ json(any: any, maybeInit?: ResponseInit | Response): Response;
1531
+ };
1532
+ /**
1533
+ * This Fetch API interface represents the response to a request.
1534
+ *
1535
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1536
+ */
1537
+ export interface Response extends Body {
1531
1538
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1532
1539
  clone(): Response;
1533
1540
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
@@ -1562,11 +1569,22 @@ export type RequestInfo<
1562
1569
  *
1563
1570
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1564
1571
  */
1565
- export declare class Request<
1572
+ export declare var Request: {
1573
+ prototype: Request;
1574
+ new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
1575
+ input: RequestInfo<CfProperties>,
1576
+ init?: RequestInit<Cf>,
1577
+ ): Request<CfHostMetadata, Cf>;
1578
+ };
1579
+ /**
1580
+ * This Fetch API interface represents a resource request.
1581
+ *
1582
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1583
+ */
1584
+ export interface Request<
1566
1585
  CfHostMetadata = unknown,
1567
1586
  Cf = CfProperties<CfHostMetadata>,
1568
1587
  > extends Body {
1569
- constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
1570
1588
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1571
1589
  clone(): Request<CfHostMetadata, Cf>;
1572
1590
  /**
@@ -2301,7 +2319,7 @@ export declare class TextDecoderStream extends TransformStream<
2301
2319
  ArrayBuffer | ArrayBufferView,
2302
2320
  string
2303
2321
  > {
2304
- constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2322
+ constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2305
2323
  get encoding(): string;
2306
2324
  get fatal(): boolean;
2307
2325
  get ignoreBOM(): boolean;
@@ -2671,8 +2689,24 @@ export type WebSocketEventMap = {
2671
2689
  *
2672
2690
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2673
2691
  */
2674
- export declare class WebSocket extends EventTarget<WebSocketEventMap> {
2675
- constructor(url: string, protocols?: string[] | string);
2692
+ export declare var WebSocket: {
2693
+ prototype: WebSocket;
2694
+ new (url: string, protocols?: string[] | string): WebSocket;
2695
+ readonly READY_STATE_CONNECTING: number;
2696
+ readonly CONNECTING: number;
2697
+ readonly READY_STATE_OPEN: number;
2698
+ readonly OPEN: number;
2699
+ readonly READY_STATE_CLOSING: number;
2700
+ readonly CLOSING: number;
2701
+ readonly READY_STATE_CLOSED: number;
2702
+ readonly CLOSED: number;
2703
+ };
2704
+ /**
2705
+ * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2706
+ *
2707
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2708
+ */
2709
+ export interface WebSocket extends EventTarget<WebSocketEventMap> {
2676
2710
  accept(): void;
2677
2711
  /**
2678
2712
  * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
@@ -2688,14 +2722,6 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
2688
2722
  close(code?: number, reason?: string): void;
2689
2723
  serializeAttachment(attachment: any): void;
2690
2724
  deserializeAttachment(): any | null;
2691
- static readonly READY_STATE_CONNECTING: number;
2692
- static readonly CONNECTING: number;
2693
- static readonly READY_STATE_OPEN: number;
2694
- static readonly OPEN: number;
2695
- static readonly READY_STATE_CLOSING: number;
2696
- static readonly CLOSING: number;
2697
- static readonly READY_STATE_CLOSED: number;
2698
- static readonly CLOSED: number;
2699
2725
  /**
2700
2726
  * Returns the state of the WebSocket object's connection. It can have the values described below.
2701
2727
  *
@@ -3493,7 +3519,7 @@ export type AiTextToImageInput = {
3493
3519
  strength?: number;
3494
3520
  guidance?: number;
3495
3521
  };
3496
- export type AiTextToImageOutput = Uint8Array;
3522
+ export type AiTextToImageOutput = ReadableStream<Uint8Array>;
3497
3523
  export declare abstract class BaseAiTextToImage {
3498
3524
  inputs: AiTextToImageInput;
3499
3525
  postProcessedOutputs: AiTextToImageOutput;
@@ -4776,7 +4802,7 @@ export interface Hyperdrive {
4776
4802
  // Copyright (c) 2024 Cloudflare, Inc.
4777
4803
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4778
4804
  // https://opensource.org/licenses/Apache-2.0
4779
- export type InfoResponse =
4805
+ export type ImageInfoResponse =
4780
4806
  | {
4781
4807
  format: "image/svg+xml";
4782
4808
  }
@@ -4786,7 +4812,7 @@ export type InfoResponse =
4786
4812
  width: number;
4787
4813
  height: number;
4788
4814
  };
4789
- export type Transform = {
4815
+ export type ImageTransform = {
4790
4816
  fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
4791
4817
  gravity?:
4792
4818
  | "left"
@@ -4836,7 +4862,7 @@ export type Transform = {
4836
4862
  };
4837
4863
  zoom?: number;
4838
4864
  };
4839
- export type OutputOptions = {
4865
+ export type ImageOutputOptions = {
4840
4866
  format:
4841
4867
  | "image/jpeg"
4842
4868
  | "image/png"
@@ -4854,7 +4880,7 @@ export interface ImagesBinding {
4854
4880
  * @throws {@link ImagesError} with code 9412 if input is not an image
4855
4881
  * @param stream The image bytes
4856
4882
  */
4857
- info(stream: ReadableStream<Uint8Array>): Promise<InfoResponse>;
4883
+ info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
4858
4884
  /**
4859
4885
  * Begin applying a series of transformations to an image
4860
4886
  * @param stream The image bytes
@@ -4868,15 +4894,15 @@ export interface ImageTransformer {
4868
4894
  * You can then apply more transformations or retrieve the output.
4869
4895
  * @param transform
4870
4896
  */
4871
- transform(transform: Transform): ImageTransformer;
4897
+ transform(transform: ImageTransform): ImageTransformer;
4872
4898
  /**
4873
4899
  * Retrieve the image that results from applying the transforms to the
4874
4900
  * provided input
4875
4901
  * @param options Options that apply to the output e.g. output format
4876
4902
  */
4877
- output(options: OutputOptions): Promise<TransformationResult>;
4903
+ output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
4878
4904
  }
4879
- export interface TransformationResult {
4905
+ export interface ImageTransformationResult {
4880
4906
  /**
4881
4907
  * The image as a response, ready to store in cache or return to users
4882
4908
  */
@@ -14,6 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
  /* eslint-disable */
16
16
  // noinspection JSUnusedGlobalSymbols
17
+ declare var onmessage: never;
17
18
  /**
18
19
  * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
19
20
  *
@@ -1523,28 +1524,34 @@ declare abstract class Body {
1523
1524
  *
1524
1525
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1525
1526
  */
1526
- declare class Response extends Body {
1527
- constructor(body?: BodyInit | null, init?: ResponseInit);
1528
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
1529
- static redirect(url: string, status?: number): Response;
1530
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
1531
- static json(any: any, maybeInit?: ResponseInit | Response): Response;
1527
+ declare var Response: {
1528
+ prototype: Response;
1529
+ new (body?: BodyInit | null, init?: ResponseInit): Response;
1530
+ redirect(url: string, status?: number): Response;
1531
+ json(any: any, maybeInit?: ResponseInit | Response): Response;
1532
+ };
1533
+ /**
1534
+ * This Fetch API interface represents the response to a request.
1535
+ *
1536
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1537
+ */
1538
+ interface Response extends Body {
1532
1539
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1533
1540
  clone(): Response;
1534
1541
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1535
- get status(): number;
1542
+ status: number;
1536
1543
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1537
- get statusText(): string;
1544
+ statusText: string;
1538
1545
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1539
- get headers(): Headers;
1546
+ headers: Headers;
1540
1547
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1541
- get ok(): boolean;
1548
+ ok: boolean;
1542
1549
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1543
- get redirected(): boolean;
1550
+ redirected: boolean;
1544
1551
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1545
- get url(): string;
1546
- get webSocket(): WebSocket | null;
1547
- get cf(): any | undefined;
1552
+ url: string;
1553
+ webSocket: WebSocket | null;
1554
+ cf: any | undefined;
1548
1555
  }
1549
1556
  interface ResponseInit {
1550
1557
  status?: number;
@@ -1563,11 +1570,20 @@ type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
1563
1570
  *
1564
1571
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1565
1572
  */
1566
- declare class Request<
1567
- CfHostMetadata = unknown,
1568
- Cf = CfProperties<CfHostMetadata>,
1569
- > extends Body {
1570
- constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
1573
+ declare var Request: {
1574
+ prototype: Request;
1575
+ new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
1576
+ input: RequestInfo<CfProperties>,
1577
+ init?: RequestInit<Cf>,
1578
+ ): Request<CfHostMetadata, Cf>;
1579
+ };
1580
+ /**
1581
+ * This Fetch API interface represents a resource request.
1582
+ *
1583
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1584
+ */
1585
+ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>
1586
+ extends Body {
1571
1587
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1572
1588
  clone(): Request<CfHostMetadata, Cf>;
1573
1589
  /**
@@ -1575,45 +1591,45 @@ declare class Request<
1575
1591
  *
1576
1592
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1577
1593
  */
1578
- get method(): string;
1594
+ method: string;
1579
1595
  /**
1580
1596
  * Returns the URL of request as a string.
1581
1597
  *
1582
1598
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
1583
1599
  */
1584
- get url(): string;
1600
+ url: string;
1585
1601
  /**
1586
1602
  * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
1587
1603
  *
1588
1604
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1589
1605
  */
1590
- get headers(): Headers;
1606
+ headers: Headers;
1591
1607
  /**
1592
1608
  * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
1593
1609
  *
1594
1610
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
1595
1611
  */
1596
- get redirect(): string;
1597
- get fetcher(): Fetcher | null;
1612
+ redirect: string;
1613
+ fetcher: Fetcher | null;
1598
1614
  /**
1599
1615
  * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
1600
1616
  *
1601
1617
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
1602
1618
  */
1603
- get signal(): AbortSignal;
1604
- get cf(): Cf | undefined;
1619
+ signal: AbortSignal;
1620
+ cf: Cf | undefined;
1605
1621
  /**
1606
1622
  * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
1607
1623
  *
1608
1624
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
1609
1625
  */
1610
- get integrity(): string;
1626
+ integrity: string;
1611
1627
  /**
1612
1628
  * Returns a boolean indicating whether or not request can outlive the global in which it was created.
1613
1629
  *
1614
1630
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1615
1631
  */
1616
- get keepalive(): boolean;
1632
+ keepalive: boolean;
1617
1633
  }
1618
1634
  interface RequestInit<Cf = CfProperties> {
1619
1635
  /* A string to set request's method. */
@@ -2298,7 +2314,7 @@ declare class TextDecoderStream extends TransformStream<
2298
2314
  ArrayBuffer | ArrayBufferView,
2299
2315
  string
2300
2316
  > {
2301
- constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2317
+ constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2302
2318
  get encoding(): string;
2303
2319
  get fatal(): boolean;
2304
2320
  get ignoreBOM(): boolean;
@@ -2688,8 +2704,24 @@ type WebSocketEventMap = {
2688
2704
  *
2689
2705
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2690
2706
  */
2691
- declare class WebSocket extends EventTarget<WebSocketEventMap> {
2692
- constructor(url: string, protocols?: string[] | string);
2707
+ declare var WebSocket: {
2708
+ prototype: WebSocket;
2709
+ new (url: string, protocols?: string[] | string): WebSocket;
2710
+ readonly READY_STATE_CONNECTING: number;
2711
+ readonly CONNECTING: number;
2712
+ readonly READY_STATE_OPEN: number;
2713
+ readonly OPEN: number;
2714
+ readonly READY_STATE_CLOSING: number;
2715
+ readonly CLOSING: number;
2716
+ readonly READY_STATE_CLOSED: number;
2717
+ readonly CLOSED: number;
2718
+ };
2719
+ /**
2720
+ * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2721
+ *
2722
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2723
+ */
2724
+ interface WebSocket extends EventTarget<WebSocketEventMap> {
2693
2725
  accept(): void;
2694
2726
  /**
2695
2727
  * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
@@ -2705,38 +2737,30 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
2705
2737
  close(code?: number, reason?: string): void;
2706
2738
  serializeAttachment(attachment: any): void;
2707
2739
  deserializeAttachment(): any | null;
2708
- static readonly READY_STATE_CONNECTING: number;
2709
- static readonly CONNECTING: number;
2710
- static readonly READY_STATE_OPEN: number;
2711
- static readonly OPEN: number;
2712
- static readonly READY_STATE_CLOSING: number;
2713
- static readonly CLOSING: number;
2714
- static readonly READY_STATE_CLOSED: number;
2715
- static readonly CLOSED: number;
2716
2740
  /**
2717
2741
  * Returns the state of the WebSocket object's connection. It can have the values described below.
2718
2742
  *
2719
2743
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2720
2744
  */
2721
- get readyState(): number;
2745
+ readyState: number;
2722
2746
  /**
2723
2747
  * Returns the URL that was used to establish the WebSocket connection.
2724
2748
  *
2725
2749
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2726
2750
  */
2727
- get url(): string | null;
2751
+ url: string | null;
2728
2752
  /**
2729
2753
  * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
2730
2754
  *
2731
2755
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2732
2756
  */
2733
- get protocol(): string | null;
2757
+ protocol: string | null;
2734
2758
  /**
2735
2759
  * Returns the extensions selected by the server, if any.
2736
2760
  *
2737
2761
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2738
2762
  */
2739
- get extensions(): string | null;
2763
+ extensions: string | null;
2740
2764
  }
2741
2765
  declare const WebSocketPair: {
2742
2766
  new (): {
@@ -3510,7 +3534,7 @@ type AiTextToImageInput = {
3510
3534
  strength?: number;
3511
3535
  guidance?: number;
3512
3536
  };
3513
- type AiTextToImageOutput = Uint8Array;
3537
+ type AiTextToImageOutput = ReadableStream<Uint8Array>;
3514
3538
  declare abstract class BaseAiTextToImage {
3515
3539
  inputs: AiTextToImageInput;
3516
3540
  postProcessedOutputs: AiTextToImageOutput;
@@ -4787,7 +4811,7 @@ interface Hyperdrive {
4787
4811
  // Copyright (c) 2024 Cloudflare, Inc.
4788
4812
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4789
4813
  // https://opensource.org/licenses/Apache-2.0
4790
- type InfoResponse =
4814
+ type ImageInfoResponse =
4791
4815
  | {
4792
4816
  format: "image/svg+xml";
4793
4817
  }
@@ -4797,7 +4821,7 @@ type InfoResponse =
4797
4821
  width: number;
4798
4822
  height: number;
4799
4823
  };
4800
- type Transform = {
4824
+ type ImageTransform = {
4801
4825
  fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
4802
4826
  gravity?:
4803
4827
  | "left"
@@ -4847,7 +4871,7 @@ type Transform = {
4847
4871
  };
4848
4872
  zoom?: number;
4849
4873
  };
4850
- type OutputOptions = {
4874
+ type ImageOutputOptions = {
4851
4875
  format:
4852
4876
  | "image/jpeg"
4853
4877
  | "image/png"
@@ -4865,7 +4889,7 @@ interface ImagesBinding {
4865
4889
  * @throws {@link ImagesError} with code 9412 if input is not an image
4866
4890
  * @param stream The image bytes
4867
4891
  */
4868
- info(stream: ReadableStream<Uint8Array>): Promise<InfoResponse>;
4892
+ info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
4869
4893
  /**
4870
4894
  * Begin applying a series of transformations to an image
4871
4895
  * @param stream The image bytes
@@ -4879,15 +4903,15 @@ interface ImageTransformer {
4879
4903
  * You can then apply more transformations or retrieve the output.
4880
4904
  * @param transform
4881
4905
  */
4882
- transform(transform: Transform): ImageTransformer;
4906
+ transform(transform: ImageTransform): ImageTransformer;
4883
4907
  /**
4884
4908
  * Retrieve the image that results from applying the transforms to the
4885
4909
  * provided input
4886
4910
  * @param options Options that apply to the output e.g. output format
4887
4911
  */
4888
- output(options: OutputOptions): Promise<TransformationResult>;
4912
+ output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
4889
4913
  }
4890
- interface TransformationResult {
4914
+ interface ImageTransformationResult {
4891
4915
  /**
4892
4916
  * The image as a response, ready to store in cache or return to users
4893
4917
  */