@cloudflare/workers-types 3.12.0 → 3.14.1
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/index.d.ts +34 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -344,6 +344,7 @@ interface DocumentEnd {
|
|
|
344
344
|
|
|
345
345
|
interface DurableObject {
|
|
346
346
|
fetch(request: Request): Promise<Response>;
|
|
347
|
+
alarm?(): Promise<void>;
|
|
347
348
|
}
|
|
348
349
|
|
|
349
350
|
interface DurableObjectGetAlarmOptions {
|
|
@@ -647,7 +648,7 @@ interface FileOptions {
|
|
|
647
648
|
lastModified?: number;
|
|
648
649
|
}
|
|
649
650
|
|
|
650
|
-
declare class FixedLengthStream extends
|
|
651
|
+
declare class FixedLengthStream extends IdentityTransformStream {
|
|
651
652
|
constructor(expectedLength: number | bigint);
|
|
652
653
|
}
|
|
653
654
|
|
|
@@ -752,6 +753,7 @@ interface IncomingRequestCfProperties {
|
|
|
752
753
|
asOrganization: string;
|
|
753
754
|
botManagement?: IncomingRequestCfPropertiesBotManagement;
|
|
754
755
|
city?: string;
|
|
756
|
+
clientAcceptEncoding?: string;
|
|
755
757
|
clientTcpRtt: number;
|
|
756
758
|
clientTrustScore?: number;
|
|
757
759
|
/**
|
|
@@ -1103,6 +1105,7 @@ declare abstract class R2Object {
|
|
|
1103
1105
|
readonly uploaded: Date;
|
|
1104
1106
|
readonly httpMetadata: R2HTTPMetadata;
|
|
1105
1107
|
readonly customMetadata: Record<string, string>;
|
|
1108
|
+
readonly range?: R2Range;
|
|
1106
1109
|
writeHttpMetadata(headers: Headers): void;
|
|
1107
1110
|
}
|
|
1108
1111
|
|
|
@@ -1295,6 +1298,15 @@ interface RequestInitCfProperties {
|
|
|
1295
1298
|
* Only available for Enterprise customers.
|
|
1296
1299
|
*/
|
|
1297
1300
|
cacheKey?: string;
|
|
1301
|
+
/**
|
|
1302
|
+
* This allows you to append additional Cache-Tag response headers
|
|
1303
|
+
* to the origin response without modifications to the origin server.
|
|
1304
|
+
* This will allow for greater control over the Purge by Cache Tag feature
|
|
1305
|
+
* utilizing changes only in the Workers process.
|
|
1306
|
+
*
|
|
1307
|
+
* Only available for Enterprise customers.
|
|
1308
|
+
*/
|
|
1309
|
+
cacheTags?: string[];
|
|
1298
1310
|
/**
|
|
1299
1311
|
* Force response to be cached for a given number of seconds. (e.g. 300)
|
|
1300
1312
|
*/
|
|
@@ -1449,6 +1461,7 @@ declare type RequestInitializerDict = RequestInit;
|
|
|
1449
1461
|
declare class Response extends Body {
|
|
1450
1462
|
constructor(bodyInit?: BodyInit | null, maybeInit?: ResponseInit | Response);
|
|
1451
1463
|
static redirect(url: string, status?: number): Response;
|
|
1464
|
+
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1452
1465
|
clone(): Response;
|
|
1453
1466
|
readonly status: number;
|
|
1454
1467
|
readonly statusText: string;
|
|
@@ -1718,11 +1731,30 @@ interface TextEncoderEncodeIntoResult {
|
|
|
1718
1731
|
}
|
|
1719
1732
|
|
|
1720
1733
|
declare class TransformStream {
|
|
1721
|
-
constructor(
|
|
1734
|
+
constructor(
|
|
1735
|
+
maybeTransformer?: Transformer,
|
|
1736
|
+
maybeWritableStrategy?: StreamQueuingStrategy,
|
|
1737
|
+
maybeReadableStrategy?: StreamQueuingStrategy
|
|
1738
|
+
);
|
|
1722
1739
|
readonly readable: ReadableStream;
|
|
1723
1740
|
readonly writable: WritableStream;
|
|
1724
1741
|
}
|
|
1725
1742
|
|
|
1743
|
+
interface TransformStreamDefaultController {
|
|
1744
|
+
readonly desiredSize: number | null;
|
|
1745
|
+
enqueue(chunk: any): void;
|
|
1746
|
+
error(reason: any): void;
|
|
1747
|
+
terminate(): void;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
interface Transformer {
|
|
1751
|
+
readableType?: string;
|
|
1752
|
+
writableType?: string;
|
|
1753
|
+
start?(controller: TransformStreamDefaultController): any;
|
|
1754
|
+
transform?(chunk: any, controller: TransformStreamDefaultController): any;
|
|
1755
|
+
flush?(controller: TransformStreamDefaultController): any;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1726
1758
|
declare class URL {
|
|
1727
1759
|
constructor(url: string, base?: string);
|
|
1728
1760
|
href: string;
|