Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit e146987

Browse files
Update workers-types (#251)
* Update workers-types * Add a changeset, update package-lock.json Co-authored-by: Sunil Pai <[email protected]>
1 parent d99c8ce commit e146987

File tree

4 files changed

+452
-24
lines changed

4 files changed

+452
-24
lines changed

.changeset/chilly-dolls-cheer.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/workers-types": minor
3+
---
4+
5+
Updated auto-generated types @ 2022-06-16

index.d.ts

+46-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ declare class AbortSignal extends EventTarget {
1616
throwIfAborted(): void;
1717
}
1818

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+
1932
interface BasicImageTransformations {
2033
/**
2134
* Maximum width in image pixels. The value must be an integer.
@@ -344,6 +357,7 @@ interface DocumentEnd {
344357

345358
interface DurableObject {
346359
fetch(request: Request): Promise<Response>;
360+
alarm?(): Promise<void>;
347361
}
348362

349363
interface DurableObjectGetAlarmOptions {
@@ -647,7 +661,7 @@ interface FileOptions {
647661
lastModified?: number;
648662
}
649663

650-
declare class FixedLengthStream extends TransformStream {
664+
declare class FixedLengthStream extends IdentityTransformStream {
651665
constructor(expectedLength: number | bigint);
652666
}
653667

@@ -752,6 +766,7 @@ interface IncomingRequestCfProperties {
752766
asOrganization: string;
753767
botManagement?: IncomingRequestCfPropertiesBotManagement;
754768
city?: string;
769+
clientAcceptEncoding?: string;
755770
clientTcpRtt: number;
756771
clientTrustScore?: number;
757772
/**
@@ -1295,6 +1310,15 @@ interface RequestInitCfProperties {
12951310
* Only available for Enterprise customers.
12961311
*/
12971312
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[];
12981322
/**
12991323
* Force response to be cached for a given number of seconds. (e.g. 300)
13001324
*/
@@ -1449,6 +1473,7 @@ declare type RequestInitializerDict = RequestInit;
14491473
declare class Response extends Body {
14501474
constructor(bodyInit?: BodyInit | null, maybeInit?: ResponseInit | Response);
14511475
static redirect(url: string, status?: number): Response;
1476+
static json(any: any, maybeInit?: ResponseInit | Response): Response;
14521477
clone(): Response;
14531478
readonly status: number;
14541479
readonly statusText: string;
@@ -1718,11 +1743,30 @@ interface TextEncoderEncodeIntoResult {
17181743
}
17191744

17201745
declare class TransformStream {
1721-
constructor();
1746+
constructor(
1747+
maybeTransformer?: Transformer,
1748+
maybeWritableStrategy?: StreamQueuingStrategy,
1749+
maybeReadableStrategy?: StreamQueuingStrategy
1750+
);
17221751
readonly readable: ReadableStream;
17231752
readonly writable: WritableStream;
17241753
}
17251754

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+
17261770
declare class URL {
17271771
constructor(url: string, base?: string);
17281772
href: string;

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)