@cloudflare/workers-types 4.20240924.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.
- package/2021-11-03/index.d.ts +54 -30
- package/2021-11-03/index.ts +53 -27
- package/2022-01-31/index.d.ts +75 -51
- package/2022-01-31/index.ts +74 -48
- package/2022-03-21/index.d.ts +75 -51
- package/2022-03-21/index.ts +74 -48
- package/2022-08-04/index.d.ts +75 -51
- package/2022-08-04/index.ts +74 -48
- package/2022-10-31/index.d.ts +82 -58
- package/2022-10-31/index.ts +81 -55
- package/2022-11-30/index.d.ts +82 -58
- package/2022-11-30/index.ts +81 -55
- package/2023-03-01/index.d.ts +82 -58
- package/2023-03-01/index.ts +81 -55
- package/2023-07-01/index.d.ts +84 -60
- package/2023-07-01/index.ts +83 -57
- package/experimental/index.d.ts +84 -60
- package/experimental/index.ts +83 -57
- package/index.d.ts +54 -30
- package/index.ts +53 -27
- package/oldest/index.d.ts +54 -30
- package/oldest/index.ts +53 -27
- package/package.json +1 -1
package/experimental/index.ts
CHANGED
|
@@ -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
|
*
|
|
@@ -1557,28 +1558,34 @@ export declare abstract class Body {
|
|
|
1557
1558
|
*
|
|
1558
1559
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1559
1560
|
*/
|
|
1560
|
-
export declare
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1561
|
+
export declare var Response: {
|
|
1562
|
+
prototype: Response;
|
|
1563
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
1564
|
+
redirect(url: string, status?: number): Response;
|
|
1565
|
+
json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1566
|
+
};
|
|
1567
|
+
/**
|
|
1568
|
+
* This Fetch API interface represents the response to a request.
|
|
1569
|
+
*
|
|
1570
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1571
|
+
*/
|
|
1572
|
+
export interface Response extends Body {
|
|
1566
1573
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1567
1574
|
clone(): Response;
|
|
1568
1575
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1569
|
-
|
|
1576
|
+
status: number;
|
|
1570
1577
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1571
|
-
|
|
1578
|
+
statusText: string;
|
|
1572
1579
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1573
|
-
|
|
1580
|
+
headers: Headers;
|
|
1574
1581
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1575
|
-
|
|
1582
|
+
ok: boolean;
|
|
1576
1583
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1577
|
-
|
|
1584
|
+
redirected: boolean;
|
|
1578
1585
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1586
|
+
url: string;
|
|
1587
|
+
webSocket: WebSocket | null;
|
|
1588
|
+
cf: any | undefined;
|
|
1582
1589
|
}
|
|
1583
1590
|
export interface ResponseInit {
|
|
1584
1591
|
status?: number;
|
|
@@ -1597,11 +1604,22 @@ export type RequestInfo<
|
|
|
1597
1604
|
*
|
|
1598
1605
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1599
1606
|
*/
|
|
1600
|
-
export declare
|
|
1607
|
+
export declare var Request: {
|
|
1608
|
+
prototype: Request;
|
|
1609
|
+
new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
|
|
1610
|
+
input: RequestInfo<CfProperties>,
|
|
1611
|
+
init?: RequestInit<Cf>,
|
|
1612
|
+
): Request<CfHostMetadata, Cf>;
|
|
1613
|
+
};
|
|
1614
|
+
/**
|
|
1615
|
+
* This Fetch API interface represents a resource request.
|
|
1616
|
+
*
|
|
1617
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1618
|
+
*/
|
|
1619
|
+
export interface Request<
|
|
1601
1620
|
CfHostMetadata = unknown,
|
|
1602
1621
|
Cf = CfProperties<CfHostMetadata>,
|
|
1603
1622
|
> extends Body {
|
|
1604
|
-
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1605
1623
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1606
1624
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1607
1625
|
/**
|
|
@@ -1609,45 +1627,45 @@ export declare class Request<
|
|
|
1609
1627
|
*
|
|
1610
1628
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1611
1629
|
*/
|
|
1612
|
-
|
|
1630
|
+
method: string;
|
|
1613
1631
|
/**
|
|
1614
1632
|
* Returns the URL of request as a string.
|
|
1615
1633
|
*
|
|
1616
1634
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1617
1635
|
*/
|
|
1618
|
-
|
|
1636
|
+
url: string;
|
|
1619
1637
|
/**
|
|
1620
1638
|
* 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.
|
|
1621
1639
|
*
|
|
1622
1640
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1623
1641
|
*/
|
|
1624
|
-
|
|
1642
|
+
headers: Headers;
|
|
1625
1643
|
/**
|
|
1626
1644
|
* 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.
|
|
1627
1645
|
*
|
|
1628
1646
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1629
1647
|
*/
|
|
1630
|
-
|
|
1631
|
-
|
|
1648
|
+
redirect: string;
|
|
1649
|
+
fetcher: Fetcher | null;
|
|
1632
1650
|
/**
|
|
1633
1651
|
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1634
1652
|
*
|
|
1635
1653
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1636
1654
|
*/
|
|
1637
|
-
|
|
1638
|
-
|
|
1655
|
+
signal: AbortSignal;
|
|
1656
|
+
cf: Cf | undefined;
|
|
1639
1657
|
/**
|
|
1640
1658
|
* 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]
|
|
1641
1659
|
*
|
|
1642
1660
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1643
1661
|
*/
|
|
1644
|
-
|
|
1662
|
+
integrity: string;
|
|
1645
1663
|
/**
|
|
1646
1664
|
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1647
1665
|
*
|
|
1648
1666
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1649
1667
|
*/
|
|
1650
|
-
|
|
1668
|
+
keepalive: boolean;
|
|
1651
1669
|
/**
|
|
1652
1670
|
* Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
|
|
1653
1671
|
*
|
|
@@ -2386,7 +2404,7 @@ export declare class TextDecoderStream extends TransformStream<
|
|
|
2386
2404
|
ArrayBuffer | ArrayBufferView,
|
|
2387
2405
|
string
|
|
2388
2406
|
> {
|
|
2389
|
-
constructor(
|
|
2407
|
+
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
|
|
2390
2408
|
get encoding(): string;
|
|
2391
2409
|
get fatal(): boolean;
|
|
2392
2410
|
get ignoreBOM(): boolean;
|
|
@@ -2600,13 +2618,13 @@ export declare class URL {
|
|
|
2600
2618
|
/*function toString() { [native code] }*/
|
|
2601
2619
|
toString(): string;
|
|
2602
2620
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2603
|
-
static canParse(
|
|
2604
|
-
static parse(
|
|
2621
|
+
static canParse(url: string, base?: string): boolean;
|
|
2622
|
+
static parse(url: string, base?: string): URL | null;
|
|
2605
2623
|
}
|
|
2606
2624
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2607
2625
|
export declare class URLSearchParams {
|
|
2608
2626
|
constructor(
|
|
2609
|
-
|
|
2627
|
+
init?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
2610
2628
|
);
|
|
2611
2629
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2612
2630
|
get size(): number;
|
|
@@ -2615,37 +2633,37 @@ export declare class URLSearchParams {
|
|
|
2615
2633
|
*
|
|
2616
2634
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2617
2635
|
*/
|
|
2618
|
-
append(
|
|
2636
|
+
append(name: string, value: string): void;
|
|
2619
2637
|
/**
|
|
2620
2638
|
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2621
2639
|
*
|
|
2622
2640
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
2623
2641
|
*/
|
|
2624
|
-
delete(
|
|
2642
|
+
delete(name: string, value?: string): void;
|
|
2625
2643
|
/**
|
|
2626
2644
|
* Returns the first value associated to the given search parameter.
|
|
2627
2645
|
*
|
|
2628
2646
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2629
2647
|
*/
|
|
2630
|
-
get(
|
|
2648
|
+
get(name: string): string | null;
|
|
2631
2649
|
/**
|
|
2632
2650
|
* Returns all the values association with a given search parameter.
|
|
2633
2651
|
*
|
|
2634
2652
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2635
2653
|
*/
|
|
2636
|
-
getAll(
|
|
2654
|
+
getAll(name: string): string[];
|
|
2637
2655
|
/**
|
|
2638
2656
|
* Returns a Boolean indicating if such a search parameter exists.
|
|
2639
2657
|
*
|
|
2640
2658
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
2641
2659
|
*/
|
|
2642
|
-
has(
|
|
2660
|
+
has(name: string, value?: string): boolean;
|
|
2643
2661
|
/**
|
|
2644
2662
|
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
2645
2663
|
*
|
|
2646
2664
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2647
2665
|
*/
|
|
2648
|
-
set(
|
|
2666
|
+
set(name: string, value: string): void;
|
|
2649
2667
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2650
2668
|
sort(): void;
|
|
2651
2669
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
@@ -2775,8 +2793,24 @@ export type WebSocketEventMap = {
|
|
|
2775
2793
|
*
|
|
2776
2794
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2777
2795
|
*/
|
|
2778
|
-
export declare
|
|
2779
|
-
|
|
2796
|
+
export declare var WebSocket: {
|
|
2797
|
+
prototype: WebSocket;
|
|
2798
|
+
new (url: string, protocols?: string[] | string): WebSocket;
|
|
2799
|
+
readonly READY_STATE_CONNECTING: number;
|
|
2800
|
+
readonly CONNECTING: number;
|
|
2801
|
+
readonly READY_STATE_OPEN: number;
|
|
2802
|
+
readonly OPEN: number;
|
|
2803
|
+
readonly READY_STATE_CLOSING: number;
|
|
2804
|
+
readonly CLOSING: number;
|
|
2805
|
+
readonly READY_STATE_CLOSED: number;
|
|
2806
|
+
readonly CLOSED: number;
|
|
2807
|
+
};
|
|
2808
|
+
/**
|
|
2809
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2810
|
+
*
|
|
2811
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2812
|
+
*/
|
|
2813
|
+
export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2780
2814
|
accept(): void;
|
|
2781
2815
|
/**
|
|
2782
2816
|
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
@@ -2792,38 +2826,30 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
2792
2826
|
close(code?: number, reason?: string): void;
|
|
2793
2827
|
serializeAttachment(attachment: any): void;
|
|
2794
2828
|
deserializeAttachment(): any | null;
|
|
2795
|
-
static readonly READY_STATE_CONNECTING: number;
|
|
2796
|
-
static readonly CONNECTING: number;
|
|
2797
|
-
static readonly READY_STATE_OPEN: number;
|
|
2798
|
-
static readonly OPEN: number;
|
|
2799
|
-
static readonly READY_STATE_CLOSING: number;
|
|
2800
|
-
static readonly CLOSING: number;
|
|
2801
|
-
static readonly READY_STATE_CLOSED: number;
|
|
2802
|
-
static readonly CLOSED: number;
|
|
2803
2829
|
/**
|
|
2804
2830
|
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2805
2831
|
*
|
|
2806
2832
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2807
2833
|
*/
|
|
2808
|
-
|
|
2834
|
+
readyState: number;
|
|
2809
2835
|
/**
|
|
2810
2836
|
* Returns the URL that was used to establish the WebSocket connection.
|
|
2811
2837
|
*
|
|
2812
2838
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2813
2839
|
*/
|
|
2814
|
-
|
|
2840
|
+
url: string | null;
|
|
2815
2841
|
/**
|
|
2816
2842
|
* 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.
|
|
2817
2843
|
*
|
|
2818
2844
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2819
2845
|
*/
|
|
2820
|
-
|
|
2846
|
+
protocol: string | null;
|
|
2821
2847
|
/**
|
|
2822
2848
|
* Returns the extensions selected by the server, if any.
|
|
2823
2849
|
*
|
|
2824
2850
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2825
2851
|
*/
|
|
2826
|
-
|
|
2852
|
+
extensions: string | null;
|
|
2827
2853
|
}
|
|
2828
2854
|
export declare const WebSocketPair: {
|
|
2829
2855
|
new (): {
|
|
@@ -3612,7 +3638,7 @@ export type AiTextToImageInput = {
|
|
|
3612
3638
|
strength?: number;
|
|
3613
3639
|
guidance?: number;
|
|
3614
3640
|
};
|
|
3615
|
-
export type AiTextToImageOutput = Uint8Array
|
|
3641
|
+
export type AiTextToImageOutput = ReadableStream<Uint8Array>;
|
|
3616
3642
|
export declare abstract class BaseAiTextToImage {
|
|
3617
3643
|
inputs: AiTextToImageInput;
|
|
3618
3644
|
postProcessedOutputs: AiTextToImageOutput;
|
|
@@ -4895,7 +4921,7 @@ export interface Hyperdrive {
|
|
|
4895
4921
|
// Copyright (c) 2024 Cloudflare, Inc.
|
|
4896
4922
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4897
4923
|
// https://opensource.org/licenses/Apache-2.0
|
|
4898
|
-
export type
|
|
4924
|
+
export type ImageInfoResponse =
|
|
4899
4925
|
| {
|
|
4900
4926
|
format: "image/svg+xml";
|
|
4901
4927
|
}
|
|
@@ -4905,7 +4931,7 @@ export type InfoResponse =
|
|
|
4905
4931
|
width: number;
|
|
4906
4932
|
height: number;
|
|
4907
4933
|
};
|
|
4908
|
-
export type
|
|
4934
|
+
export type ImageTransform = {
|
|
4909
4935
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
4910
4936
|
gravity?:
|
|
4911
4937
|
| "left"
|
|
@@ -4955,7 +4981,7 @@ export type Transform = {
|
|
|
4955
4981
|
};
|
|
4956
4982
|
zoom?: number;
|
|
4957
4983
|
};
|
|
4958
|
-
export type
|
|
4984
|
+
export type ImageOutputOptions = {
|
|
4959
4985
|
format:
|
|
4960
4986
|
| "image/jpeg"
|
|
4961
4987
|
| "image/png"
|
|
@@ -4973,7 +4999,7 @@ export interface ImagesBinding {
|
|
|
4973
4999
|
* @throws {@link ImagesError} with code 9412 if input is not an image
|
|
4974
5000
|
* @param stream The image bytes
|
|
4975
5001
|
*/
|
|
4976
|
-
info(stream: ReadableStream<Uint8Array>): Promise<
|
|
5002
|
+
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
|
|
4977
5003
|
/**
|
|
4978
5004
|
* Begin applying a series of transformations to an image
|
|
4979
5005
|
* @param stream The image bytes
|
|
@@ -4987,15 +5013,15 @@ export interface ImageTransformer {
|
|
|
4987
5013
|
* You can then apply more transformations or retrieve the output.
|
|
4988
5014
|
* @param transform
|
|
4989
5015
|
*/
|
|
4990
|
-
transform(transform:
|
|
5016
|
+
transform(transform: ImageTransform): ImageTransformer;
|
|
4991
5017
|
/**
|
|
4992
5018
|
* Retrieve the image that results from applying the transforms to the
|
|
4993
5019
|
* provided input
|
|
4994
5020
|
* @param options Options that apply to the output e.g. output format
|
|
4995
5021
|
*/
|
|
4996
|
-
output(options:
|
|
5022
|
+
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
|
|
4997
5023
|
}
|
|
4998
|
-
export interface
|
|
5024
|
+
export interface ImageTransformationResult {
|
|
4999
5025
|
/**
|
|
5000
5026
|
* The image as a response, ready to store in cache or return to users
|
|
5001
5027
|
*/
|
package/index.d.ts
CHANGED
|
@@ -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
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
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
|
|
1561
|
-
|
|
1562
|
-
Cf = CfProperties<CfHostMetadata
|
|
1563
|
-
|
|
1564
|
-
|
|
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(
|
|
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
|
|
2666
|
-
|
|
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
|
|
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
|
|
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
|
|
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<
|
|
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:
|
|
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:
|
|
4886
|
+
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
|
|
4863
4887
|
}
|
|
4864
|
-
interface
|
|
4888
|
+
interface ImageTransformationResult {
|
|
4865
4889
|
/**
|
|
4866
4890
|
* The image as a response, ready to store in cache or return to users
|
|
4867
4891
|
*/
|