@cloudflare/workers-types 3.12.0 → 3.13.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/index.d.ts +46 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -16,6 +16,19 @@ declare class AbortSignal extends EventTarget {
|
|
|
16
16
|
throwIfAborted(): void;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
interface AnalyticsEngine {
|
|
20
|
+
writeEvent(event?: AnalyticsEngineEvent): void;
|
|
21
|
+
logEvent(event?: AnalyticsEngineEvent): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface AnalyticsEngineEvent {
|
|
25
|
+
accountId?: any;
|
|
26
|
+
indexId?: any;
|
|
27
|
+
version?: any;
|
|
28
|
+
doubles?: number[];
|
|
29
|
+
blobs?: (ArrayBuffer | string | null)[];
|
|
30
|
+
}
|
|
31
|
+
|
|
19
32
|
interface BasicImageTransformations {
|
|
20
33
|
/**
|
|
21
34
|
* Maximum width in image pixels. The value must be an integer.
|
|
@@ -344,6 +357,7 @@ interface DocumentEnd {
|
|
|
344
357
|
|
|
345
358
|
interface DurableObject {
|
|
346
359
|
fetch(request: Request): Promise<Response>;
|
|
360
|
+
alarm?(): Promise<void>;
|
|
347
361
|
}
|
|
348
362
|
|
|
349
363
|
interface DurableObjectGetAlarmOptions {
|
|
@@ -647,7 +661,7 @@ interface FileOptions {
|
|
|
647
661
|
lastModified?: number;
|
|
648
662
|
}
|
|
649
663
|
|
|
650
|
-
declare class FixedLengthStream extends
|
|
664
|
+
declare class FixedLengthStream extends IdentityTransformStream {
|
|
651
665
|
constructor(expectedLength: number | bigint);
|
|
652
666
|
}
|
|
653
667
|
|
|
@@ -752,6 +766,7 @@ interface IncomingRequestCfProperties {
|
|
|
752
766
|
asOrganization: string;
|
|
753
767
|
botManagement?: IncomingRequestCfPropertiesBotManagement;
|
|
754
768
|
city?: string;
|
|
769
|
+
clientAcceptEncoding?: string;
|
|
755
770
|
clientTcpRtt: number;
|
|
756
771
|
clientTrustScore?: number;
|
|
757
772
|
/**
|
|
@@ -1295,6 +1310,15 @@ interface RequestInitCfProperties {
|
|
|
1295
1310
|
* Only available for Enterprise customers.
|
|
1296
1311
|
*/
|
|
1297
1312
|
cacheKey?: string;
|
|
1313
|
+
/**
|
|
1314
|
+
* This allows you to append additional Cache-Tag response headers
|
|
1315
|
+
* to the origin response without modifications to the origin server.
|
|
1316
|
+
* This will allow for greater control over the Purge by Cache Tag feature
|
|
1317
|
+
* utilizing changes only in the Workers process.
|
|
1318
|
+
*
|
|
1319
|
+
* Only available for Enterprise customers.
|
|
1320
|
+
*/
|
|
1321
|
+
cacheTags?: string[];
|
|
1298
1322
|
/**
|
|
1299
1323
|
* Force response to be cached for a given number of seconds. (e.g. 300)
|
|
1300
1324
|
*/
|
|
@@ -1449,6 +1473,7 @@ declare type RequestInitializerDict = RequestInit;
|
|
|
1449
1473
|
declare class Response extends Body {
|
|
1450
1474
|
constructor(bodyInit?: BodyInit | null, maybeInit?: ResponseInit | Response);
|
|
1451
1475
|
static redirect(url: string, status?: number): Response;
|
|
1476
|
+
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1452
1477
|
clone(): Response;
|
|
1453
1478
|
readonly status: number;
|
|
1454
1479
|
readonly statusText: string;
|
|
@@ -1718,11 +1743,30 @@ interface TextEncoderEncodeIntoResult {
|
|
|
1718
1743
|
}
|
|
1719
1744
|
|
|
1720
1745
|
declare class TransformStream {
|
|
1721
|
-
constructor(
|
|
1746
|
+
constructor(
|
|
1747
|
+
maybeTransformer?: Transformer,
|
|
1748
|
+
maybeWritableStrategy?: StreamQueuingStrategy,
|
|
1749
|
+
maybeReadableStrategy?: StreamQueuingStrategy
|
|
1750
|
+
);
|
|
1722
1751
|
readonly readable: ReadableStream;
|
|
1723
1752
|
readonly writable: WritableStream;
|
|
1724
1753
|
}
|
|
1725
1754
|
|
|
1755
|
+
interface TransformStreamDefaultController {
|
|
1756
|
+
readonly desiredSize: number | null;
|
|
1757
|
+
enqueue(chunk: any): void;
|
|
1758
|
+
error(reason: any): void;
|
|
1759
|
+
terminate(): void;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
interface Transformer {
|
|
1763
|
+
readableType?: string;
|
|
1764
|
+
writableType?: string;
|
|
1765
|
+
start?(controller: TransformStreamDefaultController): any;
|
|
1766
|
+
transform?(chunk: any, controller: TransformStreamDefaultController): any;
|
|
1767
|
+
flush?(controller: TransformStreamDefaultController): any;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1726
1770
|
declare class URL {
|
|
1727
1771
|
constructor(url: string, base?: string);
|
|
1728
1772
|
href: string;
|