diff --git a/.coderabbit.yaml b/.coderabbit.yaml
new file mode 100644
index 0000000..5b2dd9d
--- /dev/null
+++ b/.coderabbit.yaml
@@ -0,0 +1,27 @@
+# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
+# yaml template to refer to https://docs.coderabbit.ai/reference/yaml-template#enterprise
+
+language: en-US
+
+reviews:
+ profile: assertive
+ auto_review:
+ enabled: true
+ drafts: false
+ collapse_walkthrough: false
+ high_level_summary: true
+ high_level_summary_in_walkthrough: true
+ finishing_touches:
+ docstrings:
+ enabled: false
+ unit_tests:
+ enabled: false
+ in_progress_fortune: true
+ poem: true
+ request_changes_workflow: true
+ sequence_diagrams: true
+ suggested_reviewers: false
+
+issue_enrichment:
+ auto_enrich:
+ enabled: true
diff --git a/.cursor/mcp.json b/.cursor/mcp.json
new file mode 100644
index 0000000..ee5d245
--- /dev/null
+++ b/.cursor/mcp.json
@@ -0,0 +1,8 @@
+{
+ "mcpServers": {
+ "next-devtools": {
+ "command": "npx",
+ "args": ["-y", "next-devtools-mcp@latest"]
+ }
+ }
+}
diff --git a/.cursor/worktrees.json b/.cursor/worktrees.json
new file mode 100644
index 0000000..c18c64a
--- /dev/null
+++ b/.cursor/worktrees.json
@@ -0,0 +1,3 @@
+{
+ "setup-worktree": ["pnpm install", "cp $ROOT_WORKTREE_PATH/.env .env"]
+}
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..399e592
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,17 @@
+# EditorConfig is awesome: https://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# Matches all files
+[*]
+end_of_line = lf
+insert_final_newline = true
+indent_size = 2
+indent_style = space
+max_line_length = 80
+trim_trailing_whitespace = true
+
+# Matches all Markdown files
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000..e1d58b2
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,5 @@
+##########################
+#### CODE OWNER BLOCK ####
+##########################
+
+* @dandedotdev
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..aff82a1
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,6 @@
+version: 2
+updates:
+ - package-ecosystem: "npm"
+ directory: "/"
+ schedule:
+ interval: "weekly"
diff --git a/.github/workflows/check-secrets.yml b/.github/workflows/check-secrets.yml
new file mode 100644
index 0000000..efdb354
--- /dev/null
+++ b/.github/workflows/check-secrets.yml
@@ -0,0 +1,25 @@
+name: Check Secrets
+
+on:
+ pull_request:
+ branches:
+ - "**"
+ workflow_dispatch:
+
+jobs:
+ check-secrets:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Git checkout
+ uses: actions/checkout@v4
+
+ - name: Install Git Secrets
+ run: |
+ sudo apt-get update -y
+ sudo apt-get install -y git-secrets
+
+ - name: Scan for secrets
+ run: |
+ git secrets --register-aws
+ git secrets --scan
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
new file mode 100644
index 0000000..6e9f047
--- /dev/null
+++ b/.github/workflows/pr.yml
@@ -0,0 +1,87 @@
+name: CI workflow
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
+
+env:
+ NODE_VERSION: 25.3.0
+ PNPM_VERSION: 10.30.0
+
+on:
+ pull_request:
+ branches:
+ - "**"
+ workflow_dispatch:
+
+jobs:
+ init:
+ name: Initial Common Steps
+ runs-on: ubuntu-latest
+ outputs:
+ cache-hit: ${{ steps.cache.outputs.cache-hit }}
+
+ steps:
+ - name: Git checkout
+ uses: actions/checkout@v4
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v4
+ with:
+ version: ${{ env.PNPM_VERSION }}
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+
+ - name: Cache dependencies
+ id: cache
+ uses: actions/cache@v4
+ with:
+ path: |
+ node_modules
+ ~/.pnpm-store
+ key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
+
+ - name: Install dependencies
+ if: steps.cache.outputs.cache-hit != 'true'
+ run: pnpm install --frozen-lockfile
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+ needs: init
+
+ steps:
+ - name: Git checkout
+ uses: actions/checkout@v4
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v4
+ with:
+ version: ${{ env.PNPM_VERSION }}
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+
+ - name: Cache dependencies
+ id: cache
+ uses: actions/cache@v4
+ with:
+ path: |
+ node_modules
+ ~/.pnpm-store
+ key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
+
+ - name: Install dependencies
+ if: steps.cache.outputs.cache-hit != 'true'
+ run: pnpm install --frozen-lockfile
+
+ - name: Run Type Check
+ run: pnpm type-check
+
+ - name: Run linters
+ run: pnpm lint
diff --git a/.gitignore b/.gitignore
index 9ed8bae..ebe879a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,17 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# =================================== #
+# AI #
+# =================================== #
+
+.agents/skills
+.claude/skills
+.cursor/*
+!.cursor/mcp.json
+!.cursor/worktrees.json
+
+
# dependencies
/node_modules
/.pnp
diff --git a/.markdownlint.json b/.markdownlint.json
new file mode 100644
index 0000000..ab58673
--- /dev/null
+++ b/.markdownlint.json
@@ -0,0 +1,5 @@
+{
+ "MD013": false,
+ "MD040": false,
+ "MD041": false
+}
diff --git a/.markdownlintignore b/.markdownlintignore
new file mode 100644
index 0000000..07e6e47
--- /dev/null
+++ b/.markdownlintignore
@@ -0,0 +1 @@
+/node_modules
diff --git a/.mise.toml b/.mise.toml
new file mode 100644
index 0000000..8142710
--- /dev/null
+++ b/.mise.toml
@@ -0,0 +1,3 @@
+[tools]
+node = "25.3.0"
+pnpm = "10.30.0"
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..3d0cc4e
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,37 @@
+# =================================== #
+# AI #
+# =================================== #
+
+.agents
+.claude
+.cursor
+
+
+# =================================== #
+# MISC
+# =================================== #
+
+.DS_Store
+
+
+# =================================== #
+# Next.js
+# =================================== #
+
+.next
+.cache
+*.local
+dist
+dist-ssr
+pnpm-lock.yaml
+public
+node_modules
+next-env.d.ts
+next.config.ts
+
+
+# =================================== #
+# Testing
+# =================================== #
+
+**/coverage
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 0000000..071b407
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,15 @@
+{
+ "recommendations": [
+ "streetsidesoftware.code-spell-checker",
+ "fill-labs.dependi",
+ "editorconfig.editorconfig",
+ "dbaeumer.vscode-eslint",
+ "yzhang.markdown-all-in-one",
+ "shd101wyy.markdown-preview-enhanced",
+ "esbenp.prettier-vscode",
+ "yoavbls.pretty-ts-errors",
+ "kisstkondoros.vscode-gutter-preview",
+ "DavidAnson.vscode-markdownlint",
+ "bradlc.vscode-tailwindcss"
+ ]
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 4110aab..c18851b 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,19 @@
{
- "files.associations": {
- "wrangler.json": "jsonc"
- }
+ "editor.codeActionsOnSave": {
+ "source.fixAll.eslint": "explicit",
+ "source.fixAll.markdownlint": "explicit",
+ "source.fixAll.prettier": "explicit",
+ "source.organizeImports": "explicit",
+ "source.sortMembers": "explicit"
+ },
+ "files.associations": {
+ "wrangler.json": "jsonc"
+ },
+ "json.schemaDownload.enable": false,
+ "terminal.integrated.suggest.enabled": true,
+ "workbench.editor.customLabels.patterns": {
+ "**/index.*": "${dirname} (index)",
+ "**/layout.tsx": "${dirname} (layout)",
+ "**/page.tsx": "${dirname} (page)"
+ }
}
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..14d4fa8
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 dandedotdev
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/app/layout.tsx b/app/layout.tsx
new file mode 100644
index 0000000..20ec60c
--- /dev/null
+++ b/app/layout.tsx
@@ -0,0 +1,39 @@
+import type { Metadata } from "next"
+import { Geist, Geist_Mono } from "next/font/google"
+
+import "@/styles/globals.css"
+
+const geistSans = Geist({
+ variable: "--font-geist-sans",
+ subsets: ["latin"],
+})
+
+const geistMono = Geist_Mono({
+ variable: "--font-geist-mono",
+ subsets: ["latin"],
+})
+
+export const metadata: Metadata = {
+ title: "Dandelion Huang",
+ description:
+ "Full-stack Engineer focused on building scalable applications with seamless user experiences, using React and Rust, with a focus on AI and System Design.",
+}
+
+export default function RootLayout({
+ children,
+}: Readonly<{
+ children: React.ReactNode
+}>) {
+ return (
+
+
+
+
+
+ {children}
+
+
+ )
+}
diff --git a/app/page.tsx b/app/page.tsx
new file mode 100644
index 0000000..c2c2ed3
--- /dev/null
+++ b/app/page.tsx
@@ -0,0 +1,72 @@
+import Image from "next/image"
+
+const SOCIAL_LINKS = [
+ {
+ label: "Instagram",
+ href: "https://www.instagram.com/dandelion.huang/",
+ icon: (
+
+
+
+ ),
+ },
+ {
+ label: "GitHub",
+ href: "https://github.com/dandedotdev",
+ icon: (
+
+
+
+ ),
+ },
+] as const
+
+export default function Home() {
+ return (
+
+
+
+
+
+
+
+ Dandelion Huang
+
+
+
+ Full-stack Engineer focused on building scalable applications with
+ seamless user experiences, using React and Rust, with a focus on AI
+ and System Design. Active in the tech community—catch me at the
+ next Clojure, dbt, or Elixir Taiwan Meetup!
+
+
+
+ Beyond code, I take great pleasure in tea, coffee, and desserts, and I
+ love sharing these sensory experiences with those around me.
+
+
+
+ {SOCIAL_LINKS.map((link) => (
+
+ {link.icon}
+ {link.label}
+
+ ))}
+
+
+
+ )
+}
diff --git a/cloudflare-env.d.ts b/cloudflare-env.d.ts
index 26098de..a2f22ca 100644
--- a/cloudflare-env.d.ts
+++ b/cloudflare-env.d.ts
@@ -2,19 +2,23 @@
// Generated by Wrangler by running `wrangler types --env-interface CloudflareEnv ./cloudflare-env.d.ts` (hash: da1437d6e8676ee05b4680aead110808)
// Runtime types generated with workerd@1.20260217.0 2025-12-01 global_fetch_strictly_public,nodejs_compat
declare namespace Cloudflare {
- interface Env {
- IMAGES: ImagesBinding;
- ASSETS: Fetcher;
- NEXTJS_ENV: string;
- WORKER_SELF_REFERENCE: Fetcher /* blog */;
- }
+ interface Env {
+ IMAGES: ImagesBinding
+ ASSETS: Fetcher
+ NEXTJS_ENV: string
+ WORKER_SELF_REFERENCE: Fetcher /* blog */
+ }
}
interface CloudflareEnv 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<
+ Pick
+ > {}
}
// Begin runtime types
@@ -34,70 +38,70 @@ and limitations under the License.
***************************************************************************** */
/* eslint-disable */
// noinspection JSUnusedGlobalSymbols
-declare var onmessage: never;
+declare var onmessage: never
/**
* The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
*/
declare class DOMException extends Error {
- constructor(message?: string, name?: string);
- /**
- * The **`message`** read-only property of the a message or description associated with the given error name.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
- */
- readonly message: string;
- /**
- * The **`name`** read-only property of the one of the strings associated with an error name.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
- */
- readonly name: string;
- /**
- * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
- * @deprecated
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
- */
- readonly code: number;
- static readonly INDEX_SIZE_ERR: number;
- static readonly DOMSTRING_SIZE_ERR: number;
- static readonly HIERARCHY_REQUEST_ERR: number;
- static readonly WRONG_DOCUMENT_ERR: number;
- static readonly INVALID_CHARACTER_ERR: number;
- static readonly NO_DATA_ALLOWED_ERR: number;
- static readonly NO_MODIFICATION_ALLOWED_ERR: number;
- static readonly NOT_FOUND_ERR: number;
- static readonly NOT_SUPPORTED_ERR: number;
- static readonly INUSE_ATTRIBUTE_ERR: number;
- static readonly INVALID_STATE_ERR: number;
- static readonly SYNTAX_ERR: number;
- static readonly INVALID_MODIFICATION_ERR: number;
- static readonly NAMESPACE_ERR: number;
- static readonly INVALID_ACCESS_ERR: number;
- static readonly VALIDATION_ERR: number;
- static readonly TYPE_MISMATCH_ERR: number;
- static readonly SECURITY_ERR: number;
- static readonly NETWORK_ERR: number;
- static readonly ABORT_ERR: number;
- static readonly URL_MISMATCH_ERR: number;
- static readonly QUOTA_EXCEEDED_ERR: number;
- static readonly TIMEOUT_ERR: number;
- static readonly INVALID_NODE_TYPE_ERR: number;
- static readonly DATA_CLONE_ERR: number;
- get stack(): any;
- set stack(value: any);
+ constructor(message?: string, name?: string)
+ /**
+ * The **`message`** read-only property of the a message or description associated with the given error name.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
+ */
+ readonly message: string
+ /**
+ * The **`name`** read-only property of the one of the strings associated with an error name.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
+ */
+ readonly name: string
+ /**
+ * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
+ * @deprecated
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
+ */
+ readonly code: number
+ static readonly INDEX_SIZE_ERR: number
+ static readonly DOMSTRING_SIZE_ERR: number
+ static readonly HIERARCHY_REQUEST_ERR: number
+ static readonly WRONG_DOCUMENT_ERR: number
+ static readonly INVALID_CHARACTER_ERR: number
+ static readonly NO_DATA_ALLOWED_ERR: number
+ static readonly NO_MODIFICATION_ALLOWED_ERR: number
+ static readonly NOT_FOUND_ERR: number
+ static readonly NOT_SUPPORTED_ERR: number
+ static readonly INUSE_ATTRIBUTE_ERR: number
+ static readonly INVALID_STATE_ERR: number
+ static readonly SYNTAX_ERR: number
+ static readonly INVALID_MODIFICATION_ERR: number
+ static readonly NAMESPACE_ERR: number
+ static readonly INVALID_ACCESS_ERR: number
+ static readonly VALIDATION_ERR: number
+ static readonly TYPE_MISMATCH_ERR: number
+ static readonly SECURITY_ERR: number
+ static readonly NETWORK_ERR: number
+ static readonly ABORT_ERR: number
+ static readonly URL_MISMATCH_ERR: number
+ static readonly QUOTA_EXCEEDED_ERR: number
+ static readonly TIMEOUT_ERR: number
+ static readonly INVALID_NODE_TYPE_ERR: number
+ static readonly DATA_CLONE_ERR: number
+ get stack(): any
+ set stack(value: any)
}
type WorkerGlobalScopeEventMap = {
- fetch: FetchEvent;
- scheduled: ScheduledEvent;
- queue: QueueEvent;
- unhandledrejection: PromiseRejectionEvent;
- rejectionhandled: PromiseRejectionEvent;
-};
+ fetch: FetchEvent
+ scheduled: ScheduledEvent
+ queue: QueueEvent
+ unhandledrejection: PromiseRejectionEvent
+ rejectionhandled: PromiseRejectionEvent
+}
declare abstract class WorkerGlobalScope extends EventTarget {
- EventTarget: typeof EventTarget;
+ EventTarget: typeof EventTarget
}
/* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). *
* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox).
@@ -105,186 +109,204 @@ declare abstract class WorkerGlobalScope extends EventTarget;
- type Imports = Record;
- type ExportValue = Function | Global | Memory | Table;
- type Exports = Record;
- class Instance {
- constructor(module: Module, imports?: Imports);
- readonly exports: Exports;
- }
- interface MemoryDescriptor {
- initial: number;
- maximum?: number;
- shared?: boolean;
- }
- class Memory {
- constructor(descriptor: MemoryDescriptor);
- readonly buffer: ArrayBuffer;
- grow(delta: number): number;
- }
- type ImportExportKind = "function" | "global" | "memory" | "table";
- interface ModuleExportDescriptor {
- kind: ImportExportKind;
- name: string;
- }
- interface ModuleImportDescriptor {
- kind: ImportExportKind;
- module: string;
- name: string;
- }
- abstract class Module {
- static customSections(module: Module, sectionName: string): ArrayBuffer[];
- static exports(module: Module): ModuleExportDescriptor[];
- static imports(module: Module): ModuleImportDescriptor[];
- }
- type TableKind = "anyfunc" | "externref";
- interface TableDescriptor {
- element: TableKind;
- initial: number;
- maximum?: number;
- }
- class Table {
- constructor(descriptor: TableDescriptor, value?: any);
- readonly length: number;
- get(index: number): any;
- grow(delta: number, value?: any): number;
- set(index: number, value?: any): void;
- }
- function instantiate(module: Module, imports?: Imports): Promise;
- function validate(bytes: BufferSource): boolean;
+ class CompileError extends Error {
+ constructor(message?: string)
+ }
+ class RuntimeError extends Error {
+ constructor(message?: string)
+ }
+ type ValueType =
+ | "anyfunc"
+ | "externref"
+ | "f32"
+ | "f64"
+ | "i32"
+ | "i64"
+ | "v128"
+ interface GlobalDescriptor {
+ value: ValueType
+ mutable?: boolean
+ }
+ class Global {
+ constructor(descriptor: GlobalDescriptor, value?: any)
+ value: any
+ valueOf(): any
+ }
+ type ImportValue = ExportValue | number
+ type ModuleImports = Record
+ type Imports = Record
+ type ExportValue = Function | Global | Memory | Table
+ type Exports = Record
+ class Instance {
+ constructor(module: Module, imports?: Imports)
+ readonly exports: Exports
+ }
+ interface MemoryDescriptor {
+ initial: number
+ maximum?: number
+ shared?: boolean
+ }
+ class Memory {
+ constructor(descriptor: MemoryDescriptor)
+ readonly buffer: ArrayBuffer
+ grow(delta: number): number
+ }
+ type ImportExportKind = "function" | "global" | "memory" | "table"
+ interface ModuleExportDescriptor {
+ kind: ImportExportKind
+ name: string
+ }
+ interface ModuleImportDescriptor {
+ kind: ImportExportKind
+ module: string
+ name: string
+ }
+ abstract class Module {
+ static customSections(module: Module, sectionName: string): ArrayBuffer[]
+ static exports(module: Module): ModuleExportDescriptor[]
+ static imports(module: Module): ModuleImportDescriptor[]
+ }
+ type TableKind = "anyfunc" | "externref"
+ interface TableDescriptor {
+ element: TableKind
+ initial: number
+ maximum?: number
+ }
+ class Table {
+ constructor(descriptor: TableDescriptor, value?: any)
+ readonly length: number
+ get(index: number): any
+ grow(delta: number, value?: any): number
+ set(index: number, value?: any): void
+ }
+ function instantiate(module: Module, imports?: Imports): Promise
+ function validate(bytes: BufferSource): boolean
}
/**
* The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker.
@@ -293,313 +315,456 @@ declare namespace WebAssembly {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
*/
interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
- DOMException: typeof DOMException;
- WorkerGlobalScope: typeof WorkerGlobalScope;
- btoa(data: string): string;
- atob(data: string): string;
- setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
- setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
- clearTimeout(timeoutId: number | null): void;
- setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
- setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
- clearInterval(timeoutId: number | null): void;
- queueMicrotask(task: Function): void;
- structuredClone(value: T, options?: StructuredSerializeOptions): T;
- reportError(error: any): void;
- fetch(input: RequestInfo | URL, init?: RequestInit): Promise;
- self: ServiceWorkerGlobalScope;
- crypto: Crypto;
- caches: CacheStorage;
- scheduler: Scheduler;
- performance: Performance;
- Cloudflare: Cloudflare;
- readonly origin: string;
- Event: typeof Event;
- ExtendableEvent: typeof ExtendableEvent;
- CustomEvent: typeof CustomEvent;
- PromiseRejectionEvent: typeof PromiseRejectionEvent;
- FetchEvent: typeof FetchEvent;
- TailEvent: typeof TailEvent;
- TraceEvent: typeof TailEvent;
- ScheduledEvent: typeof ScheduledEvent;
- MessageEvent: typeof MessageEvent;
- CloseEvent: typeof CloseEvent;
- ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;
- ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;
- ReadableStream: typeof ReadableStream;
- WritableStream: typeof WritableStream;
- WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;
- TransformStream: typeof TransformStream;
- ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
- CountQueuingStrategy: typeof CountQueuingStrategy;
- ErrorEvent: typeof ErrorEvent;
- MessageChannel: typeof MessageChannel;
- MessagePort: typeof MessagePort;
- EventSource: typeof EventSource;
- ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
- ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
- ReadableByteStreamController: typeof ReadableByteStreamController;
- WritableStreamDefaultController: typeof WritableStreamDefaultController;
- TransformStreamDefaultController: typeof TransformStreamDefaultController;
- CompressionStream: typeof CompressionStream;
- DecompressionStream: typeof DecompressionStream;
- TextEncoderStream: typeof TextEncoderStream;
- TextDecoderStream: typeof TextDecoderStream;
- Headers: typeof Headers;
- Body: typeof Body;
- Request: typeof Request;
- Response: typeof Response;
- WebSocket: typeof WebSocket;
- WebSocketPair: typeof WebSocketPair;
- WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
- AbortController: typeof AbortController;
- AbortSignal: typeof AbortSignal;
- TextDecoder: typeof TextDecoder;
- TextEncoder: typeof TextEncoder;
- navigator: Navigator;
- Navigator: typeof Navigator;
- URL: typeof URL;
- URLSearchParams: typeof URLSearchParams;
- URLPattern: typeof URLPattern;
- Blob: typeof Blob;
- File: typeof File;
- FormData: typeof FormData;
- Crypto: typeof Crypto;
- SubtleCrypto: typeof SubtleCrypto;
- CryptoKey: typeof CryptoKey;
- CacheStorage: typeof CacheStorage;
- Cache: typeof Cache;
- FixedLengthStream: typeof FixedLengthStream;
- IdentityTransformStream: typeof IdentityTransformStream;
- HTMLRewriter: typeof HTMLRewriter;
-}
-declare function addEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetAddEventListenerOptions | boolean): void;
-declare function removeEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetEventListenerOptions | boolean): void;
+ DOMException: typeof DOMException
+ WorkerGlobalScope: typeof WorkerGlobalScope
+ btoa(data: string): string
+ atob(data: string): string
+ setTimeout(callback: (...args: any[]) => void, msDelay?: number): number
+ setTimeout(
+ callback: (...args: Args) => void,
+ msDelay?: number,
+ ...args: Args
+ ): number
+ clearTimeout(timeoutId: number | null): void
+ setInterval(callback: (...args: any[]) => void, msDelay?: number): number
+ setInterval(
+ callback: (...args: Args) => void,
+ msDelay?: number,
+ ...args: Args
+ ): number
+ clearInterval(timeoutId: number | null): void
+ queueMicrotask(task: Function): void
+ structuredClone(value: T, options?: StructuredSerializeOptions): T
+ reportError(error: any): void
+ fetch(
+ input: RequestInfo | URL,
+ init?: RequestInit
+ ): Promise
+ self: ServiceWorkerGlobalScope
+ crypto: Crypto
+ caches: CacheStorage
+ scheduler: Scheduler
+ performance: Performance
+ Cloudflare: Cloudflare
+ readonly origin: string
+ Event: typeof Event
+ ExtendableEvent: typeof ExtendableEvent
+ CustomEvent: typeof CustomEvent
+ PromiseRejectionEvent: typeof PromiseRejectionEvent
+ FetchEvent: typeof FetchEvent
+ TailEvent: typeof TailEvent
+ TraceEvent: typeof TailEvent
+ ScheduledEvent: typeof ScheduledEvent
+ MessageEvent: typeof MessageEvent
+ CloseEvent: typeof CloseEvent
+ ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader
+ ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader
+ ReadableStream: typeof ReadableStream
+ WritableStream: typeof WritableStream
+ WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter
+ TransformStream: typeof TransformStream
+ ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy
+ CountQueuingStrategy: typeof CountQueuingStrategy
+ ErrorEvent: typeof ErrorEvent
+ MessageChannel: typeof MessageChannel
+ MessagePort: typeof MessagePort
+ EventSource: typeof EventSource
+ ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest
+ ReadableStreamDefaultController: typeof ReadableStreamDefaultController
+ ReadableByteStreamController: typeof ReadableByteStreamController
+ WritableStreamDefaultController: typeof WritableStreamDefaultController
+ TransformStreamDefaultController: typeof TransformStreamDefaultController
+ CompressionStream: typeof CompressionStream
+ DecompressionStream: typeof DecompressionStream
+ TextEncoderStream: typeof TextEncoderStream
+ TextDecoderStream: typeof TextDecoderStream
+ Headers: typeof Headers
+ Body: typeof Body
+ Request: typeof Request
+ Response: typeof Response
+ WebSocket: typeof WebSocket
+ WebSocketPair: typeof WebSocketPair
+ WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair
+ AbortController: typeof AbortController
+ AbortSignal: typeof AbortSignal
+ TextDecoder: typeof TextDecoder
+ TextEncoder: typeof TextEncoder
+ navigator: Navigator
+ Navigator: typeof Navigator
+ URL: typeof URL
+ URLSearchParams: typeof URLSearchParams
+ URLPattern: typeof URLPattern
+ Blob: typeof Blob
+ File: typeof File
+ FormData: typeof FormData
+ Crypto: typeof Crypto
+ SubtleCrypto: typeof SubtleCrypto
+ CryptoKey: typeof CryptoKey
+ CacheStorage: typeof CacheStorage
+ Cache: typeof Cache
+ FixedLengthStream: typeof FixedLengthStream
+ IdentityTransformStream: typeof IdentityTransformStream
+ HTMLRewriter: typeof HTMLRewriter
+}
+declare function addEventListener(
+ type: Type,
+ handler: EventListenerOrEventListenerObject,
+ options?: EventTargetAddEventListenerOptions | boolean
+): void
+declare function removeEventListener<
+ Type extends keyof WorkerGlobalScopeEventMap,
+>(
+ type: Type,
+ handler: EventListenerOrEventListenerObject,
+ options?: EventTargetEventListenerOptions | boolean
+): void
/**
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/
-declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean;
+declare function dispatchEvent(
+ event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]
+): boolean
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
-declare function btoa(data: string): string;
+declare function btoa(data: string): string
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
-declare function atob(data: string): string;
+declare function atob(data: string): string
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
-declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
+declare function setTimeout(
+ callback: (...args: any[]) => void,
+ msDelay?: number
+): number
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
-declare function setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+declare function setTimeout(
+ callback: (...args: Args) => void,
+ msDelay?: number,
+ ...args: Args
+): number
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */
-declare function clearTimeout(timeoutId: number | null): void;
+declare function clearTimeout(timeoutId: number | null): void
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
-declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
+declare function setInterval(
+ callback: (...args: any[]) => void,
+ msDelay?: number
+): number
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
-declare function setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+declare function setInterval(
+ callback: (...args: Args) => void,
+ msDelay?: number,
+ ...args: Args
+): number
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */
-declare function clearInterval(timeoutId: number | null): void;
+declare function clearInterval(timeoutId: number | null): void
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */
-declare function queueMicrotask(task: Function): void;
+declare function queueMicrotask(task: Function): void
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
-declare function structuredClone(value: T, options?: StructuredSerializeOptions): T;
+declare function structuredClone(
+ value: T,
+ options?: StructuredSerializeOptions
+): T
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */
-declare function reportError(error: any): void;
+declare function reportError(error: any): void
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */
-declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise;
-declare const self: ServiceWorkerGlobalScope;
+declare function fetch(
+ input: RequestInfo | URL,
+ init?: RequestInit
+): Promise
+declare const self: ServiceWorkerGlobalScope
/**
-* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
-* The Workers runtime implements the full surface of this API, but with some differences in
-* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
-* compared to those implemented in most browsers.
-*
-* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
-*/
-declare const crypto: Crypto;
+ * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
+ * The Workers runtime implements the full surface of this API, but with some differences in
+ * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
+ * compared to those implemented in most browsers.
+ *
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
+ */
+declare const crypto: Crypto
/**
-* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
-*
-* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
-*/
-declare const caches: CacheStorage;
-declare const scheduler: Scheduler;
+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
+ *
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
+ */
+declare const caches: CacheStorage
+declare const scheduler: Scheduler
/**
-* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
-* as well as timing of subrequests and other operations.
-*
-* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
-*/
-declare const performance: Performance;
-declare const Cloudflare: Cloudflare;
-declare const origin: string;
-declare const navigator: Navigator;
-interface TestController {
-}
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
+ * as well as timing of subrequests and other operations.
+ *
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
+ */
+declare const performance: Performance
+declare const Cloudflare: Cloudflare
+declare const origin: string
+declare const navigator: Navigator
+interface TestController {}
interface ExecutionContext {
- waitUntil(promise: Promise): void;
- passThroughOnException(): void;
- readonly exports: Cloudflare.Exports;
- readonly props: Props;
-}
-type ExportedHandlerFetchHandler = (request: Request>, env: Env, ctx: ExecutionContext) => Response | Promise;
-type ExportedHandlerTailHandler = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise;
-type ExportedHandlerTraceHandler = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise;
-type ExportedHandlerTailStreamHandler = (event: TailStream.TailEvent, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise;
-type ExportedHandlerScheduledHandler = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise;
-type ExportedHandlerQueueHandler = (batch: MessageBatch, env: Env, ctx: ExecutionContext) => void | Promise;
-type ExportedHandlerTestHandler = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise;
-interface ExportedHandler {
- fetch?: ExportedHandlerFetchHandler;
- tail?: ExportedHandlerTailHandler;
- trace?: ExportedHandlerTraceHandler;
- tailStream?: ExportedHandlerTailStreamHandler;
- scheduled?: ExportedHandlerScheduledHandler;
- test?: ExportedHandlerTestHandler;
- email?: EmailExportedHandler;
- queue?: ExportedHandlerQueueHandler;
+ waitUntil(promise: Promise): void
+ passThroughOnException(): void
+ readonly exports: Cloudflare.Exports
+ readonly props: Props
+}
+type ExportedHandlerFetchHandler = (
+ request: Request>,
+ env: Env,
+ ctx: ExecutionContext
+) => Response | Promise
+type ExportedHandlerTailHandler = (
+ events: TraceItem[],
+ env: Env,
+ ctx: ExecutionContext
+) => void | Promise
+type ExportedHandlerTraceHandler = (
+ traces: TraceItem[],
+ env: Env,
+ ctx: ExecutionContext
+) => void | Promise
+type ExportedHandlerTailStreamHandler = (
+ event: TailStream.TailEvent,
+ env: Env,
+ ctx: ExecutionContext
+) => TailStream.TailEventHandlerType | Promise
+type ExportedHandlerScheduledHandler = (
+ controller: ScheduledController,
+ env: Env,
+ ctx: ExecutionContext
+) => void | Promise
+type ExportedHandlerQueueHandler = (
+ batch: MessageBatch,
+ env: Env,
+ ctx: ExecutionContext
+) => void | Promise
+type ExportedHandlerTestHandler = (
+ controller: TestController,
+ env: Env,
+ ctx: ExecutionContext
+) => void | Promise
+interface ExportedHandler<
+ Env = unknown,
+ QueueHandlerMessage = unknown,
+ CfHostMetadata = unknown,
+> {
+ fetch?: ExportedHandlerFetchHandler
+ tail?: ExportedHandlerTailHandler
+ trace?: ExportedHandlerTraceHandler
+ tailStream?: ExportedHandlerTailStreamHandler
+ scheduled?: ExportedHandlerScheduledHandler
+ test?: ExportedHandlerTestHandler
+ email?: EmailExportedHandler
+ queue?: ExportedHandlerQueueHandler
}
interface StructuredSerializeOptions {
- transfer?: any[];
+ transfer?: any[]
}
declare abstract class Navigator {
- sendBeacon(url: string, body?: BodyInit): boolean;
- readonly userAgent: string;
- readonly hardwareConcurrency: number;
- readonly language: string;
- readonly languages: string[];
+ sendBeacon(url: string, body?: BodyInit): boolean
+ readonly userAgent: string
+ readonly hardwareConcurrency: number
+ readonly language: string
+ readonly languages: string[]
}
interface AlarmInvocationInfo {
- readonly isRetry: boolean;
- readonly retryCount: number;
+ readonly isRetry: boolean
+ readonly retryCount: number
}
interface Cloudflare {
- readonly compatibilityFlags: Record;
+ readonly compatibilityFlags: Record
}
interface DurableObject {
- fetch(request: Request): Response | Promise;
- alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise;
- webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise;
- webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise;
- webSocketError?(ws: WebSocket, error: unknown): void | Promise;
-}
-type DurableObjectStub = Fetcher & {
- readonly id: DurableObjectId;
- readonly name?: string;
-};
+ fetch(request: Request): Response | Promise
+ alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise
+ webSocketMessage?(
+ ws: WebSocket,
+ message: string | ArrayBuffer
+ ): void | Promise
+ webSocketClose?(
+ ws: WebSocket,
+ code: number,
+ reason: string,
+ wasClean: boolean
+ ): void | Promise
+ webSocketError?(ws: WebSocket, error: unknown): void | Promise
+}
+type DurableObjectStub<
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
+> = Fetcher<
+ T,
+ "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
+> & {
+ readonly id: DurableObjectId
+ readonly name?: string
+}
interface DurableObjectId {
- toString(): string;
- equals(other: DurableObjectId): boolean;
- readonly name?: string;
-}
-declare abstract class DurableObjectNamespace {
- newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
- idFromName(name: string): DurableObjectId;
- idFromString(id: string): DurableObjectId;
- get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub;
- getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub;
- jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
-}
-type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
+ toString(): string
+ equals(other: DurableObjectId): boolean
+ readonly name?: string
+}
+declare abstract class DurableObjectNamespace<
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
+> {
+ newUniqueId(
+ options?: DurableObjectNamespaceNewUniqueIdOptions
+ ): DurableObjectId
+ idFromName(name: string): DurableObjectId
+ idFromString(id: string): DurableObjectId
+ get(
+ id: DurableObjectId,
+ options?: DurableObjectNamespaceGetDurableObjectOptions
+ ): DurableObjectStub
+ getByName(
+ name: string,
+ options?: DurableObjectNamespaceGetDurableObjectOptions
+ ): DurableObjectStub
+ jurisdiction(
+ jurisdiction: DurableObjectJurisdiction
+ ): DurableObjectNamespace
+}
+type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high"
interface DurableObjectNamespaceNewUniqueIdOptions {
- jurisdiction?: DurableObjectJurisdiction;
-}
-type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
-type DurableObjectRoutingMode = "primary-only";
+ jurisdiction?: DurableObjectJurisdiction
+}
+type DurableObjectLocationHint =
+ | "wnam"
+ | "enam"
+ | "sam"
+ | "weur"
+ | "eeur"
+ | "apac"
+ | "oc"
+ | "afr"
+ | "me"
+type DurableObjectRoutingMode = "primary-only"
interface DurableObjectNamespaceGetDurableObjectOptions {
- locationHint?: DurableObjectLocationHint;
- routingMode?: DurableObjectRoutingMode;
-}
-interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {
+ locationHint?: DurableObjectLocationHint
+ routingMode?: DurableObjectRoutingMode
}
+interface DurableObjectClass<
+ _T extends Rpc.DurableObjectBranded | undefined = undefined,
+> {}
interface DurableObjectState {
- waitUntil(promise: Promise): void;
- readonly exports: Cloudflare.Exports;
- readonly props: Props;
- readonly id: DurableObjectId;
- readonly storage: DurableObjectStorage;
- container?: Container;
- blockConcurrencyWhile(callback: () => Promise): Promise;
- acceptWebSocket(ws: WebSocket, tags?: string[]): void;
- getWebSockets(tag?: string): WebSocket[];
- setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
- getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
- getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
- setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
- getHibernatableWebSocketEventTimeout(): number | null;
- getTags(ws: WebSocket): string[];
- abort(reason?: string): void;
+ waitUntil(promise: Promise): void
+ readonly exports: Cloudflare.Exports
+ readonly props: Props
+ readonly id: DurableObjectId
+ readonly storage: DurableObjectStorage
+ container?: Container
+ blockConcurrencyWhile(callback: () => Promise): Promise
+ acceptWebSocket(ws: WebSocket, tags?: string[]): void
+ getWebSockets(tag?: string): WebSocket[]
+ setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void
+ getWebSocketAutoResponse(): WebSocketRequestResponsePair | null
+ getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null
+ setHibernatableWebSocketEventTimeout(timeoutMs?: number): void
+ getHibernatableWebSocketEventTimeout(): number | null
+ getTags(ws: WebSocket): string[]
+ abort(reason?: string): void
}
interface DurableObjectTransaction {
- get(key: string, options?: DurableObjectGetOptions): Promise;
- get(keys: string[], options?: DurableObjectGetOptions): Promise>;
- list(options?: DurableObjectListOptions): Promise>;
- put(key: string, value: T, options?: DurableObjectPutOptions): Promise;
- put(entries: Record, options?: DurableObjectPutOptions): Promise;
- delete(key: string, options?: DurableObjectPutOptions): Promise;
- delete(keys: string[], options?: DurableObjectPutOptions): Promise;
- rollback(): void;
- getAlarm(options?: DurableObjectGetAlarmOptions): Promise;
- setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise;
- deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise;
+ get(
+ key: string,
+ options?: DurableObjectGetOptions
+ ): Promise
+ get(
+ keys: string[],
+ options?: DurableObjectGetOptions
+ ): Promise>
+ list(options?: DurableObjectListOptions): Promise>
+ put(
+ key: string,
+ value: T,
+ options?: DurableObjectPutOptions
+ ): Promise
+ put(
+ entries: Record,
+ options?: DurableObjectPutOptions
+ ): Promise
+ delete(key: string, options?: DurableObjectPutOptions): Promise
+ delete(keys: string[], options?: DurableObjectPutOptions): Promise
+ rollback(): void
+ getAlarm(options?: DurableObjectGetAlarmOptions): Promise
+ setAlarm(
+ scheduledTime: number | Date,
+ options?: DurableObjectSetAlarmOptions
+ ): Promise
+ deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise
}
interface DurableObjectStorage {
- get(key: string, options?: DurableObjectGetOptions): Promise;
- get(keys: string[], options?: DurableObjectGetOptions): Promise>;
- list(options?: DurableObjectListOptions): Promise>;
- put(key: string, value: T, options?: DurableObjectPutOptions): Promise;
- put(entries: Record, options?: DurableObjectPutOptions): Promise;
- delete(key: string, options?: DurableObjectPutOptions): Promise;
- delete(keys: string[], options?: DurableObjectPutOptions): Promise;
- deleteAll(options?: DurableObjectPutOptions): Promise;
- transaction(closure: (txn: DurableObjectTransaction) => Promise): Promise;
- getAlarm(options?: DurableObjectGetAlarmOptions): Promise;
- setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise;
- deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise;
- sync(): Promise;
- sql: SqlStorage;
- kv: SyncKvStorage;
- transactionSync(closure: () => T): T;
- getCurrentBookmark(): Promise;
- getBookmarkForTime(timestamp: number | Date): Promise;
- onNextSessionRestoreBookmark(bookmark: string): Promise;
+ get(
+ key: string,
+ options?: DurableObjectGetOptions
+ ): Promise
+ get(
+ keys: string[],
+ options?: DurableObjectGetOptions
+ ): Promise>
+ list(options?: DurableObjectListOptions): Promise>
+ put(
+ key: string,
+ value: T,
+ options?: DurableObjectPutOptions
+ ): Promise
+ put(
+ entries: Record,
+ options?: DurableObjectPutOptions
+ ): Promise
+ delete(key: string, options?: DurableObjectPutOptions): Promise
+ delete(keys: string[], options?: DurableObjectPutOptions): Promise
+ deleteAll(options?: DurableObjectPutOptions): Promise
+ transaction(
+ closure: (txn: DurableObjectTransaction) => Promise
+ ): Promise
+ getAlarm(options?: DurableObjectGetAlarmOptions): Promise
+ setAlarm(
+ scheduledTime: number | Date,
+ options?: DurableObjectSetAlarmOptions
+ ): Promise
+ deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise
+ sync(): Promise
+ sql: SqlStorage
+ kv: SyncKvStorage
+ transactionSync(closure: () => T): T
+ getCurrentBookmark(): Promise
+ getBookmarkForTime(timestamp: number | Date): Promise
+ onNextSessionRestoreBookmark(bookmark: string): Promise
}
interface DurableObjectListOptions {
- start?: string;
- startAfter?: string;
- end?: string;
- prefix?: string;
- reverse?: boolean;
- limit?: number;
- allowConcurrency?: boolean;
- noCache?: boolean;
+ start?: string
+ startAfter?: string
+ end?: string
+ prefix?: string
+ reverse?: boolean
+ limit?: number
+ allowConcurrency?: boolean
+ noCache?: boolean
}
interface DurableObjectGetOptions {
- allowConcurrency?: boolean;
- noCache?: boolean;
+ allowConcurrency?: boolean
+ noCache?: boolean
}
interface DurableObjectGetAlarmOptions {
- allowConcurrency?: boolean;
+ allowConcurrency?: boolean
}
interface DurableObjectPutOptions {
- allowConcurrency?: boolean;
- allowUnconfirmed?: boolean;
- noCache?: boolean;
+ allowConcurrency?: boolean
+ allowUnconfirmed?: boolean
+ noCache?: boolean
}
interface DurableObjectSetAlarmOptions {
- allowConcurrency?: boolean;
- allowUnconfirmed?: boolean;
+ allowConcurrency?: boolean
+ allowUnconfirmed?: boolean
}
declare class WebSocketRequestResponsePair {
- constructor(request: string, response: string);
- get request(): string;
- get response(): string;
+ constructor(request: string, response: string)
+ get request(): string
+ get response(): string
}
interface AnalyticsEngineDataset {
- writeDataPoint(event?: AnalyticsEngineDataPoint): void;
+ writeDataPoint(event?: AnalyticsEngineDataPoint): void
}
interface AnalyticsEngineDataPoint {
- indexes?: ((ArrayBuffer | string) | null)[];
- doubles?: number[];
- blobs?: ((ArrayBuffer | string) | null)[];
+ indexes?: ((ArrayBuffer | string) | null)[]
+ doubles?: number[]
+ blobs?: ((ArrayBuffer | string) | null)[]
}
/**
* The **`Event`** interface represents an event which takes place on an `EventTarget`.
@@ -607,171 +772,183 @@ interface AnalyticsEngineDataPoint {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
*/
declare class Event {
- constructor(type: string, init?: EventInit);
- /**
- * The **`type`** read-only property of the Event interface returns a string containing the event's type.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
- */
- get type(): string;
- /**
- * The **`eventPhase`** read-only property of the being evaluated.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
- */
- get eventPhase(): number;
- /**
- * The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
- */
- get composed(): boolean;
- /**
- * The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
- */
- get bubbles(): boolean;
- /**
- * The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
- */
- get cancelable(): boolean;
- /**
- * The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
- */
- get defaultPrevented(): boolean;
- /**
- * The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not.
- * @deprecated
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
- */
- get returnValue(): boolean;
- /**
- * The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
- */
- get currentTarget(): EventTarget | undefined;
- /**
- * The read-only **`target`** property of the dispatched.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
- */
- get target(): EventTarget | undefined;
- /**
- * The deprecated **`Event.srcElement`** is an alias for the Event.target property.
- * @deprecated
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
- */
- get srcElement(): EventTarget | undefined;
- /**
- * The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
- */
- get timeStamp(): number;
- /**
- * The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
- */
- get isTrusted(): boolean;
- /**
- * The **`cancelBubble`** property of the Event interface is deprecated.
- * @deprecated
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
- */
- get cancelBubble(): boolean;
- /**
- * The **`cancelBubble`** property of the Event interface is deprecated.
- * @deprecated
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
- */
- set cancelBubble(value: boolean);
- /**
- * The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
- */
- stopImmediatePropagation(): void;
- /**
- * The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
- */
- preventDefault(): void;
- /**
- * The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
- */
- stopPropagation(): void;
- /**
- * The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
- */
- composedPath(): EventTarget[];
- static readonly NONE: number;
- static readonly CAPTURING_PHASE: number;
- static readonly AT_TARGET: number;
- static readonly BUBBLING_PHASE: number;
+ constructor(type: string, init?: EventInit)
+ /**
+ * The **`type`** read-only property of the Event interface returns a string containing the event's type.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
+ */
+ get type(): string
+ /**
+ * The **`eventPhase`** read-only property of the being evaluated.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
+ */
+ get eventPhase(): number
+ /**
+ * The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
+ */
+ get composed(): boolean
+ /**
+ * The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
+ */
+ get bubbles(): boolean
+ /**
+ * The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
+ */
+ get cancelable(): boolean
+ /**
+ * The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
+ */
+ get defaultPrevented(): boolean
+ /**
+ * The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not.
+ * @deprecated
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
+ */
+ get returnValue(): boolean
+ /**
+ * The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
+ */
+ get currentTarget(): EventTarget | undefined
+ /**
+ * The read-only **`target`** property of the dispatched.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
+ */
+ get target(): EventTarget | undefined
+ /**
+ * The deprecated **`Event.srcElement`** is an alias for the Event.target property.
+ * @deprecated
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
+ */
+ get srcElement(): EventTarget | undefined
+ /**
+ * The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
+ */
+ get timeStamp(): number
+ /**
+ * The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
+ */
+ get isTrusted(): boolean
+ /**
+ * The **`cancelBubble`** property of the Event interface is deprecated.
+ * @deprecated
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
+ */
+ get cancelBubble(): boolean
+ /**
+ * The **`cancelBubble`** property of the Event interface is deprecated.
+ * @deprecated
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
+ */
+ set cancelBubble(value: boolean)
+ /**
+ * The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
+ */
+ stopImmediatePropagation(): void
+ /**
+ * The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
+ */
+ preventDefault(): void
+ /**
+ * The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
+ */
+ stopPropagation(): void
+ /**
+ * The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
+ */
+ composedPath(): EventTarget[]
+ static readonly NONE: number
+ static readonly CAPTURING_PHASE: number
+ static readonly AT_TARGET: number
+ static readonly BUBBLING_PHASE: number
}
interface EventInit {
- bubbles?: boolean;
- cancelable?: boolean;
- composed?: boolean;
+ bubbles?: boolean
+ cancelable?: boolean
+ composed?: boolean
}
-type EventListener = (event: EventType) => void;
+type EventListener = (event: EventType) => void
interface EventListenerObject {
- handleEvent(event: EventType): void;
+ handleEvent(event: EventType): void
}
-type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
+type EventListenerOrEventListenerObject =
+ | EventListener
+ | EventListenerObject
/**
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
*/
-declare class EventTarget = Record> {
- constructor();
- /**
- * The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
- */
- addEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetAddEventListenerOptions | boolean): void;
- /**
- * The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
- */
- removeEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetEventListenerOptions | boolean): void;
- /**
- * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
- */
- dispatchEvent(event: EventMap[keyof EventMap]): boolean;
+declare class EventTarget<
+ EventMap extends Record = Record,
+> {
+ constructor()
+ /**
+ * The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
+ */
+ addEventListener(
+ type: Type,
+ handler: EventListenerOrEventListenerObject,
+ options?: EventTargetAddEventListenerOptions | boolean
+ ): void
+ /**
+ * The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
+ */
+ removeEventListener(
+ type: Type,
+ handler: EventListenerOrEventListenerObject,
+ options?: EventTargetEventListenerOptions | boolean
+ ): void
+ /**
+ * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
+ */
+ dispatchEvent(event: EventMap[keyof EventMap]): boolean
}
interface EventTargetEventListenerOptions {
- capture?: boolean;
+ capture?: boolean
}
interface EventTargetAddEventListenerOptions {
- capture?: boolean;
- passive?: boolean;
- once?: boolean;
- signal?: AbortSignal;
+ capture?: boolean
+ passive?: boolean
+ once?: boolean
+ signal?: AbortSignal
}
interface EventTargetHandlerObject {
- handleEvent: (event: Event) => any | undefined;
+ handleEvent: (event: Event) => any | undefined
}
/**
* The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired.
@@ -779,19 +956,19 @@ interface EventTargetHandlerObject {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
*/
declare class AbortController {
- constructor();
- /**
- * The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
- */
- get signal(): AbortSignal;
- /**
- * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
- */
- abort(reason?: any): void;
+ constructor()
+ /**
+ * The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
+ */
+ get signal(): AbortSignal
+ /**
+ * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
+ */
+ abort(reason?: any): void
}
/**
* The **`AbortSignal`** interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object.
@@ -799,52 +976,52 @@ declare class AbortController {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
*/
declare abstract class AbortSignal extends EventTarget {
- /**
- * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
- */
- static abort(reason?: any): AbortSignal;
- /**
- * The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static)
- */
- static timeout(delay: number): AbortSignal;
- /**
- * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
- */
- static any(signals: AbortSignal[]): AbortSignal;
- /**
- * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
- */
- get aborted(): boolean;
- /**
- * The **`reason`** read-only property returns a JavaScript value that indicates the abort reason.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason)
- */
- get reason(): any;
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
- get onabort(): any | null;
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
- set onabort(value: any | null);
- /**
- * The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
- */
- throwIfAborted(): void;
+ /**
+ * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
+ */
+ static abort(reason?: any): AbortSignal
+ /**
+ * The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static)
+ */
+ static timeout(delay: number): AbortSignal
+ /**
+ * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
+ */
+ static any(signals: AbortSignal[]): AbortSignal
+ /**
+ * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
+ */
+ get aborted(): boolean
+ /**
+ * The **`reason`** read-only property returns a JavaScript value that indicates the abort reason.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason)
+ */
+ get reason(): any
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
+ get onabort(): any | null
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
+ set onabort(value: any | null)
+ /**
+ * The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
+ */
+ throwIfAborted(): void
}
interface Scheduler {
- wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise;
+ wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise
}
interface SchedulerWaitOptions {
- signal?: AbortSignal;
+ signal?: AbortSignal
}
/**
* The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
@@ -852,12 +1029,12 @@ interface SchedulerWaitOptions {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
*/
declare abstract class ExtendableEvent extends Event {
- /**
- * The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
- */
- waitUntil(promise: Promise): void;
+ /**
+ * The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
+ */
+ waitUntil(promise: Promise): void
}
/**
* The **`CustomEvent`** interface represents events initialized by an application for any purpose.
@@ -865,19 +1042,19 @@ declare abstract class ExtendableEvent extends Event {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
*/
declare class CustomEvent extends Event {
- constructor(type: string, init?: CustomEventCustomEventInit);
- /**
- * The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
- */
- get detail(): T;
+ constructor(type: string, init?: CustomEventCustomEventInit)
+ /**
+ * The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
+ */
+ get detail(): T
}
interface CustomEventCustomEventInit {
- bubbles?: boolean;
- cancelable?: boolean;
- composed?: boolean;
- detail?: any;
+ bubbles?: boolean
+ cancelable?: boolean
+ composed?: boolean
+ detail?: any
}
/**
* The **`Blob`** interface represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a ReadableStream so its methods can be used for processing the data.
@@ -885,52 +1062,55 @@ interface CustomEventCustomEventInit {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
*/
declare class Blob {
- constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
- /**
- * The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size)
- */
- get size(): number;
- /**
- * The **`type`** read-only property of the Blob interface returns the MIME type of the file.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type)
- */
- get type(): string;
- /**
- * The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
- */
- slice(start?: number, end?: number, type?: string): Blob;
- /**
- * The **`arrayBuffer()`** method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer)
- */
- arrayBuffer(): Promise;
- /**
- * The **`bytes()`** method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes)
- */
- bytes(): Promise;
- /**
- * The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
- */
- text(): Promise;
- /**
- * The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
- */
- stream(): ReadableStream;
+ constructor(
+ type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
+ options?: BlobOptions
+ )
+ /**
+ * The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size)
+ */
+ get size(): number
+ /**
+ * The **`type`** read-only property of the Blob interface returns the MIME type of the file.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type)
+ */
+ get type(): string
+ /**
+ * The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
+ */
+ slice(start?: number, end?: number, type?: string): Blob
+ /**
+ * The **`arrayBuffer()`** method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer)
+ */
+ arrayBuffer(): Promise
+ /**
+ * The **`bytes()`** method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes)
+ */
+ bytes(): Promise
+ /**
+ * The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
+ */
+ text(): Promise
+ /**
+ * The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
+ */
+ stream(): ReadableStream
}
interface BlobOptions {
- type?: string;
+ type?: string
}
/**
* The **`File`** interface provides information about files and allows JavaScript in a web page to access their content.
@@ -938,84 +1118,104 @@ interface BlobOptions {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
*/
declare class File extends Blob {
- constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
- /**
- * The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
- */
- get name(): string;
- /**
- * The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
- */
- get lastModified(): number;
+ constructor(
+ bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
+ name: string,
+ options?: FileOptions
+ )
+ /**
+ * The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
+ */
+ get name(): string
+ /**
+ * The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
+ */
+ get lastModified(): number
}
interface FileOptions {
- type?: string;
- lastModified?: number;
+ type?: string
+ lastModified?: number
}
/**
-* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
-*
-* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
-*/
+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
+ *
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
+ */
declare abstract class CacheStorage {
- /**
- * The **`open()`** method of the the Cache object matching the `cacheName`.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
- */
- open(cacheName: string): Promise;
- readonly default: Cache;
+ /**
+ * The **`open()`** method of the the Cache object matching the `cacheName`.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
+ */
+ open(cacheName: string): Promise
+ readonly default: Cache
}
/**
-* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
-*
-* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
-*/
+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
+ *
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
+ */
declare abstract class Cache {
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
- delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise;
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
- match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise;
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
- put(request: RequestInfo | URL, response: Response): Promise;
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
+ delete(
+ request: RequestInfo | URL,
+ options?: CacheQueryOptions
+ ): Promise
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
+ match(
+ request: RequestInfo | URL,
+ options?: CacheQueryOptions
+ ): Promise
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
+ put(request: RequestInfo | URL, response: Response): Promise
}
interface CacheQueryOptions {
- ignoreMethod?: boolean;
+ ignoreMethod?: boolean
}
/**
-* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
-* The Workers runtime implements the full surface of this API, but with some differences in
-* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
-* compared to those implemented in most browsers.
-*
-* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
-*/
+ * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
+ * The Workers runtime implements the full surface of this API, but with some differences in
+ * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
+ * compared to those implemented in most browsers.
+ *
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
+ */
declare abstract class Crypto {
- /**
- * The **`Crypto.subtle`** read-only property returns a cryptographic operations.
- * Available only in secure contexts.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
- */
- get subtle(): SubtleCrypto;
- /**
- * The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
- */
- getRandomValues(buffer: T): T;
- /**
- * The **`randomUUID()`** method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator.
- * Available only in secure contexts.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
- */
- randomUUID(): string;
- DigestStream: typeof DigestStream;
+ /**
+ * The **`Crypto.subtle`** read-only property returns a cryptographic operations.
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
+ */
+ get subtle(): SubtleCrypto
+ /**
+ * The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
+ */
+ getRandomValues<
+ T extends
+ | Int8Array
+ | Uint8Array
+ | Int16Array
+ | Uint16Array
+ | Int32Array
+ | Uint32Array
+ | BigInt64Array
+ | BigUint64Array,
+ >(buffer: T): T
+ /**
+ * The **`randomUUID()`** method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator.
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
+ */
+ randomUUID(): string
+ DigestStream: typeof DigestStream
}
/**
* The **`SubtleCrypto`** interface of the Web Crypto API provides a number of low-level cryptographic functions.
@@ -1024,79 +1224,135 @@ declare abstract class Crypto {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
*/
declare abstract class SubtleCrypto {
- /**
- * The **`encrypt()`** method of the SubtleCrypto interface encrypts data.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt)
- */
- encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise;
- /**
- * The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
- */
- decrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, cipherText: ArrayBuffer | ArrayBufferView): Promise;
- /**
- * The **`sign()`** method of the SubtleCrypto interface generates a digital signature.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign)
- */
- sign(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, data: ArrayBuffer | ArrayBufferView): Promise;
- /**
- * The **`verify()`** method of the SubtleCrypto interface verifies a digital signature.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify)
- */
- verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise;
- /**
- * The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
- */
- digest(algorithm: string | SubtleCryptoHashAlgorithm, data: ArrayBuffer | ArrayBufferView): Promise;
- /**
- * The **`generateKey()`** method of the SubtleCrypto interface is used to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms).
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey)
- */
- generateKey(algorithm: string | SubtleCryptoGenerateKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise;
- /**
- * The **`deriveKey()`** method of the SubtleCrypto interface can be used to derive a secret key from a master key.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey)
- */
- deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise;
- /**
- * The **`deriveBits()`** method of the key.
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
- */
- deriveBits(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, length?: number | null): Promise