Skip to content

Commit 7e3f3d7

Browse files
committed
v0:ref: update worker-config.ts
1 parent 3c5e56c commit 7e3f3d7

1 file changed

Lines changed: 91 additions & 29 deletions

File tree

apps/workers/v0/worker-configuration.d.ts

Lines changed: 91 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable */
2-
// Generated by Wrangler by running `wrangler types --c wrangler.jsonc --c ../auth/wrangler.jsonc --env-interface=CloudflareBindings` (hash: 6254112bffc75530e32350db72a64709)
3-
// Runtime types generated with workerd@1.20250712.0 2025-05-22 nodejs_compat
2+
// Generated by Wrangler by running `wrangler types --c wrangler.jsonc --c ../auth/wrangler.jsonc --env-interface=CloudflareBindings` (hash: ac0cb6b58b3d9cc72da6449b0cd60377)
3+
// Runtime types generated with workerd@1.20250726.0 2025-05-22 nodejs_compat
44
declare namespace Cloudflare {
55
interface Env {
66
DEEPCRAWL_V0_LINKS_STORE: KVNamespace;
@@ -1121,6 +1121,47 @@ interface ErrorEventErrorEventInit {
11211121
colno?: number;
11221122
error?: any;
11231123
}
1124+
/**
1125+
* A message received by a target object.
1126+
*
1127+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
1128+
*/
1129+
declare class MessageEvent extends Event {
1130+
constructor(type: string, initializer: MessageEventInit);
1131+
/**
1132+
* Returns the data of the message.
1133+
*
1134+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
1135+
*/
1136+
readonly data: any;
1137+
/**
1138+
* Returns the origin of the message, for server-sent events and cross-document messaging.
1139+
*
1140+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
1141+
*/
1142+
readonly origin: string | null;
1143+
/**
1144+
* Returns the last event ID string, for server-sent events.
1145+
*
1146+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
1147+
*/
1148+
readonly lastEventId: string;
1149+
/**
1150+
* Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.
1151+
*
1152+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
1153+
*/
1154+
readonly source: MessagePort | null;
1155+
/**
1156+
* Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.
1157+
*
1158+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
1159+
*/
1160+
readonly ports: MessagePort[];
1161+
}
1162+
interface MessageEventInit {
1163+
data: ArrayBuffer | string;
1164+
}
11241165
/**
11251166
* Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
11261167
*
@@ -1429,7 +1470,7 @@ interface RequestInit<Cf = CfProperties> {
14291470
signal?: (AbortSignal | null);
14301471
encodeResponseBody?: "automatic" | "manual";
14311472
}
1432-
type Service<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = Fetcher<T>;
1473+
type Service<T extends (new (...args: any[]) => Rpc.WorkerEntrypointBranded) | Rpc.WorkerEntrypointBranded | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? Fetcher<InstanceType<T>> : T extends Rpc.WorkerEntrypointBranded ? Fetcher<T> : T extends Exclude<Rpc.EntrypointBranded, Rpc.WorkerEntrypointBranded> ? never : Fetcher<undefined>;
14331474
type Fetcher<T extends Rpc.EntrypointBranded | undefined = undefined, Reserved extends string = never> = (T extends Rpc.EntrypointBranded ? Rpc.Provider<T, Reserved | "fetch" | "connect"> : unknown) & {
14341475
getSessionWithAPIKey(apiKey: string): unknown;
14351476
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@@ -2304,23 +2345,6 @@ interface CloseEventInit {
23042345
reason?: string;
23052346
wasClean?: boolean;
23062347
}
2307-
/**
2308-
* A message received by a target object.
2309-
*
2310-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
2311-
*/
2312-
declare class MessageEvent extends Event {
2313-
constructor(type: string, initializer: MessageEventInit);
2314-
/**
2315-
* Returns the data of the message.
2316-
*
2317-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
2318-
*/
2319-
readonly data: ArrayBuffer | string;
2320-
}
2321-
interface MessageEventInit {
2322-
data: ArrayBuffer | string;
2323-
}
23242348
type WebSocketEventMap = {
23252349
close: CloseEvent;
23262350
message: MessageEvent;
@@ -2508,6 +2532,38 @@ interface ContainerStartupOptions {
25082532
enableInternet: boolean;
25092533
env?: Record<string, string>;
25102534
}
2535+
/**
2536+
* This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
2537+
*
2538+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort)
2539+
*/
2540+
interface MessagePort extends EventTarget {
2541+
/**
2542+
* Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
2543+
*
2544+
* Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.
2545+
*
2546+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
2547+
*/
2548+
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
2549+
/**
2550+
* Disconnects the port, so that it is no longer active.
2551+
*
2552+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
2553+
*/
2554+
close(): void;
2555+
/**
2556+
* Begins dispatching messages received on the port.
2557+
*
2558+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
2559+
*/
2560+
start(): void;
2561+
get onmessage(): any | null;
2562+
set onmessage(value: any | null);
2563+
}
2564+
interface MessagePortPostMessageOptions {
2565+
transfer?: any[];
2566+
}
25112567
type AiImageClassificationInput = {
25122568
image: number[];
25132569
};
@@ -5797,13 +5853,13 @@ interface IncomingRequestCfPropertiesBase extends Record<string, unknown> {
57975853
*
57985854
* @example 395747
57995855
*/
5800-
asn: number;
5856+
asn?: number;
58015857
/**
58025858
* The organization which owns the ASN of the incoming request.
58035859
*
58045860
* @example "Google Cloud"
58055861
*/
5806-
asOrganization: string;
5862+
asOrganization?: string;
58075863
/**
58085864
* The original value of the `Accept-Encoding` header if Cloudflare modified it.
58095865
*
@@ -5927,7 +5983,7 @@ interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> {
59275983
* This field is only present if you have Cloudflare for SaaS enabled on your account
59285984
* and you have followed the [required steps to enable it]((https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/)).
59295985
*/
5930-
hostMetadata: HostMetadata;
5986+
hostMetadata?: HostMetadata;
59315987
}
59325988
interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
59335989
/**
@@ -6454,7 +6510,7 @@ type ImageTransform = {
64546510
rotate?: 0 | 90 | 180 | 270;
64556511
saturation?: number;
64566512
sharpen?: number;
6457-
trim?: "border" | {
6513+
trim?: 'border' | {
64586514
top?: number;
64596515
bottom?: number;
64606516
left?: number;
@@ -6476,6 +6532,9 @@ type ImageDrawOptions = {
64766532
bottom?: number;
64776533
right?: number;
64786534
};
6535+
type ImageInputOptions = {
6536+
encoding?: 'base64';
6537+
};
64796538
type ImageOutputOptions = {
64806539
format: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/avif' | 'rgb' | 'rgba';
64816540
quality?: number;
@@ -6487,13 +6546,13 @@ interface ImagesBinding {
64876546
* @throws {@link ImagesError} with code 9412 if input is not an image
64886547
* @param stream The image bytes
64896548
*/
6490-
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
6549+
info(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): Promise<ImageInfoResponse>;
64916550
/**
64926551
* Begin applying a series of transformations to an image
64936552
* @param stream The image bytes
64946553
* @returns A transform handle
64956554
*/
6496-
input(stream: ReadableStream<Uint8Array>): ImageTransformer;
6555+
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
64976556
}
64986557
interface ImageTransformer {
64996558
/**
@@ -6516,6 +6575,9 @@ interface ImageTransformer {
65166575
*/
65176576
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
65186577
}
6578+
type ImageTransformationOutputOptions = {
6579+
encoding?: 'base64';
6580+
};
65196581
interface ImageTransformationResult {
65206582
/**
65216583
* The image as a response, ready to store in cache or return to users
@@ -6528,7 +6590,7 @@ interface ImageTransformationResult {
65286590
/**
65296591
* The bytes of the response
65306592
*/
6531-
image(): ReadableStream<Uint8Array>;
6593+
image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array>;
65326594
}
65336595
interface ImagesError extends Error {
65346596
readonly code: number;
@@ -6848,7 +6910,7 @@ declare namespace TailStream {
68486910
readonly type: "fetch";
68496911
readonly method: string;
68506912
readonly url: string;
6851-
readonly cfJson: string;
6913+
readonly cfJson?: object;
68526914
readonly headers: Header[];
68536915
}
68546916
interface JsRpcEventInfo {
@@ -6959,7 +7021,7 @@ declare namespace TailStream {
69597021
interface Log {
69607022
readonly type: "log";
69617023
readonly level: "debug" | "error" | "info" | "log" | "warn";
6962-
readonly message: string;
7024+
readonly message: object;
69637025
}
69647026
interface Return {
69657027
readonly type: "return";

0 commit comments

Comments
 (0)