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