diff --git a/worker-configuration.d.ts b/worker-configuration.d.ts index a7b69c7..439106d 100644 --- a/worker-configuration.d.ts +++ b/worker-configuration.d.ts @@ -2,32 +2,32 @@ // Generated by Wrangler by running `wrangler types` (hash: df24977940a31745cb42d562b6645de2) // Runtime types generated with workerd@1.20251210.0 2025-11-28 nodejs_compat declare namespace Cloudflare { - interface GlobalProps { - mainModule: typeof import("./src/index"); - durableNamespaces: "AnilistDo"; - } - interface Env { - DELAYED_TASKS: KVNamespace; - ADMIN_SDK_JSON: string; - CLOUDFLARE_TOKEN: string; - CLOUDFLARE_D1_TOKEN: string; - CLOUDFLARE_ACCOUNT_ID: string; - CLOUDFLARE_DATABASE_ID: string; - PROXY_URL: string; - USE_MOCK_DATA: string; - LOG_DB_QUERIES: string; - ANILIST_DO: DurableObjectNamespace; - DB: D1Database; - ANILIST_UPDATES: Queue; - NEW_EPISODE: Queue; - } + interface GlobalProps { + mainModule: typeof import("./src/index"); + durableNamespaces: "AnilistDo"; + } + interface Env { + DELAYED_TASKS: KVNamespace; + ADMIN_SDK_JSON: string; + CLOUDFLARE_TOKEN: string; + CLOUDFLARE_D1_TOKEN: string; + CLOUDFLARE_ACCOUNT_ID: string; + CLOUDFLARE_DATABASE_ID: string; + PROXY_URL: string; + USE_MOCK_DATA: string; + LOG_DB_QUERIES: string; + ANILIST_DO: DurableObjectNamespace; + DB: D1Database; + ANILIST_UPDATES: Queue; + NEW_EPISODE: Queue; + } } -interface Env extends Cloudflare.Env {} +interface Env extends Cloudflare.Env { } type StringifyValues> = { - [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string; + [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string; }; declare namespace NodeJS { - interface ProcessEnv extends StringifyValues> {} + interface ProcessEnv extends StringifyValues> { } } // Begin runtime types @@ -1644,7 +1644,7 @@ declare abstract class Body { */ declare var Response: { prototype: Response; - new (body?: BodyInit | null, init?: ResponseInit): Response; + new(body?: BodyInit | null, init?: ResponseInit): Response; error(): Response; redirect(url: string, status?: number): Response; json(any: any, maybeInit?: (ResponseInit | Response)): Response; @@ -2192,7 +2192,7 @@ interface ReadableStream { */ declare const ReadableStream: { prototype: ReadableStream; - new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; + new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; new (underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; }; /** @@ -3034,7 +3034,7 @@ type WebSocketEventMap = { */ declare var WebSocket: { prototype: WebSocket; - new (url: string, protocols?: (string[] | string)): WebSocket; + new(url: string, protocols?: (string[] | string)): WebSocket; readonly READY_STATE_CONNECTING: number; readonly CONNECTING: number; readonly READY_STATE_OPEN: number; @@ -3091,7 +3091,7 @@ interface WebSocket extends EventTarget { extensions: string | null; } declare const WebSocketPair: { - new (): { + new(): { 0: WebSocket; 1: WebSocket; }; @@ -9413,21 +9413,21 @@ interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder { certNotAfter: ""; } /** Possible outcomes of TLS verification */ -declare type CertVerificationStatus = -/** Authentication succeeded */ -"SUCCESS" -/** No certificate was presented */ - | "NONE" -/** Failed because the certificate was self-signed */ - | "FAILED:self signed certificate" -/** Failed because the certificate failed a trust chain check */ - | "FAILED:unable to verify the first certificate" -/** Failed because the certificate not yet valid */ - | "FAILED:certificate is not yet valid" -/** Failed because the certificate is expired */ - | "FAILED:certificate has expired" -/** Failed for another unspecified reason */ - | "FAILED"; +declare type CertVerificationStatus = + /** Authentication succeeded */ + "SUCCESS" + /** No certificate was presented */ + | "NONE" + /** Failed because the certificate was self-signed */ + | "FAILED:self signed certificate" + /** Failed because the certificate failed a trust chain check */ + | "FAILED:unable to verify the first certificate" + /** Failed because the certificate not yet valid */ + | "FAILED:certificate is not yet valid" + /** Failed because the certificate is expired */ + | "FAILED:certificate has expired" + /** Failed for another unspecified reason */ + | "FAILED"; /** * An upstream endpoint's response to a TCP `keepalive` message from Cloudflare. */ @@ -9477,15 +9477,15 @@ interface D1ExecResult { count: number; duration: number; } -type D1SessionConstraint = -// Indicates that the first query should go to the primary, and the rest queries -// using the same D1DatabaseSession will go to any replica that is consistent with -// the bookmark maintained by the session (returned by the first query). -'first-primary' -// Indicates that the first query can go anywhere (primary or replica), and the rest queries -// using the same D1DatabaseSession will go to any replica that is consistent with -// the bookmark maintained by the session (returned by the first query). - | 'first-unconstrained'; +type D1SessionConstraint = + // Indicates that the first query should go to the primary, and the rest queries + // using the same D1DatabaseSession will go to any replica that is consistent with + // the bookmark maintained by the session (returned by the first query). + 'first-primary' + // Indicates that the first query can go anywhere (primary or replica), and the rest queries + // using the same D1DatabaseSession will go to any replica that is consistent with + // the bookmark maintained by the session (returned by the first query). + | 'first-unconstrained'; type D1SessionBookmark = string; declare abstract class D1Database { prepare(query: string): D1PreparedStatement; @@ -9599,7 +9599,7 @@ declare type EmailExportedHandler = (message: ForwardableEmailMes declare module "cloudflare:email" { let _EmailMessage: { prototype: EmailMessage; - new (from: string, to: string, raw: ReadableStream | string): EmailMessage; + new(from: string, to: string, raw: ReadableStream | string): EmailMessage; }; export { _EmailMessage as EmailMessage }; } @@ -10058,17 +10058,17 @@ declare namespace Rpc { // The reason for using a generic type here is to build a serializable subset of structured // cloneable composite types. This allows types defined with the "interface" keyword to pass the // serializable check as well. Otherwise, only types defined with the "type" keyword would pass. - type Serializable = - // Structured cloneables - BaseType - // Structured cloneable composites - | Map ? Serializable : never, T extends Map ? Serializable : never> | Set ? Serializable : never> | ReadonlyArray ? Serializable : never> | { - [K in keyof T]: K extends number | string ? Serializable : never; - } - // Special types - | Stub - // Serialized as stubs, see `Stubify` - | Stubable; + type Serializable = + // Structured cloneables + BaseType + // Structured cloneable composites + | Map ? Serializable : never, T extends Map ? Serializable : never> | Set ? Serializable : never> | ReadonlyArray ? Serializable : never> | { + [K in keyof T]: K extends number | string ? Serializable : never; + } + // Special types + | Stub + // Serialized as stubs, see `Stubify` + | Stubable; // Base type for all RPC stubs, including common memory management methods. // `T` is used as a marker type for unwrapping `Stub`s later. interface StubBase extends Disposable { @@ -10083,8 +10083,8 @@ declare namespace Rpc { type Stubify = T extends Stubable ? Stub : T extends Map ? Map, Stubify> : T extends Set ? Set> : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends BaseType ? T : T extends { [key: string | number]: any; } ? { - [K in keyof T]: Stubify; - } : T; + [K in keyof T]: Stubify; + } : T; // Recursively rewrite all `Stub`s with the corresponding `T`s. // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies: // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`. @@ -10092,8 +10092,8 @@ declare namespace Rpc { type Unstubify = T extends StubBase ? V : T extends Map ? Map, Unstubify> : T extends Set ? Set> : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends BaseType ? T : T extends { [key: string | number]: unknown; } ? { - [K in keyof T]: Unstubify; - } : T; + [K in keyof T]: Unstubify; + } : T; type UnstubifyAll = { [I in keyof A]: Unstubify; }; @@ -10166,7 +10166,7 @@ declare namespace Cloudflare { [K in keyof MainModule]: LoopbackForExport // If the export is listed in `durableNamespaces`, then it is also a // DurableObjectNamespace. - & (K extends GlobalProp<"durableNamespaces", never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace : DurableObjectNamespace : DurableObjectNamespace : {}); + & (K extends GlobalProp<"durableNamespaces", never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace : DurableObjectNamespace : DurableObjectNamespace : {}); }; } declare namespace CloudflareWorkersModule { @@ -10251,6 +10251,9 @@ declare namespace CloudflareWorkersModule { export const env: Cloudflare.Env; export const exports: Cloudflare.Exports; } +declare module 'cloudflare:test' { + export = CloudflareWorkersModule; +} declare module 'cloudflare:workers' { export = CloudflareWorkersModule; } @@ -10822,10 +10825,10 @@ interface WorkflowInstanceCreateOptions { } type InstanceStatus = { status: 'queued' // means that instance is waiting to be started (see concurrency limits) - | 'running' | 'paused' | 'errored' | 'terminated' // user terminated the instance while it was running - | 'complete' | 'waiting' // instance is hibernating and waiting for sleep or event to finish - | 'waitingForPause' // instance is finishing the current work to pause - | 'unknown'; + | 'running' | 'paused' | 'errored' | 'terminated' // user terminated the instance while it was running + | 'complete' | 'waiting' // instance is hibernating and waiting for sleep or event to finish + | 'waitingForPause' // instance is finishing the current work to pause + | 'unknown'; error?: { name: string; message: string;