@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.
- 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/2022-03-21/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
|
*
|
|
@@ -1545,28 +1546,34 @@ export declare abstract class Body {
|
|
|
1545
1546
|
*
|
|
1546
1547
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1547
1548
|
*/
|
|
1548
|
-
export declare
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1549
|
+
export declare var Response: {
|
|
1550
|
+
prototype: Response;
|
|
1551
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
1552
|
+
redirect(url: string, status?: number): Response;
|
|
1553
|
+
json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1554
|
+
};
|
|
1555
|
+
/**
|
|
1556
|
+
* This Fetch API interface represents the response to a request.
|
|
1557
|
+
*
|
|
1558
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1559
|
+
*/
|
|
1560
|
+
export interface Response extends Body {
|
|
1554
1561
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1555
1562
|
clone(): Response;
|
|
1556
1563
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1557
|
-
|
|
1564
|
+
status: number;
|
|
1558
1565
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1559
|
-
|
|
1566
|
+
statusText: string;
|
|
1560
1567
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1561
|
-
|
|
1568
|
+
headers: Headers;
|
|
1562
1569
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1563
|
-
|
|
1570
|
+
ok: boolean;
|
|
1564
1571
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1565
|
-
|
|
1572
|
+
redirected: boolean;
|
|
1566
1573
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1574
|
+
url: string;
|
|
1575
|
+
webSocket: WebSocket | null;
|
|
1576
|
+
cf: any | undefined;
|
|
1570
1577
|
}
|
|
1571
1578
|
export interface ResponseInit {
|
|
1572
1579
|
status?: number;
|
|
@@ -1585,11 +1592,22 @@ export type RequestInfo<
|
|
|
1585
1592
|
*
|
|
1586
1593
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1587
1594
|
*/
|
|
1588
|
-
export declare
|
|
1595
|
+
export declare var Request: {
|
|
1596
|
+
prototype: Request;
|
|
1597
|
+
new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
|
|
1598
|
+
input: RequestInfo<CfProperties>,
|
|
1599
|
+
init?: RequestInit<Cf>,
|
|
1600
|
+
): Request<CfHostMetadata, Cf>;
|
|
1601
|
+
};
|
|
1602
|
+
/**
|
|
1603
|
+
* This Fetch API interface represents a resource request.
|
|
1604
|
+
*
|
|
1605
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1606
|
+
*/
|
|
1607
|
+
export interface Request<
|
|
1589
1608
|
CfHostMetadata = unknown,
|
|
1590
1609
|
Cf = CfProperties<CfHostMetadata>,
|
|
1591
1610
|
> extends Body {
|
|
1592
|
-
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1593
1611
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1594
1612
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1595
1613
|
/**
|
|
@@ -1597,45 +1615,45 @@ export declare class Request<
|
|
|
1597
1615
|
*
|
|
1598
1616
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1599
1617
|
*/
|
|
1600
|
-
|
|
1618
|
+
method: string;
|
|
1601
1619
|
/**
|
|
1602
1620
|
* Returns the URL of request as a string.
|
|
1603
1621
|
*
|
|
1604
1622
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1605
1623
|
*/
|
|
1606
|
-
|
|
1624
|
+
url: string;
|
|
1607
1625
|
/**
|
|
1608
1626
|
* 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.
|
|
1609
1627
|
*
|
|
1610
1628
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1611
1629
|
*/
|
|
1612
|
-
|
|
1630
|
+
headers: Headers;
|
|
1613
1631
|
/**
|
|
1614
1632
|
* 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.
|
|
1615
1633
|
*
|
|
1616
1634
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1617
1635
|
*/
|
|
1618
|
-
|
|
1619
|
-
|
|
1636
|
+
redirect: string;
|
|
1637
|
+
fetcher: Fetcher | null;
|
|
1620
1638
|
/**
|
|
1621
1639
|
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1622
1640
|
*
|
|
1623
1641
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1624
1642
|
*/
|
|
1625
|
-
|
|
1626
|
-
|
|
1643
|
+
signal: AbortSignal;
|
|
1644
|
+
cf: Cf | undefined;
|
|
1627
1645
|
/**
|
|
1628
1646
|
* 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]
|
|
1629
1647
|
*
|
|
1630
1648
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1631
1649
|
*/
|
|
1632
|
-
|
|
1650
|
+
integrity: string;
|
|
1633
1651
|
/**
|
|
1634
1652
|
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1635
1653
|
*
|
|
1636
1654
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1637
1655
|
*/
|
|
1638
|
-
|
|
1656
|
+
keepalive: boolean;
|
|
1639
1657
|
}
|
|
1640
1658
|
export interface RequestInit<Cf = CfProperties> {
|
|
1641
1659
|
/* A string to set request's method. */
|
|
@@ -2324,7 +2342,7 @@ export declare class TextDecoderStream extends TransformStream<
|
|
|
2324
2342
|
ArrayBuffer | ArrayBufferView,
|
|
2325
2343
|
string
|
|
2326
2344
|
> {
|
|
2327
|
-
constructor(
|
|
2345
|
+
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
|
|
2328
2346
|
get encoding(): string;
|
|
2329
2347
|
get fatal(): boolean;
|
|
2330
2348
|
get ignoreBOM(): boolean;
|
|
@@ -2714,8 +2732,24 @@ export type WebSocketEventMap = {
|
|
|
2714
2732
|
*
|
|
2715
2733
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2716
2734
|
*/
|
|
2717
|
-
export declare
|
|
2718
|
-
|
|
2735
|
+
export declare var WebSocket: {
|
|
2736
|
+
prototype: WebSocket;
|
|
2737
|
+
new (url: string, protocols?: string[] | string): WebSocket;
|
|
2738
|
+
readonly READY_STATE_CONNECTING: number;
|
|
2739
|
+
readonly CONNECTING: number;
|
|
2740
|
+
readonly READY_STATE_OPEN: number;
|
|
2741
|
+
readonly OPEN: number;
|
|
2742
|
+
readonly READY_STATE_CLOSING: number;
|
|
2743
|
+
readonly CLOSING: number;
|
|
2744
|
+
readonly READY_STATE_CLOSED: number;
|
|
2745
|
+
readonly CLOSED: number;
|
|
2746
|
+
};
|
|
2747
|
+
/**
|
|
2748
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2749
|
+
*
|
|
2750
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2751
|
+
*/
|
|
2752
|
+
export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2719
2753
|
accept(): void;
|
|
2720
2754
|
/**
|
|
2721
2755
|
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
@@ -2731,38 +2765,30 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
2731
2765
|
close(code?: number, reason?: string): void;
|
|
2732
2766
|
serializeAttachment(attachment: any): void;
|
|
2733
2767
|
deserializeAttachment(): any | null;
|
|
2734
|
-
static readonly READY_STATE_CONNECTING: number;
|
|
2735
|
-
static readonly CONNECTING: number;
|
|
2736
|
-
static readonly READY_STATE_OPEN: number;
|
|
2737
|
-
static readonly OPEN: number;
|
|
2738
|
-
static readonly READY_STATE_CLOSING: number;
|
|
2739
|
-
static readonly CLOSING: number;
|
|
2740
|
-
static readonly READY_STATE_CLOSED: number;
|
|
2741
|
-
static readonly CLOSED: number;
|
|
2742
2768
|
/**
|
|
2743
2769
|
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2744
2770
|
*
|
|
2745
2771
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2746
2772
|
*/
|
|
2747
|
-
|
|
2773
|
+
readyState: number;
|
|
2748
2774
|
/**
|
|
2749
2775
|
* Returns the URL that was used to establish the WebSocket connection.
|
|
2750
2776
|
*
|
|
2751
2777
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2752
2778
|
*/
|
|
2753
|
-
|
|
2779
|
+
url: string | null;
|
|
2754
2780
|
/**
|
|
2755
2781
|
* 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.
|
|
2756
2782
|
*
|
|
2757
2783
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2758
2784
|
*/
|
|
2759
|
-
|
|
2785
|
+
protocol: string | null;
|
|
2760
2786
|
/**
|
|
2761
2787
|
* Returns the extensions selected by the server, if any.
|
|
2762
2788
|
*
|
|
2763
2789
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2764
2790
|
*/
|
|
2765
|
-
|
|
2791
|
+
extensions: string | null;
|
|
2766
2792
|
}
|
|
2767
2793
|
export declare const WebSocketPair: {
|
|
2768
2794
|
new (): {
|
|
@@ -3543,7 +3569,7 @@ export type AiTextToImageInput = {
|
|
|
3543
3569
|
strength?: number;
|
|
3544
3570
|
guidance?: number;
|
|
3545
3571
|
};
|
|
3546
|
-
export type AiTextToImageOutput = Uint8Array
|
|
3572
|
+
export type AiTextToImageOutput = ReadableStream<Uint8Array>;
|
|
3547
3573
|
export declare abstract class BaseAiTextToImage {
|
|
3548
3574
|
inputs: AiTextToImageInput;
|
|
3549
3575
|
postProcessedOutputs: AiTextToImageOutput;
|
|
@@ -4826,7 +4852,7 @@ export interface Hyperdrive {
|
|
|
4826
4852
|
// Copyright (c) 2024 Cloudflare, Inc.
|
|
4827
4853
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4828
4854
|
// https://opensource.org/licenses/Apache-2.0
|
|
4829
|
-
export type
|
|
4855
|
+
export type ImageInfoResponse =
|
|
4830
4856
|
| {
|
|
4831
4857
|
format: "image/svg+xml";
|
|
4832
4858
|
}
|
|
@@ -4836,7 +4862,7 @@ export type InfoResponse =
|
|
|
4836
4862
|
width: number;
|
|
4837
4863
|
height: number;
|
|
4838
4864
|
};
|
|
4839
|
-
export type
|
|
4865
|
+
export type ImageTransform = {
|
|
4840
4866
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
4841
4867
|
gravity?:
|
|
4842
4868
|
| "left"
|
|
@@ -4886,7 +4912,7 @@ export type Transform = {
|
|
|
4886
4912
|
};
|
|
4887
4913
|
zoom?: number;
|
|
4888
4914
|
};
|
|
4889
|
-
export type
|
|
4915
|
+
export type ImageOutputOptions = {
|
|
4890
4916
|
format:
|
|
4891
4917
|
| "image/jpeg"
|
|
4892
4918
|
| "image/png"
|
|
@@ -4904,7 +4930,7 @@ export interface ImagesBinding {
|
|
|
4904
4930
|
* @throws {@link ImagesError} with code 9412 if input is not an image
|
|
4905
4931
|
* @param stream The image bytes
|
|
4906
4932
|
*/
|
|
4907
|
-
info(stream: ReadableStream<Uint8Array>): Promise<
|
|
4933
|
+
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
|
|
4908
4934
|
/**
|
|
4909
4935
|
* Begin applying a series of transformations to an image
|
|
4910
4936
|
* @param stream The image bytes
|
|
@@ -4918,15 +4944,15 @@ export interface ImageTransformer {
|
|
|
4918
4944
|
* You can then apply more transformations or retrieve the output.
|
|
4919
4945
|
* @param transform
|
|
4920
4946
|
*/
|
|
4921
|
-
transform(transform:
|
|
4947
|
+
transform(transform: ImageTransform): ImageTransformer;
|
|
4922
4948
|
/**
|
|
4923
4949
|
* Retrieve the image that results from applying the transforms to the
|
|
4924
4950
|
* provided input
|
|
4925
4951
|
* @param options Options that apply to the output e.g. output format
|
|
4926
4952
|
*/
|
|
4927
|
-
output(options:
|
|
4953
|
+
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
|
|
4928
4954
|
}
|
|
4929
|
-
export interface
|
|
4955
|
+
export interface ImageTransformationResult {
|
|
4930
4956
|
/**
|
|
4931
4957
|
* The image as a response, ready to store in cache or return to users
|
|
4932
4958
|
*/
|
package/2022-08-04/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
|
*
|
|
@@ -1540,28 +1541,34 @@ declare abstract class Body {
|
|
|
1540
1541
|
*
|
|
1541
1542
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1542
1543
|
*/
|
|
1543
|
-
declare
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1544
|
+
declare var Response: {
|
|
1545
|
+
prototype: Response;
|
|
1546
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
1547
|
+
redirect(url: string, status?: number): Response;
|
|
1548
|
+
json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1549
|
+
};
|
|
1550
|
+
/**
|
|
1551
|
+
* This Fetch API interface represents the response to a request.
|
|
1552
|
+
*
|
|
1553
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1554
|
+
*/
|
|
1555
|
+
interface Response extends Body {
|
|
1549
1556
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1550
1557
|
clone(): Response;
|
|
1551
1558
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1552
|
-
|
|
1559
|
+
status: number;
|
|
1553
1560
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1554
|
-
|
|
1561
|
+
statusText: string;
|
|
1555
1562
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1556
|
-
|
|
1563
|
+
headers: Headers;
|
|
1557
1564
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1558
|
-
|
|
1565
|
+
ok: boolean;
|
|
1559
1566
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1560
|
-
|
|
1567
|
+
redirected: boolean;
|
|
1561
1568
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1569
|
+
url: string;
|
|
1570
|
+
webSocket: WebSocket | null;
|
|
1571
|
+
cf: any | undefined;
|
|
1565
1572
|
}
|
|
1566
1573
|
interface ResponseInit {
|
|
1567
1574
|
status?: number;
|
|
@@ -1580,11 +1587,20 @@ type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
|
1580
1587
|
*
|
|
1581
1588
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1582
1589
|
*/
|
|
1583
|
-
declare
|
|
1584
|
-
|
|
1585
|
-
Cf = CfProperties<CfHostMetadata
|
|
1586
|
-
|
|
1587
|
-
|
|
1590
|
+
declare var Request: {
|
|
1591
|
+
prototype: Request;
|
|
1592
|
+
new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
|
|
1593
|
+
input: RequestInfo<CfProperties>,
|
|
1594
|
+
init?: RequestInit<Cf>,
|
|
1595
|
+
): Request<CfHostMetadata, Cf>;
|
|
1596
|
+
};
|
|
1597
|
+
/**
|
|
1598
|
+
* This Fetch API interface represents a resource request.
|
|
1599
|
+
*
|
|
1600
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1601
|
+
*/
|
|
1602
|
+
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>
|
|
1603
|
+
extends Body {
|
|
1588
1604
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1589
1605
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1590
1606
|
/**
|
|
@@ -1592,45 +1608,45 @@ declare class Request<
|
|
|
1592
1608
|
*
|
|
1593
1609
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1594
1610
|
*/
|
|
1595
|
-
|
|
1611
|
+
method: string;
|
|
1596
1612
|
/**
|
|
1597
1613
|
* Returns the URL of request as a string.
|
|
1598
1614
|
*
|
|
1599
1615
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1600
1616
|
*/
|
|
1601
|
-
|
|
1617
|
+
url: string;
|
|
1602
1618
|
/**
|
|
1603
1619
|
* 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.
|
|
1604
1620
|
*
|
|
1605
1621
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1606
1622
|
*/
|
|
1607
|
-
|
|
1623
|
+
headers: Headers;
|
|
1608
1624
|
/**
|
|
1609
1625
|
* 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.
|
|
1610
1626
|
*
|
|
1611
1627
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1612
1628
|
*/
|
|
1613
|
-
|
|
1614
|
-
|
|
1629
|
+
redirect: string;
|
|
1630
|
+
fetcher: Fetcher | null;
|
|
1615
1631
|
/**
|
|
1616
1632
|
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1617
1633
|
*
|
|
1618
1634
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1619
1635
|
*/
|
|
1620
|
-
|
|
1621
|
-
|
|
1636
|
+
signal: AbortSignal;
|
|
1637
|
+
cf: Cf | undefined;
|
|
1622
1638
|
/**
|
|
1623
1639
|
* 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]
|
|
1624
1640
|
*
|
|
1625
1641
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1626
1642
|
*/
|
|
1627
|
-
|
|
1643
|
+
integrity: string;
|
|
1628
1644
|
/**
|
|
1629
1645
|
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1630
1646
|
*
|
|
1631
1647
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1632
1648
|
*/
|
|
1633
|
-
|
|
1649
|
+
keepalive: boolean;
|
|
1634
1650
|
}
|
|
1635
1651
|
interface RequestInit<Cf = CfProperties> {
|
|
1636
1652
|
/* A string to set request's method. */
|
|
@@ -2316,7 +2332,7 @@ declare class TextDecoderStream extends TransformStream<
|
|
|
2316
2332
|
ArrayBuffer | ArrayBufferView,
|
|
2317
2333
|
string
|
|
2318
2334
|
> {
|
|
2319
|
-
constructor(
|
|
2335
|
+
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
|
|
2320
2336
|
get encoding(): string;
|
|
2321
2337
|
get fatal(): boolean;
|
|
2322
2338
|
get ignoreBOM(): boolean;
|
|
@@ -2706,8 +2722,24 @@ type WebSocketEventMap = {
|
|
|
2706
2722
|
*
|
|
2707
2723
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2708
2724
|
*/
|
|
2709
|
-
declare
|
|
2710
|
-
|
|
2725
|
+
declare var WebSocket: {
|
|
2726
|
+
prototype: WebSocket;
|
|
2727
|
+
new (url: string, protocols?: string[] | string): WebSocket;
|
|
2728
|
+
readonly READY_STATE_CONNECTING: number;
|
|
2729
|
+
readonly CONNECTING: number;
|
|
2730
|
+
readonly READY_STATE_OPEN: number;
|
|
2731
|
+
readonly OPEN: number;
|
|
2732
|
+
readonly READY_STATE_CLOSING: number;
|
|
2733
|
+
readonly CLOSING: number;
|
|
2734
|
+
readonly READY_STATE_CLOSED: number;
|
|
2735
|
+
readonly CLOSED: number;
|
|
2736
|
+
};
|
|
2737
|
+
/**
|
|
2738
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2739
|
+
*
|
|
2740
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2741
|
+
*/
|
|
2742
|
+
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2711
2743
|
accept(): void;
|
|
2712
2744
|
/**
|
|
2713
2745
|
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
@@ -2723,38 +2755,30 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
2723
2755
|
close(code?: number, reason?: string): void;
|
|
2724
2756
|
serializeAttachment(attachment: any): void;
|
|
2725
2757
|
deserializeAttachment(): any | null;
|
|
2726
|
-
static readonly READY_STATE_CONNECTING: number;
|
|
2727
|
-
static readonly CONNECTING: number;
|
|
2728
|
-
static readonly READY_STATE_OPEN: number;
|
|
2729
|
-
static readonly OPEN: number;
|
|
2730
|
-
static readonly READY_STATE_CLOSING: number;
|
|
2731
|
-
static readonly CLOSING: number;
|
|
2732
|
-
static readonly READY_STATE_CLOSED: number;
|
|
2733
|
-
static readonly CLOSED: number;
|
|
2734
2758
|
/**
|
|
2735
2759
|
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2736
2760
|
*
|
|
2737
2761
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2738
2762
|
*/
|
|
2739
|
-
|
|
2763
|
+
readyState: number;
|
|
2740
2764
|
/**
|
|
2741
2765
|
* Returns the URL that was used to establish the WebSocket connection.
|
|
2742
2766
|
*
|
|
2743
2767
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2744
2768
|
*/
|
|
2745
|
-
|
|
2769
|
+
url: string | null;
|
|
2746
2770
|
/**
|
|
2747
2771
|
* 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.
|
|
2748
2772
|
*
|
|
2749
2773
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2750
2774
|
*/
|
|
2751
|
-
|
|
2775
|
+
protocol: string | null;
|
|
2752
2776
|
/**
|
|
2753
2777
|
* Returns the extensions selected by the server, if any.
|
|
2754
2778
|
*
|
|
2755
2779
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2756
2780
|
*/
|
|
2757
|
-
|
|
2781
|
+
extensions: string | null;
|
|
2758
2782
|
}
|
|
2759
2783
|
declare const WebSocketPair: {
|
|
2760
2784
|
new (): {
|
|
@@ -3535,7 +3559,7 @@ type AiTextToImageInput = {
|
|
|
3535
3559
|
strength?: number;
|
|
3536
3560
|
guidance?: number;
|
|
3537
3561
|
};
|
|
3538
|
-
type AiTextToImageOutput = Uint8Array
|
|
3562
|
+
type AiTextToImageOutput = ReadableStream<Uint8Array>;
|
|
3539
3563
|
declare abstract class BaseAiTextToImage {
|
|
3540
3564
|
inputs: AiTextToImageInput;
|
|
3541
3565
|
postProcessedOutputs: AiTextToImageOutput;
|
|
@@ -4812,7 +4836,7 @@ interface Hyperdrive {
|
|
|
4812
4836
|
// Copyright (c) 2024 Cloudflare, Inc.
|
|
4813
4837
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4814
4838
|
// https://opensource.org/licenses/Apache-2.0
|
|
4815
|
-
type
|
|
4839
|
+
type ImageInfoResponse =
|
|
4816
4840
|
| {
|
|
4817
4841
|
format: "image/svg+xml";
|
|
4818
4842
|
}
|
|
@@ -4822,7 +4846,7 @@ type InfoResponse =
|
|
|
4822
4846
|
width: number;
|
|
4823
4847
|
height: number;
|
|
4824
4848
|
};
|
|
4825
|
-
type
|
|
4849
|
+
type ImageTransform = {
|
|
4826
4850
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
4827
4851
|
gravity?:
|
|
4828
4852
|
| "left"
|
|
@@ -4872,7 +4896,7 @@ type Transform = {
|
|
|
4872
4896
|
};
|
|
4873
4897
|
zoom?: number;
|
|
4874
4898
|
};
|
|
4875
|
-
type
|
|
4899
|
+
type ImageOutputOptions = {
|
|
4876
4900
|
format:
|
|
4877
4901
|
| "image/jpeg"
|
|
4878
4902
|
| "image/png"
|
|
@@ -4890,7 +4914,7 @@ interface ImagesBinding {
|
|
|
4890
4914
|
* @throws {@link ImagesError} with code 9412 if input is not an image
|
|
4891
4915
|
* @param stream The image bytes
|
|
4892
4916
|
*/
|
|
4893
|
-
info(stream: ReadableStream<Uint8Array>): Promise<
|
|
4917
|
+
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
|
|
4894
4918
|
/**
|
|
4895
4919
|
* Begin applying a series of transformations to an image
|
|
4896
4920
|
* @param stream The image bytes
|
|
@@ -4904,15 +4928,15 @@ interface ImageTransformer {
|
|
|
4904
4928
|
* You can then apply more transformations or retrieve the output.
|
|
4905
4929
|
* @param transform
|
|
4906
4930
|
*/
|
|
4907
|
-
transform(transform:
|
|
4931
|
+
transform(transform: ImageTransform): ImageTransformer;
|
|
4908
4932
|
/**
|
|
4909
4933
|
* Retrieve the image that results from applying the transforms to the
|
|
4910
4934
|
* provided input
|
|
4911
4935
|
* @param options Options that apply to the output e.g. output format
|
|
4912
4936
|
*/
|
|
4913
|
-
output(options:
|
|
4937
|
+
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
|
|
4914
4938
|
}
|
|
4915
|
-
interface
|
|
4939
|
+
interface ImageTransformationResult {
|
|
4916
4940
|
/**
|
|
4917
4941
|
* The image as a response, ready to store in cache or return to users
|
|
4918
4942
|
*/
|