#
tokens: 115584/50000 1/1091 files (page 67/67)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 67 of 67. Use http://codebase.md/better-auth/better-auth?lines=true&page={x} to view the full context.

# Directory Structure

```
├── .gitattributes
├── .github
│   ├── CODEOWNERS
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE
│   │   ├── bug_report.yml
│   │   └── feature_request.yml
│   ├── renovate.json5
│   └── workflows
│       ├── ci.yml
│       ├── e2e.yml
│       ├── preview.yml
│       └── release.yml
├── .gitignore
├── .npmrc
├── .nvmrc
├── .vscode
│   └── settings.json
├── banner-dark.png
├── banner.png
├── biome.json
├── bump.config.ts
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── demo
│   ├── expo-example
│   │   ├── .env.example
│   │   ├── .gitignore
│   │   ├── app.config.ts
│   │   ├── assets
│   │   │   ├── bg-image.jpeg
│   │   │   ├── fonts
│   │   │   │   └── SpaceMono-Regular.ttf
│   │   │   ├── icon.png
│   │   │   └── images
│   │   │       ├── adaptive-icon.png
│   │   │       ├── favicon.png
│   │   │       ├── logo.png
│   │   │       ├── partial-react-logo.png
│   │   │       ├── react-logo.png
│   │   │       ├── [email protected]
│   │   │       ├── [email protected]
│   │   │       └── splash.png
│   │   ├── babel.config.js
│   │   ├── components.json
│   │   ├── expo-env.d.ts
│   │   ├── index.ts
│   │   ├── metro.config.js
│   │   ├── nativewind-env.d.ts
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── src
│   │   │   ├── app
│   │   │   │   ├── _layout.tsx
│   │   │   │   ├── api
│   │   │   │   │   └── auth
│   │   │   │   │       └── [...route]+api.ts
│   │   │   │   ├── dashboard.tsx
│   │   │   │   ├── forget-password.tsx
│   │   │   │   ├── index.tsx
│   │   │   │   └── sign-up.tsx
│   │   │   ├── components
│   │   │   │   ├── icons
│   │   │   │   │   └── google.tsx
│   │   │   │   └── ui
│   │   │   │       ├── avatar.tsx
│   │   │   │       ├── button.tsx
│   │   │   │       ├── card.tsx
│   │   │   │       ├── dialog.tsx
│   │   │   │       ├── input.tsx
│   │   │   │       ├── separator.tsx
│   │   │   │       └── text.tsx
│   │   │   ├── global.css
│   │   │   └── lib
│   │   │       ├── auth-client.ts
│   │   │       ├── auth.ts
│   │   │       ├── icons
│   │   │       │   ├── iconWithClassName.ts
│   │   │       │   └── X.tsx
│   │   │       └── utils.ts
│   │   ├── tailwind.config.js
│   │   └── tsconfig.json
│   └── nextjs
│       ├── .env.example
│       ├── .gitignore
│       ├── app
│       │   ├── (auth)
│       │   │   ├── forget-password
│       │   │   │   └── page.tsx
│       │   │   ├── reset-password
│       │   │   │   └── page.tsx
│       │   │   ├── sign-in
│       │   │   │   ├── loading.tsx
│       │   │   │   └── page.tsx
│       │   │   └── two-factor
│       │   │       ├── otp
│       │   │       │   └── page.tsx
│       │   │       └── page.tsx
│       │   ├── accept-invitation
│       │   │   └── [id]
│       │   │       ├── invitation-error.tsx
│       │   │       └── page.tsx
│       │   ├── admin
│       │   │   └── page.tsx
│       │   ├── api
│       │   │   └── auth
│       │   │       └── [...all]
│       │   │           └── route.ts
│       │   ├── apps
│       │   │   └── register
│       │   │       └── page.tsx
│       │   ├── client-test
│       │   │   └── page.tsx
│       │   ├── dashboard
│       │   │   ├── change-plan.tsx
│       │   │   ├── client.tsx
│       │   │   ├── organization-card.tsx
│       │   │   ├── page.tsx
│       │   │   ├── upgrade-button.tsx
│       │   │   └── user-card.tsx
│       │   ├── device
│       │   │   ├── approve
│       │   │   │   └── page.tsx
│       │   │   ├── denied
│       │   │   │   └── page.tsx
│       │   │   ├── layout.tsx
│       │   │   ├── page.tsx
│       │   │   └── success
│       │   │       └── page.tsx
│       │   ├── favicon.ico
│       │   ├── features.tsx
│       │   ├── fonts
│       │   │   ├── GeistMonoVF.woff
│       │   │   └── GeistVF.woff
│       │   ├── globals.css
│       │   ├── layout.tsx
│       │   ├── oauth
│       │   │   └── authorize
│       │   │       ├── concet-buttons.tsx
│       │   │       └── page.tsx
│       │   ├── page.tsx
│       │   └── pricing
│       │       └── page.tsx
│       ├── components
│       │   ├── account-switch.tsx
│       │   ├── blocks
│       │   │   └── pricing.tsx
│       │   ├── logo.tsx
│       │   ├── one-tap.tsx
│       │   ├── sign-in-btn.tsx
│       │   ├── sign-in.tsx
│       │   ├── sign-up.tsx
│       │   ├── theme-provider.tsx
│       │   ├── theme-toggle.tsx
│       │   ├── tier-labels.tsx
│       │   ├── ui
│       │   │   ├── accordion.tsx
│       │   │   ├── alert-dialog.tsx
│       │   │   ├── alert.tsx
│       │   │   ├── aspect-ratio.tsx
│       │   │   ├── avatar.tsx
│       │   │   ├── badge.tsx
│       │   │   ├── breadcrumb.tsx
│       │   │   ├── button.tsx
│       │   │   ├── calendar.tsx
│       │   │   ├── card.tsx
│       │   │   ├── carousel.tsx
│       │   │   ├── chart.tsx
│       │   │   ├── checkbox.tsx
│       │   │   ├── collapsible.tsx
│       │   │   ├── command.tsx
│       │   │   ├── context-menu.tsx
│       │   │   ├── copy-button.tsx
│       │   │   ├── dialog.tsx
│       │   │   ├── drawer.tsx
│       │   │   ├── dropdown-menu.tsx
│       │   │   ├── form.tsx
│       │   │   ├── hover-card.tsx
│       │   │   ├── input-otp.tsx
│       │   │   ├── input.tsx
│       │   │   ├── label.tsx
│       │   │   ├── menubar.tsx
│       │   │   ├── navigation-menu.tsx
│       │   │   ├── pagination.tsx
│       │   │   ├── password-input.tsx
│       │   │   ├── popover.tsx
│       │   │   ├── progress.tsx
│       │   │   ├── radio-group.tsx
│       │   │   ├── resizable.tsx
│       │   │   ├── scroll-area.tsx
│       │   │   ├── select.tsx
│       │   │   ├── separator.tsx
│       │   │   ├── sheet.tsx
│       │   │   ├── skeleton.tsx
│       │   │   ├── slider.tsx
│       │   │   ├── sonner.tsx
│       │   │   ├── switch.tsx
│       │   │   ├── table.tsx
│       │   │   ├── tabs.tsx
│       │   │   ├── tabs2.tsx
│       │   │   ├── textarea.tsx
│       │   │   ├── toast.tsx
│       │   │   ├── toaster.tsx
│       │   │   ├── toggle-group.tsx
│       │   │   ├── toggle.tsx
│       │   │   └── tooltip.tsx
│       │   └── wrapper.tsx
│       ├── components.json
│       ├── hooks
│       │   └── use-toast.ts
│       ├── lib
│       │   ├── auth-client.ts
│       │   ├── auth-types.ts
│       │   ├── auth.ts
│       │   ├── email
│       │   │   ├── invitation.tsx
│       │   │   ├── resend.ts
│       │   │   └── reset-password.tsx
│       │   ├── metadata.ts
│       │   ├── shared.ts
│       │   └── utils.ts
│       ├── middleware.ts
│       ├── next.config.ts
│       ├── package.json
│       ├── postcss.config.mjs
│       ├── public
│       │   ├── __og.png
│       │   ├── _og.png
│       │   ├── favicon
│       │   │   ├── android-chrome-192x192.png
│       │   │   ├── android-chrome-512x512.png
│       │   │   ├── apple-touch-icon.png
│       │   │   ├── favicon-16x16.png
│       │   │   ├── favicon-32x32.png
│       │   │   ├── favicon.ico
│       │   │   ├── light
│       │   │   │   ├── android-chrome-192x192.png
│       │   │   │   ├── android-chrome-512x512.png
│       │   │   │   ├── apple-touch-icon.png
│       │   │   │   ├── favicon-16x16.png
│       │   │   │   ├── favicon-32x32.png
│       │   │   │   ├── favicon.ico
│       │   │   │   └── site.webmanifest
│       │   │   └── site.webmanifest
│       │   ├── logo.svg
│       │   └── og.png
│       ├── README.md
│       ├── tailwind.config.ts
│       ├── tsconfig.json
│       └── turbo.json
├── docker-compose.yml
├── docs
│   ├── .env.example
│   ├── .gitignore
│   ├── app
│   │   ├── api
│   │   │   ├── ai-chat
│   │   │   │   └── route.ts
│   │   │   ├── analytics
│   │   │   │   ├── conversation
│   │   │   │   │   └── route.ts
│   │   │   │   ├── event
│   │   │   │   │   └── route.ts
│   │   │   │   └── feedback
│   │   │   │       └── route.ts
│   │   │   ├── chat
│   │   │   │   └── route.ts
│   │   │   ├── og
│   │   │   │   └── route.tsx
│   │   │   ├── og-release
│   │   │   │   └── route.tsx
│   │   │   ├── search
│   │   │   │   └── route.ts
│   │   │   └── support
│   │   │       └── route.ts
│   │   ├── blog
│   │   │   ├── _components
│   │   │   │   ├── _layout.tsx
│   │   │   │   ├── blog-list.tsx
│   │   │   │   ├── changelog-layout.tsx
│   │   │   │   ├── default-changelog.tsx
│   │   │   │   ├── fmt-dates.tsx
│   │   │   │   ├── icons.tsx
│   │   │   │   ├── stat-field.tsx
│   │   │   │   └── support.tsx
│   │   │   ├── [[...slug]]
│   │   │   │   └── page.tsx
│   │   │   └── layout.tsx
│   │   ├── changelogs
│   │   │   ├── _components
│   │   │   │   ├── _layout.tsx
│   │   │   │   ├── changelog-layout.tsx
│   │   │   │   ├── default-changelog.tsx
│   │   │   │   ├── fmt-dates.tsx
│   │   │   │   ├── grid-pattern.tsx
│   │   │   │   ├── icons.tsx
│   │   │   │   └── stat-field.tsx
│   │   │   ├── [[...slug]]
│   │   │   │   └── page.tsx
│   │   │   └── layout.tsx
│   │   ├── community
│   │   │   ├── _components
│   │   │   │   ├── header.tsx
│   │   │   │   └── stats.tsx
│   │   │   └── page.tsx
│   │   ├── docs
│   │   │   ├── [[...slug]]
│   │   │   │   ├── page.client.tsx
│   │   │   │   └── page.tsx
│   │   │   ├── layout.tsx
│   │   │   └── lib
│   │   │       └── get-llm-text.ts
│   │   ├── global.css
│   │   ├── layout.config.tsx
│   │   ├── layout.tsx
│   │   ├── llms.txt
│   │   │   ├── [...slug]
│   │   │   │   └── route.ts
│   │   │   └── route.ts
│   │   ├── not-found.tsx
│   │   ├── page.tsx
│   │   ├── reference
│   │   │   └── route.ts
│   │   ├── sitemap.xml
│   │   ├── static.json
│   │   │   └── route.ts
│   │   └── v1
│   │       ├── _components
│   │       │   └── v1-text.tsx
│   │       ├── bg-line.tsx
│   │       └── page.tsx
│   ├── assets
│   │   ├── Geist.ttf
│   │   └── GeistMono.ttf
│   ├── components
│   │   ├── ai-chat-modal.tsx
│   │   ├── anchor-scroll-fix.tsx
│   │   ├── api-method-tabs.tsx
│   │   ├── api-method.tsx
│   │   ├── banner.tsx
│   │   ├── blocks
│   │   │   └── features.tsx
│   │   ├── builder
│   │   │   ├── beam.tsx
│   │   │   ├── code-tabs
│   │   │   │   ├── code-editor.tsx
│   │   │   │   ├── code-tabs.tsx
│   │   │   │   ├── index.tsx
│   │   │   │   ├── tab-bar.tsx
│   │   │   │   └── theme.ts
│   │   │   ├── index.tsx
│   │   │   ├── sign-in.tsx
│   │   │   ├── sign-up.tsx
│   │   │   ├── social-provider.tsx
│   │   │   ├── store.ts
│   │   │   └── tabs.tsx
│   │   ├── display-techstack.tsx
│   │   ├── divider-text.tsx
│   │   ├── docs
│   │   │   ├── docs.client.tsx
│   │   │   ├── docs.tsx
│   │   │   ├── layout
│   │   │   │   ├── nav.tsx
│   │   │   │   ├── theme-toggle.tsx
│   │   │   │   ├── toc-thumb.tsx
│   │   │   │   └── toc.tsx
│   │   │   ├── page.client.tsx
│   │   │   ├── page.tsx
│   │   │   ├── shared.tsx
│   │   │   └── ui
│   │   │       ├── button.tsx
│   │   │       ├── collapsible.tsx
│   │   │       ├── popover.tsx
│   │   │       └── scroll-area.tsx
│   │   ├── endpoint.tsx
│   │   ├── features.tsx
│   │   ├── floating-ai-search.tsx
│   │   ├── fork-button.tsx
│   │   ├── generate-apple-jwt.tsx
│   │   ├── generate-secret.tsx
│   │   ├── github-stat.tsx
│   │   ├── icons.tsx
│   │   ├── landing
│   │   │   ├── gradient-bg.tsx
│   │   │   ├── grid-pattern.tsx
│   │   │   ├── hero.tsx
│   │   │   ├── section-svg.tsx
│   │   │   ├── section.tsx
│   │   │   ├── spotlight.tsx
│   │   │   └── testimonials.tsx
│   │   ├── logo-context-menu.tsx
│   │   ├── logo.tsx
│   │   ├── markdown-renderer.tsx
│   │   ├── markdown.tsx
│   │   ├── mdx
│   │   │   ├── add-to-cursor.tsx
│   │   │   └── database-tables.tsx
│   │   ├── message-feedback.tsx
│   │   ├── mobile-search-icon.tsx
│   │   ├── nav-bar.tsx
│   │   ├── nav-link.tsx
│   │   ├── nav-mobile.tsx
│   │   ├── promo-card.tsx
│   │   ├── resource-card.tsx
│   │   ├── resource-grid.tsx
│   │   ├── resource-section.tsx
│   │   ├── ripple.tsx
│   │   ├── search-dialog.tsx
│   │   ├── side-bar.tsx
│   │   ├── sidebar-content.tsx
│   │   ├── techstack-icons.tsx
│   │   ├── theme-provider.tsx
│   │   ├── theme-toggler.tsx
│   │   └── ui
│   │       ├── accordion.tsx
│   │       ├── alert-dialog.tsx
│   │       ├── alert.tsx
│   │       ├── aside-link.tsx
│   │       ├── aspect-ratio.tsx
│   │       ├── avatar.tsx
│   │       ├── background-beams.tsx
│   │       ├── background-boxes.tsx
│   │       ├── badge.tsx
│   │       ├── breadcrumb.tsx
│   │       ├── button.tsx
│   │       ├── calendar.tsx
│   │       ├── callout.tsx
│   │       ├── card.tsx
│   │       ├── carousel.tsx
│   │       ├── chart.tsx
│   │       ├── checkbox.tsx
│   │       ├── code-block.tsx
│   │       ├── collapsible.tsx
│   │       ├── command.tsx
│   │       ├── context-menu.tsx
│   │       ├── dialog.tsx
│   │       ├── drawer.tsx
│   │       ├── dropdown-menu.tsx
│   │       ├── dynamic-code-block.tsx
│   │       ├── fade-in.tsx
│   │       ├── form.tsx
│   │       ├── hover-card.tsx
│   │       ├── input-otp.tsx
│   │       ├── input.tsx
│   │       ├── label.tsx
│   │       ├── menubar.tsx
│   │       ├── navigation-menu.tsx
│   │       ├── pagination.tsx
│   │       ├── popover.tsx
│   │       ├── progress.tsx
│   │       ├── radio-group.tsx
│   │       ├── resizable.tsx
│   │       ├── scroll-area.tsx
│   │       ├── select.tsx
│   │       ├── separator.tsx
│   │       ├── sheet.tsx
│   │       ├── sidebar.tsx
│   │       ├── skeleton.tsx
│   │       ├── slider.tsx
│   │       ├── sonner.tsx
│   │       ├── sparkles.tsx
│   │       ├── switch.tsx
│   │       ├── table.tsx
│   │       ├── tabs.tsx
│   │       ├── textarea.tsx
│   │       ├── toggle-group.tsx
│   │       ├── toggle.tsx
│   │       ├── tooltip-docs.tsx
│   │       ├── tooltip.tsx
│   │       └── use-copy-button.tsx
│   ├── components.json
│   ├── content
│   │   ├── blogs
│   │   │   ├── 0-supabase-auth-to-planetscale-migration.mdx
│   │   │   ├── 1-3.mdx
│   │   │   ├── authjs-joins-better-auth.mdx
│   │   │   └── seed-round.mdx
│   │   ├── changelogs
│   │   │   ├── 1-2.mdx
│   │   │   └── 1.0.mdx
│   │   └── docs
│   │       ├── adapters
│   │       │   ├── community-adapters.mdx
│   │       │   ├── drizzle.mdx
│   │       │   ├── mongo.mdx
│   │       │   ├── mssql.mdx
│   │       │   ├── mysql.mdx
│   │       │   ├── other-relational-databases.mdx
│   │       │   ├── postgresql.mdx
│   │       │   ├── prisma.mdx
│   │       │   └── sqlite.mdx
│   │       ├── authentication
│   │       │   ├── apple.mdx
│   │       │   ├── atlassian.mdx
│   │       │   ├── cognito.mdx
│   │       │   ├── discord.mdx
│   │       │   ├── dropbox.mdx
│   │       │   ├── email-password.mdx
│   │       │   ├── facebook.mdx
│   │       │   ├── figma.mdx
│   │       │   ├── github.mdx
│   │       │   ├── gitlab.mdx
│   │       │   ├── google.mdx
│   │       │   ├── huggingface.mdx
│   │       │   ├── kakao.mdx
│   │       │   ├── kick.mdx
│   │       │   ├── line.mdx
│   │       │   ├── linear.mdx
│   │       │   ├── linkedin.mdx
│   │       │   ├── microsoft.mdx
│   │       │   ├── naver.mdx
│   │       │   ├── notion.mdx
│   │       │   ├── other-social-providers.mdx
│   │       │   ├── paypal.mdx
│   │       │   ├── reddit.mdx
│   │       │   ├── roblox.mdx
│   │       │   ├── salesforce.mdx
│   │       │   ├── slack.mdx
│   │       │   ├── spotify.mdx
│   │       │   ├── tiktok.mdx
│   │       │   ├── twitch.mdx
│   │       │   ├── twitter.mdx
│   │       │   ├── vk.mdx
│   │       │   └── zoom.mdx
│   │       ├── basic-usage.mdx
│   │       ├── comparison.mdx
│   │       ├── concepts
│   │       │   ├── api.mdx
│   │       │   ├── cli.mdx
│   │       │   ├── client.mdx
│   │       │   ├── cookies.mdx
│   │       │   ├── database.mdx
│   │       │   ├── email.mdx
│   │       │   ├── hooks.mdx
│   │       │   ├── oauth.mdx
│   │       │   ├── plugins.mdx
│   │       │   ├── rate-limit.mdx
│   │       │   ├── session-management.mdx
│   │       │   ├── typescript.mdx
│   │       │   └── users-accounts.mdx
│   │       ├── examples
│   │       │   ├── astro.mdx
│   │       │   ├── next-js.mdx
│   │       │   ├── nuxt.mdx
│   │       │   ├── remix.mdx
│   │       │   └── svelte-kit.mdx
│   │       ├── guides
│   │       │   ├── auth0-migration-guide.mdx
│   │       │   ├── browser-extension-guide.mdx
│   │       │   ├── clerk-migration-guide.mdx
│   │       │   ├── create-a-db-adapter.mdx
│   │       │   ├── next-auth-migration-guide.mdx
│   │       │   ├── optimizing-for-performance.mdx
│   │       │   ├── saml-sso-with-okta.mdx
│   │       │   ├── supabase-migration-guide.mdx
│   │       │   └── your-first-plugin.mdx
│   │       ├── installation.mdx
│   │       ├── integrations
│   │       │   ├── astro.mdx
│   │       │   ├── convex.mdx
│   │       │   ├── elysia.mdx
│   │       │   ├── expo.mdx
│   │       │   ├── express.mdx
│   │       │   ├── fastify.mdx
│   │       │   ├── hono.mdx
│   │       │   ├── lynx.mdx
│   │       │   ├── nestjs.mdx
│   │       │   ├── next.mdx
│   │       │   ├── nitro.mdx
│   │       │   ├── nuxt.mdx
│   │       │   ├── remix.mdx
│   │       │   ├── solid-start.mdx
│   │       │   ├── svelte-kit.mdx
│   │       │   ├── tanstack.mdx
│   │       │   └── waku.mdx
│   │       ├── introduction.mdx
│   │       ├── meta.json
│   │       ├── plugins
│   │       │   ├── 2fa.mdx
│   │       │   ├── admin.mdx
│   │       │   ├── anonymous.mdx
│   │       │   ├── api-key.mdx
│   │       │   ├── autumn.mdx
│   │       │   ├── bearer.mdx
│   │       │   ├── captcha.mdx
│   │       │   ├── community-plugins.mdx
│   │       │   ├── device-authorization.mdx
│   │       │   ├── dodopayments.mdx
│   │       │   ├── dub.mdx
│   │       │   ├── email-otp.mdx
│   │       │   ├── generic-oauth.mdx
│   │       │   ├── have-i-been-pwned.mdx
│   │       │   ├── jwt.mdx
│   │       │   ├── last-login-method.mdx
│   │       │   ├── magic-link.mdx
│   │       │   ├── mcp.mdx
│   │       │   ├── multi-session.mdx
│   │       │   ├── oauth-proxy.mdx
│   │       │   ├── oidc-provider.mdx
│   │       │   ├── one-tap.mdx
│   │       │   ├── one-time-token.mdx
│   │       │   ├── open-api.mdx
│   │       │   ├── organization.mdx
│   │       │   ├── passkey.mdx
│   │       │   ├── phone-number.mdx
│   │       │   ├── polar.mdx
│   │       │   ├── siwe.mdx
│   │       │   ├── sso.mdx
│   │       │   ├── stripe.mdx
│   │       │   └── username.mdx
│   │       └── reference
│   │           ├── contributing.mdx
│   │           ├── faq.mdx
│   │           ├── options.mdx
│   │           ├── resources.mdx
│   │           ├── security.mdx
│   │           └── telemetry.mdx
│   ├── hooks
│   │   └── use-mobile.ts
│   ├── ignore-build.sh
│   ├── lib
│   │   ├── blog.ts
│   │   ├── chat
│   │   │   └── inkeep-qa-schema.ts
│   │   ├── constants.ts
│   │   ├── export-search-indexes.ts
│   │   ├── inkeep-analytics.ts
│   │   ├── is-active.ts
│   │   ├── metadata.ts
│   │   ├── source.ts
│   │   └── utils.ts
│   ├── next.config.js
│   ├── package.json
│   ├── postcss.config.js
│   ├── proxy.ts
│   ├── public
│   │   ├── avatars
│   │   │   └── beka.jpg
│   │   ├── blogs
│   │   │   ├── authjs-joins.png
│   │   │   ├── seed-round.png
│   │   │   └── supabase-ps.png
│   │   ├── branding
│   │   │   ├── better-auth-brand-assets.zip
│   │   │   ├── better-auth-logo-dark.png
│   │   │   ├── better-auth-logo-dark.svg
│   │   │   ├── better-auth-logo-light.png
│   │   │   ├── better-auth-logo-light.svg
│   │   │   ├── better-auth-logo-wordmark-dark.png
│   │   │   ├── better-auth-logo-wordmark-dark.svg
│   │   │   ├── better-auth-logo-wordmark-light.png
│   │   │   └── better-auth-logo-wordmark-light.svg
│   │   ├── extension-id.png
│   │   ├── favicon
│   │   │   ├── android-chrome-192x192.png
│   │   │   ├── android-chrome-512x512.png
│   │   │   ├── apple-touch-icon.png
│   │   │   ├── favicon-16x16.png
│   │   │   ├── favicon-32x32.png
│   │   │   ├── favicon.ico
│   │   │   ├── light
│   │   │   │   ├── android-chrome-192x192.png
│   │   │   │   ├── android-chrome-512x512.png
│   │   │   │   ├── apple-touch-icon.png
│   │   │   │   ├── favicon-16x16.png
│   │   │   │   ├── favicon-32x32.png
│   │   │   │   ├── favicon.ico
│   │   │   │   └── site.webmanifest
│   │   │   └── site.webmanifest
│   │   ├── images
│   │   │   └── blogs
│   │   │       └── better auth (1).png
│   │   ├── logo.png
│   │   ├── logo.svg
│   │   ├── LogoDark.webp
│   │   ├── LogoLight.webp
│   │   ├── og.png
│   │   ├── open-api-reference.png
│   │   ├── people-say
│   │   │   ├── code-with-antonio.jpg
│   │   │   ├── dagmawi-babi.png
│   │   │   ├── dax.png
│   │   │   ├── dev-ed.png
│   │   │   ├── egoist.png
│   │   │   ├── guillermo-rauch.png
│   │   │   ├── jonathan-wilke.png
│   │   │   ├── josh-tried-coding.jpg
│   │   │   ├── kitze.jpg
│   │   │   ├── lazar-nikolov.png
│   │   │   ├── nizzy.png
│   │   │   ├── omar-mcadam.png
│   │   │   ├── ryan-vogel.jpg
│   │   │   ├── saltyatom.jpg
│   │   │   ├── sebastien-chopin.png
│   │   │   ├── shreyas-mididoddi.png
│   │   │   ├── tech-nerd.png
│   │   │   ├── theo.png
│   │   │   ├── vybhav-bhargav.png
│   │   │   └── xavier-pladevall.jpg
│   │   ├── plus.svg
│   │   ├── release-og
│   │   │   ├── 1-2.png
│   │   │   ├── 1-3.png
│   │   │   └── changelog-og.png
│   │   └── v1-og.png
│   ├── README.md
│   ├── scripts
│   │   ├── endpoint-to-doc
│   │   │   ├── index.ts
│   │   │   ├── input.ts
│   │   │   ├── output.mdx
│   │   │   └── readme.md
│   │   └── sync-orama.ts
│   ├── source.config.ts
│   ├── tailwind.config.js
│   ├── tsconfig.json
│   └── turbo.json
├── e2e
│   ├── integration
│   │   ├── package.json
│   │   ├── playwright.config.ts
│   │   ├── solid-vinxi
│   │   │   ├── .gitignore
│   │   │   ├── app.config.ts
│   │   │   ├── e2e
│   │   │   │   ├── test.spec.ts
│   │   │   │   └── utils.ts
│   │   │   ├── package.json
│   │   │   ├── public
│   │   │   │   └── favicon.ico
│   │   │   ├── src
│   │   │   │   ├── app.tsx
│   │   │   │   ├── entry-client.tsx
│   │   │   │   ├── entry-server.tsx
│   │   │   │   ├── global.d.ts
│   │   │   │   ├── lib
│   │   │   │   │   ├── auth-client.ts
│   │   │   │   │   └── auth.ts
│   │   │   │   └── routes
│   │   │   │       ├── [...404].tsx
│   │   │   │       ├── api
│   │   │   │       │   └── auth
│   │   │   │       │       └── [...all].ts
│   │   │   │       └── index.tsx
│   │   │   └── tsconfig.json
│   │   ├── test-utils
│   │   │   ├── package.json
│   │   │   └── src
│   │   │       └── playwright.ts
│   │   └── vanilla-node
│   │       ├── e2e
│   │       │   ├── app.ts
│   │       │   ├── domain.spec.ts
│   │       │   ├── postgres-js.spec.ts
│   │       │   ├── test.spec.ts
│   │       │   └── utils.ts
│   │       ├── index.html
│   │       ├── package.json
│   │       ├── src
│   │       │   ├── main.ts
│   │       │   └── vite-env.d.ts
│   │       ├── tsconfig.json
│   │       └── vite.config.ts
│   └── smoke
│       ├── package.json
│       ├── test
│       │   ├── bun.spec.ts
│       │   ├── cloudflare.spec.ts
│       │   ├── deno.spec.ts
│       │   ├── fixtures
│       │   │   ├── bun-simple.ts
│       │   │   ├── cloudflare
│       │   │   │   ├── .gitignore
│       │   │   │   ├── drizzle
│       │   │   │   │   ├── 0000_clean_vector.sql
│       │   │   │   │   └── meta
│       │   │   │   │       ├── _journal.json
│       │   │   │   │       └── 0000_snapshot.json
│       │   │   │   ├── drizzle.config.ts
│       │   │   │   ├── package.json
│       │   │   │   ├── src
│       │   │   │   │   ├── auth-schema.ts
│       │   │   │   │   ├── db.ts
│       │   │   │   │   └── index.ts
│       │   │   │   ├── test
│       │   │   │   │   ├── apply-migrations.ts
│       │   │   │   │   ├── env.d.ts
│       │   │   │   │   └── index.test.ts
│       │   │   │   ├── tsconfig.json
│       │   │   │   ├── vitest.config.ts
│       │   │   │   ├── worker-configuration.d.ts
│       │   │   │   └── wrangler.json
│       │   │   ├── deno-simple.ts
│       │   │   ├── tsconfig-exact-optional-property-types
│       │   │   │   ├── package.json
│       │   │   │   ├── src
│       │   │   │   │   ├── index.ts
│       │   │   │   │   └── user-additional-fields.ts
│       │   │   │   └── tsconfig.json
│       │   │   ├── tsconfig-verbatim-module-syntax-node10
│       │   │   │   ├── package.json
│       │   │   │   ├── src
│       │   │   │   │   └── index.ts
│       │   │   │   └── tsconfig.json
│       │   │   └── vite
│       │   │       ├── package.json
│       │   │       ├── src
│       │   │       │   ├── client.ts
│       │   │       │   └── server.ts
│       │   │       ├── tsconfig.json
│       │   │       └── vite.config.ts
│       │   ├── ssr.ts
│       │   ├── typecheck.spec.ts
│       │   └── vite.spec.ts
│       └── tsconfig.json
├── LICENSE.md
├── package.json
├── packages
│   ├── better-auth
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── src
│   │   │   ├── __snapshots__
│   │   │   │   └── init.test.ts.snap
│   │   │   ├── adapters
│   │   │   │   ├── adapter-factory
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── test
│   │   │   │   │   │   ├── __snapshots__
│   │   │   │   │   │   │   └── adapter-factory.test.ts.snap
│   │   │   │   │   │   └── adapter-factory.test.ts
│   │   │   │   │   └── types.ts
│   │   │   │   ├── create-test-suite.ts
│   │   │   │   ├── drizzle-adapter
│   │   │   │   │   ├── drizzle-adapter.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── test
│   │   │   │   │       ├── .gitignore
│   │   │   │   │       ├── adapter.drizzle.mysql.test.ts
│   │   │   │   │       ├── adapter.drizzle.pg.test.ts
│   │   │   │   │       ├── adapter.drizzle.sqlite.test.ts
│   │   │   │   │       └── generate-schema.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── kysely-adapter
│   │   │   │   │   ├── bun-sqlite-dialect.ts
│   │   │   │   │   ├── dialect.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── kysely-adapter.ts
│   │   │   │   │   ├── node-sqlite-dialect.ts
│   │   │   │   │   ├── test
│   │   │   │   │   │   ├── adapter.kysely.mssql.test.ts
│   │   │   │   │   │   ├── adapter.kysely.mysql.test.ts
│   │   │   │   │   │   ├── adapter.kysely.pg.test.ts
│   │   │   │   │   │   ├── adapter.kysely.sqlite.test.ts
│   │   │   │   │   │   └── node-sqlite-dialect.test.ts
│   │   │   │   │   └── types.ts
│   │   │   │   ├── memory-adapter
│   │   │   │   │   ├── adapter.memory.test.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── memory-adapter.ts
│   │   │   │   ├── mongodb-adapter
│   │   │   │   │   ├── adapter.mongo-db.test.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── mongodb-adapter.ts
│   │   │   │   ├── prisma-adapter
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── prisma-adapter.ts
│   │   │   │   │   └── test
│   │   │   │   │       ├── .gitignore
│   │   │   │   │       ├── base.prisma
│   │   │   │   │       ├── generate-auth-config.ts
│   │   │   │   │       ├── generate-prisma-schema.ts
│   │   │   │   │       ├── get-prisma-client.ts
│   │   │   │   │       ├── prisma.mysql.test.ts
│   │   │   │   │       ├── prisma.pg.test.ts
│   │   │   │   │       ├── prisma.sqlite.test.ts
│   │   │   │   │       └── push-prisma-schema.ts
│   │   │   │   ├── test-adapter.ts
│   │   │   │   ├── test.ts
│   │   │   │   ├── tests
│   │   │   │   │   ├── auth-flow.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── normal.ts
│   │   │   │   │   ├── number-id.ts
│   │   │   │   │   ├── performance.ts
│   │   │   │   │   └── transactions.ts
│   │   │   │   └── utils.ts
│   │   │   ├── api
│   │   │   │   ├── check-endpoint-conflicts.test.ts
│   │   │   │   ├── index.test.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── middlewares
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── origin-check.test.ts
│   │   │   │   │   └── origin-check.ts
│   │   │   │   ├── rate-limiter
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── rate-limiter.test.ts
│   │   │   │   ├── routes
│   │   │   │   │   ├── account.test.ts
│   │   │   │   │   ├── account.ts
│   │   │   │   │   ├── callback.ts
│   │   │   │   │   ├── email-verification.test.ts
│   │   │   │   │   ├── email-verification.ts
│   │   │   │   │   ├── error.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── ok.ts
│   │   │   │   │   ├── reset-password.test.ts
│   │   │   │   │   ├── reset-password.ts
│   │   │   │   │   ├── session-api.test.ts
│   │   │   │   │   ├── session.ts
│   │   │   │   │   ├── sign-in.test.ts
│   │   │   │   │   ├── sign-in.ts
│   │   │   │   │   ├── sign-out.test.ts
│   │   │   │   │   ├── sign-out.ts
│   │   │   │   │   ├── sign-up.test.ts
│   │   │   │   │   ├── sign-up.ts
│   │   │   │   │   ├── update-user.test.ts
│   │   │   │   │   └── update-user.ts
│   │   │   │   ├── to-auth-endpoints.test.ts
│   │   │   │   └── to-auth-endpoints.ts
│   │   │   ├── auth.test.ts
│   │   │   ├── auth.ts
│   │   │   ├── call.test.ts
│   │   │   ├── client
│   │   │   │   ├── client-ssr.test.ts
│   │   │   │   ├── client.test.ts
│   │   │   │   ├── config.ts
│   │   │   │   ├── fetch-plugins.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── lynx
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── lynx-store.ts
│   │   │   │   ├── parser.ts
│   │   │   │   ├── path-to-object.ts
│   │   │   │   ├── plugins
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── infer-plugin.ts
│   │   │   │   ├── proxy.ts
│   │   │   │   ├── query.ts
│   │   │   │   ├── react
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── react-store.ts
│   │   │   │   ├── session-atom.ts
│   │   │   │   ├── solid
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── solid-store.ts
│   │   │   │   ├── svelte
│   │   │   │   │   └── index.ts
│   │   │   │   ├── test-plugin.ts
│   │   │   │   ├── types.ts
│   │   │   │   ├── url.test.ts
│   │   │   │   ├── vanilla.ts
│   │   │   │   └── vue
│   │   │   │       ├── index.ts
│   │   │   │       └── vue-store.ts
│   │   │   ├── cookies
│   │   │   │   ├── check-cookies.ts
│   │   │   │   ├── cookie-utils.ts
│   │   │   │   ├── cookies.test.ts
│   │   │   │   └── index.ts
│   │   │   ├── crypto
│   │   │   │   ├── buffer.ts
│   │   │   │   ├── hash.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── jwt.ts
│   │   │   │   ├── password.test.ts
│   │   │   │   ├── password.ts
│   │   │   │   └── random.ts
│   │   │   ├── db
│   │   │   │   ├── db.test.ts
│   │   │   │   ├── field.ts
│   │   │   │   ├── get-migration.ts
│   │   │   │   ├── get-schema.ts
│   │   │   │   ├── get-tables.test.ts
│   │   │   │   ├── get-tables.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── internal-adapter.test.ts
│   │   │   │   ├── internal-adapter.ts
│   │   │   │   ├── schema.ts
│   │   │   │   ├── secondary-storage.test.ts
│   │   │   │   ├── to-zod.ts
│   │   │   │   ├── utils.ts
│   │   │   │   └── with-hooks.ts
│   │   │   ├── index.ts
│   │   │   ├── init.test.ts
│   │   │   ├── init.ts
│   │   │   ├── integrations
│   │   │   │   ├── next-js.ts
│   │   │   │   ├── node.ts
│   │   │   │   ├── react-start.ts
│   │   │   │   ├── solid-start.ts
│   │   │   │   └── svelte-kit.ts
│   │   │   ├── oauth2
│   │   │   │   ├── index.ts
│   │   │   │   ├── link-account.test.ts
│   │   │   │   ├── link-account.ts
│   │   │   │   ├── state.ts
│   │   │   │   └── utils.ts
│   │   │   ├── plugins
│   │   │   │   ├── access
│   │   │   │   │   ├── access.test.ts
│   │   │   │   │   ├── access.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── types.ts
│   │   │   │   ├── additional-fields
│   │   │   │   │   ├── additional-fields.test.ts
│   │   │   │   │   └── client.ts
│   │   │   │   ├── admin
│   │   │   │   │   ├── access
│   │   │   │   │   │   ├── index.ts
│   │   │   │   │   │   └── statement.ts
│   │   │   │   │   ├── admin.test.ts
│   │   │   │   │   ├── admin.ts
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── error-codes.ts
│   │   │   │   │   ├── has-permission.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── schema.ts
│   │   │   │   │   └── types.ts
│   │   │   │   ├── anonymous
│   │   │   │   │   ├── anon.test.ts
│   │   │   │   │   ├── client.ts
│   │   │   │   │   └── index.ts
│   │   │   │   ├── api-key
│   │   │   │   │   ├── api-key.test.ts
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── rate-limit.ts
│   │   │   │   │   ├── routes
│   │   │   │   │   │   ├── create-api-key.ts
│   │   │   │   │   │   ├── delete-all-expired-api-keys.ts
│   │   │   │   │   │   ├── delete-api-key.ts
│   │   │   │   │   │   ├── get-api-key.ts
│   │   │   │   │   │   ├── index.ts
│   │   │   │   │   │   ├── list-api-keys.ts
│   │   │   │   │   │   ├── update-api-key.ts
│   │   │   │   │   │   └── verify-api-key.ts
│   │   │   │   │   ├── schema.ts
│   │   │   │   │   └── types.ts
│   │   │   │   ├── bearer
│   │   │   │   │   ├── bearer.test.ts
│   │   │   │   │   └── index.ts
│   │   │   │   ├── captcha
│   │   │   │   │   ├── captcha.test.ts
│   │   │   │   │   ├── constants.ts
│   │   │   │   │   ├── error-codes.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── types.ts
│   │   │   │   │   ├── utils.ts
│   │   │   │   │   └── verify-handlers
│   │   │   │   │       ├── captchafox.ts
│   │   │   │   │       ├── cloudflare-turnstile.ts
│   │   │   │   │       ├── google-recaptcha.ts
│   │   │   │   │       ├── h-captcha.ts
│   │   │   │   │       └── index.ts
│   │   │   │   ├── custom-session
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── custom-session.test.ts
│   │   │   │   │   └── index.ts
│   │   │   │   ├── device-authorization
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── device-authorization.test.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── schema.ts
│   │   │   │   ├── email-otp
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── email-otp.test.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── utils.ts
│   │   │   │   ├── generic-oauth
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── generic-oauth.test.ts
│   │   │   │   │   └── index.ts
│   │   │   │   ├── haveibeenpwned
│   │   │   │   │   ├── haveibeenpwned.test.ts
│   │   │   │   │   └── index.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── jwt
│   │   │   │   │   ├── adapter.ts
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── jwt.test.ts
│   │   │   │   │   ├── schema.ts
│   │   │   │   │   ├── sign.ts
│   │   │   │   │   ├── types.ts
│   │   │   │   │   └── utils.ts
│   │   │   │   ├── last-login-method
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── custom-prefix.test.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── last-login-method.test.ts
│   │   │   │   ├── magic-link
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── magic-link.test.ts
│   │   │   │   │   └── utils.ts
│   │   │   │   ├── mcp
│   │   │   │   │   ├── authorize.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── mcp.test.ts
│   │   │   │   ├── multi-session
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── multi-session.test.ts
│   │   │   │   ├── oauth-proxy
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── oauth-proxy.test.ts
│   │   │   │   ├── oidc-provider
│   │   │   │   │   ├── authorize.ts
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── oidc.test.ts
│   │   │   │   │   ├── schema.ts
│   │   │   │   │   ├── types.ts
│   │   │   │   │   ├── ui.ts
│   │   │   │   │   └── utils.ts
│   │   │   │   ├── one-tap
│   │   │   │   │   ├── client.ts
│   │   │   │   │   └── index.ts
│   │   │   │   ├── one-time-token
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── one-time-token.test.ts
│   │   │   │   │   └── utils.ts
│   │   │   │   ├── open-api
│   │   │   │   │   ├── generator.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── logo.ts
│   │   │   │   │   └── open-api.test.ts
│   │   │   │   ├── organization
│   │   │   │   │   ├── access
│   │   │   │   │   │   ├── index.ts
│   │   │   │   │   │   └── statement.ts
│   │   │   │   │   ├── adapter.ts
│   │   │   │   │   ├── call.ts
│   │   │   │   │   ├── client.test.ts
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── error-codes.ts
│   │   │   │   │   ├── has-permission.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── organization-hook.test.ts
│   │   │   │   │   ├── organization.test.ts
│   │   │   │   │   ├── organization.ts
│   │   │   │   │   ├── permission.ts
│   │   │   │   │   ├── routes
│   │   │   │   │   │   ├── crud-access-control.test.ts
│   │   │   │   │   │   ├── crud-access-control.ts
│   │   │   │   │   │   ├── crud-invites.ts
│   │   │   │   │   │   ├── crud-members.test.ts
│   │   │   │   │   │   ├── crud-members.ts
│   │   │   │   │   │   ├── crud-org.test.ts
│   │   │   │   │   │   ├── crud-org.ts
│   │   │   │   │   │   └── crud-team.ts
│   │   │   │   │   ├── schema.ts
│   │   │   │   │   ├── team.test.ts
│   │   │   │   │   └── types.ts
│   │   │   │   ├── passkey
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── passkey.test.ts
│   │   │   │   ├── phone-number
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── phone-number-error.ts
│   │   │   │   │   └── phone-number.test.ts
│   │   │   │   ├── siwe
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── schema.ts
│   │   │   │   │   ├── siwe.test.ts
│   │   │   │   │   └── types.ts
│   │   │   │   ├── sso
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   └── sso.test.ts
│   │   │   │   ├── two-factor
│   │   │   │   │   ├── backup-codes
│   │   │   │   │   │   └── index.ts
│   │   │   │   │   ├── client.ts
│   │   │   │   │   ├── constant.ts
│   │   │   │   │   ├── error-code.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── otp
│   │   │   │   │   │   └── index.ts
│   │   │   │   │   ├── schema.ts
│   │   │   │   │   ├── totp
│   │   │   │   │   │   └── index.ts
│   │   │   │   │   ├── two-factor.test.ts
│   │   │   │   │   ├── types.ts
│   │   │   │   │   ├── utils.ts
│   │   │   │   │   └── verify-two-factor.ts
│   │   │   │   └── username
│   │   │   │       ├── client.ts
│   │   │   │       ├── error-codes.ts
│   │   │   │       ├── index.ts
│   │   │   │       ├── schema.ts
│   │   │   │       └── username.test.ts
│   │   │   ├── social-providers
│   │   │   │   └── index.ts
│   │   │   ├── social.test.ts
│   │   │   ├── test-utils
│   │   │   │   ├── headers.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── state.ts
│   │   │   │   └── test-instance.ts
│   │   │   ├── types
│   │   │   │   ├── adapter.ts
│   │   │   │   ├── api.ts
│   │   │   │   ├── helper.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── models.ts
│   │   │   │   ├── plugins.ts
│   │   │   │   └── types.test.ts
│   │   │   └── utils
│   │   │       ├── await-object.ts
│   │   │       ├── boolean.ts
│   │   │       ├── clone.ts
│   │   │       ├── constants.ts
│   │   │       ├── date.ts
│   │   │       ├── ensure-utc.ts
│   │   │       ├── get-request-ip.ts
│   │   │       ├── hashing.ts
│   │   │       ├── hide-metadata.ts
│   │   │       ├── id.ts
│   │   │       ├── import-util.ts
│   │   │       ├── index.ts
│   │   │       ├── is-atom.ts
│   │   │       ├── is-promise.ts
│   │   │       ├── json.ts
│   │   │       ├── merger.ts
│   │   │       ├── middleware-response.ts
│   │   │       ├── misc.ts
│   │   │       ├── password.ts
│   │   │       ├── plugin-helper.ts
│   │   │       ├── shim.ts
│   │   │       ├── time.ts
│   │   │       ├── url.ts
│   │   │       └── wildcard.ts
│   │   ├── tsconfig.json
│   │   ├── tsdown.config.ts
│   │   └── vitest.config.ts
│   ├── cli
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── src
│   │   │   ├── commands
│   │   │   │   ├── generate.ts
│   │   │   │   ├── info.ts
│   │   │   │   ├── init.ts
│   │   │   │   ├── login.ts
│   │   │   │   ├── mcp.ts
│   │   │   │   ├── migrate.ts
│   │   │   │   └── secret.ts
│   │   │   ├── generators
│   │   │   │   ├── auth-config.ts
│   │   │   │   ├── drizzle.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── kysely.ts
│   │   │   │   ├── prisma.ts
│   │   │   │   └── types.ts
│   │   │   ├── index.ts
│   │   │   └── utils
│   │   │       ├── add-svelte-kit-env-modules.ts
│   │   │       ├── check-package-managers.ts
│   │   │       ├── format-ms.ts
│   │   │       ├── get-config.ts
│   │   │       ├── get-package-info.ts
│   │   │       ├── get-tsconfig-info.ts
│   │   │       └── install-dependencies.ts
│   │   ├── test
│   │   │   ├── __snapshots__
│   │   │   │   ├── auth-schema-mysql-enum.txt
│   │   │   │   ├── auth-schema-mysql-number-id.txt
│   │   │   │   ├── auth-schema-mysql-passkey-number-id.txt
│   │   │   │   ├── auth-schema-mysql-passkey.txt
│   │   │   │   ├── auth-schema-mysql.txt
│   │   │   │   ├── auth-schema-number-id.txt
│   │   │   │   ├── auth-schema-pg-enum.txt
│   │   │   │   ├── auth-schema-pg-passkey.txt
│   │   │   │   ├── auth-schema-sqlite-enum.txt
│   │   │   │   ├── auth-schema-sqlite-number-id.txt
│   │   │   │   ├── auth-schema-sqlite-passkey-number-id.txt
│   │   │   │   ├── auth-schema-sqlite-passkey.txt
│   │   │   │   ├── auth-schema-sqlite.txt
│   │   │   │   ├── auth-schema.txt
│   │   │   │   ├── migrations.sql
│   │   │   │   ├── schema-mongodb.prisma
│   │   │   │   ├── schema-mysql-custom.prisma
│   │   │   │   ├── schema-mysql.prisma
│   │   │   │   ├── schema-numberid.prisma
│   │   │   │   └── schema.prisma
│   │   │   ├── generate-all-db.test.ts
│   │   │   ├── generate.test.ts
│   │   │   ├── get-config.test.ts
│   │   │   ├── info.test.ts
│   │   │   └── migrate.test.ts
│   │   ├── tsconfig.json
│   │   ├── tsconfig.test.json
│   │   └── tsdown.config.ts
│   ├── core
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── async_hooks
│   │   │   │   └── index.ts
│   │   │   ├── context
│   │   │   │   ├── index.ts
│   │   │   │   └── transaction.ts
│   │   │   ├── db
│   │   │   │   ├── adapter
│   │   │   │   │   └── index.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── plugin.ts
│   │   │   │   ├── schema
│   │   │   │   │   ├── account.ts
│   │   │   │   │   ├── rate-limit.ts
│   │   │   │   │   ├── session.ts
│   │   │   │   │   ├── shared.ts
│   │   │   │   │   ├── user.ts
│   │   │   │   │   └── verification.ts
│   │   │   │   └── type.ts
│   │   │   ├── env
│   │   │   │   ├── color-depth.ts
│   │   │   │   ├── env-impl.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── logger.test.ts
│   │   │   │   └── logger.ts
│   │   │   ├── error
│   │   │   │   ├── codes.ts
│   │   │   │   └── index.ts
│   │   │   ├── index.ts
│   │   │   ├── middleware
│   │   │   │   └── index.ts
│   │   │   ├── oauth2
│   │   │   │   ├── client-credentials-token.ts
│   │   │   │   ├── create-authorization-url.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── oauth-provider.ts
│   │   │   │   ├── refresh-access-token.ts
│   │   │   │   ├── utils.ts
│   │   │   │   └── validate-authorization-code.ts
│   │   │   ├── social-providers
│   │   │   │   ├── apple.ts
│   │   │   │   ├── atlassian.ts
│   │   │   │   ├── cognito.ts
│   │   │   │   ├── discord.ts
│   │   │   │   ├── dropbox.ts
│   │   │   │   ├── facebook.ts
│   │   │   │   ├── figma.ts
│   │   │   │   ├── github.ts
│   │   │   │   ├── gitlab.ts
│   │   │   │   ├── google.ts
│   │   │   │   ├── huggingface.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── kakao.ts
│   │   │   │   ├── kick.ts
│   │   │   │   ├── line.ts
│   │   │   │   ├── linear.ts
│   │   │   │   ├── linkedin.ts
│   │   │   │   ├── microsoft-entra-id.ts
│   │   │   │   ├── naver.ts
│   │   │   │   ├── notion.ts
│   │   │   │   ├── paypal.ts
│   │   │   │   ├── reddit.ts
│   │   │   │   ├── roblox.ts
│   │   │   │   ├── salesforce.ts
│   │   │   │   ├── slack.ts
│   │   │   │   ├── spotify.ts
│   │   │   │   ├── tiktok.ts
│   │   │   │   ├── twitch.ts
│   │   │   │   ├── twitter.ts
│   │   │   │   ├── vk.ts
│   │   │   │   └── zoom.ts
│   │   │   ├── types
│   │   │   │   ├── context.ts
│   │   │   │   ├── cookie.ts
│   │   │   │   ├── helper.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── init-options.ts
│   │   │   │   ├── plugin-client.ts
│   │   │   │   └── plugin.ts
│   │   │   └── utils
│   │   │       ├── error-codes.ts
│   │   │       └── index.ts
│   │   ├── tsconfig.json
│   │   └── tsdown.config.ts
│   ├── expo
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── src
│   │   │   ├── client.ts
│   │   │   ├── expo.test.ts
│   │   │   └── index.ts
│   │   ├── tsconfig.json
│   │   └── tsdown.config.ts
│   ├── sso
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── client.ts
│   │   │   ├── index.ts
│   │   │   ├── oidc.test.ts
│   │   │   └── saml.test.ts
│   │   ├── tsconfig.json
│   │   └── tsdown.config.ts
│   ├── stripe
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── client.ts
│   │   │   ├── hooks.ts
│   │   │   ├── index.ts
│   │   │   ├── schema.ts
│   │   │   ├── stripe.test.ts
│   │   │   ├── types.ts
│   │   │   └── utils.ts
│   │   ├── tsconfig.json
│   │   ├── tsdown.config.ts
│   │   └── vitest.config.ts
│   └── telemetry
│       ├── package.json
│       ├── src
│       │   ├── detectors
│       │   │   ├── detect-auth-config.ts
│       │   │   ├── detect-database.ts
│       │   │   ├── detect-framework.ts
│       │   │   ├── detect-project-info.ts
│       │   │   ├── detect-runtime.ts
│       │   │   └── detect-system-info.ts
│       │   ├── index.ts
│       │   ├── project-id.ts
│       │   ├── telemetry.test.ts
│       │   ├── types.ts
│       │   └── utils
│       │       ├── hash.ts
│       │       ├── id.ts
│       │       ├── import-util.ts
│       │       └── package-json.ts
│       ├── tsconfig.json
│       └── tsdown.config.ts
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── README.md
├── SECURITY.md
├── tsconfig.json
└── turbo.json
```

# Files

--------------------------------------------------------------------------------
/e2e/smoke/test/fixtures/cloudflare/worker-configuration.d.ts:
--------------------------------------------------------------------------------

```typescript
   1 | /* eslint-disable */
   2 | // Generated by Wrangler by running `wrangler types` (hash: 6487ecb550ec445fefe4708f90eca18e)
   3 | // Runtime types generated with [email protected] 2025-04-01
   4 | declare namespace Cloudflare {
   5 | 	interface Env {
   6 | 		AUTH_STORAGE: KVNamespace;
   7 | 		AUTH_DB: D1Database;
   8 | 	}
   9 | }
  10 | interface Env extends Cloudflare.Env {}
  11 | 
  12 | // Begin runtime types
  13 | /*! *****************************************************************************
  14 | Copyright (c) Cloudflare. All rights reserved.
  15 | Copyright (c) Microsoft Corporation. All rights reserved.
  16 | 
  17 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  18 | this file except in compliance with the License. You may obtain a copy of the
  19 | License at http://www.apache.org/licenses/LICENSE-2.0
  20 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  21 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  22 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  23 | MERCHANTABLITY OR NON-INFRINGEMENT.
  24 | See the Apache Version 2.0 License for specific language governing permissions
  25 | and limitations under the License.
  26 | ***************************************************************************** */
  27 | /* eslint-disable */
  28 | // noinspection JSUnusedGlobalSymbols
  29 | declare var onmessage: never;
  30 | /**
  31 |  * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
  32 |  *
  33 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
  34 |  */
  35 | declare class DOMException extends Error {
  36 | 	constructor(message?: string, name?: string);
  37 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
  38 | 	readonly message: string;
  39 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
  40 | 	readonly name: string;
  41 | 	/**
  42 | 	 * @deprecated
  43 | 	 *
  44 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
  45 | 	 */
  46 | 	readonly code: number;
  47 | 	static readonly INDEX_SIZE_ERR: number;
  48 | 	static readonly DOMSTRING_SIZE_ERR: number;
  49 | 	static readonly HIERARCHY_REQUEST_ERR: number;
  50 | 	static readonly WRONG_DOCUMENT_ERR: number;
  51 | 	static readonly INVALID_CHARACTER_ERR: number;
  52 | 	static readonly NO_DATA_ALLOWED_ERR: number;
  53 | 	static readonly NO_MODIFICATION_ALLOWED_ERR: number;
  54 | 	static readonly NOT_FOUND_ERR: number;
  55 | 	static readonly NOT_SUPPORTED_ERR: number;
  56 | 	static readonly INUSE_ATTRIBUTE_ERR: number;
  57 | 	static readonly INVALID_STATE_ERR: number;
  58 | 	static readonly SYNTAX_ERR: number;
  59 | 	static readonly INVALID_MODIFICATION_ERR: number;
  60 | 	static readonly NAMESPACE_ERR: number;
  61 | 	static readonly INVALID_ACCESS_ERR: number;
  62 | 	static readonly VALIDATION_ERR: number;
  63 | 	static readonly TYPE_MISMATCH_ERR: number;
  64 | 	static readonly SECURITY_ERR: number;
  65 | 	static readonly NETWORK_ERR: number;
  66 | 	static readonly ABORT_ERR: number;
  67 | 	static readonly URL_MISMATCH_ERR: number;
  68 | 	static readonly QUOTA_EXCEEDED_ERR: number;
  69 | 	static readonly TIMEOUT_ERR: number;
  70 | 	static readonly INVALID_NODE_TYPE_ERR: number;
  71 | 	static readonly DATA_CLONE_ERR: number;
  72 | 	get stack(): any;
  73 | 	set stack(value: any);
  74 | }
  75 | type WorkerGlobalScopeEventMap = {
  76 | 	fetch: FetchEvent;
  77 | 	scheduled: ScheduledEvent;
  78 | 	queue: QueueEvent;
  79 | 	unhandledrejection: PromiseRejectionEvent;
  80 | 	rejectionhandled: PromiseRejectionEvent;
  81 | };
  82 | declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
  83 | 	EventTarget: typeof EventTarget;
  84 | }
  85 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
  86 | interface Console {
  87 | 	assert(condition?: boolean, ...data: any[]): void;
  88 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
  89 | 	clear(): void;
  90 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
  91 | 	count(label?: string): void;
  92 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
  93 | 	countReset(label?: string): void;
  94 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
  95 | 	debug(...data: any[]): void;
  96 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
  97 | 	dir(item?: any, options?: any): void;
  98 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
  99 | 	dirxml(...data: any[]): void;
 100 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
 101 | 	error(...data: any[]): void;
 102 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
 103 | 	group(...data: any[]): void;
 104 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
 105 | 	groupCollapsed(...data: any[]): void;
 106 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
 107 | 	groupEnd(): void;
 108 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
 109 | 	info(...data: any[]): void;
 110 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
 111 | 	log(...data: any[]): void;
 112 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
 113 | 	table(tabularData?: any, properties?: string[]): void;
 114 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
 115 | 	time(label?: string): void;
 116 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
 117 | 	timeEnd(label?: string): void;
 118 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
 119 | 	timeLog(label?: string, ...data: any[]): void;
 120 | 	timeStamp(label?: string): void;
 121 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
 122 | 	trace(...data: any[]): void;
 123 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
 124 | 	warn(...data: any[]): void;
 125 | }
 126 | declare const console: Console;
 127 | type BufferSource = ArrayBufferView | ArrayBuffer;
 128 | type TypedArray =
 129 | 	| Int8Array
 130 | 	| Uint8Array
 131 | 	| Uint8ClampedArray
 132 | 	| Int16Array
 133 | 	| Uint16Array
 134 | 	| Int32Array
 135 | 	| Uint32Array
 136 | 	| Float32Array
 137 | 	| Float64Array
 138 | 	| BigInt64Array
 139 | 	| BigUint64Array;
 140 | declare namespace WebAssembly {
 141 | 	class CompileError extends Error {
 142 | 		constructor(message?: string);
 143 | 	}
 144 | 	class RuntimeError extends Error {
 145 | 		constructor(message?: string);
 146 | 	}
 147 | 	type ValueType =
 148 | 		| "anyfunc"
 149 | 		| "externref"
 150 | 		| "f32"
 151 | 		| "f64"
 152 | 		| "i32"
 153 | 		| "i64"
 154 | 		| "v128";
 155 | 	interface GlobalDescriptor {
 156 | 		value: ValueType;
 157 | 		mutable?: boolean;
 158 | 	}
 159 | 	class Global {
 160 | 		constructor(descriptor: GlobalDescriptor, value?: any);
 161 | 		value: any;
 162 | 		valueOf(): any;
 163 | 	}
 164 | 	type ImportValue = ExportValue | number;
 165 | 	type ModuleImports = Record<string, ImportValue>;
 166 | 	type Imports = Record<string, ModuleImports>;
 167 | 	type ExportValue = Function | Global | Memory | Table;
 168 | 	type Exports = Record<string, ExportValue>;
 169 | 	class Instance {
 170 | 		constructor(module: Module, imports?: Imports);
 171 | 		readonly exports: Exports;
 172 | 	}
 173 | 	interface MemoryDescriptor {
 174 | 		initial: number;
 175 | 		maximum?: number;
 176 | 		shared?: boolean;
 177 | 	}
 178 | 	class Memory {
 179 | 		constructor(descriptor: MemoryDescriptor);
 180 | 		readonly buffer: ArrayBuffer;
 181 | 		grow(delta: number): number;
 182 | 	}
 183 | 	type ImportExportKind = "function" | "global" | "memory" | "table";
 184 | 	interface ModuleExportDescriptor {
 185 | 		kind: ImportExportKind;
 186 | 		name: string;
 187 | 	}
 188 | 	interface ModuleImportDescriptor {
 189 | 		kind: ImportExportKind;
 190 | 		module: string;
 191 | 		name: string;
 192 | 	}
 193 | 	abstract class Module {
 194 | 		static customSections(module: Module, sectionName: string): ArrayBuffer[];
 195 | 		static exports(module: Module): ModuleExportDescriptor[];
 196 | 		static imports(module: Module): ModuleImportDescriptor[];
 197 | 	}
 198 | 	type TableKind = "anyfunc" | "externref";
 199 | 	interface TableDescriptor {
 200 | 		element: TableKind;
 201 | 		initial: number;
 202 | 		maximum?: number;
 203 | 	}
 204 | 	class Table {
 205 | 		constructor(descriptor: TableDescriptor, value?: any);
 206 | 		readonly length: number;
 207 | 		get(index: number): any;
 208 | 		grow(delta: number, value?: any): number;
 209 | 		set(index: number, value?: any): void;
 210 | 	}
 211 | 	function instantiate(module: Module, imports?: Imports): Promise<Instance>;
 212 | 	function validate(bytes: BufferSource): boolean;
 213 | }
 214 | /**
 215 |  * This ServiceWorker API interface represents the global execution context of a service worker.
 216 |  * Available only in secure contexts.
 217 |  *
 218 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
 219 |  */
 220 | interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
 221 | 	DOMException: typeof DOMException;
 222 | 	WorkerGlobalScope: typeof WorkerGlobalScope;
 223 | 	btoa(data: string): string;
 224 | 	atob(data: string): string;
 225 | 	setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
 226 | 	setTimeout<Args extends any[]>(
 227 | 		callback: (...args: Args) => void,
 228 | 		msDelay?: number,
 229 | 		...args: Args
 230 | 	): number;
 231 | 	clearTimeout(timeoutId: number | null): void;
 232 | 	setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
 233 | 	setInterval<Args extends any[]>(
 234 | 		callback: (...args: Args) => void,
 235 | 		msDelay?: number,
 236 | 		...args: Args
 237 | 	): number;
 238 | 	clearInterval(timeoutId: number | null): void;
 239 | 	queueMicrotask(task: Function): void;
 240 | 	structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
 241 | 	reportError(error: any): void;
 242 | 	fetch(
 243 | 		input: RequestInfo | URL,
 244 | 		init?: RequestInit<RequestInitCfProperties>,
 245 | 	): Promise<Response>;
 246 | 	self: ServiceWorkerGlobalScope;
 247 | 	crypto: Crypto;
 248 | 	caches: CacheStorage;
 249 | 	scheduler: Scheduler;
 250 | 	performance: Performance;
 251 | 	Cloudflare: Cloudflare;
 252 | 	readonly origin: string;
 253 | 	Event: typeof Event;
 254 | 	ExtendableEvent: typeof ExtendableEvent;
 255 | 	CustomEvent: typeof CustomEvent;
 256 | 	PromiseRejectionEvent: typeof PromiseRejectionEvent;
 257 | 	FetchEvent: typeof FetchEvent;
 258 | 	TailEvent: typeof TailEvent;
 259 | 	TraceEvent: typeof TailEvent;
 260 | 	ScheduledEvent: typeof ScheduledEvent;
 261 | 	MessageEvent: typeof MessageEvent;
 262 | 	CloseEvent: typeof CloseEvent;
 263 | 	ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;
 264 | 	ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;
 265 | 	ReadableStream: typeof ReadableStream;
 266 | 	WritableStream: typeof WritableStream;
 267 | 	WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;
 268 | 	TransformStream: typeof TransformStream;
 269 | 	ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
 270 | 	CountQueuingStrategy: typeof CountQueuingStrategy;
 271 | 	ErrorEvent: typeof ErrorEvent;
 272 | 	EventSource: typeof EventSource;
 273 | 	ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
 274 | 	ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
 275 | 	ReadableByteStreamController: typeof ReadableByteStreamController;
 276 | 	WritableStreamDefaultController: typeof WritableStreamDefaultController;
 277 | 	TransformStreamDefaultController: typeof TransformStreamDefaultController;
 278 | 	CompressionStream: typeof CompressionStream;
 279 | 	DecompressionStream: typeof DecompressionStream;
 280 | 	TextEncoderStream: typeof TextEncoderStream;
 281 | 	TextDecoderStream: typeof TextDecoderStream;
 282 | 	Headers: typeof Headers;
 283 | 	Body: typeof Body;
 284 | 	Request: typeof Request;
 285 | 	Response: typeof Response;
 286 | 	WebSocket: typeof WebSocket;
 287 | 	WebSocketPair: typeof WebSocketPair;
 288 | 	WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
 289 | 	AbortController: typeof AbortController;
 290 | 	AbortSignal: typeof AbortSignal;
 291 | 	TextDecoder: typeof TextDecoder;
 292 | 	TextEncoder: typeof TextEncoder;
 293 | 	navigator: Navigator;
 294 | 	Navigator: typeof Navigator;
 295 | 	URL: typeof URL;
 296 | 	URLSearchParams: typeof URLSearchParams;
 297 | 	URLPattern: typeof URLPattern;
 298 | 	Blob: typeof Blob;
 299 | 	File: typeof File;
 300 | 	FormData: typeof FormData;
 301 | 	Crypto: typeof Crypto;
 302 | 	SubtleCrypto: typeof SubtleCrypto;
 303 | 	CryptoKey: typeof CryptoKey;
 304 | 	CacheStorage: typeof CacheStorage;
 305 | 	Cache: typeof Cache;
 306 | 	FixedLengthStream: typeof FixedLengthStream;
 307 | 	IdentityTransformStream: typeof IdentityTransformStream;
 308 | 	HTMLRewriter: typeof HTMLRewriter;
 309 | }
 310 | declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
 311 | 	type: Type,
 312 | 	handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
 313 | 	options?: EventTargetAddEventListenerOptions | boolean,
 314 | ): void;
 315 | declare function removeEventListener<
 316 | 	Type extends keyof WorkerGlobalScopeEventMap,
 317 | >(
 318 | 	type: Type,
 319 | 	handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
 320 | 	options?: EventTargetEventListenerOptions | boolean,
 321 | ): void;
 322 | /**
 323 |  * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
 324 |  *
 325 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
 326 |  */
 327 | declare function dispatchEvent(
 328 | 	event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
 329 | ): boolean;
 330 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
 331 | declare function btoa(data: string): string;
 332 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
 333 | declare function atob(data: string): string;
 334 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
 335 | declare function setTimeout(
 336 | 	callback: (...args: any[]) => void,
 337 | 	msDelay?: number,
 338 | ): number;
 339 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
 340 | declare function setTimeout<Args extends any[]>(
 341 | 	callback: (...args: Args) => void,
 342 | 	msDelay?: number,
 343 | 	...args: Args
 344 | ): number;
 345 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */
 346 | declare function clearTimeout(timeoutId: number | null): void;
 347 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
 348 | declare function setInterval(
 349 | 	callback: (...args: any[]) => void,
 350 | 	msDelay?: number,
 351 | ): number;
 352 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
 353 | declare function setInterval<Args extends any[]>(
 354 | 	callback: (...args: Args) => void,
 355 | 	msDelay?: number,
 356 | 	...args: Args
 357 | ): number;
 358 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */
 359 | declare function clearInterval(timeoutId: number | null): void;
 360 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */
 361 | declare function queueMicrotask(task: Function): void;
 362 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
 363 | declare function structuredClone<T>(
 364 | 	value: T,
 365 | 	options?: StructuredSerializeOptions,
 366 | ): T;
 367 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */
 368 | declare function reportError(error: any): void;
 369 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */
 370 | declare function fetch(
 371 | 	input: RequestInfo | URL,
 372 | 	init?: RequestInit<RequestInitCfProperties>,
 373 | ): Promise<Response>;
 374 | declare const self: ServiceWorkerGlobalScope;
 375 | /**
 376 |  * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
 377 |  * The Workers runtime implements the full surface of this API, but with some differences in
 378 |  * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
 379 |  * compared to those implemented in most browsers.
 380 |  *
 381 |  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
 382 |  */
 383 | declare const crypto: Crypto;
 384 | /**
 385 |  * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
 386 |  *
 387 |  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
 388 |  */
 389 | declare const caches: CacheStorage;
 390 | declare const scheduler: Scheduler;
 391 | /**
 392 |  * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
 393 |  * as well as timing of subrequests and other operations.
 394 |  *
 395 |  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
 396 |  */
 397 | declare const performance: Performance;
 398 | declare const Cloudflare: Cloudflare;
 399 | declare const origin: string;
 400 | declare const navigator: Navigator;
 401 | interface TestController {}
 402 | interface ExecutionContext {
 403 | 	waitUntil(promise: Promise<any>): void;
 404 | 	passThroughOnException(): void;
 405 | 	props: any;
 406 | }
 407 | type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (
 408 | 	request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
 409 | 	env: Env,
 410 | 	ctx: ExecutionContext,
 411 | ) => Response | Promise<Response>;
 412 | type ExportedHandlerTailHandler<Env = unknown> = (
 413 | 	events: TraceItem[],
 414 | 	env: Env,
 415 | 	ctx: ExecutionContext,
 416 | ) => void | Promise<void>;
 417 | type ExportedHandlerTraceHandler<Env = unknown> = (
 418 | 	traces: TraceItem[],
 419 | 	env: Env,
 420 | 	ctx: ExecutionContext,
 421 | ) => void | Promise<void>;
 422 | type ExportedHandlerTailStreamHandler<Env = unknown> = (
 423 | 	event: TailStream.TailEvent<TailStream.Onset>,
 424 | 	env: Env,
 425 | 	ctx: ExecutionContext,
 426 | ) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
 427 | type ExportedHandlerScheduledHandler<Env = unknown> = (
 428 | 	controller: ScheduledController,
 429 | 	env: Env,
 430 | 	ctx: ExecutionContext,
 431 | ) => void | Promise<void>;
 432 | type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
 433 | 	batch: MessageBatch<Message>,
 434 | 	env: Env,
 435 | 	ctx: ExecutionContext,
 436 | ) => void | Promise<void>;
 437 | type ExportedHandlerTestHandler<Env = unknown> = (
 438 | 	controller: TestController,
 439 | 	env: Env,
 440 | 	ctx: ExecutionContext,
 441 | ) => void | Promise<void>;
 442 | interface ExportedHandler<
 443 | 	Env = unknown,
 444 | 	QueueHandlerMessage = unknown,
 445 | 	CfHostMetadata = unknown,
 446 | > {
 447 | 	fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
 448 | 	tail?: ExportedHandlerTailHandler<Env>;
 449 | 	trace?: ExportedHandlerTraceHandler<Env>;
 450 | 	tailStream?: ExportedHandlerTailStreamHandler<Env>;
 451 | 	scheduled?: ExportedHandlerScheduledHandler<Env>;
 452 | 	test?: ExportedHandlerTestHandler<Env>;
 453 | 	email?: EmailExportedHandler<Env>;
 454 | 	queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
 455 | }
 456 | interface StructuredSerializeOptions {
 457 | 	transfer?: any[];
 458 | }
 459 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
 460 | declare abstract class PromiseRejectionEvent extends Event {
 461 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
 462 | 	readonly promise: Promise<any>;
 463 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
 464 | 	readonly reason: any;
 465 | }
 466 | declare abstract class Navigator {
 467 | 	sendBeacon(
 468 | 		url: string,
 469 | 		body?:
 470 | 			| ReadableStream
 471 | 			| string
 472 | 			| (ArrayBuffer | ArrayBufferView)
 473 | 			| Blob
 474 | 			| FormData
 475 | 			| URLSearchParams
 476 | 			| URLSearchParams,
 477 | 	): boolean;
 478 | 	readonly userAgent: string;
 479 | 	readonly hardwareConcurrency: number;
 480 | }
 481 | /**
 482 |  * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
 483 |  * as well as timing of subrequests and other operations.
 484 |  *
 485 |  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
 486 |  */
 487 | interface Performance {
 488 | 	/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
 489 | 	readonly timeOrigin: number;
 490 | 	/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
 491 | 	now(): number;
 492 | }
 493 | interface AlarmInvocationInfo {
 494 | 	readonly isRetry: boolean;
 495 | 	readonly retryCount: number;
 496 | }
 497 | interface Cloudflare {
 498 | 	readonly compatibilityFlags: Record<string, boolean>;
 499 | }
 500 | interface DurableObject {
 501 | 	fetch(request: Request): Response | Promise<Response>;
 502 | 	alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
 503 | 	webSocketMessage?(
 504 | 		ws: WebSocket,
 505 | 		message: string | ArrayBuffer,
 506 | 	): void | Promise<void>;
 507 | 	webSocketClose?(
 508 | 		ws: WebSocket,
 509 | 		code: number,
 510 | 		reason: string,
 511 | 		wasClean: boolean,
 512 | 	): void | Promise<void>;
 513 | 	webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
 514 | }
 515 | type DurableObjectStub<
 516 | 	T extends Rpc.DurableObjectBranded | undefined = undefined,
 517 | > = Fetcher<
 518 | 	T,
 519 | 	"alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
 520 | > & {
 521 | 	readonly id: DurableObjectId;
 522 | 	readonly name?: string;
 523 | };
 524 | interface DurableObjectId {
 525 | 	toString(): string;
 526 | 	equals(other: DurableObjectId): boolean;
 527 | 	readonly name?: string;
 528 | }
 529 | interface DurableObjectNamespace<
 530 | 	T extends Rpc.DurableObjectBranded | undefined = undefined,
 531 | > {
 532 | 	newUniqueId(
 533 | 		options?: DurableObjectNamespaceNewUniqueIdOptions,
 534 | 	): DurableObjectId;
 535 | 	idFromName(name: string): DurableObjectId;
 536 | 	idFromString(id: string): DurableObjectId;
 537 | 	get(
 538 | 		id: DurableObjectId,
 539 | 		options?: DurableObjectNamespaceGetDurableObjectOptions,
 540 | 	): DurableObjectStub<T>;
 541 | 	getByName(
 542 | 		name: string,
 543 | 		options?: DurableObjectNamespaceGetDurableObjectOptions,
 544 | 	): DurableObjectStub<T>;
 545 | 	jurisdiction(
 546 | 		jurisdiction: DurableObjectJurisdiction,
 547 | 	): DurableObjectNamespace<T>;
 548 | }
 549 | type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
 550 | interface DurableObjectNamespaceNewUniqueIdOptions {
 551 | 	jurisdiction?: DurableObjectJurisdiction;
 552 | }
 553 | type DurableObjectLocationHint =
 554 | 	| "wnam"
 555 | 	| "enam"
 556 | 	| "sam"
 557 | 	| "weur"
 558 | 	| "eeur"
 559 | 	| "apac"
 560 | 	| "oc"
 561 | 	| "afr"
 562 | 	| "me";
 563 | interface DurableObjectNamespaceGetDurableObjectOptions {
 564 | 	locationHint?: DurableObjectLocationHint;
 565 | }
 566 | interface DurableObjectState {
 567 | 	waitUntil(promise: Promise<any>): void;
 568 | 	readonly id: DurableObjectId;
 569 | 	readonly storage: DurableObjectStorage;
 570 | 	container?: Container;
 571 | 	blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
 572 | 	acceptWebSocket(ws: WebSocket, tags?: string[]): void;
 573 | 	getWebSockets(tag?: string): WebSocket[];
 574 | 	setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
 575 | 	getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
 576 | 	getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
 577 | 	setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
 578 | 	getHibernatableWebSocketEventTimeout(): number | null;
 579 | 	getTags(ws: WebSocket): string[];
 580 | 	abort(reason?: string): void;
 581 | }
 582 | interface DurableObjectTransaction {
 583 | 	get<T = unknown>(
 584 | 		key: string,
 585 | 		options?: DurableObjectGetOptions,
 586 | 	): Promise<T | undefined>;
 587 | 	get<T = unknown>(
 588 | 		keys: string[],
 589 | 		options?: DurableObjectGetOptions,
 590 | 	): Promise<Map<string, T>>;
 591 | 	list<T = unknown>(
 592 | 		options?: DurableObjectListOptions,
 593 | 	): Promise<Map<string, T>>;
 594 | 	put<T>(
 595 | 		key: string,
 596 | 		value: T,
 597 | 		options?: DurableObjectPutOptions,
 598 | 	): Promise<void>;
 599 | 	put<T>(
 600 | 		entries: Record<string, T>,
 601 | 		options?: DurableObjectPutOptions,
 602 | 	): Promise<void>;
 603 | 	delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
 604 | 	delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
 605 | 	rollback(): void;
 606 | 	getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
 607 | 	setAlarm(
 608 | 		scheduledTime: number | Date,
 609 | 		options?: DurableObjectSetAlarmOptions,
 610 | 	): Promise<void>;
 611 | 	deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
 612 | }
 613 | interface DurableObjectStorage {
 614 | 	get<T = unknown>(
 615 | 		key: string,
 616 | 		options?: DurableObjectGetOptions,
 617 | 	): Promise<T | undefined>;
 618 | 	get<T = unknown>(
 619 | 		keys: string[],
 620 | 		options?: DurableObjectGetOptions,
 621 | 	): Promise<Map<string, T>>;
 622 | 	list<T = unknown>(
 623 | 		options?: DurableObjectListOptions,
 624 | 	): Promise<Map<string, T>>;
 625 | 	put<T>(
 626 | 		key: string,
 627 | 		value: T,
 628 | 		options?: DurableObjectPutOptions,
 629 | 	): Promise<void>;
 630 | 	put<T>(
 631 | 		entries: Record<string, T>,
 632 | 		options?: DurableObjectPutOptions,
 633 | 	): Promise<void>;
 634 | 	delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
 635 | 	delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
 636 | 	deleteAll(options?: DurableObjectPutOptions): Promise<void>;
 637 | 	transaction<T>(
 638 | 		closure: (txn: DurableObjectTransaction) => Promise<T>,
 639 | 	): Promise<T>;
 640 | 	getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
 641 | 	setAlarm(
 642 | 		scheduledTime: number | Date,
 643 | 		options?: DurableObjectSetAlarmOptions,
 644 | 	): Promise<void>;
 645 | 	deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
 646 | 	sync(): Promise<void>;
 647 | 	sql: SqlStorage;
 648 | 	transactionSync<T>(closure: () => T): T;
 649 | 	getCurrentBookmark(): Promise<string>;
 650 | 	getBookmarkForTime(timestamp: number | Date): Promise<string>;
 651 | 	onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
 652 | }
 653 | interface DurableObjectListOptions {
 654 | 	start?: string;
 655 | 	startAfter?: string;
 656 | 	end?: string;
 657 | 	prefix?: string;
 658 | 	reverse?: boolean;
 659 | 	limit?: number;
 660 | 	allowConcurrency?: boolean;
 661 | 	noCache?: boolean;
 662 | }
 663 | interface DurableObjectGetOptions {
 664 | 	allowConcurrency?: boolean;
 665 | 	noCache?: boolean;
 666 | }
 667 | interface DurableObjectGetAlarmOptions {
 668 | 	allowConcurrency?: boolean;
 669 | }
 670 | interface DurableObjectPutOptions {
 671 | 	allowConcurrency?: boolean;
 672 | 	allowUnconfirmed?: boolean;
 673 | 	noCache?: boolean;
 674 | }
 675 | interface DurableObjectSetAlarmOptions {
 676 | 	allowConcurrency?: boolean;
 677 | 	allowUnconfirmed?: boolean;
 678 | }
 679 | declare class WebSocketRequestResponsePair {
 680 | 	constructor(request: string, response: string);
 681 | 	get request(): string;
 682 | 	get response(): string;
 683 | }
 684 | interface AnalyticsEngineDataset {
 685 | 	writeDataPoint(event?: AnalyticsEngineDataPoint): void;
 686 | }
 687 | interface AnalyticsEngineDataPoint {
 688 | 	indexes?: ((ArrayBuffer | string) | null)[];
 689 | 	doubles?: number[];
 690 | 	blobs?: ((ArrayBuffer | string) | null)[];
 691 | }
 692 | /**
 693 |  * An event which takes place in the DOM.
 694 |  *
 695 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
 696 |  */
 697 | declare class Event {
 698 | 	constructor(type: string, init?: EventInit);
 699 | 	/**
 700 | 	 * Returns the type of event, e.g. "click", "hashchange", or "submit".
 701 | 	 *
 702 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
 703 | 	 */
 704 | 	get type(): string;
 705 | 	/**
 706 | 	 * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
 707 | 	 *
 708 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
 709 | 	 */
 710 | 	get eventPhase(): number;
 711 | 	/**
 712 | 	 * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
 713 | 	 *
 714 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
 715 | 	 */
 716 | 	get composed(): boolean;
 717 | 	/**
 718 | 	 * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
 719 | 	 *
 720 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
 721 | 	 */
 722 | 	get bubbles(): boolean;
 723 | 	/**
 724 | 	 * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
 725 | 	 *
 726 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
 727 | 	 */
 728 | 	get cancelable(): boolean;
 729 | 	/**
 730 | 	 * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
 731 | 	 *
 732 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
 733 | 	 */
 734 | 	get defaultPrevented(): boolean;
 735 | 	/**
 736 | 	 * @deprecated
 737 | 	 *
 738 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
 739 | 	 */
 740 | 	get returnValue(): boolean;
 741 | 	/**
 742 | 	 * Returns the object whose event listener's callback is currently being invoked.
 743 | 	 *
 744 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
 745 | 	 */
 746 | 	get currentTarget(): EventTarget | undefined;
 747 | 	/**
 748 | 	 * Returns the object to which event is dispatched (its target).
 749 | 	 *
 750 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
 751 | 	 */
 752 | 	get target(): EventTarget | undefined;
 753 | 	/**
 754 | 	 * @deprecated
 755 | 	 *
 756 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
 757 | 	 */
 758 | 	get srcElement(): EventTarget | undefined;
 759 | 	/**
 760 | 	 * Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
 761 | 	 *
 762 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
 763 | 	 */
 764 | 	get timeStamp(): number;
 765 | 	/**
 766 | 	 * Returns true if event was dispatched by the user agent, and false otherwise.
 767 | 	 *
 768 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
 769 | 	 */
 770 | 	get isTrusted(): boolean;
 771 | 	/**
 772 | 	 * @deprecated
 773 | 	 *
 774 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
 775 | 	 */
 776 | 	get cancelBubble(): boolean;
 777 | 	/**
 778 | 	 * @deprecated
 779 | 	 *
 780 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
 781 | 	 */
 782 | 	set cancelBubble(value: boolean);
 783 | 	/**
 784 | 	 * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
 785 | 	 *
 786 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
 787 | 	 */
 788 | 	stopImmediatePropagation(): void;
 789 | 	/**
 790 | 	 * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
 791 | 	 *
 792 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
 793 | 	 */
 794 | 	preventDefault(): void;
 795 | 	/**
 796 | 	 * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
 797 | 	 *
 798 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
 799 | 	 */
 800 | 	stopPropagation(): void;
 801 | 	/**
 802 | 	 * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
 803 | 	 *
 804 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
 805 | 	 */
 806 | 	composedPath(): EventTarget[];
 807 | 	static readonly NONE: number;
 808 | 	static readonly CAPTURING_PHASE: number;
 809 | 	static readonly AT_TARGET: number;
 810 | 	static readonly BUBBLING_PHASE: number;
 811 | }
 812 | interface EventInit {
 813 | 	bubbles?: boolean;
 814 | 	cancelable?: boolean;
 815 | 	composed?: boolean;
 816 | }
 817 | type EventListener<EventType extends Event = Event> = (
 818 | 	event: EventType,
 819 | ) => void;
 820 | interface EventListenerObject<EventType extends Event = Event> {
 821 | 	handleEvent(event: EventType): void;
 822 | }
 823 | type EventListenerOrEventListenerObject<EventType extends Event = Event> =
 824 | 	| EventListener<EventType>
 825 | 	| EventListenerObject<EventType>;
 826 | /**
 827 |  * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
 828 |  *
 829 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
 830 |  */
 831 | declare class EventTarget<
 832 | 	EventMap extends Record<string, Event> = Record<string, Event>,
 833 | > {
 834 | 	constructor();
 835 | 	/**
 836 | 	 * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
 837 | 	 *
 838 | 	 * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
 839 | 	 *
 840 | 	 * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
 841 | 	 *
 842 | 	 * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
 843 | 	 *
 844 | 	 * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
 845 | 	 *
 846 | 	 * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
 847 | 	 *
 848 | 	 * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
 849 | 	 *
 850 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
 851 | 	 */
 852 | 	addEventListener<Type extends keyof EventMap>(
 853 | 		type: Type,
 854 | 		handler: EventListenerOrEventListenerObject<EventMap[Type]>,
 855 | 		options?: EventTargetAddEventListenerOptions | boolean,
 856 | 	): void;
 857 | 	/**
 858 | 	 * Removes the event listener in target's event listener list with the same type, callback, and options.
 859 | 	 *
 860 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
 861 | 	 */
 862 | 	removeEventListener<Type extends keyof EventMap>(
 863 | 		type: Type,
 864 | 		handler: EventListenerOrEventListenerObject<EventMap[Type]>,
 865 | 		options?: EventTargetEventListenerOptions | boolean,
 866 | 	): void;
 867 | 	/**
 868 | 	 * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
 869 | 	 *
 870 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
 871 | 	 */
 872 | 	dispatchEvent(event: EventMap[keyof EventMap]): boolean;
 873 | }
 874 | interface EventTargetEventListenerOptions {
 875 | 	capture?: boolean;
 876 | }
 877 | interface EventTargetAddEventListenerOptions {
 878 | 	capture?: boolean;
 879 | 	passive?: boolean;
 880 | 	once?: boolean;
 881 | 	signal?: AbortSignal;
 882 | }
 883 | interface EventTargetHandlerObject {
 884 | 	handleEvent: (event: Event) => any | undefined;
 885 | }
 886 | /**
 887 |  * A controller object that allows you to abort one or more DOM requests as and when desired.
 888 |  *
 889 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
 890 |  */
 891 | declare class AbortController {
 892 | 	constructor();
 893 | 	/**
 894 | 	 * Returns the AbortSignal object associated with this object.
 895 | 	 *
 896 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
 897 | 	 */
 898 | 	get signal(): AbortSignal;
 899 | 	/**
 900 | 	 * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
 901 | 	 *
 902 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
 903 | 	 */
 904 | 	abort(reason?: any): void;
 905 | }
 906 | /**
 907 |  * A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
 908 |  *
 909 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
 910 |  */
 911 | declare abstract class AbortSignal extends EventTarget {
 912 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
 913 | 	static abort(reason?: any): AbortSignal;
 914 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
 915 | 	static timeout(delay: number): AbortSignal;
 916 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
 917 | 	static any(signals: AbortSignal[]): AbortSignal;
 918 | 	/**
 919 | 	 * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
 920 | 	 *
 921 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
 922 | 	 */
 923 | 	get aborted(): boolean;
 924 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
 925 | 	get reason(): any;
 926 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
 927 | 	get onabort(): any | null;
 928 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
 929 | 	set onabort(value: any | null);
 930 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
 931 | 	throwIfAborted(): void;
 932 | }
 933 | interface Scheduler {
 934 | 	wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
 935 | }
 936 | interface SchedulerWaitOptions {
 937 | 	signal?: AbortSignal;
 938 | }
 939 | /**
 940 |  * Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
 941 |  *
 942 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
 943 |  */
 944 | declare abstract class ExtendableEvent extends Event {
 945 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
 946 | 	waitUntil(promise: Promise<any>): void;
 947 | }
 948 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
 949 | declare class CustomEvent<T = any> extends Event {
 950 | 	constructor(type: string, init?: CustomEventCustomEventInit);
 951 | 	/**
 952 | 	 * Returns any custom data event was created with. Typically used for synthetic events.
 953 | 	 *
 954 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
 955 | 	 */
 956 | 	get detail(): T;
 957 | }
 958 | interface CustomEventCustomEventInit {
 959 | 	bubbles?: boolean;
 960 | 	cancelable?: boolean;
 961 | 	composed?: boolean;
 962 | 	detail?: any;
 963 | }
 964 | /**
 965 |  * A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.
 966 |  *
 967 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
 968 |  */
 969 | declare class Blob {
 970 | 	constructor(
 971 | 		type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
 972 | 		options?: BlobOptions,
 973 | 	);
 974 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
 975 | 	get size(): number;
 976 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
 977 | 	get type(): string;
 978 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
 979 | 	slice(start?: number, end?: number, type?: string): Blob;
 980 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
 981 | 	arrayBuffer(): Promise<ArrayBuffer>;
 982 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */
 983 | 	bytes(): Promise<Uint8Array>;
 984 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
 985 | 	text(): Promise<string>;
 986 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
 987 | 	stream(): ReadableStream;
 988 | }
 989 | interface BlobOptions {
 990 | 	type?: string;
 991 | }
 992 | /**
 993 |  * Provides information about files and allows JavaScript in a web page to access their content.
 994 |  *
 995 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
 996 |  */
 997 | declare class File extends Blob {
 998 | 	constructor(
 999 | 		bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
1000 | 		name: string,
1001 | 		options?: FileOptions,
1002 | 	);
1003 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
1004 | 	get name(): string;
1005 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
1006 | 	get lastModified(): number;
1007 | }
1008 | interface FileOptions {
1009 | 	type?: string;
1010 | 	lastModified?: number;
1011 | }
1012 | /**
1013 |  * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
1014 |  *
1015 |  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
1016 |  */
1017 | declare abstract class CacheStorage {
1018 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
1019 | 	open(cacheName: string): Promise<Cache>;
1020 | 	readonly default: Cache;
1021 | }
1022 | /**
1023 |  * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
1024 |  *
1025 |  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
1026 |  */
1027 | declare abstract class Cache {
1028 | 	/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
1029 | 	delete(
1030 | 		request: RequestInfo | URL,
1031 | 		options?: CacheQueryOptions,
1032 | 	): Promise<boolean>;
1033 | 	/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
1034 | 	match(
1035 | 		request: RequestInfo | URL,
1036 | 		options?: CacheQueryOptions,
1037 | 	): Promise<Response | undefined>;
1038 | 	/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
1039 | 	put(request: RequestInfo | URL, response: Response): Promise<void>;
1040 | }
1041 | interface CacheQueryOptions {
1042 | 	ignoreMethod?: boolean;
1043 | }
1044 | /**
1045 |  * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
1046 |  * The Workers runtime implements the full surface of this API, but with some differences in
1047 |  * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
1048 |  * compared to those implemented in most browsers.
1049 |  *
1050 |  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
1051 |  */
1052 | declare abstract class Crypto {
1053 | 	/**
1054 | 	 * Available only in secure contexts.
1055 | 	 *
1056 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
1057 | 	 */
1058 | 	get subtle(): SubtleCrypto;
1059 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
1060 | 	getRandomValues<
1061 | 		T extends
1062 | 			| Int8Array
1063 | 			| Uint8Array
1064 | 			| Int16Array
1065 | 			| Uint16Array
1066 | 			| Int32Array
1067 | 			| Uint32Array
1068 | 			| BigInt64Array
1069 | 			| BigUint64Array,
1070 | 	>(buffer: T): T;
1071 | 	/**
1072 | 	 * Available only in secure contexts.
1073 | 	 *
1074 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
1075 | 	 */
1076 | 	randomUUID(): string;
1077 | 	DigestStream: typeof DigestStream;
1078 | }
1079 | /**
1080 |  * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
1081 |  * Available only in secure contexts.
1082 |  *
1083 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
1084 |  */
1085 | declare abstract class SubtleCrypto {
1086 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
1087 | 	encrypt(
1088 | 		algorithm: string | SubtleCryptoEncryptAlgorithm,
1089 | 		key: CryptoKey,
1090 | 		plainText: ArrayBuffer | ArrayBufferView,
1091 | 	): Promise<ArrayBuffer>;
1092 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
1093 | 	decrypt(
1094 | 		algorithm: string | SubtleCryptoEncryptAlgorithm,
1095 | 		key: CryptoKey,
1096 | 		cipherText: ArrayBuffer | ArrayBufferView,
1097 | 	): Promise<ArrayBuffer>;
1098 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
1099 | 	sign(
1100 | 		algorithm: string | SubtleCryptoSignAlgorithm,
1101 | 		key: CryptoKey,
1102 | 		data: ArrayBuffer | ArrayBufferView,
1103 | 	): Promise<ArrayBuffer>;
1104 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
1105 | 	verify(
1106 | 		algorithm: string | SubtleCryptoSignAlgorithm,
1107 | 		key: CryptoKey,
1108 | 		signature: ArrayBuffer | ArrayBufferView,
1109 | 		data: ArrayBuffer | ArrayBufferView,
1110 | 	): Promise<boolean>;
1111 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
1112 | 	digest(
1113 | 		algorithm: string | SubtleCryptoHashAlgorithm,
1114 | 		data: ArrayBuffer | ArrayBufferView,
1115 | 	): Promise<ArrayBuffer>;
1116 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
1117 | 	generateKey(
1118 | 		algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
1119 | 		extractable: boolean,
1120 | 		keyUsages: string[],
1121 | 	): Promise<CryptoKey | CryptoKeyPair>;
1122 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
1123 | 	deriveKey(
1124 | 		algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
1125 | 		baseKey: CryptoKey,
1126 | 		derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
1127 | 		extractable: boolean,
1128 | 		keyUsages: string[],
1129 | 	): Promise<CryptoKey>;
1130 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
1131 | 	deriveBits(
1132 | 		algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
1133 | 		baseKey: CryptoKey,
1134 | 		length?: number | null,
1135 | 	): Promise<ArrayBuffer>;
1136 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
1137 | 	importKey(
1138 | 		format: string,
1139 | 		keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
1140 | 		algorithm: string | SubtleCryptoImportKeyAlgorithm,
1141 | 		extractable: boolean,
1142 | 		keyUsages: string[],
1143 | 	): Promise<CryptoKey>;
1144 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
1145 | 	exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
1146 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
1147 | 	wrapKey(
1148 | 		format: string,
1149 | 		key: CryptoKey,
1150 | 		wrappingKey: CryptoKey,
1151 | 		wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
1152 | 	): Promise<ArrayBuffer>;
1153 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
1154 | 	unwrapKey(
1155 | 		format: string,
1156 | 		wrappedKey: ArrayBuffer | ArrayBufferView,
1157 | 		unwrappingKey: CryptoKey,
1158 | 		unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
1159 | 		unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
1160 | 		extractable: boolean,
1161 | 		keyUsages: string[],
1162 | 	): Promise<CryptoKey>;
1163 | 	timingSafeEqual(
1164 | 		a: ArrayBuffer | ArrayBufferView,
1165 | 		b: ArrayBuffer | ArrayBufferView,
1166 | 	): boolean;
1167 | }
1168 | /**
1169 |  * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
1170 |  * Available only in secure contexts.
1171 |  *
1172 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
1173 |  */
1174 | declare abstract class CryptoKey {
1175 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
1176 | 	readonly type: string;
1177 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
1178 | 	readonly extractable: boolean;
1179 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
1180 | 	readonly algorithm:
1181 | 		| CryptoKeyKeyAlgorithm
1182 | 		| CryptoKeyAesKeyAlgorithm
1183 | 		| CryptoKeyHmacKeyAlgorithm
1184 | 		| CryptoKeyRsaKeyAlgorithm
1185 | 		| CryptoKeyEllipticKeyAlgorithm
1186 | 		| CryptoKeyArbitraryKeyAlgorithm;
1187 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
1188 | 	readonly usages: string[];
1189 | }
1190 | interface CryptoKeyPair {
1191 | 	publicKey: CryptoKey;
1192 | 	privateKey: CryptoKey;
1193 | }
1194 | interface JsonWebKey {
1195 | 	kty: string;
1196 | 	use?: string;
1197 | 	key_ops?: string[];
1198 | 	alg?: string;
1199 | 	ext?: boolean;
1200 | 	crv?: string;
1201 | 	x?: string;
1202 | 	y?: string;
1203 | 	d?: string;
1204 | 	n?: string;
1205 | 	e?: string;
1206 | 	p?: string;
1207 | 	q?: string;
1208 | 	dp?: string;
1209 | 	dq?: string;
1210 | 	qi?: string;
1211 | 	oth?: RsaOtherPrimesInfo[];
1212 | 	k?: string;
1213 | }
1214 | interface RsaOtherPrimesInfo {
1215 | 	r?: string;
1216 | 	d?: string;
1217 | 	t?: string;
1218 | }
1219 | interface SubtleCryptoDeriveKeyAlgorithm {
1220 | 	name: string;
1221 | 	salt?: ArrayBuffer | ArrayBufferView;
1222 | 	iterations?: number;
1223 | 	hash?: string | SubtleCryptoHashAlgorithm;
1224 | 	$public?: CryptoKey;
1225 | 	info?: ArrayBuffer | ArrayBufferView;
1226 | }
1227 | interface SubtleCryptoEncryptAlgorithm {
1228 | 	name: string;
1229 | 	iv?: ArrayBuffer | ArrayBufferView;
1230 | 	additionalData?: ArrayBuffer | ArrayBufferView;
1231 | 	tagLength?: number;
1232 | 	counter?: ArrayBuffer | ArrayBufferView;
1233 | 	length?: number;
1234 | 	label?: ArrayBuffer | ArrayBufferView;
1235 | }
1236 | interface SubtleCryptoGenerateKeyAlgorithm {
1237 | 	name: string;
1238 | 	hash?: string | SubtleCryptoHashAlgorithm;
1239 | 	modulusLength?: number;
1240 | 	publicExponent?: ArrayBuffer | ArrayBufferView;
1241 | 	length?: number;
1242 | 	namedCurve?: string;
1243 | }
1244 | interface SubtleCryptoHashAlgorithm {
1245 | 	name: string;
1246 | }
1247 | interface SubtleCryptoImportKeyAlgorithm {
1248 | 	name: string;
1249 | 	hash?: string | SubtleCryptoHashAlgorithm;
1250 | 	length?: number;
1251 | 	namedCurve?: string;
1252 | 	compressed?: boolean;
1253 | }
1254 | interface SubtleCryptoSignAlgorithm {
1255 | 	name: string;
1256 | 	hash?: string | SubtleCryptoHashAlgorithm;
1257 | 	dataLength?: number;
1258 | 	saltLength?: number;
1259 | }
1260 | interface CryptoKeyKeyAlgorithm {
1261 | 	name: string;
1262 | }
1263 | interface CryptoKeyAesKeyAlgorithm {
1264 | 	name: string;
1265 | 	length: number;
1266 | }
1267 | interface CryptoKeyHmacKeyAlgorithm {
1268 | 	name: string;
1269 | 	hash: CryptoKeyKeyAlgorithm;
1270 | 	length: number;
1271 | }
1272 | interface CryptoKeyRsaKeyAlgorithm {
1273 | 	name: string;
1274 | 	modulusLength: number;
1275 | 	publicExponent: ArrayBuffer | ArrayBufferView;
1276 | 	hash?: CryptoKeyKeyAlgorithm;
1277 | }
1278 | interface CryptoKeyEllipticKeyAlgorithm {
1279 | 	name: string;
1280 | 	namedCurve: string;
1281 | }
1282 | interface CryptoKeyArbitraryKeyAlgorithm {
1283 | 	name: string;
1284 | 	hash?: CryptoKeyKeyAlgorithm;
1285 | 	namedCurve?: string;
1286 | 	length?: number;
1287 | }
1288 | declare class DigestStream extends WritableStream<
1289 | 	ArrayBuffer | ArrayBufferView
1290 | > {
1291 | 	constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1292 | 	readonly digest: Promise<ArrayBuffer>;
1293 | 	get bytesWritten(): number | bigint;
1294 | }
1295 | /**
1296 |  * A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
1297 |  *
1298 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1299 |  */
1300 | declare class TextDecoder {
1301 | 	constructor(label?: string, options?: TextDecoderConstructorOptions);
1302 | 	/**
1303 | 	 * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
1304 | 	 *
1305 | 	 * ```
1306 | 	 * var string = "", decoder = new TextDecoder(encoding), buffer;
1307 | 	 * while(buffer = next_chunk()) {
1308 | 	 *   string += decoder.decode(buffer, {stream:true});
1309 | 	 * }
1310 | 	 * string += decoder.decode(); // end-of-queue
1311 | 	 * ```
1312 | 	 *
1313 | 	 * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
1314 | 	 *
1315 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
1316 | 	 */
1317 | 	decode(
1318 | 		input?: ArrayBuffer | ArrayBufferView,
1319 | 		options?: TextDecoderDecodeOptions,
1320 | 	): string;
1321 | 	get encoding(): string;
1322 | 	get fatal(): boolean;
1323 | 	get ignoreBOM(): boolean;
1324 | }
1325 | /**
1326 |  * TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
1327 |  *
1328 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
1329 |  */
1330 | declare class TextEncoder {
1331 | 	constructor();
1332 | 	/**
1333 | 	 * Returns the result of running UTF-8's encoder.
1334 | 	 *
1335 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
1336 | 	 */
1337 | 	encode(input?: string): Uint8Array;
1338 | 	/**
1339 | 	 * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.
1340 | 	 *
1341 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
1342 | 	 */
1343 | 	encodeInto(
1344 | 		input: string,
1345 | 		buffer: ArrayBuffer | ArrayBufferView,
1346 | 	): TextEncoderEncodeIntoResult;
1347 | 	get encoding(): string;
1348 | }
1349 | interface TextDecoderConstructorOptions {
1350 | 	fatal: boolean;
1351 | 	ignoreBOM: boolean;
1352 | }
1353 | interface TextDecoderDecodeOptions {
1354 | 	stream: boolean;
1355 | }
1356 | interface TextEncoderEncodeIntoResult {
1357 | 	read: number;
1358 | 	written: number;
1359 | }
1360 | /**
1361 |  * Events providing information related to errors in scripts or in files.
1362 |  *
1363 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
1364 |  */
1365 | declare class ErrorEvent extends Event {
1366 | 	constructor(type: string, init?: ErrorEventErrorEventInit);
1367 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1368 | 	get filename(): string;
1369 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1370 | 	get message(): string;
1371 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1372 | 	get lineno(): number;
1373 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1374 | 	get colno(): number;
1375 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1376 | 	get error(): any;
1377 | }
1378 | interface ErrorEventErrorEventInit {
1379 | 	message?: string;
1380 | 	filename?: string;
1381 | 	lineno?: number;
1382 | 	colno?: number;
1383 | 	error?: any;
1384 | }
1385 | /**
1386 |  * A message received by a target object.
1387 |  *
1388 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
1389 |  */
1390 | declare class MessageEvent extends Event {
1391 | 	constructor(type: string, initializer: MessageEventInit);
1392 | 	/**
1393 | 	 * Returns the data of the message.
1394 | 	 *
1395 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
1396 | 	 */
1397 | 	readonly data: any;
1398 | 	/**
1399 | 	 * Returns the origin of the message, for server-sent events and cross-document messaging.
1400 | 	 *
1401 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
1402 | 	 */
1403 | 	readonly origin: string | null;
1404 | 	/**
1405 | 	 * Returns the last event ID string, for server-sent events.
1406 | 	 *
1407 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
1408 | 	 */
1409 | 	readonly lastEventId: string;
1410 | 	/**
1411 | 	 * Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.
1412 | 	 *
1413 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
1414 | 	 */
1415 | 	readonly source: MessagePort | null;
1416 | 	/**
1417 | 	 * Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.
1418 | 	 *
1419 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
1420 | 	 */
1421 | 	readonly ports: MessagePort[];
1422 | }
1423 | interface MessageEventInit {
1424 | 	data: ArrayBuffer | string;
1425 | }
1426 | /**
1427 |  * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
1428 |  *
1429 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
1430 |  */
1431 | declare class FormData {
1432 | 	constructor();
1433 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1434 | 	append(name: string, value: string): void;
1435 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1436 | 	append(name: string, value: Blob, filename?: string): void;
1437 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
1438 | 	delete(name: string): void;
1439 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
1440 | 	get(name: string): (File | string) | null;
1441 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
1442 | 	getAll(name: string): (File | string)[];
1443 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
1444 | 	has(name: string): boolean;
1445 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1446 | 	set(name: string, value: string): void;
1447 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1448 | 	set(name: string, value: Blob, filename?: string): void;
1449 | 	/* Returns an array of key, value pairs for every entry in the list. */
1450 | 	entries(): IterableIterator<[key: string, value: File | string]>;
1451 | 	/* Returns a list of keys in the list. */
1452 | 	keys(): IterableIterator<string>;
1453 | 	/* Returns a list of values in the list. */
1454 | 	values(): IterableIterator<File | string>;
1455 | 	forEach<This = unknown>(
1456 | 		callback: (
1457 | 			this: This,
1458 | 			value: File | string,
1459 | 			key: string,
1460 | 			parent: FormData,
1461 | 		) => void,
1462 | 		thisArg?: This,
1463 | 	): void;
1464 | 	[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
1465 | }
1466 | interface ContentOptions {
1467 | 	html?: boolean;
1468 | }
1469 | declare class HTMLRewriter {
1470 | 	constructor();
1471 | 	on(
1472 | 		selector: string,
1473 | 		handlers: HTMLRewriterElementContentHandlers,
1474 | 	): HTMLRewriter;
1475 | 	onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
1476 | 	transform(response: Response): Response;
1477 | }
1478 | interface HTMLRewriterElementContentHandlers {
1479 | 	element?(element: Element): void | Promise<void>;
1480 | 	comments?(comment: Comment): void | Promise<void>;
1481 | 	text?(element: Text): void | Promise<void>;
1482 | }
1483 | interface HTMLRewriterDocumentContentHandlers {
1484 | 	doctype?(doctype: Doctype): void | Promise<void>;
1485 | 	comments?(comment: Comment): void | Promise<void>;
1486 | 	text?(text: Text): void | Promise<void>;
1487 | 	end?(end: DocumentEnd): void | Promise<void>;
1488 | }
1489 | interface Doctype {
1490 | 	readonly name: string | null;
1491 | 	readonly publicId: string | null;
1492 | 	readonly systemId: string | null;
1493 | }
1494 | interface Element {
1495 | 	tagName: string;
1496 | 	readonly attributes: IterableIterator<string[]>;
1497 | 	readonly removed: boolean;
1498 | 	readonly namespaceURI: string;
1499 | 	getAttribute(name: string): string | null;
1500 | 	hasAttribute(name: string): boolean;
1501 | 	setAttribute(name: string, value: string): Element;
1502 | 	removeAttribute(name: string): Element;
1503 | 	before(
1504 | 		content: string | ReadableStream | Response,
1505 | 		options?: ContentOptions,
1506 | 	): Element;
1507 | 	after(
1508 | 		content: string | ReadableStream | Response,
1509 | 		options?: ContentOptions,
1510 | 	): Element;
1511 | 	prepend(
1512 | 		content: string | ReadableStream | Response,
1513 | 		options?: ContentOptions,
1514 | 	): Element;
1515 | 	append(
1516 | 		content: string | ReadableStream | Response,
1517 | 		options?: ContentOptions,
1518 | 	): Element;
1519 | 	replace(
1520 | 		content: string | ReadableStream | Response,
1521 | 		options?: ContentOptions,
1522 | 	): Element;
1523 | 	remove(): Element;
1524 | 	removeAndKeepContent(): Element;
1525 | 	setInnerContent(
1526 | 		content: string | ReadableStream | Response,
1527 | 		options?: ContentOptions,
1528 | 	): Element;
1529 | 	onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
1530 | }
1531 | interface EndTag {
1532 | 	name: string;
1533 | 	before(
1534 | 		content: string | ReadableStream | Response,
1535 | 		options?: ContentOptions,
1536 | 	): EndTag;
1537 | 	after(
1538 | 		content: string | ReadableStream | Response,
1539 | 		options?: ContentOptions,
1540 | 	): EndTag;
1541 | 	remove(): EndTag;
1542 | }
1543 | interface Comment {
1544 | 	text: string;
1545 | 	readonly removed: boolean;
1546 | 	before(content: string, options?: ContentOptions): Comment;
1547 | 	after(content: string, options?: ContentOptions): Comment;
1548 | 	replace(content: string, options?: ContentOptions): Comment;
1549 | 	remove(): Comment;
1550 | }
1551 | interface Text {
1552 | 	readonly text: string;
1553 | 	readonly lastInTextNode: boolean;
1554 | 	readonly removed: boolean;
1555 | 	before(
1556 | 		content: string | ReadableStream | Response,
1557 | 		options?: ContentOptions,
1558 | 	): Text;
1559 | 	after(
1560 | 		content: string | ReadableStream | Response,
1561 | 		options?: ContentOptions,
1562 | 	): Text;
1563 | 	replace(
1564 | 		content: string | ReadableStream | Response,
1565 | 		options?: ContentOptions,
1566 | 	): Text;
1567 | 	remove(): Text;
1568 | }
1569 | interface DocumentEnd {
1570 | 	append(content: string, options?: ContentOptions): DocumentEnd;
1571 | }
1572 | /**
1573 |  * This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.
1574 |  *
1575 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
1576 |  */
1577 | declare abstract class FetchEvent extends ExtendableEvent {
1578 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1579 | 	readonly request: Request;
1580 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1581 | 	respondWith(promise: Response | Promise<Response>): void;
1582 | 	passThroughOnException(): void;
1583 | }
1584 | type HeadersInit =
1585 | 	| Headers
1586 | 	| Iterable<Iterable<string>>
1587 | 	| Record<string, string>;
1588 | /**
1589 |  * This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.
1590 |  *
1591 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
1592 |  */
1593 | declare class Headers {
1594 | 	constructor(init?: HeadersInit);
1595 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
1596 | 	get(name: string): string | null;
1597 | 	getAll(name: string): string[];
1598 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */
1599 | 	getSetCookie(): string[];
1600 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
1601 | 	has(name: string): boolean;
1602 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
1603 | 	set(name: string, value: string): void;
1604 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
1605 | 	append(name: string, value: string): void;
1606 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
1607 | 	delete(name: string): void;
1608 | 	forEach<This = unknown>(
1609 | 		callback: (this: This, value: string, key: string, parent: Headers) => void,
1610 | 		thisArg?: This,
1611 | 	): void;
1612 | 	/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
1613 | 	entries(): IterableIterator<[key: string, value: string]>;
1614 | 	/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1615 | 	keys(): IterableIterator<string>;
1616 | 	/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1617 | 	values(): IterableIterator<string>;
1618 | 	[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
1619 | }
1620 | type BodyInit =
1621 | 	| ReadableStream<Uint8Array>
1622 | 	| string
1623 | 	| ArrayBuffer
1624 | 	| ArrayBufferView
1625 | 	| Blob
1626 | 	| URLSearchParams
1627 | 	| FormData;
1628 | declare abstract class Body {
1629 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
1630 | 	get body(): ReadableStream | null;
1631 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
1632 | 	get bodyUsed(): boolean;
1633 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
1634 | 	arrayBuffer(): Promise<ArrayBuffer>;
1635 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */
1636 | 	bytes(): Promise<Uint8Array>;
1637 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
1638 | 	text(): Promise<string>;
1639 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
1640 | 	json<T>(): Promise<T>;
1641 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
1642 | 	formData(): Promise<FormData>;
1643 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
1644 | 	blob(): Promise<Blob>;
1645 | }
1646 | /**
1647 |  * This Fetch API interface represents the response to a request.
1648 |  *
1649 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1650 |  */
1651 | declare var Response: {
1652 | 	prototype: Response;
1653 | 	new (body?: BodyInit | null, init?: ResponseInit): Response;
1654 | 	error(): Response;
1655 | 	redirect(url: string, status?: number): Response;
1656 | 	json(any: any, maybeInit?: ResponseInit | Response): Response;
1657 | };
1658 | /**
1659 |  * This Fetch API interface represents the response to a request.
1660 |  *
1661 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1662 |  */
1663 | interface Response extends Body {
1664 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1665 | 	clone(): Response;
1666 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1667 | 	status: number;
1668 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1669 | 	statusText: string;
1670 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1671 | 	headers: Headers;
1672 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1673 | 	ok: boolean;
1674 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1675 | 	redirected: boolean;
1676 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1677 | 	url: string;
1678 | 	webSocket: WebSocket | null;
1679 | 	cf: any | undefined;
1680 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type) */
1681 | 	type: "default" | "error";
1682 | }
1683 | interface ResponseInit {
1684 | 	status?: number;
1685 | 	statusText?: string;
1686 | 	headers?: HeadersInit;
1687 | 	cf?: any;
1688 | 	webSocket?: WebSocket | null;
1689 | 	encodeBody?: "automatic" | "manual";
1690 | }
1691 | type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
1692 | 	| Request<CfHostMetadata, Cf>
1693 | 	| string;
1694 | /**
1695 |  * This Fetch API interface represents a resource request.
1696 |  *
1697 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1698 |  */
1699 | declare var Request: {
1700 | 	prototype: Request;
1701 | 	new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
1702 | 		input: RequestInfo<CfProperties> | URL,
1703 | 		init?: RequestInit<Cf>,
1704 | 	): Request<CfHostMetadata, Cf>;
1705 | };
1706 | /**
1707 |  * This Fetch API interface represents a resource request.
1708 |  *
1709 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1710 |  */
1711 | interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>
1712 | 	extends Body {
1713 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1714 | 	clone(): Request<CfHostMetadata, Cf>;
1715 | 	/**
1716 | 	 * Returns request's HTTP method, which is "GET" by default.
1717 | 	 *
1718 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1719 | 	 */
1720 | 	method: string;
1721 | 	/**
1722 | 	 * Returns the URL of request as a string.
1723 | 	 *
1724 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
1725 | 	 */
1726 | 	url: string;
1727 | 	/**
1728 | 	 * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
1729 | 	 *
1730 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1731 | 	 */
1732 | 	headers: Headers;
1733 | 	/**
1734 | 	 * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
1735 | 	 *
1736 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
1737 | 	 */
1738 | 	redirect: string;
1739 | 	fetcher: Fetcher | null;
1740 | 	/**
1741 | 	 * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
1742 | 	 *
1743 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
1744 | 	 */
1745 | 	signal: AbortSignal;
1746 | 	cf: Cf | undefined;
1747 | 	/**
1748 | 	 * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
1749 | 	 *
1750 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
1751 | 	 */
1752 | 	integrity: string;
1753 | 	/**
1754 | 	 * Returns a boolean indicating whether or not request can outlive the global in which it was created.
1755 | 	 *
1756 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1757 | 	 */
1758 | 	keepalive: boolean;
1759 | 	/**
1760 | 	 * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
1761 | 	 *
1762 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
1763 | 	 */
1764 | 	cache?: "no-store";
1765 | }
1766 | interface RequestInit<Cf = CfProperties> {
1767 | 	/* A string to set request's method. */
1768 | 	method?: string;
1769 | 	/* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
1770 | 	headers?: HeadersInit;
1771 | 	/* A BodyInit object or null to set request's body. */
1772 | 	body?: BodyInit | null;
1773 | 	/* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */
1774 | 	redirect?: string;
1775 | 	fetcher?: Fetcher | null;
1776 | 	cf?: Cf;
1777 | 	/* A string indicating how the request will interact with the browser's cache to set request's cache. */
1778 | 	cache?: "no-store";
1779 | 	/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1780 | 	integrity?: string;
1781 | 	/* An AbortSignal to set request's signal. */
1782 | 	signal?: AbortSignal | null;
1783 | 	encodeResponseBody?: "automatic" | "manual";
1784 | }
1785 | type Service<
1786 | 	T extends
1787 | 		| (new (
1788 | 				...args: any[]
1789 | 		  ) => Rpc.WorkerEntrypointBranded)
1790 | 		| Rpc.WorkerEntrypointBranded
1791 | 		| ExportedHandler<any, any, any>
1792 | 		| undefined = undefined,
1793 | > = T extends new (
1794 | 	...args: any[]
1795 | ) => Rpc.WorkerEntrypointBranded
1796 | 	? Fetcher<InstanceType<T>>
1797 | 	: T extends Rpc.WorkerEntrypointBranded
1798 | 		? Fetcher<T>
1799 | 		: T extends Exclude<Rpc.EntrypointBranded, Rpc.WorkerEntrypointBranded>
1800 | 			? never
1801 | 			: Fetcher<undefined>;
1802 | type Fetcher<
1803 | 	T extends Rpc.EntrypointBranded | undefined = undefined,
1804 | 	Reserved extends string = never,
1805 | > = (T extends Rpc.EntrypointBranded
1806 | 	? Rpc.Provider<T, Reserved | "fetch" | "connect">
1807 | 	: unknown) & {
1808 | 	fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
1809 | 	connect(address: SocketAddress | string, options?: SocketOptions): Socket;
1810 | };
1811 | interface KVNamespaceListKey<Metadata, Key extends string = string> {
1812 | 	name: Key;
1813 | 	expiration?: number;
1814 | 	metadata?: Metadata;
1815 | }
1816 | type KVNamespaceListResult<Metadata, Key extends string = string> =
1817 | 	| {
1818 | 			list_complete: false;
1819 | 			keys: KVNamespaceListKey<Metadata, Key>[];
1820 | 			cursor: string;
1821 | 			cacheStatus: string | null;
1822 | 	  }
1823 | 	| {
1824 | 			list_complete: true;
1825 | 			keys: KVNamespaceListKey<Metadata, Key>[];
1826 | 			cacheStatus: string | null;
1827 | 	  };
1828 | interface KVNamespace<Key extends string = string> {
1829 | 	get(
1830 | 		key: Key,
1831 | 		options?: Partial<KVNamespaceGetOptions<undefined>>,
1832 | 	): Promise<string | null>;
1833 | 	get(key: Key, type: "text"): Promise<string | null>;
1834 | 	get<ExpectedValue = unknown>(
1835 | 		key: Key,
1836 | 		type: "json",
1837 | 	): Promise<ExpectedValue | null>;
1838 | 	get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
1839 | 	get(key: Key, type: "stream"): Promise<ReadableStream | null>;
1840 | 	get(
1841 | 		key: Key,
1842 | 		options?: KVNamespaceGetOptions<"text">,
1843 | 	): Promise<string | null>;
1844 | 	get<ExpectedValue = unknown>(
1845 | 		key: Key,
1846 | 		options?: KVNamespaceGetOptions<"json">,
1847 | 	): Promise<ExpectedValue | null>;
1848 | 	get(
1849 | 		key: Key,
1850 | 		options?: KVNamespaceGetOptions<"arrayBuffer">,
1851 | 	): Promise<ArrayBuffer | null>;
1852 | 	get(
1853 | 		key: Key,
1854 | 		options?: KVNamespaceGetOptions<"stream">,
1855 | 	): Promise<ReadableStream | null>;
1856 | 	get(key: Array<Key>, type: "text"): Promise<Map<string, string | null>>;
1857 | 	get<ExpectedValue = unknown>(
1858 | 		key: Array<Key>,
1859 | 		type: "json",
1860 | 	): Promise<Map<string, ExpectedValue | null>>;
1861 | 	get(
1862 | 		key: Array<Key>,
1863 | 		options?: Partial<KVNamespaceGetOptions<undefined>>,
1864 | 	): Promise<Map<string, string | null>>;
1865 | 	get(
1866 | 		key: Array<Key>,
1867 | 		options?: KVNamespaceGetOptions<"text">,
1868 | 	): Promise<Map<string, string | null>>;
1869 | 	get<ExpectedValue = unknown>(
1870 | 		key: Array<Key>,
1871 | 		options?: KVNamespaceGetOptions<"json">,
1872 | 	): Promise<Map<string, ExpectedValue | null>>;
1873 | 	list<Metadata = unknown>(
1874 | 		options?: KVNamespaceListOptions,
1875 | 	): Promise<KVNamespaceListResult<Metadata, Key>>;
1876 | 	put(
1877 | 		key: Key,
1878 | 		value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
1879 | 		options?: KVNamespacePutOptions,
1880 | 	): Promise<void>;
1881 | 	getWithMetadata<Metadata = unknown>(
1882 | 		key: Key,
1883 | 		options?: Partial<KVNamespaceGetOptions<undefined>>,
1884 | 	): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1885 | 	getWithMetadata<Metadata = unknown>(
1886 | 		key: Key,
1887 | 		type: "text",
1888 | 	): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1889 | 	getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
1890 | 		key: Key,
1891 | 		type: "json",
1892 | 	): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1893 | 	getWithMetadata<Metadata = unknown>(
1894 | 		key: Key,
1895 | 		type: "arrayBuffer",
1896 | 	): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1897 | 	getWithMetadata<Metadata = unknown>(
1898 | 		key: Key,
1899 | 		type: "stream",
1900 | 	): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1901 | 	getWithMetadata<Metadata = unknown>(
1902 | 		key: Key,
1903 | 		options: KVNamespaceGetOptions<"text">,
1904 | 	): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1905 | 	getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
1906 | 		key: Key,
1907 | 		options: KVNamespaceGetOptions<"json">,
1908 | 	): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1909 | 	getWithMetadata<Metadata = unknown>(
1910 | 		key: Key,
1911 | 		options: KVNamespaceGetOptions<"arrayBuffer">,
1912 | 	): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1913 | 	getWithMetadata<Metadata = unknown>(
1914 | 		key: Key,
1915 | 		options: KVNamespaceGetOptions<"stream">,
1916 | 	): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1917 | 	getWithMetadata<Metadata = unknown>(
1918 | 		key: Array<Key>,
1919 | 		type: "text",
1920 | 	): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1921 | 	getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
1922 | 		key: Array<Key>,
1923 | 		type: "json",
1924 | 	): Promise<
1925 | 		Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>
1926 | 	>;
1927 | 	getWithMetadata<Metadata = unknown>(
1928 | 		key: Array<Key>,
1929 | 		options?: Partial<KVNamespaceGetOptions<undefined>>,
1930 | 	): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1931 | 	getWithMetadata<Metadata = unknown>(
1932 | 		key: Array<Key>,
1933 | 		options?: KVNamespaceGetOptions<"text">,
1934 | 	): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1935 | 	getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
1936 | 		key: Array<Key>,
1937 | 		options?: KVNamespaceGetOptions<"json">,
1938 | 	): Promise<
1939 | 		Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>
1940 | 	>;
1941 | 	delete(key: Key): Promise<void>;
1942 | }
1943 | interface KVNamespaceListOptions {
1944 | 	limit?: number;
1945 | 	prefix?: string | null;
1946 | 	cursor?: string | null;
1947 | }
1948 | interface KVNamespaceGetOptions<Type> {
1949 | 	type: Type;
1950 | 	cacheTtl?: number;
1951 | }
1952 | interface KVNamespacePutOptions {
1953 | 	expiration?: number;
1954 | 	expirationTtl?: number;
1955 | 	metadata?: any | null;
1956 | }
1957 | interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
1958 | 	value: Value | null;
1959 | 	metadata: Metadata | null;
1960 | 	cacheStatus: string | null;
1961 | }
1962 | type QueueContentType = "text" | "bytes" | "json" | "v8";
1963 | interface Queue<Body = unknown> {
1964 | 	send(message: Body, options?: QueueSendOptions): Promise<void>;
1965 | 	sendBatch(
1966 | 		messages: Iterable<MessageSendRequest<Body>>,
1967 | 		options?: QueueSendBatchOptions,
1968 | 	): Promise<void>;
1969 | }
1970 | interface QueueSendOptions {
1971 | 	contentType?: QueueContentType;
1972 | 	delaySeconds?: number;
1973 | }
1974 | interface QueueSendBatchOptions {
1975 | 	delaySeconds?: number;
1976 | }
1977 | interface MessageSendRequest<Body = unknown> {
1978 | 	body: Body;
1979 | 	contentType?: QueueContentType;
1980 | 	delaySeconds?: number;
1981 | }
1982 | interface QueueRetryOptions {
1983 | 	delaySeconds?: number;
1984 | }
1985 | interface Message<Body = unknown> {
1986 | 	readonly id: string;
1987 | 	readonly timestamp: Date;
1988 | 	readonly body: Body;
1989 | 	readonly attempts: number;
1990 | 	retry(options?: QueueRetryOptions): void;
1991 | 	ack(): void;
1992 | }
1993 | interface QueueEvent<Body = unknown> extends ExtendableEvent {
1994 | 	readonly messages: readonly Message<Body>[];
1995 | 	readonly queue: string;
1996 | 	retryAll(options?: QueueRetryOptions): void;
1997 | 	ackAll(): void;
1998 | }
1999 | interface MessageBatch<Body = unknown> {
2000 | 	readonly messages: readonly Message<Body>[];
2001 | 	readonly queue: string;
2002 | 	retryAll(options?: QueueRetryOptions): void;
2003 | 	ackAll(): void;
2004 | }
2005 | interface R2Error extends Error {
2006 | 	readonly name: string;
2007 | 	readonly code: number;
2008 | 	readonly message: string;
2009 | 	readonly action: string;
2010 | 	readonly stack: any;
2011 | }
2012 | interface R2ListOptions {
2013 | 	limit?: number;
2014 | 	prefix?: string;
2015 | 	cursor?: string;
2016 | 	delimiter?: string;
2017 | 	startAfter?: string;
2018 | 	include?: ("httpMetadata" | "customMetadata")[];
2019 | }
2020 | declare abstract class R2Bucket {
2021 | 	head(key: string): Promise<R2Object | null>;
2022 | 	get(
2023 | 		key: string,
2024 | 		options: R2GetOptions & {
2025 | 			onlyIf: R2Conditional | Headers;
2026 | 		},
2027 | 	): Promise<R2ObjectBody | R2Object | null>;
2028 | 	get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
2029 | 	put(
2030 | 		key: string,
2031 | 		value:
2032 | 			| ReadableStream
2033 | 			| ArrayBuffer
2034 | 			| ArrayBufferView
2035 | 			| string
2036 | 			| null
2037 | 			| Blob,
2038 | 		options?: R2PutOptions & {
2039 | 			onlyIf: R2Conditional | Headers;
2040 | 		},
2041 | 	): Promise<R2Object | null>;
2042 | 	put(
2043 | 		key: string,
2044 | 		value:
2045 | 			| ReadableStream
2046 | 			| ArrayBuffer
2047 | 			| ArrayBufferView
2048 | 			| string
2049 | 			| null
2050 | 			| Blob,
2051 | 		options?: R2PutOptions,
2052 | 	): Promise<R2Object>;
2053 | 	createMultipartUpload(
2054 | 		key: string,
2055 | 		options?: R2MultipartOptions,
2056 | 	): Promise<R2MultipartUpload>;
2057 | 	resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
2058 | 	delete(keys: string | string[]): Promise<void>;
2059 | 	list(options?: R2ListOptions): Promise<R2Objects>;
2060 | }
2061 | interface R2MultipartUpload {
2062 | 	readonly key: string;
2063 | 	readonly uploadId: string;
2064 | 	uploadPart(
2065 | 		partNumber: number,
2066 | 		value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
2067 | 		options?: R2UploadPartOptions,
2068 | 	): Promise<R2UploadedPart>;
2069 | 	abort(): Promise<void>;
2070 | 	complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
2071 | }
2072 | interface R2UploadedPart {
2073 | 	partNumber: number;
2074 | 	etag: string;
2075 | }
2076 | declare abstract class R2Object {
2077 | 	readonly key: string;
2078 | 	readonly version: string;
2079 | 	readonly size: number;
2080 | 	readonly etag: string;
2081 | 	readonly httpEtag: string;
2082 | 	readonly checksums: R2Checksums;
2083 | 	readonly uploaded: Date;
2084 | 	readonly httpMetadata?: R2HTTPMetadata;
2085 | 	readonly customMetadata?: Record<string, string>;
2086 | 	readonly range?: R2Range;
2087 | 	readonly storageClass: string;
2088 | 	readonly ssecKeyMd5?: string;
2089 | 	writeHttpMetadata(headers: Headers): void;
2090 | }
2091 | interface R2ObjectBody extends R2Object {
2092 | 	get body(): ReadableStream;
2093 | 	get bodyUsed(): boolean;
2094 | 	arrayBuffer(): Promise<ArrayBuffer>;
2095 | 	bytes(): Promise<Uint8Array>;
2096 | 	text(): Promise<string>;
2097 | 	json<T>(): Promise<T>;
2098 | 	blob(): Promise<Blob>;
2099 | }
2100 | type R2Range =
2101 | 	| {
2102 | 			offset: number;
2103 | 			length?: number;
2104 | 	  }
2105 | 	| {
2106 | 			offset?: number;
2107 | 			length: number;
2108 | 	  }
2109 | 	| {
2110 | 			suffix: number;
2111 | 	  };
2112 | interface R2Conditional {
2113 | 	etagMatches?: string;
2114 | 	etagDoesNotMatch?: string;
2115 | 	uploadedBefore?: Date;
2116 | 	uploadedAfter?: Date;
2117 | 	secondsGranularity?: boolean;
2118 | }
2119 | interface R2GetOptions {
2120 | 	onlyIf?: R2Conditional | Headers;
2121 | 	range?: R2Range | Headers;
2122 | 	ssecKey?: ArrayBuffer | string;
2123 | }
2124 | interface R2PutOptions {
2125 | 	onlyIf?: R2Conditional | Headers;
2126 | 	httpMetadata?: R2HTTPMetadata | Headers;
2127 | 	customMetadata?: Record<string, string>;
2128 | 	md5?: (ArrayBuffer | ArrayBufferView) | string;
2129 | 	sha1?: (ArrayBuffer | ArrayBufferView) | string;
2130 | 	sha256?: (ArrayBuffer | ArrayBufferView) | string;
2131 | 	sha384?: (ArrayBuffer | ArrayBufferView) | string;
2132 | 	sha512?: (ArrayBuffer | ArrayBufferView) | string;
2133 | 	storageClass?: string;
2134 | 	ssecKey?: ArrayBuffer | string;
2135 | }
2136 | interface R2MultipartOptions {
2137 | 	httpMetadata?: R2HTTPMetadata | Headers;
2138 | 	customMetadata?: Record<string, string>;
2139 | 	storageClass?: string;
2140 | 	ssecKey?: ArrayBuffer | string;
2141 | }
2142 | interface R2Checksums {
2143 | 	readonly md5?: ArrayBuffer;
2144 | 	readonly sha1?: ArrayBuffer;
2145 | 	readonly sha256?: ArrayBuffer;
2146 | 	readonly sha384?: ArrayBuffer;
2147 | 	readonly sha512?: ArrayBuffer;
2148 | 	toJSON(): R2StringChecksums;
2149 | }
2150 | interface R2StringChecksums {
2151 | 	md5?: string;
2152 | 	sha1?: string;
2153 | 	sha256?: string;
2154 | 	sha384?: string;
2155 | 	sha512?: string;
2156 | }
2157 | interface R2HTTPMetadata {
2158 | 	contentType?: string;
2159 | 	contentLanguage?: string;
2160 | 	contentDisposition?: string;
2161 | 	contentEncoding?: string;
2162 | 	cacheControl?: string;
2163 | 	cacheExpiry?: Date;
2164 | }
2165 | type R2Objects = {
2166 | 	objects: R2Object[];
2167 | 	delimitedPrefixes: string[];
2168 | } & (
2169 | 	| {
2170 | 			truncated: true;
2171 | 			cursor: string;
2172 | 	  }
2173 | 	| {
2174 | 			truncated: false;
2175 | 	  }
2176 | );
2177 | interface R2UploadPartOptions {
2178 | 	ssecKey?: ArrayBuffer | string;
2179 | }
2180 | declare abstract class ScheduledEvent extends ExtendableEvent {
2181 | 	readonly scheduledTime: number;
2182 | 	readonly cron: string;
2183 | 	noRetry(): void;
2184 | }
2185 | interface ScheduledController {
2186 | 	readonly scheduledTime: number;
2187 | 	readonly cron: string;
2188 | 	noRetry(): void;
2189 | }
2190 | interface QueuingStrategy<T = any> {
2191 | 	highWaterMark?: number | bigint;
2192 | 	size?: (chunk: T) => number | bigint;
2193 | }
2194 | interface UnderlyingSink<W = any> {
2195 | 	type?: string;
2196 | 	start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
2197 | 	write?: (
2198 | 		chunk: W,
2199 | 		controller: WritableStreamDefaultController,
2200 | 	) => void | Promise<void>;
2201 | 	abort?: (reason: any) => void | Promise<void>;
2202 | 	close?: () => void | Promise<void>;
2203 | }
2204 | interface UnderlyingByteSource {
2205 | 	type: "bytes";
2206 | 	autoAllocateChunkSize?: number;
2207 | 	start?: (controller: ReadableByteStreamController) => void | Promise<void>;
2208 | 	pull?: (controller: ReadableByteStreamController) => void | Promise<void>;
2209 | 	cancel?: (reason: any) => void | Promise<void>;
2210 | }
2211 | interface UnderlyingSource<R = any> {
2212 | 	type?: "" | undefined;
2213 | 	start?: (
2214 | 		controller: ReadableStreamDefaultController<R>,
2215 | 	) => void | Promise<void>;
2216 | 	pull?: (
2217 | 		controller: ReadableStreamDefaultController<R>,
2218 | 	) => void | Promise<void>;
2219 | 	cancel?: (reason: any) => void | Promise<void>;
2220 | 	expectedLength?: number | bigint;
2221 | }
2222 | interface Transformer<I = any, O = any> {
2223 | 	readableType?: string;
2224 | 	writableType?: string;
2225 | 	start?: (
2226 | 		controller: TransformStreamDefaultController<O>,
2227 | 	) => void | Promise<void>;
2228 | 	transform?: (
2229 | 		chunk: I,
2230 | 		controller: TransformStreamDefaultController<O>,
2231 | 	) => void | Promise<void>;
2232 | 	flush?: (
2233 | 		controller: TransformStreamDefaultController<O>,
2234 | 	) => void | Promise<void>;
2235 | 	cancel?: (reason: any) => void | Promise<void>;
2236 | 	expectedLength?: number;
2237 | }
2238 | interface StreamPipeOptions {
2239 | 	/**
2240 | 	 * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
2241 | 	 *
2242 | 	 * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
2243 | 	 *
2244 | 	 * Errors and closures of the source and destination streams propagate as follows:
2245 | 	 *
2246 | 	 * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
2247 | 	 *
2248 | 	 * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
2249 | 	 *
2250 | 	 * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
2251 | 	 *
2252 | 	 * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
2253 | 	 *
2254 | 	 * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
2255 | 	 */
2256 | 	preventClose?: boolean;
2257 | 	preventAbort?: boolean;
2258 | 	preventCancel?: boolean;
2259 | 	signal?: AbortSignal;
2260 | }
2261 | type ReadableStreamReadResult<R = any> =
2262 | 	| {
2263 | 			done: false;
2264 | 			value: R;
2265 | 	  }
2266 | 	| {
2267 | 			done: true;
2268 | 			value?: undefined;
2269 | 	  };
2270 | /**
2271 |  * This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
2272 |  *
2273 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
2274 |  */
2275 | interface ReadableStream<R = any> {
2276 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
2277 | 	get locked(): boolean;
2278 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
2279 | 	cancel(reason?: any): Promise<void>;
2280 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
2281 | 	getReader(): ReadableStreamDefaultReader<R>;
2282 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
2283 | 	getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
2284 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
2285 | 	pipeThrough<T>(
2286 | 		transform: ReadableWritablePair<T, R>,
2287 | 		options?: StreamPipeOptions,
2288 | 	): ReadableStream<T>;
2289 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
2290 | 	pipeTo(
2291 | 		destination: WritableStream<R>,
2292 | 		options?: StreamPipeOptions,
2293 | 	): Promise<void>;
2294 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
2295 | 	tee(): [ReadableStream<R>, ReadableStream<R>];
2296 | 	values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
2297 | 	[Symbol.asyncIterator](
2298 | 		options?: ReadableStreamValuesOptions,
2299 | 	): AsyncIterableIterator<R>;
2300 | }
2301 | /**
2302 |  * This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
2303 |  *
2304 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
2305 |  */
2306 | declare const ReadableStream: {
2307 | 	prototype: ReadableStream;
2308 | 	new (
2309 | 		underlyingSource: UnderlyingByteSource,
2310 | 		strategy?: QueuingStrategy<Uint8Array>,
2311 | 	): ReadableStream<Uint8Array>;
2312 | 	new <R = any>(
2313 | 		underlyingSource?: UnderlyingSource<R>,
2314 | 		strategy?: QueuingStrategy<R>,
2315 | 	): ReadableStream<R>;
2316 | };
2317 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
2318 | declare class ReadableStreamDefaultReader<R = any> {
2319 | 	constructor(stream: ReadableStream);
2320 | 	get closed(): Promise<void>;
2321 | 	cancel(reason?: any): Promise<void>;
2322 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
2323 | 	read(): Promise<ReadableStreamReadResult<R>>;
2324 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
2325 | 	releaseLock(): void;
2326 | }
2327 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
2328 | declare class ReadableStreamBYOBReader {
2329 | 	constructor(stream: ReadableStream);
2330 | 	get closed(): Promise<void>;
2331 | 	cancel(reason?: any): Promise<void>;
2332 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
2333 | 	read<T extends ArrayBufferView>(
2334 | 		view: T,
2335 | 	): Promise<ReadableStreamReadResult<T>>;
2336 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
2337 | 	releaseLock(): void;
2338 | 	readAtLeast<T extends ArrayBufferView>(
2339 | 		minElements: number,
2340 | 		view: T,
2341 | 	): Promise<ReadableStreamReadResult<T>>;
2342 | }
2343 | interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
2344 | 	min?: number;
2345 | }
2346 | interface ReadableStreamGetReaderOptions {
2347 | 	/**
2348 | 	 * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
2349 | 	 *
2350 | 	 * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
2351 | 	 */
2352 | 	mode: "byob";
2353 | }
2354 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
2355 | declare abstract class ReadableStreamBYOBRequest {
2356 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
2357 | 	get view(): Uint8Array | null;
2358 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
2359 | 	respond(bytesWritten: number): void;
2360 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
2361 | 	respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
2362 | 	get atLeast(): number | null;
2363 | }
2364 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
2365 | declare abstract class ReadableStreamDefaultController<R = any> {
2366 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
2367 | 	get desiredSize(): number | null;
2368 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
2369 | 	close(): void;
2370 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
2371 | 	enqueue(chunk?: R): void;
2372 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
2373 | 	error(reason: any): void;
2374 | }
2375 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
2376 | declare abstract class ReadableByteStreamController {
2377 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
2378 | 	get byobRequest(): ReadableStreamBYOBRequest | null;
2379 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
2380 | 	get desiredSize(): number | null;
2381 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
2382 | 	close(): void;
2383 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
2384 | 	enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
2385 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
2386 | 	error(reason: any): void;
2387 | }
2388 | /**
2389 |  * This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.
2390 |  *
2391 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
2392 |  */
2393 | declare abstract class WritableStreamDefaultController {
2394 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
2395 | 	get signal(): AbortSignal;
2396 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
2397 | 	error(reason?: any): void;
2398 | }
2399 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
2400 | declare abstract class TransformStreamDefaultController<O = any> {
2401 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
2402 | 	get desiredSize(): number | null;
2403 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
2404 | 	enqueue(chunk?: O): void;
2405 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
2406 | 	error(reason: any): void;
2407 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
2408 | 	terminate(): void;
2409 | }
2410 | interface ReadableWritablePair<R = any, W = any> {
2411 | 	/**
2412 | 	 * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
2413 | 	 *
2414 | 	 * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
2415 | 	 */
2416 | 	writable: WritableStream<W>;
2417 | 	readable: ReadableStream<R>;
2418 | }
2419 | /**
2420 |  * This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
2421 |  *
2422 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
2423 |  */
2424 | declare class WritableStream<W = any> {
2425 | 	constructor(
2426 | 		underlyingSink?: UnderlyingSink,
2427 | 		queuingStrategy?: QueuingStrategy,
2428 | 	);
2429 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
2430 | 	get locked(): boolean;
2431 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
2432 | 	abort(reason?: any): Promise<void>;
2433 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
2434 | 	close(): Promise<void>;
2435 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
2436 | 	getWriter(): WritableStreamDefaultWriter<W>;
2437 | }
2438 | /**
2439 |  * This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink.
2440 |  *
2441 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
2442 |  */
2443 | declare class WritableStreamDefaultWriter<W = any> {
2444 | 	constructor(stream: WritableStream);
2445 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
2446 | 	get closed(): Promise<void>;
2447 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
2448 | 	get ready(): Promise<void>;
2449 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
2450 | 	get desiredSize(): number | null;
2451 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
2452 | 	abort(reason?: any): Promise<void>;
2453 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
2454 | 	close(): Promise<void>;
2455 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
2456 | 	write(chunk?: W): Promise<void>;
2457 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
2458 | 	releaseLock(): void;
2459 | }
2460 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
2461 | declare class TransformStream<I = any, O = any> {
2462 | 	constructor(
2463 | 		transformer?: Transformer<I, O>,
2464 | 		writableStrategy?: QueuingStrategy<I>,
2465 | 		readableStrategy?: QueuingStrategy<O>,
2466 | 	);
2467 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
2468 | 	get readable(): ReadableStream<O>;
2469 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
2470 | 	get writable(): WritableStream<I>;
2471 | }
2472 | declare class FixedLengthStream extends IdentityTransformStream {
2473 | 	constructor(
2474 | 		expectedLength: number | bigint,
2475 | 		queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2476 | 	);
2477 | }
2478 | declare class IdentityTransformStream extends TransformStream<
2479 | 	ArrayBuffer | ArrayBufferView,
2480 | 	Uint8Array
2481 | > {
2482 | 	constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2483 | }
2484 | interface IdentityTransformStreamQueuingStrategy {
2485 | 	highWaterMark?: number | bigint;
2486 | }
2487 | interface ReadableStreamValuesOptions {
2488 | 	preventCancel?: boolean;
2489 | }
2490 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
2491 | declare class CompressionStream extends TransformStream<
2492 | 	ArrayBuffer | ArrayBufferView,
2493 | 	Uint8Array
2494 | > {
2495 | 	constructor(format: "gzip" | "deflate" | "deflate-raw");
2496 | }
2497 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
2498 | declare class DecompressionStream extends TransformStream<
2499 | 	ArrayBuffer | ArrayBufferView,
2500 | 	Uint8Array
2501 | > {
2502 | 	constructor(format: "gzip" | "deflate" | "deflate-raw");
2503 | }
2504 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
2505 | declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
2506 | 	constructor();
2507 | 	get encoding(): string;
2508 | }
2509 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
2510 | declare class TextDecoderStream extends TransformStream<
2511 | 	ArrayBuffer | ArrayBufferView,
2512 | 	string
2513 | > {
2514 | 	constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2515 | 	get encoding(): string;
2516 | 	get fatal(): boolean;
2517 | 	get ignoreBOM(): boolean;
2518 | }
2519 | interface TextDecoderStreamTextDecoderStreamInit {
2520 | 	fatal?: boolean;
2521 | 	ignoreBOM?: boolean;
2522 | }
2523 | /**
2524 |  * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
2525 |  *
2526 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
2527 |  */
2528 | declare class ByteLengthQueuingStrategy
2529 | 	implements QueuingStrategy<ArrayBufferView>
2530 | {
2531 | 	constructor(init: QueuingStrategyInit);
2532 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
2533 | 	get highWaterMark(): number;
2534 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
2535 | 	get size(): (chunk?: any) => number;
2536 | }
2537 | /**
2538 |  * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
2539 |  *
2540 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
2541 |  */
2542 | declare class CountQueuingStrategy implements QueuingStrategy {
2543 | 	constructor(init: QueuingStrategyInit);
2544 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
2545 | 	get highWaterMark(): number;
2546 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
2547 | 	get size(): (chunk?: any) => number;
2548 | }
2549 | interface QueuingStrategyInit {
2550 | 	/**
2551 | 	 * Creates a new ByteLengthQueuingStrategy with the provided high water mark.
2552 | 	 *
2553 | 	 * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.
2554 | 	 */
2555 | 	highWaterMark: number;
2556 | }
2557 | interface ScriptVersion {
2558 | 	id?: string;
2559 | 	tag?: string;
2560 | 	message?: string;
2561 | }
2562 | declare abstract class TailEvent extends ExtendableEvent {
2563 | 	readonly events: TraceItem[];
2564 | 	readonly traces: TraceItem[];
2565 | }
2566 | interface TraceItem {
2567 | 	readonly event:
2568 | 		| (
2569 | 				| TraceItemFetchEventInfo
2570 | 				| TraceItemJsRpcEventInfo
2571 | 				| TraceItemScheduledEventInfo
2572 | 				| TraceItemAlarmEventInfo
2573 | 				| TraceItemQueueEventInfo
2574 | 				| TraceItemEmailEventInfo
2575 | 				| TraceItemTailEventInfo
2576 | 				| TraceItemCustomEventInfo
2577 | 				| TraceItemHibernatableWebSocketEventInfo
2578 | 		  )
2579 | 		| null;
2580 | 	readonly eventTimestamp: number | null;
2581 | 	readonly logs: TraceLog[];
2582 | 	readonly exceptions: TraceException[];
2583 | 	readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
2584 | 	readonly scriptName: string | null;
2585 | 	readonly entrypoint?: string;
2586 | 	readonly scriptVersion?: ScriptVersion;
2587 | 	readonly dispatchNamespace?: string;
2588 | 	readonly scriptTags?: string[];
2589 | 	readonly outcome: string;
2590 | 	readonly executionModel: string;
2591 | 	readonly truncated: boolean;
2592 | 	readonly cpuTime: number;
2593 | 	readonly wallTime: number;
2594 | }
2595 | interface TraceItemAlarmEventInfo {
2596 | 	readonly scheduledTime: Date;
2597 | }
2598 | interface TraceItemCustomEventInfo {}
2599 | interface TraceItemScheduledEventInfo {
2600 | 	readonly scheduledTime: number;
2601 | 	readonly cron: string;
2602 | }
2603 | interface TraceItemQueueEventInfo {
2604 | 	readonly queue: string;
2605 | 	readonly batchSize: number;
2606 | }
2607 | interface TraceItemEmailEventInfo {
2608 | 	readonly mailFrom: string;
2609 | 	readonly rcptTo: string;
2610 | 	readonly rawSize: number;
2611 | }
2612 | interface TraceItemTailEventInfo {
2613 | 	readonly consumedEvents: TraceItemTailEventInfoTailItem[];
2614 | }
2615 | interface TraceItemTailEventInfoTailItem {
2616 | 	readonly scriptName: string | null;
2617 | }
2618 | interface TraceItemFetchEventInfo {
2619 | 	readonly response?: TraceItemFetchEventInfoResponse;
2620 | 	readonly request: TraceItemFetchEventInfoRequest;
2621 | }
2622 | interface TraceItemFetchEventInfoRequest {
2623 | 	readonly cf?: any;
2624 | 	readonly headers: Record<string, string>;
2625 | 	readonly method: string;
2626 | 	readonly url: string;
2627 | 	getUnredacted(): TraceItemFetchEventInfoRequest;
2628 | }
2629 | interface TraceItemFetchEventInfoResponse {
2630 | 	readonly status: number;
2631 | }
2632 | interface TraceItemJsRpcEventInfo {
2633 | 	readonly rpcMethod: string;
2634 | }
2635 | interface TraceItemHibernatableWebSocketEventInfo {
2636 | 	readonly getWebSocketEvent:
2637 | 		| TraceItemHibernatableWebSocketEventInfoMessage
2638 | 		| TraceItemHibernatableWebSocketEventInfoClose
2639 | 		| TraceItemHibernatableWebSocketEventInfoError;
2640 | }
2641 | interface TraceItemHibernatableWebSocketEventInfoMessage {
2642 | 	readonly webSocketEventType: string;
2643 | }
2644 | interface TraceItemHibernatableWebSocketEventInfoClose {
2645 | 	readonly webSocketEventType: string;
2646 | 	readonly code: number;
2647 | 	readonly wasClean: boolean;
2648 | }
2649 | interface TraceItemHibernatableWebSocketEventInfoError {
2650 | 	readonly webSocketEventType: string;
2651 | }
2652 | interface TraceLog {
2653 | 	readonly timestamp: number;
2654 | 	readonly level: string;
2655 | 	readonly message: any;
2656 | }
2657 | interface TraceException {
2658 | 	readonly timestamp: number;
2659 | 	readonly message: string;
2660 | 	readonly name: string;
2661 | 	readonly stack?: string;
2662 | }
2663 | interface TraceDiagnosticChannelEvent {
2664 | 	readonly timestamp: number;
2665 | 	readonly channel: string;
2666 | 	readonly message: any;
2667 | }
2668 | interface TraceMetrics {
2669 | 	readonly cpuTime: number;
2670 | 	readonly wallTime: number;
2671 | }
2672 | interface UnsafeTraceMetrics {
2673 | 	fromTrace(item: TraceItem): TraceMetrics;
2674 | }
2675 | /**
2676 |  * The URL interface represents an object providing static methods used for creating object URLs.
2677 |  *
2678 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
2679 |  */
2680 | declare class URL {
2681 | 	constructor(url: string | URL, base?: string | URL);
2682 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
2683 | 	get origin(): string;
2684 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2685 | 	get href(): string;
2686 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2687 | 	set href(value: string);
2688 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2689 | 	get protocol(): string;
2690 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2691 | 	set protocol(value: string);
2692 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2693 | 	get username(): string;
2694 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2695 | 	set username(value: string);
2696 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2697 | 	get password(): string;
2698 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2699 | 	set password(value: string);
2700 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2701 | 	get host(): string;
2702 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2703 | 	set host(value: string);
2704 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2705 | 	get hostname(): string;
2706 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2707 | 	set hostname(value: string);
2708 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2709 | 	get port(): string;
2710 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2711 | 	set port(value: string);
2712 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2713 | 	get pathname(): string;
2714 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2715 | 	set pathname(value: string);
2716 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2717 | 	get search(): string;
2718 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2719 | 	set search(value: string);
2720 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2721 | 	get hash(): string;
2722 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2723 | 	set hash(value: string);
2724 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
2725 | 	get searchParams(): URLSearchParams;
2726 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
2727 | 	toJSON(): string;
2728 | 	/*function toString() { [native code] }*/
2729 | 	toString(): string;
2730 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
2731 | 	static canParse(url: string, base?: string): boolean;
2732 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
2733 | 	static parse(url: string, base?: string): URL | null;
2734 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
2735 | 	static createObjectURL(object: File | Blob): string;
2736 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
2737 | 	static revokeObjectURL(object_url: string): void;
2738 | }
2739 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
2740 | declare class URLSearchParams {
2741 | 	constructor(
2742 | 		init?: Iterable<Iterable<string>> | Record<string, string> | string,
2743 | 	);
2744 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
2745 | 	get size(): number;
2746 | 	/**
2747 | 	 * Appends a specified key/value pair as a new search parameter.
2748 | 	 *
2749 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
2750 | 	 */
2751 | 	append(name: string, value: string): void;
2752 | 	/**
2753 | 	 * Deletes the given search parameter, and its associated value, from the list of all search parameters.
2754 | 	 *
2755 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
2756 | 	 */
2757 | 	delete(name: string, value?: string): void;
2758 | 	/**
2759 | 	 * Returns the first value associated to the given search parameter.
2760 | 	 *
2761 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
2762 | 	 */
2763 | 	get(name: string): string | null;
2764 | 	/**
2765 | 	 * Returns all the values association with a given search parameter.
2766 | 	 *
2767 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
2768 | 	 */
2769 | 	getAll(name: string): string[];
2770 | 	/**
2771 | 	 * Returns a Boolean indicating if such a search parameter exists.
2772 | 	 *
2773 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
2774 | 	 */
2775 | 	has(name: string, value?: string): boolean;
2776 | 	/**
2777 | 	 * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
2778 | 	 *
2779 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
2780 | 	 */
2781 | 	set(name: string, value: string): void;
2782 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
2783 | 	sort(): void;
2784 | 	/* Returns an array of key, value pairs for every entry in the search params. */
2785 | 	entries(): IterableIterator<[key: string, value: string]>;
2786 | 	/* Returns a list of keys in the search params. */
2787 | 	keys(): IterableIterator<string>;
2788 | 	/* Returns a list of values in the search params. */
2789 | 	values(): IterableIterator<string>;
2790 | 	forEach<This = unknown>(
2791 | 		callback: (
2792 | 			this: This,
2793 | 			value: string,
2794 | 			key: string,
2795 | 			parent: URLSearchParams,
2796 | 		) => void,
2797 | 		thisArg?: This,
2798 | 	): void;
2799 | 	/*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
2800 | 	toString(): string;
2801 | 	[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
2802 | }
2803 | declare class URLPattern {
2804 | 	constructor(
2805 | 		input?: string | URLPatternInit,
2806 | 		baseURL?: string | URLPatternOptions,
2807 | 		patternOptions?: URLPatternOptions,
2808 | 	);
2809 | 	get protocol(): string;
2810 | 	get username(): string;
2811 | 	get password(): string;
2812 | 	get hostname(): string;
2813 | 	get port(): string;
2814 | 	get pathname(): string;
2815 | 	get search(): string;
2816 | 	get hash(): string;
2817 | 	test(input?: string | URLPatternInit, baseURL?: string): boolean;
2818 | 	exec(
2819 | 		input?: string | URLPatternInit,
2820 | 		baseURL?: string,
2821 | 	): URLPatternResult | null;
2822 | }
2823 | interface URLPatternInit {
2824 | 	protocol?: string;
2825 | 	username?: string;
2826 | 	password?: string;
2827 | 	hostname?: string;
2828 | 	port?: string;
2829 | 	pathname?: string;
2830 | 	search?: string;
2831 | 	hash?: string;
2832 | 	baseURL?: string;
2833 | }
2834 | interface URLPatternComponentResult {
2835 | 	input: string;
2836 | 	groups: Record<string, string>;
2837 | }
2838 | interface URLPatternResult {
2839 | 	inputs: (string | URLPatternInit)[];
2840 | 	protocol: URLPatternComponentResult;
2841 | 	username: URLPatternComponentResult;
2842 | 	password: URLPatternComponentResult;
2843 | 	hostname: URLPatternComponentResult;
2844 | 	port: URLPatternComponentResult;
2845 | 	pathname: URLPatternComponentResult;
2846 | 	search: URLPatternComponentResult;
2847 | 	hash: URLPatternComponentResult;
2848 | }
2849 | interface URLPatternOptions {
2850 | 	ignoreCase?: boolean;
2851 | }
2852 | /**
2853 |  * A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.
2854 |  *
2855 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
2856 |  */
2857 | declare class CloseEvent extends Event {
2858 | 	constructor(type: string, initializer?: CloseEventInit);
2859 | 	/**
2860 | 	 * Returns the WebSocket connection close code provided by the server.
2861 | 	 *
2862 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
2863 | 	 */
2864 | 	readonly code: number;
2865 | 	/**
2866 | 	 * Returns the WebSocket connection close reason provided by the server.
2867 | 	 *
2868 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
2869 | 	 */
2870 | 	readonly reason: string;
2871 | 	/**
2872 | 	 * Returns true if the connection closed cleanly; false otherwise.
2873 | 	 *
2874 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
2875 | 	 */
2876 | 	readonly wasClean: boolean;
2877 | }
2878 | interface CloseEventInit {
2879 | 	code?: number;
2880 | 	reason?: string;
2881 | 	wasClean?: boolean;
2882 | }
2883 | type WebSocketEventMap = {
2884 | 	close: CloseEvent;
2885 | 	message: MessageEvent;
2886 | 	open: Event;
2887 | 	error: ErrorEvent;
2888 | };
2889 | /**
2890 |  * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2891 |  *
2892 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2893 |  */
2894 | declare var WebSocket: {
2895 | 	prototype: WebSocket;
2896 | 	new (url: string, protocols?: string[] | string): WebSocket;
2897 | 	readonly READY_STATE_CONNECTING: number;
2898 | 	readonly CONNECTING: number;
2899 | 	readonly READY_STATE_OPEN: number;
2900 | 	readonly OPEN: number;
2901 | 	readonly READY_STATE_CLOSING: number;
2902 | 	readonly CLOSING: number;
2903 | 	readonly READY_STATE_CLOSED: number;
2904 | 	readonly CLOSED: number;
2905 | };
2906 | /**
2907 |  * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2908 |  *
2909 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2910 |  */
2911 | interface WebSocket extends EventTarget<WebSocketEventMap> {
2912 | 	accept(): void;
2913 | 	/**
2914 | 	 * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
2915 | 	 *
2916 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
2917 | 	 */
2918 | 	send(message: (ArrayBuffer | ArrayBufferView) | string): void;
2919 | 	/**
2920 | 	 * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
2921 | 	 *
2922 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
2923 | 	 */
2924 | 	close(code?: number, reason?: string): void;
2925 | 	serializeAttachment(attachment: any): void;
2926 | 	deserializeAttachment(): any | null;
2927 | 	/**
2928 | 	 * Returns the state of the WebSocket object's connection. It can have the values described below.
2929 | 	 *
2930 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2931 | 	 */
2932 | 	readyState: number;
2933 | 	/**
2934 | 	 * Returns the URL that was used to establish the WebSocket connection.
2935 | 	 *
2936 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2937 | 	 */
2938 | 	url: string | null;
2939 | 	/**
2940 | 	 * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
2941 | 	 *
2942 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2943 | 	 */
2944 | 	protocol: string | null;
2945 | 	/**
2946 | 	 * Returns the extensions selected by the server, if any.
2947 | 	 *
2948 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2949 | 	 */
2950 | 	extensions: string | null;
2951 | }
2952 | declare const WebSocketPair: {
2953 | 	new (): {
2954 | 		0: WebSocket;
2955 | 		1: WebSocket;
2956 | 	};
2957 | };
2958 | interface SqlStorage {
2959 | 	exec<T extends Record<string, SqlStorageValue>>(
2960 | 		query: string,
2961 | 		...bindings: any[]
2962 | 	): SqlStorageCursor<T>;
2963 | 	get databaseSize(): number;
2964 | 	Cursor: typeof SqlStorageCursor;
2965 | 	Statement: typeof SqlStorageStatement;
2966 | }
2967 | declare abstract class SqlStorageStatement {}
2968 | type SqlStorageValue = ArrayBuffer | string | number | null;
2969 | declare abstract class SqlStorageCursor<
2970 | 	T extends Record<string, SqlStorageValue>,
2971 | > {
2972 | 	next():
2973 | 		| {
2974 | 				done?: false;
2975 | 				value: T;
2976 | 		  }
2977 | 		| {
2978 | 				done: true;
2979 | 				value?: never;
2980 | 		  };
2981 | 	toArray(): T[];
2982 | 	one(): T;
2983 | 	raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
2984 | 	columnNames: string[];
2985 | 	get rowsRead(): number;
2986 | 	get rowsWritten(): number;
2987 | 	[Symbol.iterator](): IterableIterator<T>;
2988 | }
2989 | interface Socket {
2990 | 	get readable(): ReadableStream;
2991 | 	get writable(): WritableStream;
2992 | 	get closed(): Promise<void>;
2993 | 	get opened(): Promise<SocketInfo>;
2994 | 	get upgraded(): boolean;
2995 | 	get secureTransport(): "on" | "off" | "starttls";
2996 | 	close(): Promise<void>;
2997 | 	startTls(options?: TlsOptions): Socket;
2998 | }
2999 | interface SocketOptions {
3000 | 	secureTransport?: string;
3001 | 	allowHalfOpen: boolean;
3002 | 	highWaterMark?: number | bigint;
3003 | }
3004 | interface SocketAddress {
3005 | 	hostname: string;
3006 | 	port: number;
3007 | }
3008 | interface TlsOptions {
3009 | 	expectedServerHostname?: string;
3010 | }
3011 | interface SocketInfo {
3012 | 	remoteAddress?: string;
3013 | 	localAddress?: string;
3014 | }
3015 | /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
3016 | declare class EventSource extends EventTarget {
3017 | 	constructor(url: string, init?: EventSourceEventSourceInit);
3018 | 	/**
3019 | 	 * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3020 | 	 *
3021 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3022 | 	 */
3023 | 	close(): void;
3024 | 	/**
3025 | 	 * Returns the URL providing the event stream.
3026 | 	 *
3027 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3028 | 	 */
3029 | 	get url(): string;
3030 | 	/**
3031 | 	 * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3032 | 	 *
3033 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3034 | 	 */
3035 | 	get withCredentials(): boolean;
3036 | 	/**
3037 | 	 * Returns the state of this EventSource object's connection. It can have the values described below.
3038 | 	 *
3039 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3040 | 	 */
3041 | 	get readyState(): number;
3042 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3043 | 	get onopen(): any | null;
3044 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3045 | 	set onopen(value: any | null);
3046 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3047 | 	get onmessage(): any | null;
3048 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3049 | 	set onmessage(value: any | null);
3050 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3051 | 	get onerror(): any | null;
3052 | 	/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3053 | 	set onerror(value: any | null);
3054 | 	static readonly CONNECTING: number;
3055 | 	static readonly OPEN: number;
3056 | 	static readonly CLOSED: number;
3057 | 	static from(stream: ReadableStream): EventSource;
3058 | }
3059 | interface EventSourceEventSourceInit {
3060 | 	withCredentials?: boolean;
3061 | 	fetcher?: Fetcher;
3062 | }
3063 | interface Container {
3064 | 	get running(): boolean;
3065 | 	start(options?: ContainerStartupOptions): void;
3066 | 	monitor(): Promise<void>;
3067 | 	destroy(error?: any): Promise<void>;
3068 | 	signal(signo: number): void;
3069 | 	getTcpPort(port: number): Fetcher;
3070 | }
3071 | interface ContainerStartupOptions {
3072 | 	entrypoint?: string[];
3073 | 	enableInternet: boolean;
3074 | 	env?: Record<string, string>;
3075 | }
3076 | /**
3077 |  * This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
3078 |  *
3079 |  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort)
3080 |  */
3081 | interface MessagePort extends EventTarget {
3082 | 	/**
3083 | 	 * Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
3084 | 	 *
3085 | 	 * Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.
3086 | 	 *
3087 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
3088 | 	 */
3089 | 	postMessage(
3090 | 		data?: any,
3091 | 		options?: any[] | MessagePortPostMessageOptions,
3092 | 	): void;
3093 | 	/**
3094 | 	 * Disconnects the port, so that it is no longer active.
3095 | 	 *
3096 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
3097 | 	 */
3098 | 	close(): void;
3099 | 	/**
3100 | 	 * Begins dispatching messages received on the port.
3101 | 	 *
3102 | 	 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
3103 | 	 */
3104 | 	start(): void;
3105 | 	get onmessage(): any | null;
3106 | 	set onmessage(value: any | null);
3107 | }
3108 | interface MessagePortPostMessageOptions {
3109 | 	transfer?: any[];
3110 | }
3111 | type AiImageClassificationInput = {
3112 | 	image: number[];
3113 | };
3114 | type AiImageClassificationOutput = {
3115 | 	score?: number;
3116 | 	label?: string;
3117 | }[];
3118 | declare abstract class BaseAiImageClassification {
3119 | 	inputs: AiImageClassificationInput;
3120 | 	postProcessedOutputs: AiImageClassificationOutput;
3121 | }
3122 | type AiImageToTextInput = {
3123 | 	image: number[];
3124 | 	prompt?: string;
3125 | 	max_tokens?: number;
3126 | 	temperature?: number;
3127 | 	top_p?: number;
3128 | 	top_k?: number;
3129 | 	seed?: number;
3130 | 	repetition_penalty?: number;
3131 | 	frequency_penalty?: number;
3132 | 	presence_penalty?: number;
3133 | 	raw?: boolean;
3134 | 	messages?: RoleScopedChatInput[];
3135 | };
3136 | type AiImageToTextOutput = {
3137 | 	description: string;
3138 | };
3139 | declare abstract class BaseAiImageToText {
3140 | 	inputs: AiImageToTextInput;
3141 | 	postProcessedOutputs: AiImageToTextOutput;
3142 | }
3143 | type AiImageTextToTextInput = {
3144 | 	image: string;
3145 | 	prompt?: string;
3146 | 	max_tokens?: number;
3147 | 	temperature?: number;
3148 | 	ignore_eos?: boolean;
3149 | 	top_p?: number;
3150 | 	top_k?: number;
3151 | 	seed?: number;
3152 | 	repetition_penalty?: number;
3153 | 	frequency_penalty?: number;
3154 | 	presence_penalty?: number;
3155 | 	raw?: boolean;
3156 | 	messages?: RoleScopedChatInput[];
3157 | };
3158 | type AiImageTextToTextOutput = {
3159 | 	description: string;
3160 | };
3161 | declare abstract class BaseAiImageTextToText {
3162 | 	inputs: AiImageTextToTextInput;
3163 | 	postProcessedOutputs: AiImageTextToTextOutput;
3164 | }
3165 | type AiObjectDetectionInput = {
3166 | 	image: number[];
3167 | };
3168 | type AiObjectDetectionOutput = {
3169 | 	score?: number;
3170 | 	label?: string;
3171 | }[];
3172 | declare abstract class BaseAiObjectDetection {
3173 | 	inputs: AiObjectDetectionInput;
3174 | 	postProcessedOutputs: AiObjectDetectionOutput;
3175 | }
3176 | type AiSentenceSimilarityInput = {
3177 | 	source: string;
3178 | 	sentences: string[];
3179 | };
3180 | type AiSentenceSimilarityOutput = number[];
3181 | declare abstract class BaseAiSentenceSimilarity {
3182 | 	inputs: AiSentenceSimilarityInput;
3183 | 	postProcessedOutputs: AiSentenceSimilarityOutput;
3184 | }
3185 | type AiAutomaticSpeechRecognitionInput = {
3186 | 	audio: number[];
3187 | };
3188 | type AiAutomaticSpeechRecognitionOutput = {
3189 | 	text?: string;
3190 | 	words?: {
3191 | 		word: string;
3192 | 		start: number;
3193 | 		end: number;
3194 | 	}[];
3195 | 	vtt?: string;
3196 | };
3197 | declare abstract class BaseAiAutomaticSpeechRecognition {
3198 | 	inputs: AiAutomaticSpeechRecognitionInput;
3199 | 	postProcessedOutputs: AiAutomaticSpeechRecognitionOutput;
3200 | }
3201 | type AiSummarizationInput = {
3202 | 	input_text: string;
3203 | 	max_length?: number;
3204 | };
3205 | type AiSummarizationOutput = {
3206 | 	summary: string;
3207 | };
3208 | declare abstract class BaseAiSummarization {
3209 | 	inputs: AiSummarizationInput;
3210 | 	postProcessedOutputs: AiSummarizationOutput;
3211 | }
3212 | type AiTextClassificationInput = {
3213 | 	text: string;
3214 | };
3215 | type AiTextClassificationOutput = {
3216 | 	score?: number;
3217 | 	label?: string;
3218 | }[];
3219 | declare abstract class BaseAiTextClassification {
3220 | 	inputs: AiTextClassificationInput;
3221 | 	postProcessedOutputs: AiTextClassificationOutput;
3222 | }
3223 | type AiTextEmbeddingsInput = {
3224 | 	text: string | string[];
3225 | };
3226 | type AiTextEmbeddingsOutput = {
3227 | 	shape: number[];
3228 | 	data: number[][];
3229 | };
3230 | declare abstract class BaseAiTextEmbeddings {
3231 | 	inputs: AiTextEmbeddingsInput;
3232 | 	postProcessedOutputs: AiTextEmbeddingsOutput;
3233 | }
3234 | type RoleScopedChatInput = {
3235 | 	role:
3236 | 		| "user"
3237 | 		| "assistant"
3238 | 		| "system"
3239 | 		| "tool"
3240 | 		| (string & NonNullable<unknown>);
3241 | 	content: string;
3242 | 	name?: string;
3243 | };
3244 | type AiTextGenerationToolLegacyInput = {
3245 | 	name: string;
3246 | 	description: string;
3247 | 	parameters?: {
3248 | 		type: "object" | (string & NonNullable<unknown>);
3249 | 		properties: {
3250 | 			[key: string]: {
3251 | 				type: string;
3252 | 				description?: string;
3253 | 			};
3254 | 		};
3255 | 		required: string[];
3256 | 	};
3257 | };
3258 | type AiTextGenerationToolInput = {
3259 | 	type: "function" | (string & NonNullable<unknown>);
3260 | 	function: {
3261 | 		name: string;
3262 | 		description: string;
3263 | 		parameters?: {
3264 | 			type: "object" | (string & NonNullable<unknown>);
3265 | 			properties: {
3266 | 				[key: string]: {
3267 | 					type: string;
3268 | 					description?: string;
3269 | 				};
3270 | 			};
3271 | 			required: string[];
3272 | 		};
3273 | 	};
3274 | };
3275 | type AiTextGenerationFunctionsInput = {
3276 | 	name: string;
3277 | 	code: string;
3278 | };
3279 | type AiTextGenerationResponseFormat = {
3280 | 	type: string;
3281 | 	json_schema?: any;
3282 | };
3283 | type AiTextGenerationInput = {
3284 | 	prompt?: string;
3285 | 	raw?: boolean;
3286 | 	stream?: boolean;
3287 | 	max_tokens?: number;
3288 | 	temperature?: number;
3289 | 	top_p?: number;
3290 | 	top_k?: number;
3291 | 	seed?: number;
3292 | 	repetition_penalty?: number;
3293 | 	frequency_penalty?: number;
3294 | 	presence_penalty?: number;
3295 | 	messages?: RoleScopedChatInput[];
3296 | 	response_format?: AiTextGenerationResponseFormat;
3297 | 	tools?:
3298 | 		| AiTextGenerationToolInput[]
3299 | 		| AiTextGenerationToolLegacyInput[]
3300 | 		| (object & NonNullable<unknown>);
3301 | 	functions?: AiTextGenerationFunctionsInput[];
3302 | };
3303 | type AiTextGenerationOutput = {
3304 | 	response?: string;
3305 | 	tool_calls?: {
3306 | 		name: string;
3307 | 		arguments: unknown;
3308 | 	}[];
3309 | };
3310 | declare abstract class BaseAiTextGeneration {
3311 | 	inputs: AiTextGenerationInput;
3312 | 	postProcessedOutputs: AiTextGenerationOutput;
3313 | }
3314 | type AiTextToSpeechInput = {
3315 | 	prompt: string;
3316 | 	lang?: string;
3317 | };
3318 | type AiTextToSpeechOutput =
3319 | 	| Uint8Array
3320 | 	| {
3321 | 			audio: string;
3322 | 	  };
3323 | declare abstract class BaseAiTextToSpeech {
3324 | 	inputs: AiTextToSpeechInput;
3325 | 	postProcessedOutputs: AiTextToSpeechOutput;
3326 | }
3327 | type AiTextToImageInput = {
3328 | 	prompt: string;
3329 | 	negative_prompt?: string;
3330 | 	height?: number;
3331 | 	width?: number;
3332 | 	image?: number[];
3333 | 	image_b64?: string;
3334 | 	mask?: number[];
3335 | 	num_steps?: number;
3336 | 	strength?: number;
3337 | 	guidance?: number;
3338 | 	seed?: number;
3339 | };
3340 | type AiTextToImageOutput = ReadableStream<Uint8Array>;
3341 | declare abstract class BaseAiTextToImage {
3342 | 	inputs: AiTextToImageInput;
3343 | 	postProcessedOutputs: AiTextToImageOutput;
3344 | }
3345 | type AiTranslationInput = {
3346 | 	text: string;
3347 | 	target_lang: string;
3348 | 	source_lang?: string;
3349 | };
3350 | type AiTranslationOutput = {
3351 | 	translated_text?: string;
3352 | };
3353 | declare abstract class BaseAiTranslation {
3354 | 	inputs: AiTranslationInput;
3355 | 	postProcessedOutputs: AiTranslationOutput;
3356 | }
3357 | type Ai_Cf_Baai_Bge_Base_En_V1_5_Input =
3358 | 	| {
3359 | 			text: string | string[];
3360 | 			/**
3361 | 			 * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
3362 | 			 */
3363 | 			pooling?: "mean" | "cls";
3364 | 	  }
3365 | 	| {
3366 | 			/**
3367 | 			 * Batch of the embeddings requests to run using async-queue
3368 | 			 */
3369 | 			requests: {
3370 | 				text: string | string[];
3371 | 				/**
3372 | 				 * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
3373 | 				 */
3374 | 				pooling?: "mean" | "cls";
3375 | 			}[];
3376 | 	  };
3377 | type Ai_Cf_Baai_Bge_Base_En_V1_5_Output =
3378 | 	| {
3379 | 			shape?: number[];
3380 | 			/**
3381 | 			 * Embeddings of the requested text values
3382 | 			 */
3383 | 			data?: number[][];
3384 | 			/**
3385 | 			 * The pooling method used in the embedding process.
3386 | 			 */
3387 | 			pooling?: "mean" | "cls";
3388 | 	  }
3389 | 	| AsyncResponse;
3390 | interface AsyncResponse {
3391 | 	/**
3392 | 	 * The async request id that can be used to obtain the results.
3393 | 	 */
3394 | 	request_id?: string;
3395 | }
3396 | declare abstract class Base_Ai_Cf_Baai_Bge_Base_En_V1_5 {
3397 | 	inputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Input;
3398 | 	postProcessedOutputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Output;
3399 | }
3400 | type Ai_Cf_Openai_Whisper_Input =
3401 | 	| string
3402 | 	| {
3403 | 			/**
3404 | 			 * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
3405 | 			 */
3406 | 			audio: number[];
3407 | 	  };
3408 | interface Ai_Cf_Openai_Whisper_Output {
3409 | 	/**
3410 | 	 * The transcription
3411 | 	 */
3412 | 	text: string;
3413 | 	word_count?: number;
3414 | 	words?: {
3415 | 		word?: string;
3416 | 		/**
3417 | 		 * The second this word begins in the recording
3418 | 		 */
3419 | 		start?: number;
3420 | 		/**
3421 | 		 * The ending second when the word completes
3422 | 		 */
3423 | 		end?: number;
3424 | 	}[];
3425 | 	vtt?: string;
3426 | }
3427 | declare abstract class Base_Ai_Cf_Openai_Whisper {
3428 | 	inputs: Ai_Cf_Openai_Whisper_Input;
3429 | 	postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
3430 | }
3431 | type Ai_Cf_Meta_M2M100_1_2B_Input =
3432 | 	| {
3433 | 			/**
3434 | 			 * The text to be translated
3435 | 			 */
3436 | 			text: string;
3437 | 			/**
3438 | 			 * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
3439 | 			 */
3440 | 			source_lang?: string;
3441 | 			/**
3442 | 			 * The language code to translate the text into (e.g., 'es' for Spanish)
3443 | 			 */
3444 | 			target_lang: string;
3445 | 	  }
3446 | 	| {
3447 | 			/**
3448 | 			 * Batch of the embeddings requests to run using async-queue
3449 | 			 */
3450 | 			requests: {
3451 | 				/**
3452 | 				 * The text to be translated
3453 | 				 */
3454 | 				text: string;
3455 | 				/**
3456 | 				 * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
3457 | 				 */
3458 | 				source_lang?: string;
3459 | 				/**
3460 | 				 * The language code to translate the text into (e.g., 'es' for Spanish)
3461 | 				 */
3462 | 				target_lang: string;
3463 | 			}[];
3464 | 	  };
3465 | type Ai_Cf_Meta_M2M100_1_2B_Output =
3466 | 	| {
3467 | 			/**
3468 | 			 * The translated text in the target language
3469 | 			 */
3470 | 			translated_text?: string;
3471 | 	  }
3472 | 	| AsyncResponse;
3473 | declare abstract class Base_Ai_Cf_Meta_M2M100_1_2B {
3474 | 	inputs: Ai_Cf_Meta_M2M100_1_2B_Input;
3475 | 	postProcessedOutputs: Ai_Cf_Meta_M2M100_1_2B_Output;
3476 | }
3477 | type Ai_Cf_Baai_Bge_Small_En_V1_5_Input =
3478 | 	| {
3479 | 			text: string | string[];
3480 | 			/**
3481 | 			 * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
3482 | 			 */
3483 | 			pooling?: "mean" | "cls";
3484 | 	  }
3485 | 	| {
3486 | 			/**
3487 | 			 * Batch of the embeddings requests to run using async-queue
3488 | 			 */
3489 | 			requests: {
3490 | 				text: string | string[];
3491 | 				/**
3492 | 				 * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
3493 | 				 */
3494 | 				pooling?: "mean" | "cls";
3495 | 			}[];
3496 | 	  };
3497 | type Ai_Cf_Baai_Bge_Small_En_V1_5_Output =
3498 | 	| {
3499 | 			shape?: number[];
3500 | 			/**
3501 | 			 * Embeddings of the requested text values
3502 | 			 */
3503 | 			data?: number[][];
3504 | 			/**
3505 | 			 * The pooling method used in the embedding process.
3506 | 			 */
3507 | 			pooling?: "mean" | "cls";
3508 | 	  }
3509 | 	| AsyncResponse;
3510 | declare abstract class Base_Ai_Cf_Baai_Bge_Small_En_V1_5 {
3511 | 	inputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Input;
3512 | 	postProcessedOutputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Output;
3513 | }
3514 | type Ai_Cf_Baai_Bge_Large_En_V1_5_Input =
3515 | 	| {
3516 | 			text: string | string[];
3517 | 			/**
3518 | 			 * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
3519 | 			 */
3520 | 			pooling?: "mean" | "cls";
3521 | 	  }
3522 | 	| {
3523 | 			/**
3524 | 			 * Batch of the embeddings requests to run using async-queue
3525 | 			 */
3526 | 			requests: {
3527 | 				text: string | string[];
3528 | 				/**
3529 | 				 * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
3530 | 				 */
3531 | 				pooling?: "mean" | "cls";
3532 | 			}[];
3533 | 	  };
3534 | type Ai_Cf_Baai_Bge_Large_En_V1_5_Output =
3535 | 	| {
3536 | 			shape?: number[];
3537 | 			/**
3538 | 			 * Embeddings of the requested text values
3539 | 			 */
3540 | 			data?: number[][];
3541 | 			/**
3542 | 			 * The pooling method used in the embedding process.
3543 | 			 */
3544 | 			pooling?: "mean" | "cls";
3545 | 	  }
3546 | 	| AsyncResponse;
3547 | declare abstract class Base_Ai_Cf_Baai_Bge_Large_En_V1_5 {
3548 | 	inputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Input;
3549 | 	postProcessedOutputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Output;
3550 | }
3551 | type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input =
3552 | 	| string
3553 | 	| {
3554 | 			/**
3555 | 			 * The input text prompt for the model to generate a response.
3556 | 			 */
3557 | 			prompt?: string;
3558 | 			/**
3559 | 			 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3560 | 			 */
3561 | 			raw?: boolean;
3562 | 			/**
3563 | 			 * Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3564 | 			 */
3565 | 			top_p?: number;
3566 | 			/**
3567 | 			 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3568 | 			 */
3569 | 			top_k?: number;
3570 | 			/**
3571 | 			 * Random seed for reproducibility of the generation.
3572 | 			 */
3573 | 			seed?: number;
3574 | 			/**
3575 | 			 * Penalty for repeated tokens; higher values discourage repetition.
3576 | 			 */
3577 | 			repetition_penalty?: number;
3578 | 			/**
3579 | 			 * Decreases the likelihood of the model repeating the same lines verbatim.
3580 | 			 */
3581 | 			frequency_penalty?: number;
3582 | 			/**
3583 | 			 * Increases the likelihood of the model introducing new topics.
3584 | 			 */
3585 | 			presence_penalty?: number;
3586 | 			image: number[] | (string & NonNullable<unknown>);
3587 | 			/**
3588 | 			 * The maximum number of tokens to generate in the response.
3589 | 			 */
3590 | 			max_tokens?: number;
3591 | 	  };
3592 | interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {
3593 | 	description?: string;
3594 | }
3595 | declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {
3596 | 	inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input;
3597 | 	postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output;
3598 | }
3599 | type Ai_Cf_Openai_Whisper_Tiny_En_Input =
3600 | 	| string
3601 | 	| {
3602 | 			/**
3603 | 			 * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
3604 | 			 */
3605 | 			audio: number[];
3606 | 	  };
3607 | interface Ai_Cf_Openai_Whisper_Tiny_En_Output {
3608 | 	/**
3609 | 	 * The transcription
3610 | 	 */
3611 | 	text: string;
3612 | 	word_count?: number;
3613 | 	words?: {
3614 | 		word?: string;
3615 | 		/**
3616 | 		 * The second this word begins in the recording
3617 | 		 */
3618 | 		start?: number;
3619 | 		/**
3620 | 		 * The ending second when the word completes
3621 | 		 */
3622 | 		end?: number;
3623 | 	}[];
3624 | 	vtt?: string;
3625 | }
3626 | declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
3627 | 	inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input;
3628 | 	postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;
3629 | }
3630 | interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
3631 | 	/**
3632 | 	 * Base64 encoded value of the audio data.
3633 | 	 */
3634 | 	audio: string;
3635 | 	/**
3636 | 	 * Supported tasks are 'translate' or 'transcribe'.
3637 | 	 */
3638 | 	task?: string;
3639 | 	/**
3640 | 	 * The language of the audio being transcribed or translated.
3641 | 	 */
3642 | 	language?: string;
3643 | 	/**
3644 | 	 * Preprocess the audio with a voice activity detection model.
3645 | 	 */
3646 | 	vad_filter?: boolean;
3647 | 	/**
3648 | 	 * A text prompt to help provide context to the model on the contents of the audio.
3649 | 	 */
3650 | 	initial_prompt?: string;
3651 | 	/**
3652 | 	 * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
3653 | 	 */
3654 | 	prefix?: string;
3655 | }
3656 | interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
3657 | 	transcription_info?: {
3658 | 		/**
3659 | 		 * The language of the audio being transcribed or translated.
3660 | 		 */
3661 | 		language?: string;
3662 | 		/**
3663 | 		 * The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1.
3664 | 		 */
3665 | 		language_probability?: number;
3666 | 		/**
3667 | 		 * The total duration of the original audio file, in seconds.
3668 | 		 */
3669 | 		duration?: number;
3670 | 		/**
3671 | 		 * The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds.
3672 | 		 */
3673 | 		duration_after_vad?: number;
3674 | 	};
3675 | 	/**
3676 | 	 * The complete transcription of the audio.
3677 | 	 */
3678 | 	text: string;
3679 | 	/**
3680 | 	 * The total number of words in the transcription.
3681 | 	 */
3682 | 	word_count?: number;
3683 | 	segments?: {
3684 | 		/**
3685 | 		 * The starting time of the segment within the audio, in seconds.
3686 | 		 */
3687 | 		start?: number;
3688 | 		/**
3689 | 		 * The ending time of the segment within the audio, in seconds.
3690 | 		 */
3691 | 		end?: number;
3692 | 		/**
3693 | 		 * The transcription of the segment.
3694 | 		 */
3695 | 		text?: string;
3696 | 		/**
3697 | 		 * The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs.
3698 | 		 */
3699 | 		temperature?: number;
3700 | 		/**
3701 | 		 * The average log probability of the predictions for the words in this segment, indicating overall confidence.
3702 | 		 */
3703 | 		avg_logprob?: number;
3704 | 		/**
3705 | 		 * The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process.
3706 | 		 */
3707 | 		compression_ratio?: number;
3708 | 		/**
3709 | 		 * The probability that the segment contains no speech, represented as a decimal between 0 and 1.
3710 | 		 */
3711 | 		no_speech_prob?: number;
3712 | 		words?: {
3713 | 			/**
3714 | 			 * The individual word transcribed from the audio.
3715 | 			 */
3716 | 			word?: string;
3717 | 			/**
3718 | 			 * The starting time of the word within the audio, in seconds.
3719 | 			 */
3720 | 			start?: number;
3721 | 			/**
3722 | 			 * The ending time of the word within the audio, in seconds.
3723 | 			 */
3724 | 			end?: number;
3725 | 		}[];
3726 | 	}[];
3727 | 	/**
3728 | 	 * The transcription in WebVTT format, which includes timing and text information for use in subtitles.
3729 | 	 */
3730 | 	vtt?: string;
3731 | }
3732 | declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
3733 | 	inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
3734 | 	postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
3735 | }
3736 | type Ai_Cf_Baai_Bge_M3_Input =
3737 | 	| BGEM3InputQueryAndContexts
3738 | 	| BGEM3InputEmbedding
3739 | 	| {
3740 | 			/**
3741 | 			 * Batch of the embeddings requests to run using async-queue
3742 | 			 */
3743 | 			requests: (BGEM3InputQueryAndContexts1 | BGEM3InputEmbedding1)[];
3744 | 	  };
3745 | interface BGEM3InputQueryAndContexts {
3746 | 	/**
3747 | 	 * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3748 | 	 */
3749 | 	query?: string;
3750 | 	/**
3751 | 	 * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3752 | 	 */
3753 | 	contexts: {
3754 | 		/**
3755 | 		 * One of the provided context content
3756 | 		 */
3757 | 		text?: string;
3758 | 	}[];
3759 | 	/**
3760 | 	 * When provided with too long context should the model error out or truncate the context to fit?
3761 | 	 */
3762 | 	truncate_inputs?: boolean;
3763 | }
3764 | interface BGEM3InputEmbedding {
3765 | 	text: string | string[];
3766 | 	/**
3767 | 	 * When provided with too long context should the model error out or truncate the context to fit?
3768 | 	 */
3769 | 	truncate_inputs?: boolean;
3770 | }
3771 | interface BGEM3InputQueryAndContexts1 {
3772 | 	/**
3773 | 	 * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3774 | 	 */
3775 | 	query?: string;
3776 | 	/**
3777 | 	 * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3778 | 	 */
3779 | 	contexts: {
3780 | 		/**
3781 | 		 * One of the provided context content
3782 | 		 */
3783 | 		text?: string;
3784 | 	}[];
3785 | 	/**
3786 | 	 * When provided with too long context should the model error out or truncate the context to fit?
3787 | 	 */
3788 | 	truncate_inputs?: boolean;
3789 | }
3790 | interface BGEM3InputEmbedding1 {
3791 | 	text: string | string[];
3792 | 	/**
3793 | 	 * When provided with too long context should the model error out or truncate the context to fit?
3794 | 	 */
3795 | 	truncate_inputs?: boolean;
3796 | }
3797 | type Ai_Cf_Baai_Bge_M3_Output =
3798 | 	| BGEM3OuputQuery
3799 | 	| BGEM3OutputEmbeddingForContexts
3800 | 	| BGEM3OuputEmbedding
3801 | 	| AsyncResponse;
3802 | interface BGEM3OuputQuery {
3803 | 	response?: {
3804 | 		/**
3805 | 		 * Index of the context in the request
3806 | 		 */
3807 | 		id?: number;
3808 | 		/**
3809 | 		 * Score of the context under the index.
3810 | 		 */
3811 | 		score?: number;
3812 | 	}[];
3813 | }
3814 | interface BGEM3OutputEmbeddingForContexts {
3815 | 	response?: number[][];
3816 | 	shape?: number[];
3817 | 	/**
3818 | 	 * The pooling method used in the embedding process.
3819 | 	 */
3820 | 	pooling?: "mean" | "cls";
3821 | }
3822 | interface BGEM3OuputEmbedding {
3823 | 	shape?: number[];
3824 | 	/**
3825 | 	 * Embeddings of the requested text values
3826 | 	 */
3827 | 	data?: number[][];
3828 | 	/**
3829 | 	 * The pooling method used in the embedding process.
3830 | 	 */
3831 | 	pooling?: "mean" | "cls";
3832 | }
3833 | declare abstract class Base_Ai_Cf_Baai_Bge_M3 {
3834 | 	inputs: Ai_Cf_Baai_Bge_M3_Input;
3835 | 	postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output;
3836 | }
3837 | interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
3838 | 	/**
3839 | 	 * A text description of the image you want to generate.
3840 | 	 */
3841 | 	prompt: string;
3842 | 	/**
3843 | 	 * The number of diffusion steps; higher values can improve quality but take longer.
3844 | 	 */
3845 | 	steps?: number;
3846 | }
3847 | interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output {
3848 | 	/**
3849 | 	 * The generated image in Base64 format.
3850 | 	 */
3851 | 	image?: string;
3852 | }
3853 | declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell {
3854 | 	inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input;
3855 | 	postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output;
3856 | }
3857 | type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Prompt | Messages;
3858 | interface Prompt {
3859 | 	/**
3860 | 	 * The input text prompt for the model to generate a response.
3861 | 	 */
3862 | 	prompt: string;
3863 | 	image?: number[] | (string & NonNullable<unknown>);
3864 | 	/**
3865 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3866 | 	 */
3867 | 	raw?: boolean;
3868 | 	/**
3869 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3870 | 	 */
3871 | 	stream?: boolean;
3872 | 	/**
3873 | 	 * The maximum number of tokens to generate in the response.
3874 | 	 */
3875 | 	max_tokens?: number;
3876 | 	/**
3877 | 	 * Controls the randomness of the output; higher values produce more random results.
3878 | 	 */
3879 | 	temperature?: number;
3880 | 	/**
3881 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3882 | 	 */
3883 | 	top_p?: number;
3884 | 	/**
3885 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3886 | 	 */
3887 | 	top_k?: number;
3888 | 	/**
3889 | 	 * Random seed for reproducibility of the generation.
3890 | 	 */
3891 | 	seed?: number;
3892 | 	/**
3893 | 	 * Penalty for repeated tokens; higher values discourage repetition.
3894 | 	 */
3895 | 	repetition_penalty?: number;
3896 | 	/**
3897 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
3898 | 	 */
3899 | 	frequency_penalty?: number;
3900 | 	/**
3901 | 	 * Increases the likelihood of the model introducing new topics.
3902 | 	 */
3903 | 	presence_penalty?: number;
3904 | 	/**
3905 | 	 * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3906 | 	 */
3907 | 	lora?: string;
3908 | }
3909 | interface Messages {
3910 | 	/**
3911 | 	 * An array of message objects representing the conversation history.
3912 | 	 */
3913 | 	messages: {
3914 | 		/**
3915 | 		 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3916 | 		 */
3917 | 		role?: string;
3918 | 		/**
3919 | 		 * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
3920 | 		 */
3921 | 		tool_call_id?: string;
3922 | 		content?:
3923 | 			| string
3924 | 			| {
3925 | 					/**
3926 | 					 * Type of the content provided
3927 | 					 */
3928 | 					type?: string;
3929 | 					text?: string;
3930 | 					image_url?: {
3931 | 						/**
3932 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3933 | 						 */
3934 | 						url?: string;
3935 | 					};
3936 | 			  }[]
3937 | 			| {
3938 | 					/**
3939 | 					 * Type of the content provided
3940 | 					 */
3941 | 					type?: string;
3942 | 					text?: string;
3943 | 					image_url?: {
3944 | 						/**
3945 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3946 | 						 */
3947 | 						url?: string;
3948 | 					};
3949 | 			  };
3950 | 	}[];
3951 | 	image?: number[] | (string & NonNullable<unknown>);
3952 | 	functions?: {
3953 | 		name: string;
3954 | 		code: string;
3955 | 	}[];
3956 | 	/**
3957 | 	 * A list of tools available for the assistant to use.
3958 | 	 */
3959 | 	tools?: (
3960 | 		| {
3961 | 				/**
3962 | 				 * The name of the tool. More descriptive the better.
3963 | 				 */
3964 | 				name: string;
3965 | 				/**
3966 | 				 * A brief description of what the tool does.
3967 | 				 */
3968 | 				description: string;
3969 | 				/**
3970 | 				 * Schema defining the parameters accepted by the tool.
3971 | 				 */
3972 | 				parameters: {
3973 | 					/**
3974 | 					 * The type of the parameters object (usually 'object').
3975 | 					 */
3976 | 					type: string;
3977 | 					/**
3978 | 					 * List of required parameter names.
3979 | 					 */
3980 | 					required?: string[];
3981 | 					/**
3982 | 					 * Definitions of each parameter.
3983 | 					 */
3984 | 					properties: {
3985 | 						[k: string]: {
3986 | 							/**
3987 | 							 * The data type of the parameter.
3988 | 							 */
3989 | 							type: string;
3990 | 							/**
3991 | 							 * A description of the expected parameter.
3992 | 							 */
3993 | 							description: string;
3994 | 						};
3995 | 					};
3996 | 				};
3997 | 		  }
3998 | 		| {
3999 | 				/**
4000 | 				 * Specifies the type of tool (e.g., 'function').
4001 | 				 */
4002 | 				type: string;
4003 | 				/**
4004 | 				 * Details of the function tool.
4005 | 				 */
4006 | 				function: {
4007 | 					/**
4008 | 					 * The name of the function.
4009 | 					 */
4010 | 					name: string;
4011 | 					/**
4012 | 					 * A brief description of what the function does.
4013 | 					 */
4014 | 					description: string;
4015 | 					/**
4016 | 					 * Schema defining the parameters accepted by the function.
4017 | 					 */
4018 | 					parameters: {
4019 | 						/**
4020 | 						 * The type of the parameters object (usually 'object').
4021 | 						 */
4022 | 						type: string;
4023 | 						/**
4024 | 						 * List of required parameter names.
4025 | 						 */
4026 | 						required?: string[];
4027 | 						/**
4028 | 						 * Definitions of each parameter.
4029 | 						 */
4030 | 						properties: {
4031 | 							[k: string]: {
4032 | 								/**
4033 | 								 * The data type of the parameter.
4034 | 								 */
4035 | 								type: string;
4036 | 								/**
4037 | 								 * A description of the expected parameter.
4038 | 								 */
4039 | 								description: string;
4040 | 							};
4041 | 						};
4042 | 					};
4043 | 				};
4044 | 		  }
4045 | 	)[];
4046 | 	/**
4047 | 	 * If true, the response will be streamed back incrementally.
4048 | 	 */
4049 | 	stream?: boolean;
4050 | 	/**
4051 | 	 * The maximum number of tokens to generate in the response.
4052 | 	 */
4053 | 	max_tokens?: number;
4054 | 	/**
4055 | 	 * Controls the randomness of the output; higher values produce more random results.
4056 | 	 */
4057 | 	temperature?: number;
4058 | 	/**
4059 | 	 * Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4060 | 	 */
4061 | 	top_p?: number;
4062 | 	/**
4063 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4064 | 	 */
4065 | 	top_k?: number;
4066 | 	/**
4067 | 	 * Random seed for reproducibility of the generation.
4068 | 	 */
4069 | 	seed?: number;
4070 | 	/**
4071 | 	 * Penalty for repeated tokens; higher values discourage repetition.
4072 | 	 */
4073 | 	repetition_penalty?: number;
4074 | 	/**
4075 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
4076 | 	 */
4077 | 	frequency_penalty?: number;
4078 | 	/**
4079 | 	 * Increases the likelihood of the model introducing new topics.
4080 | 	 */
4081 | 	presence_penalty?: number;
4082 | }
4083 | type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output = {
4084 | 	/**
4085 | 	 * The generated text response from the model
4086 | 	 */
4087 | 	response?: string;
4088 | 	/**
4089 | 	 * An array of tool calls requests made during the response generation
4090 | 	 */
4091 | 	tool_calls?: {
4092 | 		/**
4093 | 		 * The arguments passed to be passed to the tool call request
4094 | 		 */
4095 | 		arguments?: object;
4096 | 		/**
4097 | 		 * The name of the tool to be called
4098 | 		 */
4099 | 		name?: string;
4100 | 	}[];
4101 | };
4102 | declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct {
4103 | 	inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input;
4104 | 	postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output;
4105 | }
4106 | type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input =
4107 | 	| Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt
4108 | 	| Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages
4109 | 	| AsyncBatch;
4110 | interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt {
4111 | 	/**
4112 | 	 * The input text prompt for the model to generate a response.
4113 | 	 */
4114 | 	prompt: string;
4115 | 	/**
4116 | 	 * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
4117 | 	 */
4118 | 	lora?: string;
4119 | 	response_format?: JSONMode;
4120 | 	/**
4121 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4122 | 	 */
4123 | 	raw?: boolean;
4124 | 	/**
4125 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4126 | 	 */
4127 | 	stream?: boolean;
4128 | 	/**
4129 | 	 * The maximum number of tokens to generate in the response.
4130 | 	 */
4131 | 	max_tokens?: number;
4132 | 	/**
4133 | 	 * Controls the randomness of the output; higher values produce more random results.
4134 | 	 */
4135 | 	temperature?: number;
4136 | 	/**
4137 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4138 | 	 */
4139 | 	top_p?: number;
4140 | 	/**
4141 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4142 | 	 */
4143 | 	top_k?: number;
4144 | 	/**
4145 | 	 * Random seed for reproducibility of the generation.
4146 | 	 */
4147 | 	seed?: number;
4148 | 	/**
4149 | 	 * Penalty for repeated tokens; higher values discourage repetition.
4150 | 	 */
4151 | 	repetition_penalty?: number;
4152 | 	/**
4153 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
4154 | 	 */
4155 | 	frequency_penalty?: number;
4156 | 	/**
4157 | 	 * Increases the likelihood of the model introducing new topics.
4158 | 	 */
4159 | 	presence_penalty?: number;
4160 | }
4161 | interface JSONMode {
4162 | 	type?: "json_object" | "json_schema";
4163 | 	json_schema?: unknown;
4164 | }
4165 | interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {
4166 | 	/**
4167 | 	 * An array of message objects representing the conversation history.
4168 | 	 */
4169 | 	messages: {
4170 | 		/**
4171 | 		 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4172 | 		 */
4173 | 		role: string;
4174 | 		/**
4175 | 		 * The content of the message as a string.
4176 | 		 */
4177 | 		content: string;
4178 | 	}[];
4179 | 	functions?: {
4180 | 		name: string;
4181 | 		code: string;
4182 | 	}[];
4183 | 	/**
4184 | 	 * A list of tools available for the assistant to use.
4185 | 	 */
4186 | 	tools?: (
4187 | 		| {
4188 | 				/**
4189 | 				 * The name of the tool. More descriptive the better.
4190 | 				 */
4191 | 				name: string;
4192 | 				/**
4193 | 				 * A brief description of what the tool does.
4194 | 				 */
4195 | 				description: string;
4196 | 				/**
4197 | 				 * Schema defining the parameters accepted by the tool.
4198 | 				 */
4199 | 				parameters: {
4200 | 					/**
4201 | 					 * The type of the parameters object (usually 'object').
4202 | 					 */
4203 | 					type: string;
4204 | 					/**
4205 | 					 * List of required parameter names.
4206 | 					 */
4207 | 					required?: string[];
4208 | 					/**
4209 | 					 * Definitions of each parameter.
4210 | 					 */
4211 | 					properties: {
4212 | 						[k: string]: {
4213 | 							/**
4214 | 							 * The data type of the parameter.
4215 | 							 */
4216 | 							type: string;
4217 | 							/**
4218 | 							 * A description of the expected parameter.
4219 | 							 */
4220 | 							description: string;
4221 | 						};
4222 | 					};
4223 | 				};
4224 | 		  }
4225 | 		| {
4226 | 				/**
4227 | 				 * Specifies the type of tool (e.g., 'function').
4228 | 				 */
4229 | 				type: string;
4230 | 				/**
4231 | 				 * Details of the function tool.
4232 | 				 */
4233 | 				function: {
4234 | 					/**
4235 | 					 * The name of the function.
4236 | 					 */
4237 | 					name: string;
4238 | 					/**
4239 | 					 * A brief description of what the function does.
4240 | 					 */
4241 | 					description: string;
4242 | 					/**
4243 | 					 * Schema defining the parameters accepted by the function.
4244 | 					 */
4245 | 					parameters: {
4246 | 						/**
4247 | 						 * The type of the parameters object (usually 'object').
4248 | 						 */
4249 | 						type: string;
4250 | 						/**
4251 | 						 * List of required parameter names.
4252 | 						 */
4253 | 						required?: string[];
4254 | 						/**
4255 | 						 * Definitions of each parameter.
4256 | 						 */
4257 | 						properties: {
4258 | 							[k: string]: {
4259 | 								/**
4260 | 								 * The data type of the parameter.
4261 | 								 */
4262 | 								type: string;
4263 | 								/**
4264 | 								 * A description of the expected parameter.
4265 | 								 */
4266 | 								description: string;
4267 | 							};
4268 | 						};
4269 | 					};
4270 | 				};
4271 | 		  }
4272 | 	)[];
4273 | 	response_format?: JSONMode;
4274 | 	/**
4275 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4276 | 	 */
4277 | 	raw?: boolean;
4278 | 	/**
4279 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4280 | 	 */
4281 | 	stream?: boolean;
4282 | 	/**
4283 | 	 * The maximum number of tokens to generate in the response.
4284 | 	 */
4285 | 	max_tokens?: number;
4286 | 	/**
4287 | 	 * Controls the randomness of the output; higher values produce more random results.
4288 | 	 */
4289 | 	temperature?: number;
4290 | 	/**
4291 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4292 | 	 */
4293 | 	top_p?: number;
4294 | 	/**
4295 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4296 | 	 */
4297 | 	top_k?: number;
4298 | 	/**
4299 | 	 * Random seed for reproducibility of the generation.
4300 | 	 */
4301 | 	seed?: number;
4302 | 	/**
4303 | 	 * Penalty for repeated tokens; higher values discourage repetition.
4304 | 	 */
4305 | 	repetition_penalty?: number;
4306 | 	/**
4307 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
4308 | 	 */
4309 | 	frequency_penalty?: number;
4310 | 	/**
4311 | 	 * Increases the likelihood of the model introducing new topics.
4312 | 	 */
4313 | 	presence_penalty?: number;
4314 | }
4315 | interface AsyncBatch {
4316 | 	requests?: {
4317 | 		/**
4318 | 		 * User-supplied reference. This field will be present in the response as well it can be used to reference the request and response. It's NOT validated to be unique.
4319 | 		 */
4320 | 		external_reference?: string;
4321 | 		/**
4322 | 		 * Prompt for the text generation model
4323 | 		 */
4324 | 		prompt?: string;
4325 | 		/**
4326 | 		 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4327 | 		 */
4328 | 		stream?: boolean;
4329 | 		/**
4330 | 		 * The maximum number of tokens to generate in the response.
4331 | 		 */
4332 | 		max_tokens?: number;
4333 | 		/**
4334 | 		 * Controls the randomness of the output; higher values produce more random results.
4335 | 		 */
4336 | 		temperature?: number;
4337 | 		/**
4338 | 		 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4339 | 		 */
4340 | 		top_p?: number;
4341 | 		/**
4342 | 		 * Random seed for reproducibility of the generation.
4343 | 		 */
4344 | 		seed?: number;
4345 | 		/**
4346 | 		 * Penalty for repeated tokens; higher values discourage repetition.
4347 | 		 */
4348 | 		repetition_penalty?: number;
4349 | 		/**
4350 | 		 * Decreases the likelihood of the model repeating the same lines verbatim.
4351 | 		 */
4352 | 		frequency_penalty?: number;
4353 | 		/**
4354 | 		 * Increases the likelihood of the model introducing new topics.
4355 | 		 */
4356 | 		presence_penalty?: number;
4357 | 		response_format?: JSONMode;
4358 | 	}[];
4359 | }
4360 | type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4361 | 	| {
4362 | 			/**
4363 | 			 * The generated text response from the model
4364 | 			 */
4365 | 			response: string;
4366 | 			/**
4367 | 			 * Usage statistics for the inference request
4368 | 			 */
4369 | 			usage?: {
4370 | 				/**
4371 | 				 * Total number of tokens in input
4372 | 				 */
4373 | 				prompt_tokens?: number;
4374 | 				/**
4375 | 				 * Total number of tokens in output
4376 | 				 */
4377 | 				completion_tokens?: number;
4378 | 				/**
4379 | 				 * Total number of input and output tokens
4380 | 				 */
4381 | 				total_tokens?: number;
4382 | 			};
4383 | 			/**
4384 | 			 * An array of tool calls requests made during the response generation
4385 | 			 */
4386 | 			tool_calls?: {
4387 | 				/**
4388 | 				 * The arguments passed to be passed to the tool call request
4389 | 				 */
4390 | 				arguments?: object;
4391 | 				/**
4392 | 				 * The name of the tool to be called
4393 | 				 */
4394 | 				name?: string;
4395 | 			}[];
4396 | 	  }
4397 | 	| AsyncResponse;
4398 | declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4399 | 	inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
4400 | 	postProcessedOutputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output;
4401 | }
4402 | interface Ai_Cf_Meta_Llama_Guard_3_8B_Input {
4403 | 	/**
4404 | 	 * An array of message objects representing the conversation history.
4405 | 	 */
4406 | 	messages: {
4407 | 		/**
4408 | 		 * The role of the message sender must alternate between 'user' and 'assistant'.
4409 | 		 */
4410 | 		role: "user" | "assistant";
4411 | 		/**
4412 | 		 * The content of the message as a string.
4413 | 		 */
4414 | 		content: string;
4415 | 	}[];
4416 | 	/**
4417 | 	 * The maximum number of tokens to generate in the response.
4418 | 	 */
4419 | 	max_tokens?: number;
4420 | 	/**
4421 | 	 * Controls the randomness of the output; higher values produce more random results.
4422 | 	 */
4423 | 	temperature?: number;
4424 | 	/**
4425 | 	 * Dictate the output format of the generated response.
4426 | 	 */
4427 | 	response_format?: {
4428 | 		/**
4429 | 		 * Set to json_object to process and output generated text as JSON.
4430 | 		 */
4431 | 		type?: string;
4432 | 	};
4433 | }
4434 | interface Ai_Cf_Meta_Llama_Guard_3_8B_Output {
4435 | 	response?:
4436 | 		| string
4437 | 		| {
4438 | 				/**
4439 | 				 * Whether the conversation is safe or not.
4440 | 				 */
4441 | 				safe?: boolean;
4442 | 				/**
4443 | 				 * A list of what hazard categories predicted for the conversation, if the conversation is deemed unsafe.
4444 | 				 */
4445 | 				categories?: string[];
4446 | 		  };
4447 | 	/**
4448 | 	 * Usage statistics for the inference request
4449 | 	 */
4450 | 	usage?: {
4451 | 		/**
4452 | 		 * Total number of tokens in input
4453 | 		 */
4454 | 		prompt_tokens?: number;
4455 | 		/**
4456 | 		 * Total number of tokens in output
4457 | 		 */
4458 | 		completion_tokens?: number;
4459 | 		/**
4460 | 		 * Total number of input and output tokens
4461 | 		 */
4462 | 		total_tokens?: number;
4463 | 	};
4464 | }
4465 | declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B {
4466 | 	inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input;
4467 | 	postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output;
4468 | }
4469 | interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4470 | 	/**
4471 | 	 * A query you wish to perform against the provided contexts.
4472 | 	 */
4473 | 	query: string;
4474 | 	/**
4475 | 	 * Number of returned results starting with the best score.
4476 | 	 */
4477 | 	top_k?: number;
4478 | 	/**
4479 | 	 * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
4480 | 	 */
4481 | 	contexts: {
4482 | 		/**
4483 | 		 * One of the provided context content
4484 | 		 */
4485 | 		text?: string;
4486 | 	}[];
4487 | }
4488 | interface Ai_Cf_Baai_Bge_Reranker_Base_Output {
4489 | 	response?: {
4490 | 		/**
4491 | 		 * Index of the context in the request
4492 | 		 */
4493 | 		id?: number;
4494 | 		/**
4495 | 		 * Score of the context under the index.
4496 | 		 */
4497 | 		score?: number;
4498 | 	}[];
4499 | }
4500 | declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {
4501 | 	inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;
4502 | 	postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;
4503 | }
4504 | type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input =
4505 | 	| Qwen2_5_Coder_32B_Instruct_Prompt
4506 | 	| Qwen2_5_Coder_32B_Instruct_Messages;
4507 | interface Qwen2_5_Coder_32B_Instruct_Prompt {
4508 | 	/**
4509 | 	 * The input text prompt for the model to generate a response.
4510 | 	 */
4511 | 	prompt: string;
4512 | 	/**
4513 | 	 * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
4514 | 	 */
4515 | 	lora?: string;
4516 | 	response_format?: JSONMode;
4517 | 	/**
4518 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4519 | 	 */
4520 | 	raw?: boolean;
4521 | 	/**
4522 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4523 | 	 */
4524 | 	stream?: boolean;
4525 | 	/**
4526 | 	 * The maximum number of tokens to generate in the response.
4527 | 	 */
4528 | 	max_tokens?: number;
4529 | 	/**
4530 | 	 * Controls the randomness of the output; higher values produce more random results.
4531 | 	 */
4532 | 	temperature?: number;
4533 | 	/**
4534 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4535 | 	 */
4536 | 	top_p?: number;
4537 | 	/**
4538 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4539 | 	 */
4540 | 	top_k?: number;
4541 | 	/**
4542 | 	 * Random seed for reproducibility of the generation.
4543 | 	 */
4544 | 	seed?: number;
4545 | 	/**
4546 | 	 * Penalty for repeated tokens; higher values discourage repetition.
4547 | 	 */
4548 | 	repetition_penalty?: number;
4549 | 	/**
4550 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
4551 | 	 */
4552 | 	frequency_penalty?: number;
4553 | 	/**
4554 | 	 * Increases the likelihood of the model introducing new topics.
4555 | 	 */
4556 | 	presence_penalty?: number;
4557 | }
4558 | interface Qwen2_5_Coder_32B_Instruct_Messages {
4559 | 	/**
4560 | 	 * An array of message objects representing the conversation history.
4561 | 	 */
4562 | 	messages: {
4563 | 		/**
4564 | 		 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4565 | 		 */
4566 | 		role: string;
4567 | 		/**
4568 | 		 * The content of the message as a string.
4569 | 		 */
4570 | 		content: string;
4571 | 	}[];
4572 | 	functions?: {
4573 | 		name: string;
4574 | 		code: string;
4575 | 	}[];
4576 | 	/**
4577 | 	 * A list of tools available for the assistant to use.
4578 | 	 */
4579 | 	tools?: (
4580 | 		| {
4581 | 				/**
4582 | 				 * The name of the tool. More descriptive the better.
4583 | 				 */
4584 | 				name: string;
4585 | 				/**
4586 | 				 * A brief description of what the tool does.
4587 | 				 */
4588 | 				description: string;
4589 | 				/**
4590 | 				 * Schema defining the parameters accepted by the tool.
4591 | 				 */
4592 | 				parameters: {
4593 | 					/**
4594 | 					 * The type of the parameters object (usually 'object').
4595 | 					 */
4596 | 					type: string;
4597 | 					/**
4598 | 					 * List of required parameter names.
4599 | 					 */
4600 | 					required?: string[];
4601 | 					/**
4602 | 					 * Definitions of each parameter.
4603 | 					 */
4604 | 					properties: {
4605 | 						[k: string]: {
4606 | 							/**
4607 | 							 * The data type of the parameter.
4608 | 							 */
4609 | 							type: string;
4610 | 							/**
4611 | 							 * A description of the expected parameter.
4612 | 							 */
4613 | 							description: string;
4614 | 						};
4615 | 					};
4616 | 				};
4617 | 		  }
4618 | 		| {
4619 | 				/**
4620 | 				 * Specifies the type of tool (e.g., 'function').
4621 | 				 */
4622 | 				type: string;
4623 | 				/**
4624 | 				 * Details of the function tool.
4625 | 				 */
4626 | 				function: {
4627 | 					/**
4628 | 					 * The name of the function.
4629 | 					 */
4630 | 					name: string;
4631 | 					/**
4632 | 					 * A brief description of what the function does.
4633 | 					 */
4634 | 					description: string;
4635 | 					/**
4636 | 					 * Schema defining the parameters accepted by the function.
4637 | 					 */
4638 | 					parameters: {
4639 | 						/**
4640 | 						 * The type of the parameters object (usually 'object').
4641 | 						 */
4642 | 						type: string;
4643 | 						/**
4644 | 						 * List of required parameter names.
4645 | 						 */
4646 | 						required?: string[];
4647 | 						/**
4648 | 						 * Definitions of each parameter.
4649 | 						 */
4650 | 						properties: {
4651 | 							[k: string]: {
4652 | 								/**
4653 | 								 * The data type of the parameter.
4654 | 								 */
4655 | 								type: string;
4656 | 								/**
4657 | 								 * A description of the expected parameter.
4658 | 								 */
4659 | 								description: string;
4660 | 							};
4661 | 						};
4662 | 					};
4663 | 				};
4664 | 		  }
4665 | 	)[];
4666 | 	response_format?: JSONMode;
4667 | 	/**
4668 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4669 | 	 */
4670 | 	raw?: boolean;
4671 | 	/**
4672 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4673 | 	 */
4674 | 	stream?: boolean;
4675 | 	/**
4676 | 	 * The maximum number of tokens to generate in the response.
4677 | 	 */
4678 | 	max_tokens?: number;
4679 | 	/**
4680 | 	 * Controls the randomness of the output; higher values produce more random results.
4681 | 	 */
4682 | 	temperature?: number;
4683 | 	/**
4684 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4685 | 	 */
4686 | 	top_p?: number;
4687 | 	/**
4688 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4689 | 	 */
4690 | 	top_k?: number;
4691 | 	/**
4692 | 	 * Random seed for reproducibility of the generation.
4693 | 	 */
4694 | 	seed?: number;
4695 | 	/**
4696 | 	 * Penalty for repeated tokens; higher values discourage repetition.
4697 | 	 */
4698 | 	repetition_penalty?: number;
4699 | 	/**
4700 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
4701 | 	 */
4702 | 	frequency_penalty?: number;
4703 | 	/**
4704 | 	 * Increases the likelihood of the model introducing new topics.
4705 | 	 */
4706 | 	presence_penalty?: number;
4707 | }
4708 | type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output = {
4709 | 	/**
4710 | 	 * The generated text response from the model
4711 | 	 */
4712 | 	response: string;
4713 | 	/**
4714 | 	 * Usage statistics for the inference request
4715 | 	 */
4716 | 	usage?: {
4717 | 		/**
4718 | 		 * Total number of tokens in input
4719 | 		 */
4720 | 		prompt_tokens?: number;
4721 | 		/**
4722 | 		 * Total number of tokens in output
4723 | 		 */
4724 | 		completion_tokens?: number;
4725 | 		/**
4726 | 		 * Total number of input and output tokens
4727 | 		 */
4728 | 		total_tokens?: number;
4729 | 	};
4730 | 	/**
4731 | 	 * An array of tool calls requests made during the response generation
4732 | 	 */
4733 | 	tool_calls?: {
4734 | 		/**
4735 | 		 * The arguments passed to be passed to the tool call request
4736 | 		 */
4737 | 		arguments?: object;
4738 | 		/**
4739 | 		 * The name of the tool to be called
4740 | 		 */
4741 | 		name?: string;
4742 | 	}[];
4743 | };
4744 | declare abstract class Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct {
4745 | 	inputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input;
4746 | 	postProcessedOutputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output;
4747 | }
4748 | type Ai_Cf_Qwen_Qwq_32B_Input = Qwen_Qwq_32B_Prompt | Qwen_Qwq_32B_Messages;
4749 | interface Qwen_Qwq_32B_Prompt {
4750 | 	/**
4751 | 	 * The input text prompt for the model to generate a response.
4752 | 	 */
4753 | 	prompt: string;
4754 | 	/**
4755 | 	 * JSON schema that should be fulfilled for the response.
4756 | 	 */
4757 | 	guided_json?: object;
4758 | 	/**
4759 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4760 | 	 */
4761 | 	raw?: boolean;
4762 | 	/**
4763 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4764 | 	 */
4765 | 	stream?: boolean;
4766 | 	/**
4767 | 	 * The maximum number of tokens to generate in the response.
4768 | 	 */
4769 | 	max_tokens?: number;
4770 | 	/**
4771 | 	 * Controls the randomness of the output; higher values produce more random results.
4772 | 	 */
4773 | 	temperature?: number;
4774 | 	/**
4775 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4776 | 	 */
4777 | 	top_p?: number;
4778 | 	/**
4779 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4780 | 	 */
4781 | 	top_k?: number;
4782 | 	/**
4783 | 	 * Random seed for reproducibility of the generation.
4784 | 	 */
4785 | 	seed?: number;
4786 | 	/**
4787 | 	 * Penalty for repeated tokens; higher values discourage repetition.
4788 | 	 */
4789 | 	repetition_penalty?: number;
4790 | 	/**
4791 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
4792 | 	 */
4793 | 	frequency_penalty?: number;
4794 | 	/**
4795 | 	 * Increases the likelihood of the model introducing new topics.
4796 | 	 */
4797 | 	presence_penalty?: number;
4798 | }
4799 | interface Qwen_Qwq_32B_Messages {
4800 | 	/**
4801 | 	 * An array of message objects representing the conversation history.
4802 | 	 */
4803 | 	messages: {
4804 | 		/**
4805 | 		 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4806 | 		 */
4807 | 		role?: string;
4808 | 		/**
4809 | 		 * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
4810 | 		 */
4811 | 		tool_call_id?: string;
4812 | 		content?:
4813 | 			| string
4814 | 			| {
4815 | 					/**
4816 | 					 * Type of the content provided
4817 | 					 */
4818 | 					type?: string;
4819 | 					text?: string;
4820 | 					image_url?: {
4821 | 						/**
4822 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4823 | 						 */
4824 | 						url?: string;
4825 | 					};
4826 | 			  }[]
4827 | 			| {
4828 | 					/**
4829 | 					 * Type of the content provided
4830 | 					 */
4831 | 					type?: string;
4832 | 					text?: string;
4833 | 					image_url?: {
4834 | 						/**
4835 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4836 | 						 */
4837 | 						url?: string;
4838 | 					};
4839 | 			  };
4840 | 	}[];
4841 | 	functions?: {
4842 | 		name: string;
4843 | 		code: string;
4844 | 	}[];
4845 | 	/**
4846 | 	 * A list of tools available for the assistant to use.
4847 | 	 */
4848 | 	tools?: (
4849 | 		| {
4850 | 				/**
4851 | 				 * The name of the tool. More descriptive the better.
4852 | 				 */
4853 | 				name: string;
4854 | 				/**
4855 | 				 * A brief description of what the tool does.
4856 | 				 */
4857 | 				description: string;
4858 | 				/**
4859 | 				 * Schema defining the parameters accepted by the tool.
4860 | 				 */
4861 | 				parameters: {
4862 | 					/**
4863 | 					 * The type of the parameters object (usually 'object').
4864 | 					 */
4865 | 					type: string;
4866 | 					/**
4867 | 					 * List of required parameter names.
4868 | 					 */
4869 | 					required?: string[];
4870 | 					/**
4871 | 					 * Definitions of each parameter.
4872 | 					 */
4873 | 					properties: {
4874 | 						[k: string]: {
4875 | 							/**
4876 | 							 * The data type of the parameter.
4877 | 							 */
4878 | 							type: string;
4879 | 							/**
4880 | 							 * A description of the expected parameter.
4881 | 							 */
4882 | 							description: string;
4883 | 						};
4884 | 					};
4885 | 				};
4886 | 		  }
4887 | 		| {
4888 | 				/**
4889 | 				 * Specifies the type of tool (e.g., 'function').
4890 | 				 */
4891 | 				type: string;
4892 | 				/**
4893 | 				 * Details of the function tool.
4894 | 				 */
4895 | 				function: {
4896 | 					/**
4897 | 					 * The name of the function.
4898 | 					 */
4899 | 					name: string;
4900 | 					/**
4901 | 					 * A brief description of what the function does.
4902 | 					 */
4903 | 					description: string;
4904 | 					/**
4905 | 					 * Schema defining the parameters accepted by the function.
4906 | 					 */
4907 | 					parameters: {
4908 | 						/**
4909 | 						 * The type of the parameters object (usually 'object').
4910 | 						 */
4911 | 						type: string;
4912 | 						/**
4913 | 						 * List of required parameter names.
4914 | 						 */
4915 | 						required?: string[];
4916 | 						/**
4917 | 						 * Definitions of each parameter.
4918 | 						 */
4919 | 						properties: {
4920 | 							[k: string]: {
4921 | 								/**
4922 | 								 * The data type of the parameter.
4923 | 								 */
4924 | 								type: string;
4925 | 								/**
4926 | 								 * A description of the expected parameter.
4927 | 								 */
4928 | 								description: string;
4929 | 							};
4930 | 						};
4931 | 					};
4932 | 				};
4933 | 		  }
4934 | 	)[];
4935 | 	/**
4936 | 	 * JSON schema that should be fufilled for the response.
4937 | 	 */
4938 | 	guided_json?: object;
4939 | 	/**
4940 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4941 | 	 */
4942 | 	raw?: boolean;
4943 | 	/**
4944 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4945 | 	 */
4946 | 	stream?: boolean;
4947 | 	/**
4948 | 	 * The maximum number of tokens to generate in the response.
4949 | 	 */
4950 | 	max_tokens?: number;
4951 | 	/**
4952 | 	 * Controls the randomness of the output; higher values produce more random results.
4953 | 	 */
4954 | 	temperature?: number;
4955 | 	/**
4956 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4957 | 	 */
4958 | 	top_p?: number;
4959 | 	/**
4960 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4961 | 	 */
4962 | 	top_k?: number;
4963 | 	/**
4964 | 	 * Random seed for reproducibility of the generation.
4965 | 	 */
4966 | 	seed?: number;
4967 | 	/**
4968 | 	 * Penalty for repeated tokens; higher values discourage repetition.
4969 | 	 */
4970 | 	repetition_penalty?: number;
4971 | 	/**
4972 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
4973 | 	 */
4974 | 	frequency_penalty?: number;
4975 | 	/**
4976 | 	 * Increases the likelihood of the model introducing new topics.
4977 | 	 */
4978 | 	presence_penalty?: number;
4979 | }
4980 | type Ai_Cf_Qwen_Qwq_32B_Output = {
4981 | 	/**
4982 | 	 * The generated text response from the model
4983 | 	 */
4984 | 	response: string;
4985 | 	/**
4986 | 	 * Usage statistics for the inference request
4987 | 	 */
4988 | 	usage?: {
4989 | 		/**
4990 | 		 * Total number of tokens in input
4991 | 		 */
4992 | 		prompt_tokens?: number;
4993 | 		/**
4994 | 		 * Total number of tokens in output
4995 | 		 */
4996 | 		completion_tokens?: number;
4997 | 		/**
4998 | 		 * Total number of input and output tokens
4999 | 		 */
5000 | 		total_tokens?: number;
5001 | 	};
5002 | 	/**
5003 | 	 * An array of tool calls requests made during the response generation
5004 | 	 */
5005 | 	tool_calls?: {
5006 | 		/**
5007 | 		 * The arguments passed to be passed to the tool call request
5008 | 		 */
5009 | 		arguments?: object;
5010 | 		/**
5011 | 		 * The name of the tool to be called
5012 | 		 */
5013 | 		name?: string;
5014 | 	}[];
5015 | };
5016 | declare abstract class Base_Ai_Cf_Qwen_Qwq_32B {
5017 | 	inputs: Ai_Cf_Qwen_Qwq_32B_Input;
5018 | 	postProcessedOutputs: Ai_Cf_Qwen_Qwq_32B_Output;
5019 | }
5020 | type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input =
5021 | 	| Mistral_Small_3_1_24B_Instruct_Prompt
5022 | 	| Mistral_Small_3_1_24B_Instruct_Messages;
5023 | interface Mistral_Small_3_1_24B_Instruct_Prompt {
5024 | 	/**
5025 | 	 * The input text prompt for the model to generate a response.
5026 | 	 */
5027 | 	prompt: string;
5028 | 	/**
5029 | 	 * JSON schema that should be fulfilled for the response.
5030 | 	 */
5031 | 	guided_json?: object;
5032 | 	/**
5033 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5034 | 	 */
5035 | 	raw?: boolean;
5036 | 	/**
5037 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5038 | 	 */
5039 | 	stream?: boolean;
5040 | 	/**
5041 | 	 * The maximum number of tokens to generate in the response.
5042 | 	 */
5043 | 	max_tokens?: number;
5044 | 	/**
5045 | 	 * Controls the randomness of the output; higher values produce more random results.
5046 | 	 */
5047 | 	temperature?: number;
5048 | 	/**
5049 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
5050 | 	 */
5051 | 	top_p?: number;
5052 | 	/**
5053 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
5054 | 	 */
5055 | 	top_k?: number;
5056 | 	/**
5057 | 	 * Random seed for reproducibility of the generation.
5058 | 	 */
5059 | 	seed?: number;
5060 | 	/**
5061 | 	 * Penalty for repeated tokens; higher values discourage repetition.
5062 | 	 */
5063 | 	repetition_penalty?: number;
5064 | 	/**
5065 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
5066 | 	 */
5067 | 	frequency_penalty?: number;
5068 | 	/**
5069 | 	 * Increases the likelihood of the model introducing new topics.
5070 | 	 */
5071 | 	presence_penalty?: number;
5072 | }
5073 | interface Mistral_Small_3_1_24B_Instruct_Messages {
5074 | 	/**
5075 | 	 * An array of message objects representing the conversation history.
5076 | 	 */
5077 | 	messages: {
5078 | 		/**
5079 | 		 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5080 | 		 */
5081 | 		role?: string;
5082 | 		/**
5083 | 		 * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
5084 | 		 */
5085 | 		tool_call_id?: string;
5086 | 		content?:
5087 | 			| string
5088 | 			| {
5089 | 					/**
5090 | 					 * Type of the content provided
5091 | 					 */
5092 | 					type?: string;
5093 | 					text?: string;
5094 | 					image_url?: {
5095 | 						/**
5096 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5097 | 						 */
5098 | 						url?: string;
5099 | 					};
5100 | 			  }[]
5101 | 			| {
5102 | 					/**
5103 | 					 * Type of the content provided
5104 | 					 */
5105 | 					type?: string;
5106 | 					text?: string;
5107 | 					image_url?: {
5108 | 						/**
5109 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5110 | 						 */
5111 | 						url?: string;
5112 | 					};
5113 | 			  };
5114 | 	}[];
5115 | 	functions?: {
5116 | 		name: string;
5117 | 		code: string;
5118 | 	}[];
5119 | 	/**
5120 | 	 * A list of tools available for the assistant to use.
5121 | 	 */
5122 | 	tools?: (
5123 | 		| {
5124 | 				/**
5125 | 				 * The name of the tool. More descriptive the better.
5126 | 				 */
5127 | 				name: string;
5128 | 				/**
5129 | 				 * A brief description of what the tool does.
5130 | 				 */
5131 | 				description: string;
5132 | 				/**
5133 | 				 * Schema defining the parameters accepted by the tool.
5134 | 				 */
5135 | 				parameters: {
5136 | 					/**
5137 | 					 * The type of the parameters object (usually 'object').
5138 | 					 */
5139 | 					type: string;
5140 | 					/**
5141 | 					 * List of required parameter names.
5142 | 					 */
5143 | 					required?: string[];
5144 | 					/**
5145 | 					 * Definitions of each parameter.
5146 | 					 */
5147 | 					properties: {
5148 | 						[k: string]: {
5149 | 							/**
5150 | 							 * The data type of the parameter.
5151 | 							 */
5152 | 							type: string;
5153 | 							/**
5154 | 							 * A description of the expected parameter.
5155 | 							 */
5156 | 							description: string;
5157 | 						};
5158 | 					};
5159 | 				};
5160 | 		  }
5161 | 		| {
5162 | 				/**
5163 | 				 * Specifies the type of tool (e.g., 'function').
5164 | 				 */
5165 | 				type: string;
5166 | 				/**
5167 | 				 * Details of the function tool.
5168 | 				 */
5169 | 				function: {
5170 | 					/**
5171 | 					 * The name of the function.
5172 | 					 */
5173 | 					name: string;
5174 | 					/**
5175 | 					 * A brief description of what the function does.
5176 | 					 */
5177 | 					description: string;
5178 | 					/**
5179 | 					 * Schema defining the parameters accepted by the function.
5180 | 					 */
5181 | 					parameters: {
5182 | 						/**
5183 | 						 * The type of the parameters object (usually 'object').
5184 | 						 */
5185 | 						type: string;
5186 | 						/**
5187 | 						 * List of required parameter names.
5188 | 						 */
5189 | 						required?: string[];
5190 | 						/**
5191 | 						 * Definitions of each parameter.
5192 | 						 */
5193 | 						properties: {
5194 | 							[k: string]: {
5195 | 								/**
5196 | 								 * The data type of the parameter.
5197 | 								 */
5198 | 								type: string;
5199 | 								/**
5200 | 								 * A description of the expected parameter.
5201 | 								 */
5202 | 								description: string;
5203 | 							};
5204 | 						};
5205 | 					};
5206 | 				};
5207 | 		  }
5208 | 	)[];
5209 | 	/**
5210 | 	 * JSON schema that should be fufilled for the response.
5211 | 	 */
5212 | 	guided_json?: object;
5213 | 	/**
5214 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5215 | 	 */
5216 | 	raw?: boolean;
5217 | 	/**
5218 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5219 | 	 */
5220 | 	stream?: boolean;
5221 | 	/**
5222 | 	 * The maximum number of tokens to generate in the response.
5223 | 	 */
5224 | 	max_tokens?: number;
5225 | 	/**
5226 | 	 * Controls the randomness of the output; higher values produce more random results.
5227 | 	 */
5228 | 	temperature?: number;
5229 | 	/**
5230 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
5231 | 	 */
5232 | 	top_p?: number;
5233 | 	/**
5234 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
5235 | 	 */
5236 | 	top_k?: number;
5237 | 	/**
5238 | 	 * Random seed for reproducibility of the generation.
5239 | 	 */
5240 | 	seed?: number;
5241 | 	/**
5242 | 	 * Penalty for repeated tokens; higher values discourage repetition.
5243 | 	 */
5244 | 	repetition_penalty?: number;
5245 | 	/**
5246 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
5247 | 	 */
5248 | 	frequency_penalty?: number;
5249 | 	/**
5250 | 	 * Increases the likelihood of the model introducing new topics.
5251 | 	 */
5252 | 	presence_penalty?: number;
5253 | }
5254 | type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output = {
5255 | 	/**
5256 | 	 * The generated text response from the model
5257 | 	 */
5258 | 	response: string;
5259 | 	/**
5260 | 	 * Usage statistics for the inference request
5261 | 	 */
5262 | 	usage?: {
5263 | 		/**
5264 | 		 * Total number of tokens in input
5265 | 		 */
5266 | 		prompt_tokens?: number;
5267 | 		/**
5268 | 		 * Total number of tokens in output
5269 | 		 */
5270 | 		completion_tokens?: number;
5271 | 		/**
5272 | 		 * Total number of input and output tokens
5273 | 		 */
5274 | 		total_tokens?: number;
5275 | 	};
5276 | 	/**
5277 | 	 * An array of tool calls requests made during the response generation
5278 | 	 */
5279 | 	tool_calls?: {
5280 | 		/**
5281 | 		 * The arguments passed to be passed to the tool call request
5282 | 		 */
5283 | 		arguments?: object;
5284 | 		/**
5285 | 		 * The name of the tool to be called
5286 | 		 */
5287 | 		name?: string;
5288 | 	}[];
5289 | };
5290 | declare abstract class Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct {
5291 | 	inputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input;
5292 | 	postProcessedOutputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output;
5293 | }
5294 | type Ai_Cf_Google_Gemma_3_12B_It_Input =
5295 | 	| Google_Gemma_3_12B_It_Prompt
5296 | 	| Google_Gemma_3_12B_It_Messages;
5297 | interface Google_Gemma_3_12B_It_Prompt {
5298 | 	/**
5299 | 	 * The input text prompt for the model to generate a response.
5300 | 	 */
5301 | 	prompt: string;
5302 | 	/**
5303 | 	 * JSON schema that should be fufilled for the response.
5304 | 	 */
5305 | 	guided_json?: object;
5306 | 	/**
5307 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5308 | 	 */
5309 | 	raw?: boolean;
5310 | 	/**
5311 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5312 | 	 */
5313 | 	stream?: boolean;
5314 | 	/**
5315 | 	 * The maximum number of tokens to generate in the response.
5316 | 	 */
5317 | 	max_tokens?: number;
5318 | 	/**
5319 | 	 * Controls the randomness of the output; higher values produce more random results.
5320 | 	 */
5321 | 	temperature?: number;
5322 | 	/**
5323 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
5324 | 	 */
5325 | 	top_p?: number;
5326 | 	/**
5327 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
5328 | 	 */
5329 | 	top_k?: number;
5330 | 	/**
5331 | 	 * Random seed for reproducibility of the generation.
5332 | 	 */
5333 | 	seed?: number;
5334 | 	/**
5335 | 	 * Penalty for repeated tokens; higher values discourage repetition.
5336 | 	 */
5337 | 	repetition_penalty?: number;
5338 | 	/**
5339 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
5340 | 	 */
5341 | 	frequency_penalty?: number;
5342 | 	/**
5343 | 	 * Increases the likelihood of the model introducing new topics.
5344 | 	 */
5345 | 	presence_penalty?: number;
5346 | }
5347 | interface Google_Gemma_3_12B_It_Messages {
5348 | 	/**
5349 | 	 * An array of message objects representing the conversation history.
5350 | 	 */
5351 | 	messages: {
5352 | 		/**
5353 | 		 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5354 | 		 */
5355 | 		role?: string;
5356 | 		content?:
5357 | 			| string
5358 | 			| {
5359 | 					/**
5360 | 					 * Type of the content provided
5361 | 					 */
5362 | 					type?: string;
5363 | 					text?: string;
5364 | 					image_url?: {
5365 | 						/**
5366 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5367 | 						 */
5368 | 						url?: string;
5369 | 					};
5370 | 			  }[]
5371 | 			| {
5372 | 					/**
5373 | 					 * Type of the content provided
5374 | 					 */
5375 | 					type?: string;
5376 | 					text?: string;
5377 | 					image_url?: {
5378 | 						/**
5379 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5380 | 						 */
5381 | 						url?: string;
5382 | 					};
5383 | 			  };
5384 | 	}[];
5385 | 	functions?: {
5386 | 		name: string;
5387 | 		code: string;
5388 | 	}[];
5389 | 	/**
5390 | 	 * A list of tools available for the assistant to use.
5391 | 	 */
5392 | 	tools?: (
5393 | 		| {
5394 | 				/**
5395 | 				 * The name of the tool. More descriptive the better.
5396 | 				 */
5397 | 				name: string;
5398 | 				/**
5399 | 				 * A brief description of what the tool does.
5400 | 				 */
5401 | 				description: string;
5402 | 				/**
5403 | 				 * Schema defining the parameters accepted by the tool.
5404 | 				 */
5405 | 				parameters: {
5406 | 					/**
5407 | 					 * The type of the parameters object (usually 'object').
5408 | 					 */
5409 | 					type: string;
5410 | 					/**
5411 | 					 * List of required parameter names.
5412 | 					 */
5413 | 					required?: string[];
5414 | 					/**
5415 | 					 * Definitions of each parameter.
5416 | 					 */
5417 | 					properties: {
5418 | 						[k: string]: {
5419 | 							/**
5420 | 							 * The data type of the parameter.
5421 | 							 */
5422 | 							type: string;
5423 | 							/**
5424 | 							 * A description of the expected parameter.
5425 | 							 */
5426 | 							description: string;
5427 | 						};
5428 | 					};
5429 | 				};
5430 | 		  }
5431 | 		| {
5432 | 				/**
5433 | 				 * Specifies the type of tool (e.g., 'function').
5434 | 				 */
5435 | 				type: string;
5436 | 				/**
5437 | 				 * Details of the function tool.
5438 | 				 */
5439 | 				function: {
5440 | 					/**
5441 | 					 * The name of the function.
5442 | 					 */
5443 | 					name: string;
5444 | 					/**
5445 | 					 * A brief description of what the function does.
5446 | 					 */
5447 | 					description: string;
5448 | 					/**
5449 | 					 * Schema defining the parameters accepted by the function.
5450 | 					 */
5451 | 					parameters: {
5452 | 						/**
5453 | 						 * The type of the parameters object (usually 'object').
5454 | 						 */
5455 | 						type: string;
5456 | 						/**
5457 | 						 * List of required parameter names.
5458 | 						 */
5459 | 						required?: string[];
5460 | 						/**
5461 | 						 * Definitions of each parameter.
5462 | 						 */
5463 | 						properties: {
5464 | 							[k: string]: {
5465 | 								/**
5466 | 								 * The data type of the parameter.
5467 | 								 */
5468 | 								type: string;
5469 | 								/**
5470 | 								 * A description of the expected parameter.
5471 | 								 */
5472 | 								description: string;
5473 | 							};
5474 | 						};
5475 | 					};
5476 | 				};
5477 | 		  }
5478 | 	)[];
5479 | 	/**
5480 | 	 * JSON schema that should be fufilled for the response.
5481 | 	 */
5482 | 	guided_json?: object;
5483 | 	/**
5484 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5485 | 	 */
5486 | 	raw?: boolean;
5487 | 	/**
5488 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5489 | 	 */
5490 | 	stream?: boolean;
5491 | 	/**
5492 | 	 * The maximum number of tokens to generate in the response.
5493 | 	 */
5494 | 	max_tokens?: number;
5495 | 	/**
5496 | 	 * Controls the randomness of the output; higher values produce more random results.
5497 | 	 */
5498 | 	temperature?: number;
5499 | 	/**
5500 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
5501 | 	 */
5502 | 	top_p?: number;
5503 | 	/**
5504 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
5505 | 	 */
5506 | 	top_k?: number;
5507 | 	/**
5508 | 	 * Random seed for reproducibility of the generation.
5509 | 	 */
5510 | 	seed?: number;
5511 | 	/**
5512 | 	 * Penalty for repeated tokens; higher values discourage repetition.
5513 | 	 */
5514 | 	repetition_penalty?: number;
5515 | 	/**
5516 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
5517 | 	 */
5518 | 	frequency_penalty?: number;
5519 | 	/**
5520 | 	 * Increases the likelihood of the model introducing new topics.
5521 | 	 */
5522 | 	presence_penalty?: number;
5523 | }
5524 | type Ai_Cf_Google_Gemma_3_12B_It_Output = {
5525 | 	/**
5526 | 	 * The generated text response from the model
5527 | 	 */
5528 | 	response: string;
5529 | 	/**
5530 | 	 * Usage statistics for the inference request
5531 | 	 */
5532 | 	usage?: {
5533 | 		/**
5534 | 		 * Total number of tokens in input
5535 | 		 */
5536 | 		prompt_tokens?: number;
5537 | 		/**
5538 | 		 * Total number of tokens in output
5539 | 		 */
5540 | 		completion_tokens?: number;
5541 | 		/**
5542 | 		 * Total number of input and output tokens
5543 | 		 */
5544 | 		total_tokens?: number;
5545 | 	};
5546 | 	/**
5547 | 	 * An array of tool calls requests made during the response generation
5548 | 	 */
5549 | 	tool_calls?: {
5550 | 		/**
5551 | 		 * The arguments passed to be passed to the tool call request
5552 | 		 */
5553 | 		arguments?: object;
5554 | 		/**
5555 | 		 * The name of the tool to be called
5556 | 		 */
5557 | 		name?: string;
5558 | 	}[];
5559 | };
5560 | declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5561 | 	inputs: Ai_Cf_Google_Gemma_3_12B_It_Input;
5562 | 	postProcessedOutputs: Ai_Cf_Google_Gemma_3_12B_It_Output;
5563 | }
5564 | type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5565 | 	| Ai_Cf_Meta_Llama_4_Prompt
5566 | 	| Ai_Cf_Meta_Llama_4_Messages;
5567 | interface Ai_Cf_Meta_Llama_4_Prompt {
5568 | 	/**
5569 | 	 * The input text prompt for the model to generate a response.
5570 | 	 */
5571 | 	prompt: string;
5572 | 	/**
5573 | 	 * JSON schema that should be fulfilled for the response.
5574 | 	 */
5575 | 	guided_json?: object;
5576 | 	response_format?: JSONMode;
5577 | 	/**
5578 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5579 | 	 */
5580 | 	raw?: boolean;
5581 | 	/**
5582 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5583 | 	 */
5584 | 	stream?: boolean;
5585 | 	/**
5586 | 	 * The maximum number of tokens to generate in the response.
5587 | 	 */
5588 | 	max_tokens?: number;
5589 | 	/**
5590 | 	 * Controls the randomness of the output; higher values produce more random results.
5591 | 	 */
5592 | 	temperature?: number;
5593 | 	/**
5594 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
5595 | 	 */
5596 | 	top_p?: number;
5597 | 	/**
5598 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
5599 | 	 */
5600 | 	top_k?: number;
5601 | 	/**
5602 | 	 * Random seed for reproducibility of the generation.
5603 | 	 */
5604 | 	seed?: number;
5605 | 	/**
5606 | 	 * Penalty for repeated tokens; higher values discourage repetition.
5607 | 	 */
5608 | 	repetition_penalty?: number;
5609 | 	/**
5610 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
5611 | 	 */
5612 | 	frequency_penalty?: number;
5613 | 	/**
5614 | 	 * Increases the likelihood of the model introducing new topics.
5615 | 	 */
5616 | 	presence_penalty?: number;
5617 | }
5618 | interface Ai_Cf_Meta_Llama_4_Messages {
5619 | 	/**
5620 | 	 * An array of message objects representing the conversation history.
5621 | 	 */
5622 | 	messages: {
5623 | 		/**
5624 | 		 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5625 | 		 */
5626 | 		role?: string;
5627 | 		/**
5628 | 		 * The tool call id. If you don't know what to put here you can fall back to 000000001
5629 | 		 */
5630 | 		tool_call_id?: string;
5631 | 		content?:
5632 | 			| string
5633 | 			| {
5634 | 					/**
5635 | 					 * Type of the content provided
5636 | 					 */
5637 | 					type?: string;
5638 | 					text?: string;
5639 | 					image_url?: {
5640 | 						/**
5641 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5642 | 						 */
5643 | 						url?: string;
5644 | 					};
5645 | 			  }[]
5646 | 			| {
5647 | 					/**
5648 | 					 * Type of the content provided
5649 | 					 */
5650 | 					type?: string;
5651 | 					text?: string;
5652 | 					image_url?: {
5653 | 						/**
5654 | 						 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5655 | 						 */
5656 | 						url?: string;
5657 | 					};
5658 | 			  };
5659 | 	}[];
5660 | 	functions?: {
5661 | 		name: string;
5662 | 		code: string;
5663 | 	}[];
5664 | 	/**
5665 | 	 * A list of tools available for the assistant to use.
5666 | 	 */
5667 | 	tools?: (
5668 | 		| {
5669 | 				/**
5670 | 				 * The name of the tool. More descriptive the better.
5671 | 				 */
5672 | 				name: string;
5673 | 				/**
5674 | 				 * A brief description of what the tool does.
5675 | 				 */
5676 | 				description: string;
5677 | 				/**
5678 | 				 * Schema defining the parameters accepted by the tool.
5679 | 				 */
5680 | 				parameters: {
5681 | 					/**
5682 | 					 * The type of the parameters object (usually 'object').
5683 | 					 */
5684 | 					type: string;
5685 | 					/**
5686 | 					 * List of required parameter names.
5687 | 					 */
5688 | 					required?: string[];
5689 | 					/**
5690 | 					 * Definitions of each parameter.
5691 | 					 */
5692 | 					properties: {
5693 | 						[k: string]: {
5694 | 							/**
5695 | 							 * The data type of the parameter.
5696 | 							 */
5697 | 							type: string;
5698 | 							/**
5699 | 							 * A description of the expected parameter.
5700 | 							 */
5701 | 							description: string;
5702 | 						};
5703 | 					};
5704 | 				};
5705 | 		  }
5706 | 		| {
5707 | 				/**
5708 | 				 * Specifies the type of tool (e.g., 'function').
5709 | 				 */
5710 | 				type: string;
5711 | 				/**
5712 | 				 * Details of the function tool.
5713 | 				 */
5714 | 				function: {
5715 | 					/**
5716 | 					 * The name of the function.
5717 | 					 */
5718 | 					name: string;
5719 | 					/**
5720 | 					 * A brief description of what the function does.
5721 | 					 */
5722 | 					description: string;
5723 | 					/**
5724 | 					 * Schema defining the parameters accepted by the function.
5725 | 					 */
5726 | 					parameters: {
5727 | 						/**
5728 | 						 * The type of the parameters object (usually 'object').
5729 | 						 */
5730 | 						type: string;
5731 | 						/**
5732 | 						 * List of required parameter names.
5733 | 						 */
5734 | 						required?: string[];
5735 | 						/**
5736 | 						 * Definitions of each parameter.
5737 | 						 */
5738 | 						properties: {
5739 | 							[k: string]: {
5740 | 								/**
5741 | 								 * The data type of the parameter.
5742 | 								 */
5743 | 								type: string;
5744 | 								/**
5745 | 								 * A description of the expected parameter.
5746 | 								 */
5747 | 								description: string;
5748 | 							};
5749 | 						};
5750 | 					};
5751 | 				};
5752 | 		  }
5753 | 	)[];
5754 | 	response_format?: JSONMode;
5755 | 	/**
5756 | 	 * JSON schema that should be fufilled for the response.
5757 | 	 */
5758 | 	guided_json?: object;
5759 | 	/**
5760 | 	 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5761 | 	 */
5762 | 	raw?: boolean;
5763 | 	/**
5764 | 	 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5765 | 	 */
5766 | 	stream?: boolean;
5767 | 	/**
5768 | 	 * The maximum number of tokens to generate in the response.
5769 | 	 */
5770 | 	max_tokens?: number;
5771 | 	/**
5772 | 	 * Controls the randomness of the output; higher values produce more random results.
5773 | 	 */
5774 | 	temperature?: number;
5775 | 	/**
5776 | 	 * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
5777 | 	 */
5778 | 	top_p?: number;
5779 | 	/**
5780 | 	 * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
5781 | 	 */
5782 | 	top_k?: number;
5783 | 	/**
5784 | 	 * Random seed for reproducibility of the generation.
5785 | 	 */
5786 | 	seed?: number;
5787 | 	/**
5788 | 	 * Penalty for repeated tokens; higher values discourage repetition.
5789 | 	 */
5790 | 	repetition_penalty?: number;
5791 | 	/**
5792 | 	 * Decreases the likelihood of the model repeating the same lines verbatim.
5793 | 	 */
5794 | 	frequency_penalty?: number;
5795 | 	/**
5796 | 	 * Increases the likelihood of the model introducing new topics.
5797 | 	 */
5798 | 	presence_penalty?: number;
5799 | }
5800 | type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5801 | 	/**
5802 | 	 * The generated text response from the model
5803 | 	 */
5804 | 	response: string;
5805 | 	/**
5806 | 	 * Usage statistics for the inference request
5807 | 	 */
5808 | 	usage?: {
5809 | 		/**
5810 | 		 * Total number of tokens in input
5811 | 		 */
5812 | 		prompt_tokens?: number;
5813 | 		/**
5814 | 		 * Total number of tokens in output
5815 | 		 */
5816 | 		completion_tokens?: number;
5817 | 		/**
5818 | 		 * Total number of input and output tokens
5819 | 		 */
5820 | 		total_tokens?: number;
5821 | 	};
5822 | 	/**
5823 | 	 * An array of tool calls requests made during the response generation
5824 | 	 */
5825 | 	tool_calls?: {
5826 | 		/**
5827 | 		 * The tool call id.
5828 | 		 */
5829 | 		id?: string;
5830 | 		/**
5831 | 		 * Specifies the type of tool (e.g., 'function').
5832 | 		 */
5833 | 		type?: string;
5834 | 		/**
5835 | 		 * Details of the function tool.
5836 | 		 */
5837 | 		function?: {
5838 | 			/**
5839 | 			 * The name of the tool to be called
5840 | 			 */
5841 | 			name?: string;
5842 | 			/**
5843 | 			 * The arguments passed to be passed to the tool call request
5844 | 			 */
5845 | 			arguments?: object;
5846 | 		};
5847 | 	}[];
5848 | };
5849 | declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
5850 | 	inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5851 | 	postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5852 | }
5853 | interface AiModels {
5854 | 	"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5855 | 	"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
5856 | 	"@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
5857 | 	"@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
5858 | 	"@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5859 | 	"@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5860 | 	"@cf/myshell-ai/melotts": BaseAiTextToSpeech;
5861 | 	"@cf/microsoft/resnet-50": BaseAiImageClassification;
5862 | 	"@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5863 | 	"@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5864 | 	"@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5865 | 	"@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
5866 | 	"@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
5867 | 	"@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
5868 | 	"@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
5869 | 	"@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
5870 | 	"@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
5871 | 	"@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
5872 | 	"@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
5873 | 	"@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
5874 | 	"@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
5875 | 	"@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
5876 | 	"@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
5877 | 	"@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
5878 | 	"@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
5879 | 	"@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
5880 | 	"@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
5881 | 	"@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
5882 | 	"@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
5883 | 	"@cf/microsoft/phi-2": BaseAiTextGeneration;
5884 | 	"@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
5885 | 	"@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
5886 | 	"@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
5887 | 	"@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
5888 | 	"@hf/google/gemma-7b-it": BaseAiTextGeneration;
5889 | 	"@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
5890 | 	"@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
5891 | 	"@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
5892 | 	"@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
5893 | 	"@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
5894 | 	"@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5895 | 	"@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5896 | 	"@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5897 | 	"@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5898 | 	"@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5899 | 	"@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
5900 | 	"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
5901 | 	"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
5902 | 	"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
5903 | 	"@cf/facebook/bart-large-cnn": BaseAiSummarization;
5904 | 	"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
5905 | 	"@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;
5906 | 	"@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
5907 | 	"@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B;
5908 | 	"@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5;
5909 | 	"@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5;
5910 | 	"@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
5911 | 	"@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
5912 | 	"@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
5913 | 	"@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
5914 | 	"@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
5915 | 	"@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
5916 | 	"@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast;
5917 | 	"@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
5918 | 	"@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
5919 | 	"@cf/qwen/qwen2.5-coder-32b-instruct": Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct;
5920 | 	"@cf/qwen/qwq-32b": Base_Ai_Cf_Qwen_Qwq_32B;
5921 | 	"@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
5922 | 	"@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
5923 | 	"@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
5924 | }
5925 | type AiOptions = {
5926 | 	/**
5927 | 	 * Send requests as an asynchronous batch job, only works for supported models
5928 | 	 * https://developers.cloudflare.com/workers-ai/features/batch-api
5929 | 	 */
5930 | 	queueRequest?: boolean;
5931 | 	gateway?: GatewayOptions;
5932 | 	returnRawResponse?: boolean;
5933 | 	prefix?: string;
5934 | 	extraHeaders?: object;
5935 | };
5936 | type ConversionResponse = {
5937 | 	name: string;
5938 | 	mimeType: string;
5939 | 	format: "markdown";
5940 | 	tokens: number;
5941 | 	data: string;
5942 | };
5943 | type AiModelsSearchParams = {
5944 | 	author?: string;
5945 | 	hide_experimental?: boolean;
5946 | 	page?: number;
5947 | 	per_page?: number;
5948 | 	search?: string;
5949 | 	source?: number;
5950 | 	task?: string;
5951 | };
5952 | type AiModelsSearchObject = {
5953 | 	id: string;
5954 | 	source: number;
5955 | 	name: string;
5956 | 	description: string;
5957 | 	task: {
5958 | 		id: string;
5959 | 		name: string;
5960 | 		description: string;
5961 | 	};
5962 | 	tags: string[];
5963 | 	properties: {
5964 | 		property_id: string;
5965 | 		value: string;
5966 | 	}[];
5967 | };
5968 | interface InferenceUpstreamError extends Error {}
5969 | interface AiInternalError extends Error {}
5970 | type AiModelListType = Record<string, any>;
5971 | declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
5972 | 	aiGatewayLogId: string | null;
5973 | 	gateway(gatewayId: string): AiGateway;
5974 | 	autorag(autoragId?: string): AutoRAG;
5975 | 	run<
5976 | 		Name extends keyof AiModelList,
5977 | 		Options extends AiOptions,
5978 | 		InputOptions extends AiModelList[Name]["inputs"],
5979 | 	>(
5980 | 		model: Name,
5981 | 		inputs: InputOptions,
5982 | 		options?: Options,
5983 | 	): Promise<
5984 | 		Options extends {
5985 | 			returnRawResponse: true;
5986 | 		}
5987 | 			? Response
5988 | 			: InputOptions extends {
5989 | 						stream: true;
5990 | 					}
5991 | 				? ReadableStream
5992 | 				: AiModelList[Name]["postProcessedOutputs"]
5993 | 	>;
5994 | 	models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
5995 | 	toMarkdown(
5996 | 		files: {
5997 | 			name: string;
5998 | 			blob: Blob;
5999 | 		}[],
6000 | 		options?: {
6001 | 			gateway?: GatewayOptions;
6002 | 			extraHeaders?: object;
6003 | 		},
6004 | 	): Promise<ConversionResponse[]>;
6005 | 	toMarkdown(
6006 | 		files: {
6007 | 			name: string;
6008 | 			blob: Blob;
6009 | 		},
6010 | 		options?: {
6011 | 			gateway?: GatewayOptions;
6012 | 			extraHeaders?: object;
6013 | 		},
6014 | 	): Promise<ConversionResponse>;
6015 | }
6016 | type GatewayRetries = {
6017 | 	maxAttempts?: 1 | 2 | 3 | 4 | 5;
6018 | 	retryDelayMs?: number;
6019 | 	backoff?: "constant" | "linear" | "exponential";
6020 | };
6021 | type GatewayOptions = {
6022 | 	id: string;
6023 | 	cacheKey?: string;
6024 | 	cacheTtl?: number;
6025 | 	skipCache?: boolean;
6026 | 	metadata?: Record<string, number | string | boolean | null | bigint>;
6027 | 	collectLog?: boolean;
6028 | 	eventId?: string;
6029 | 	requestTimeoutMs?: number;
6030 | 	retries?: GatewayRetries;
6031 | };
6032 | type UniversalGatewayOptions = Exclude<GatewayOptions, "id"> & {
6033 | 	/**
6034 | 	 ** @deprecated
6035 | 	 */
6036 | 	id?: string;
6037 | };
6038 | type AiGatewayPatchLog = {
6039 | 	score?: number | null;
6040 | 	feedback?: -1 | 1 | null;
6041 | 	metadata?: Record<string, number | string | boolean | null | bigint> | null;
6042 | };
6043 | type AiGatewayLog = {
6044 | 	id: string;
6045 | 	provider: string;
6046 | 	model: string;
6047 | 	model_type?: string;
6048 | 	path: string;
6049 | 	duration: number;
6050 | 	request_type?: string;
6051 | 	request_content_type?: string;
6052 | 	status_code: number;
6053 | 	response_content_type?: string;
6054 | 	success: boolean;
6055 | 	cached: boolean;
6056 | 	tokens_in?: number;
6057 | 	tokens_out?: number;
6058 | 	metadata?: Record<string, number | string | boolean | null | bigint>;
6059 | 	step?: number;
6060 | 	cost?: number;
6061 | 	custom_cost?: boolean;
6062 | 	request_size: number;
6063 | 	request_head?: string;
6064 | 	request_head_complete: boolean;
6065 | 	response_size: number;
6066 | 	response_head?: string;
6067 | 	response_head_complete: boolean;
6068 | 	created_at: Date;
6069 | };
6070 | type AIGatewayProviders =
6071 | 	| "workers-ai"
6072 | 	| "anthropic"
6073 | 	| "aws-bedrock"
6074 | 	| "azure-openai"
6075 | 	| "google-vertex-ai"
6076 | 	| "huggingface"
6077 | 	| "openai"
6078 | 	| "perplexity-ai"
6079 | 	| "replicate"
6080 | 	| "groq"
6081 | 	| "cohere"
6082 | 	| "google-ai-studio"
6083 | 	| "mistral"
6084 | 	| "grok"
6085 | 	| "openrouter"
6086 | 	| "deepseek"
6087 | 	| "cerebras"
6088 | 	| "cartesia"
6089 | 	| "elevenlabs"
6090 | 	| "adobe-firefly";
6091 | type AIGatewayHeaders = {
6092 | 	"cf-aig-metadata":
6093 | 		| Record<string, number | string | boolean | null | bigint>
6094 | 		| string;
6095 | 	"cf-aig-custom-cost":
6096 | 		| {
6097 | 				per_token_in?: number;
6098 | 				per_token_out?: number;
6099 | 		  }
6100 | 		| {
6101 | 				total_cost?: number;
6102 | 		  }
6103 | 		| string;
6104 | 	"cf-aig-cache-ttl": number | string;
6105 | 	"cf-aig-skip-cache": boolean | string;
6106 | 	"cf-aig-cache-key": string;
6107 | 	"cf-aig-event-id": string;
6108 | 	"cf-aig-request-timeout": number | string;
6109 | 	"cf-aig-max-attempts": number | string;
6110 | 	"cf-aig-retry-delay": number | string;
6111 | 	"cf-aig-backoff": string;
6112 | 	"cf-aig-collect-log": boolean | string;
6113 | 	Authorization: string;
6114 | 	"Content-Type": string;
6115 | 	[key: string]: string | number | boolean | object;
6116 | };
6117 | type AIGatewayUniversalRequest = {
6118 | 	provider: AIGatewayProviders | string; // eslint-disable-line
6119 | 	endpoint: string;
6120 | 	headers: Partial<AIGatewayHeaders>;
6121 | 	query: unknown;
6122 | };
6123 | interface AiGatewayInternalError extends Error {}
6124 | interface AiGatewayLogNotFound extends Error {}
6125 | declare abstract class AiGateway {
6126 | 	patchLog(logId: string, data: AiGatewayPatchLog): Promise<void>;
6127 | 	getLog(logId: string): Promise<AiGatewayLog>;
6128 | 	run(
6129 | 		data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[],
6130 | 		options?: {
6131 | 			gateway?: UniversalGatewayOptions;
6132 | 			extraHeaders?: object;
6133 | 		},
6134 | 	): Promise<Response>;
6135 | 	getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
6136 | }
6137 | interface AutoRAGInternalError extends Error {}
6138 | interface AutoRAGNotFoundError extends Error {}
6139 | interface AutoRAGUnauthorizedError extends Error {}
6140 | interface AutoRAGNameNotSetError extends Error {}
6141 | type ComparisonFilter = {
6142 | 	key: string;
6143 | 	type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
6144 | 	value: string | number | boolean;
6145 | };
6146 | type CompoundFilter = {
6147 | 	type: "and" | "or";
6148 | 	filters: ComparisonFilter[];
6149 | };
6150 | type AutoRagSearchRequest = {
6151 | 	query: string;
6152 | 	filters?: CompoundFilter | ComparisonFilter;
6153 | 	max_num_results?: number;
6154 | 	ranking_options?: {
6155 | 		ranker?: string;
6156 | 		score_threshold?: number;
6157 | 	};
6158 | 	rewrite_query?: boolean;
6159 | };
6160 | type AutoRagAiSearchRequest = AutoRagSearchRequest & {
6161 | 	stream?: boolean;
6162 | 	system_prompt?: string;
6163 | };
6164 | type AutoRagAiSearchRequestStreaming = Omit<
6165 | 	AutoRagAiSearchRequest,
6166 | 	"stream"
6167 | > & {
6168 | 	stream: true;
6169 | };
6170 | type AutoRagSearchResponse = {
6171 | 	object: "vector_store.search_results.page";
6172 | 	search_query: string;
6173 | 	data: {
6174 | 		file_id: string;
6175 | 		filename: string;
6176 | 		score: number;
6177 | 		attributes: Record<string, string | number | boolean | null>;
6178 | 		content: {
6179 | 			type: "text";
6180 | 			text: string;
6181 | 		}[];
6182 | 	}[];
6183 | 	has_more: boolean;
6184 | 	next_page: string | null;
6185 | };
6186 | type AutoRagListResponse = {
6187 | 	id: string;
6188 | 	enable: boolean;
6189 | 	type: string;
6190 | 	source: string;
6191 | 	vectorize_name: string;
6192 | 	paused: boolean;
6193 | 	status: string;
6194 | }[];
6195 | type AutoRagAiSearchResponse = AutoRagSearchResponse & {
6196 | 	response: string;
6197 | };
6198 | declare abstract class AutoRAG {
6199 | 	list(): Promise<AutoRagListResponse>;
6200 | 	search(params: AutoRagSearchRequest): Promise<AutoRagSearchResponse>;
6201 | 	aiSearch(params: AutoRagAiSearchRequestStreaming): Promise<Response>;
6202 | 	aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse>;
6203 | 	aiSearch(
6204 | 		params: AutoRagAiSearchRequest,
6205 | 	): Promise<AutoRagAiSearchResponse | Response>;
6206 | }
6207 | interface BasicImageTransformations {
6208 | 	/**
6209 | 	 * Maximum width in image pixels. The value must be an integer.
6210 | 	 */
6211 | 	width?: number;
6212 | 	/**
6213 | 	 * Maximum height in image pixels. The value must be an integer.
6214 | 	 */
6215 | 	height?: number;
6216 | 	/**
6217 | 	 * Resizing mode as a string. It affects interpretation of width and height
6218 | 	 * options:
6219 | 	 *  - scale-down: Similar to contain, but the image is never enlarged. If
6220 | 	 *    the image is larger than given width or height, it will be resized.
6221 | 	 *    Otherwise its original size will be kept.
6222 | 	 *  - contain: Resizes to maximum size that fits within the given width and
6223 | 	 *    height. If only a single dimension is given (e.g. only width), the
6224 | 	 *    image will be shrunk or enlarged to exactly match that dimension.
6225 | 	 *    Aspect ratio is always preserved.
6226 | 	 *  - cover: Resizes (shrinks or enlarges) to fill the entire area of width
6227 | 	 *    and height. If the image has an aspect ratio different from the ratio
6228 | 	 *    of width and height, it will be cropped to fit.
6229 | 	 *  - crop: The image will be shrunk and cropped to fit within the area
6230 | 	 *    specified by width and height. The image will not be enlarged. For images
6231 | 	 *    smaller than the given dimensions it's the same as scale-down. For
6232 | 	 *    images larger than the given dimensions, it's the same as cover.
6233 | 	 *    See also trim.
6234 | 	 *  - pad: Resizes to the maximum size that fits within the given width and
6235 | 	 *    height, and then fills the remaining area with a background color
6236 | 	 *    (white by default). Use of this mode is not recommended, as the same
6237 | 	 *    effect can be more efficiently achieved with the contain mode and the
6238 | 	 *    CSS object-fit: contain property.
6239 | 	 *  - squeeze: Stretches and deforms to the width and height given, even if it
6240 | 	 *    breaks aspect ratio
6241 | 	 */
6242 | 	fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
6243 | 	/**
6244 | 	 * When cropping with fit: "cover", this defines the side or point that should
6245 | 	 * be left uncropped. The value is either a string
6246 | 	 * "left", "right", "top", "bottom", "auto", or "center" (the default),
6247 | 	 * or an object {x, y} containing focal point coordinates in the original
6248 | 	 * image expressed as fractions ranging from 0.0 (top or left) to 1.0
6249 | 	 * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
6250 | 	 * crop bottom or left and right sides as necessary, but won’t crop anything
6251 | 	 * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
6252 | 	 * preserve as much as possible around a point at 20% of the height of the
6253 | 	 * source image.
6254 | 	 */
6255 | 	gravity?:
6256 | 		| "left"
6257 | 		| "right"
6258 | 		| "top"
6259 | 		| "bottom"
6260 | 		| "center"
6261 | 		| "auto"
6262 | 		| "entropy"
6263 | 		| BasicImageTransformationsGravityCoordinates;
6264 | 	/**
6265 | 	 * Background color to add underneath the image. Applies only to images with
6266 | 	 * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
6267 | 	 * hsl(…), etc.)
6268 | 	 */
6269 | 	background?: string;
6270 | 	/**
6271 | 	 * Number of degrees (90, 180, 270) to rotate the image by. width and height
6272 | 	 * options refer to axes after rotation.
6273 | 	 */
6274 | 	rotate?: 0 | 90 | 180 | 270 | 360;
6275 | }
6276 | interface BasicImageTransformationsGravityCoordinates {
6277 | 	x?: number;
6278 | 	y?: number;
6279 | 	mode?: "remainder" | "box-center";
6280 | }
6281 | /**
6282 |  * In addition to the properties you can set in the RequestInit dict
6283 |  * that you pass as an argument to the Request constructor, you can
6284 |  * set certain properties of a `cf` object to control how Cloudflare
6285 |  * features are applied to that new Request.
6286 |  *
6287 |  * Note: Currently, these properties cannot be tested in the
6288 |  * playground.
6289 |  */
6290 | interface RequestInitCfProperties extends Record<string, unknown> {
6291 | 	cacheEverything?: boolean;
6292 | 	/**
6293 | 	 * A request's cache key is what determines if two requests are
6294 | 	 * "the same" for caching purposes. If a request has the same cache key
6295 | 	 * as some previous request, then we can serve the same cached response for
6296 | 	 * both. (e.g. 'some-key')
6297 | 	 *
6298 | 	 * Only available for Enterprise customers.
6299 | 	 */
6300 | 	cacheKey?: string;
6301 | 	/**
6302 | 	 * This allows you to append additional Cache-Tag response headers
6303 | 	 * to the origin response without modifications to the origin server.
6304 | 	 * This will allow for greater control over the Purge by Cache Tag feature
6305 | 	 * utilizing changes only in the Workers process.
6306 | 	 *
6307 | 	 * Only available for Enterprise customers.
6308 | 	 */
6309 | 	cacheTags?: string[];
6310 | 	/**
6311 | 	 * Force response to be cached for a given number of seconds. (e.g. 300)
6312 | 	 */
6313 | 	cacheTtl?: number;
6314 | 	/**
6315 | 	 * Force response to be cached for a given number of seconds based on the Origin status code.
6316 | 	 * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
6317 | 	 */
6318 | 	cacheTtlByStatus?: Record<string, number>;
6319 | 	scrapeShield?: boolean;
6320 | 	apps?: boolean;
6321 | 	image?: RequestInitCfPropertiesImage;
6322 | 	minify?: RequestInitCfPropertiesImageMinify;
6323 | 	mirage?: boolean;
6324 | 	polish?: "lossy" | "lossless" | "off";
6325 | 	r2?: RequestInitCfPropertiesR2;
6326 | 	/**
6327 | 	 * Redirects the request to an alternate origin server. You can use this,
6328 | 	 * for example, to implement load balancing across several origins.
6329 | 	 * (e.g.us-east.example.com)
6330 | 	 *
6331 | 	 * Note - For security reasons, the hostname set in resolveOverride must
6332 | 	 * be proxied on the same Cloudflare zone of the incoming request.
6333 | 	 * Otherwise, the setting is ignored. CNAME hosts are allowed, so to
6334 | 	 * resolve to a host under a different domain or a DNS only domain first
6335 | 	 * declare a CNAME record within your own zone’s DNS mapping to the
6336 | 	 * external hostname, set proxy on Cloudflare, then set resolveOverride
6337 | 	 * to point to that CNAME record.
6338 | 	 */
6339 | 	resolveOverride?: string;
6340 | }
6341 | interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
6342 | 	/**
6343 | 	 * Absolute URL of the image file to use for the drawing. It can be any of
6344 | 	 * the supported file formats. For drawing of watermarks or non-rectangular
6345 | 	 * overlays we recommend using PNG or WebP images.
6346 | 	 */
6347 | 	url: string;
6348 | 	/**
6349 | 	 * Floating-point number between 0 (transparent) and 1 (opaque).
6350 | 	 * For example, opacity: 0.5 makes overlay semitransparent.
6351 | 	 */
6352 | 	opacity?: number;
6353 | 	/**
6354 | 	 * - If set to true, the overlay image will be tiled to cover the entire
6355 | 	 *   area. This is useful for stock-photo-like watermarks.
6356 | 	 * - If set to "x", the overlay image will be tiled horizontally only
6357 | 	 *   (form a line).
6358 | 	 * - If set to "y", the overlay image will be tiled vertically only
6359 | 	 *   (form a line).
6360 | 	 */
6361 | 	repeat?: true | "x" | "y";
6362 | 	/**
6363 | 	 * Position of the overlay image relative to a given edge. Each property is
6364 | 	 * an offset in pixels. 0 aligns exactly to the edge. For example, left: 10
6365 | 	 * positions left side of the overlay 10 pixels from the left edge of the
6366 | 	 * image it's drawn over. bottom: 0 aligns bottom of the overlay with bottom
6367 | 	 * of the background image.
6368 | 	 *
6369 | 	 * Setting both left & right, or both top & bottom is an error.
6370 | 	 *
6371 | 	 * If no position is specified, the image will be centered.
6372 | 	 */
6373 | 	top?: number;
6374 | 	left?: number;
6375 | 	bottom?: number;
6376 | 	right?: number;
6377 | }
6378 | interface RequestInitCfPropertiesImage extends BasicImageTransformations {
6379 | 	/**
6380 | 	 * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
6381 | 	 * easier to specify higher-DPI sizes in <img srcset>.
6382 | 	 */
6383 | 	dpr?: number;
6384 | 	/**
6385 | 	 * Allows you to trim your image. Takes dpr into account and is performed before
6386 | 	 * resizing or rotation.
6387 | 	 *
6388 | 	 * It can be used as:
6389 | 	 * - left, top, right, bottom - it will specify the number of pixels to cut
6390 | 	 *   off each side
6391 | 	 * - width, height - the width/height you'd like to end up with - can be used
6392 | 	 *   in combination with the properties above
6393 | 	 * - border - this will automatically trim the surroundings of an image based on
6394 | 	 *   it's color. It consists of three properties:
6395 | 	 *    - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
6396 | 	 *    - tolerance: difference from color to treat as color
6397 | 	 *    - keep: the number of pixels of border to keep
6398 | 	 */
6399 | 	trim?:
6400 | 		| "border"
6401 | 		| {
6402 | 				top?: number;
6403 | 				bottom?: number;
6404 | 				left?: number;
6405 | 				right?: number;
6406 | 				width?: number;
6407 | 				height?: number;
6408 | 				border?:
6409 | 					| boolean
6410 | 					| {
6411 | 							color?: string;
6412 | 							tolerance?: number;
6413 | 							keep?: number;
6414 | 					  };
6415 | 		  };
6416 | 	/**
6417 | 	 * Quality setting from 1-100 (useful values are in 60-90 range). Lower values
6418 | 	 * make images look worse, but load faster. The default is 85. It applies only
6419 | 	 * to JPEG and WebP images. It doesn’t have any effect on PNG.
6420 | 	 */
6421 | 	quality?: number | "low" | "medium-low" | "medium-high" | "high";
6422 | 	/**
6423 | 	 * Output format to generate. It can be:
6424 | 	 *  - avif: generate images in AVIF format.
6425 | 	 *  - webp: generate images in Google WebP format. Set quality to 100 to get
6426 | 	 *    the WebP-lossless format.
6427 | 	 *  - json: instead of generating an image, outputs information about the
6428 | 	 *    image, in JSON format. The JSON object will contain image size
6429 | 	 *    (before and after resizing), source image’s MIME type, file size, etc.
6430 | 	 * - jpeg: generate images in JPEG format.
6431 | 	 * - png: generate images in PNG format.
6432 | 	 */
6433 | 	format?:
6434 | 		| "avif"
6435 | 		| "webp"
6436 | 		| "json"
6437 | 		| "jpeg"
6438 | 		| "png"
6439 | 		| "baseline-jpeg"
6440 | 		| "png-force"
6441 | 		| "svg";
6442 | 	/**
6443 | 	 * Whether to preserve animation frames from input files. Default is true.
6444 | 	 * Setting it to false reduces animations to still images. This setting is
6445 | 	 * recommended when enlarging images or processing arbitrary user content,
6446 | 	 * because large GIF animations can weigh tens or even hundreds of megabytes.
6447 | 	 * It is also useful to set anim:false when using format:"json" to get the
6448 | 	 * response quicker without the number of frames.
6449 | 	 */
6450 | 	anim?: boolean;
6451 | 	/**
6452 | 	 * What EXIF data should be preserved in the output image. Note that EXIF
6453 | 	 * rotation and embedded color profiles are always applied ("baked in" into
6454 | 	 * the image), and aren't affected by this option. Note that if the Polish
6455 | 	 * feature is enabled, all metadata may have been removed already and this
6456 | 	 * option may have no effect.
6457 | 	 *  - keep: Preserve most of EXIF metadata, including GPS location if there's
6458 | 	 *    any.
6459 | 	 *  - copyright: Only keep the copyright tag, and discard everything else.
6460 | 	 *    This is the default behavior for JPEG files.
6461 | 	 *  - none: Discard all invisible EXIF metadata. Currently WebP and PNG
6462 | 	 *    output formats always discard metadata.
6463 | 	 */
6464 | 	metadata?: "keep" | "copyright" | "none";
6465 | 	/**
6466 | 	 * Strength of sharpening filter to apply to the image. Floating-point
6467 | 	 * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
6468 | 	 * recommended value for downscaled images.
6469 | 	 */
6470 | 	sharpen?: number;
6471 | 	/**
6472 | 	 * Radius of a blur filter (approximate gaussian). Maximum supported radius
6473 | 	 * is 250.
6474 | 	 */
6475 | 	blur?: number;
6476 | 	/**
6477 | 	 * Overlays are drawn in the order they appear in the array (last array
6478 | 	 * entry is the topmost layer).
6479 | 	 */
6480 | 	draw?: RequestInitCfPropertiesImageDraw[];
6481 | 	/**
6482 | 	 * Fetching image from authenticated origin. Setting this property will
6483 | 	 * pass authentication headers (Authorization, Cookie, etc.) through to
6484 | 	 * the origin.
6485 | 	 */
6486 | 	"origin-auth"?: "share-publicly";
6487 | 	/**
6488 | 	 * Adds a border around the image. The border is added after resizing. Border
6489 | 	 * width takes dpr into account, and can be specified either using a single
6490 | 	 * width property, or individually for each side.
6491 | 	 */
6492 | 	border?:
6493 | 		| {
6494 | 				color: string;
6495 | 				width: number;
6496 | 		  }
6497 | 		| {
6498 | 				color: string;
6499 | 				top: number;
6500 | 				right: number;
6501 | 				bottom: number;
6502 | 				left: number;
6503 | 		  };
6504 | 	/**
6505 | 	 * Increase brightness by a factor. A value of 1.0 equals no change, a value
6506 | 	 * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
6507 | 	 * 0 is ignored.
6508 | 	 */
6509 | 	brightness?: number;
6510 | 	/**
6511 | 	 * Increase contrast by a factor. A value of 1.0 equals no change, a value of
6512 | 	 * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
6513 | 	 * ignored.
6514 | 	 */
6515 | 	contrast?: number;
6516 | 	/**
6517 | 	 * Increase exposure by a factor. A value of 1.0 equals no change, a value of
6518 | 	 * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
6519 | 	 */
6520 | 	gamma?: number;
6521 | 	/**
6522 | 	 * Increase contrast by a factor. A value of 1.0 equals no change, a value of
6523 | 	 * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
6524 | 	 * ignored.
6525 | 	 */
6526 | 	saturation?: number;
6527 | 	/**
6528 | 	 * Flips the images horizontally, vertically, or both. Flipping is applied before
6529 | 	 * rotation, so if you apply flip=h,rotate=90 then the image will be flipped
6530 | 	 * horizontally, then rotated by 90 degrees.
6531 | 	 */
6532 | 	flip?: "h" | "v" | "hv";
6533 | 	/**
6534 | 	 * Slightly reduces latency on a cache miss by selecting a
6535 | 	 * quickest-to-compress file format, at a cost of increased file size and
6536 | 	 * lower image quality. It will usually override the format option and choose
6537 | 	 * JPEG over WebP or AVIF. We do not recommend using this option, except in
6538 | 	 * unusual circumstances like resizing uncacheable dynamically-generated
6539 | 	 * images.
6540 | 	 */
6541 | 	compression?: "fast";
6542 | }
6543 | interface RequestInitCfPropertiesImageMinify {
6544 | 	javascript?: boolean;
6545 | 	css?: boolean;
6546 | 	html?: boolean;
6547 | }
6548 | interface RequestInitCfPropertiesR2 {
6549 | 	/**
6550 | 	 * Colo id of bucket that an object is stored in
6551 | 	 */
6552 | 	bucketColoId?: number;
6553 | }
6554 | /**
6555 |  * Request metadata provided by Cloudflare's edge.
6556 |  */
6557 | type IncomingRequestCfProperties<HostMetadata = unknown> =
6558 | 	IncomingRequestCfPropertiesBase &
6559 | 		IncomingRequestCfPropertiesBotManagementEnterprise &
6560 | 		IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> &
6561 | 		IncomingRequestCfPropertiesGeographicInformation &
6562 | 		IncomingRequestCfPropertiesCloudflareAccessOrApiShield;
6563 | interface IncomingRequestCfPropertiesBase extends Record<string, unknown> {
6564 | 	/**
6565 | 	 * [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request.
6566 | 	 *
6567 | 	 * @example 395747
6568 | 	 */
6569 | 	asn?: number;
6570 | 	/**
6571 | 	 * The organization which owns the ASN of the incoming request.
6572 | 	 *
6573 | 	 * @example "Google Cloud"
6574 | 	 */
6575 | 	asOrganization?: string;
6576 | 	/**
6577 | 	 * The original value of the `Accept-Encoding` header if Cloudflare modified it.
6578 | 	 *
6579 | 	 * @example "gzip, deflate, br"
6580 | 	 */
6581 | 	clientAcceptEncoding?: string;
6582 | 	/**
6583 | 	 * The number of milliseconds it took for the request to reach your worker.
6584 | 	 *
6585 | 	 * @example 22
6586 | 	 */
6587 | 	clientTcpRtt?: number;
6588 | 	/**
6589 | 	 * The three-letter [IATA](https://en.wikipedia.org/wiki/IATA_airport_code)
6590 | 	 * airport code of the data center that the request hit.
6591 | 	 *
6592 | 	 * @example "DFW"
6593 | 	 */
6594 | 	colo: string;
6595 | 	/**
6596 | 	 * Represents the upstream's response to a
6597 | 	 * [TCP `keepalive` message](https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)
6598 | 	 * from cloudflare.
6599 | 	 *
6600 | 	 * For workers with no upstream, this will always be `1`.
6601 | 	 *
6602 | 	 * @example 3
6603 | 	 */
6604 | 	edgeRequestKeepAliveStatus: IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus;
6605 | 	/**
6606 | 	 * The HTTP Protocol the request used.
6607 | 	 *
6608 | 	 * @example "HTTP/2"
6609 | 	 */
6610 | 	httpProtocol: string;
6611 | 	/**
6612 | 	 * The browser-requested prioritization information in the request object.
6613 | 	 *
6614 | 	 * If no information was set, defaults to the empty string `""`
6615 | 	 *
6616 | 	 * @example "weight=192;exclusive=0;group=3;group-weight=127"
6617 | 	 * @default ""
6618 | 	 */
6619 | 	requestPriority: string;
6620 | 	/**
6621 | 	 * The TLS version of the connection to Cloudflare.
6622 | 	 * In requests served over plaintext (without TLS), this property is the empty string `""`.
6623 | 	 *
6624 | 	 * @example "TLSv1.3"
6625 | 	 */
6626 | 	tlsVersion: string;
6627 | 	/**
6628 | 	 * The cipher for the connection to Cloudflare.
6629 | 	 * In requests served over plaintext (without TLS), this property is the empty string `""`.
6630 | 	 *
6631 | 	 * @example "AEAD-AES128-GCM-SHA256"
6632 | 	 */
6633 | 	tlsCipher: string;
6634 | 	/**
6635 | 	 * Metadata containing the [`HELLO`](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2) and [`FINISHED`](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9) messages from this request's TLS handshake.
6636 | 	 *
6637 | 	 * If the incoming request was served over plaintext (without TLS) this field is undefined.
6638 | 	 */
6639 | 	tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata;
6640 | }
6641 | interface IncomingRequestCfPropertiesBotManagementBase {
6642 | 	/**
6643 | 	 * Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot,
6644 | 	 * represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human).
6645 | 	 *
6646 | 	 * @example 54
6647 | 	 */
6648 | 	score: number;
6649 | 	/**
6650 | 	 * A boolean value that is true if the request comes from a good bot, like Google or Bing.
6651 | 	 * Most customers choose to allow this traffic. For more details, see [Traffic from known bots](https://developers.cloudflare.com/firewall/known-issues-and-faq/#how-does-firewall-rules-handle-traffic-from-known-bots).
6652 | 	 */
6653 | 	verifiedBot: boolean;
6654 | 	/**
6655 | 	 * A boolean value that is true if the request originates from a
6656 | 	 * Cloudflare-verified proxy service.
6657 | 	 */
6658 | 	corporateProxy: boolean;
6659 | 	/**
6660 | 	 * A boolean value that's true if the request matches [file extensions](https://developers.cloudflare.com/bots/reference/static-resources/) for many types of static resources.
6661 | 	 */
6662 | 	staticResource: boolean;
6663 | 	/**
6664 | 	 * List of IDs that correlate to the Bot Management heuristic detections made on a request (you can have multiple heuristic detections on the same request).
6665 | 	 */
6666 | 	detectionIds: number[];
6667 | }
6668 | interface IncomingRequestCfPropertiesBotManagement {
6669 | 	/**
6670 | 	 * Results of Cloudflare's Bot Management analysis
6671 | 	 */
6672 | 	botManagement: IncomingRequestCfPropertiesBotManagementBase;
6673 | 	/**
6674 | 	 * Duplicate of `botManagement.score`.
6675 | 	 *
6676 | 	 * @deprecated
6677 | 	 */
6678 | 	clientTrustScore: number;
6679 | }
6680 | interface IncomingRequestCfPropertiesBotManagementEnterprise
6681 | 	extends IncomingRequestCfPropertiesBotManagement {
6682 | 	/**
6683 | 	 * Results of Cloudflare's Bot Management analysis
6684 | 	 */
6685 | 	botManagement: IncomingRequestCfPropertiesBotManagementBase & {
6686 | 		/**
6687 | 		 * A [JA3 Fingerprint](https://developers.cloudflare.com/bots/concepts/ja3-fingerprint/) to help profile specific SSL/TLS clients
6688 | 		 * across different destination IPs, Ports, and X509 certificates.
6689 | 		 */
6690 | 		ja3Hash: string;
6691 | 	};
6692 | }
6693 | interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> {
6694 | 	/**
6695 | 	 * Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
6696 | 	 *
6697 | 	 * This field is only present if you have Cloudflare for SaaS enabled on your account
6698 | 	 * and you have followed the [required steps to enable it]((https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/)).
6699 | 	 */
6700 | 	hostMetadata?: HostMetadata;
6701 | }
6702 | interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
6703 | 	/**
6704 | 	 * Information about the client certificate presented to Cloudflare.
6705 | 	 *
6706 | 	 * This is populated when the incoming request is served over TLS using
6707 | 	 * either Cloudflare Access or API Shield (mTLS)
6708 | 	 * and the presented SSL certificate has a valid
6709 | 	 * [Certificate Serial Number](https://ldapwiki.com/wiki/Certificate%20Serial%20Number)
6710 | 	 * (i.e., not `null` or `""`).
6711 | 	 *
6712 | 	 * Otherwise, a set of placeholder values are used.
6713 | 	 *
6714 | 	 * The property `certPresented` will be set to `"1"` when
6715 | 	 * the object is populated (i.e. the above conditions were met).
6716 | 	 */
6717 | 	tlsClientAuth:
6718 | 		| IncomingRequestCfPropertiesTLSClientAuth
6719 | 		| IncomingRequestCfPropertiesTLSClientAuthPlaceholder;
6720 | }
6721 | /**
6722 |  * Metadata about the request's TLS handshake
6723 |  */
6724 | interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
6725 | 	/**
6726 | 	 * The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal
6727 | 	 *
6728 | 	 * @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d"
6729 | 	 */
6730 | 	clientHandshake: string;
6731 | 	/**
6732 | 	 * The server's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal
6733 | 	 *
6734 | 	 * @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d"
6735 | 	 */
6736 | 	serverHandshake: string;
6737 | 	/**
6738 | 	 * The client's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal
6739 | 	 *
6740 | 	 * @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b"
6741 | 	 */
6742 | 	clientFinished: string;
6743 | 	/**
6744 | 	 * The server's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal
6745 | 	 *
6746 | 	 * @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b"
6747 | 	 */
6748 | 	serverFinished: string;
6749 | }
6750 | /**
6751 |  * Geographic data about the request's origin.
6752 |  */
6753 | interface IncomingRequestCfPropertiesGeographicInformation {
6754 | 	/**
6755 | 	 * The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
6756 | 	 *
6757 | 	 * If your worker is [configured to accept TOR connections](https://support.cloudflare.com/hc/en-us/articles/203306930-Understanding-Cloudflare-Tor-support-and-Onion-Routing), this may also be `"T1"`, indicating a request that originated over TOR.
6758 | 	 *
6759 | 	 * If Cloudflare is unable to determine where the request originated this property is omitted.
6760 | 	 *
6761 | 	 * The country code `"T1"` is used for requests originating on TOR.
6762 | 	 *
6763 | 	 * @example "GB"
6764 | 	 */
6765 | 	country?: Iso3166Alpha2Code | "T1";
6766 | 	/**
6767 | 	 * If present, this property indicates that the request originated in the EU
6768 | 	 *
6769 | 	 * @example "1"
6770 | 	 */
6771 | 	isEUCountry?: "1";
6772 | 	/**
6773 | 	 * A two-letter code indicating the continent the request originated from.
6774 | 	 *
6775 | 	 * @example "AN"
6776 | 	 */
6777 | 	continent?: ContinentCode;
6778 | 	/**
6779 | 	 * The city the request originated from
6780 | 	 *
6781 | 	 * @example "Austin"
6782 | 	 */
6783 | 	city?: string;
6784 | 	/**
6785 | 	 * Postal code of the incoming request
6786 | 	 *
6787 | 	 * @example "78701"
6788 | 	 */
6789 | 	postalCode?: string;
6790 | 	/**
6791 | 	 * Latitude of the incoming request
6792 | 	 *
6793 | 	 * @example "30.27130"
6794 | 	 */
6795 | 	latitude?: string;
6796 | 	/**
6797 | 	 * Longitude of the incoming request
6798 | 	 *
6799 | 	 * @example "-97.74260"
6800 | 	 */
6801 | 	longitude?: string;
6802 | 	/**
6803 | 	 * Timezone of the incoming request
6804 | 	 *
6805 | 	 * @example "America/Chicago"
6806 | 	 */
6807 | 	timezone?: string;
6808 | 	/**
6809 | 	 * If known, the ISO 3166-2 name for the first level region associated with
6810 | 	 * the IP address of the incoming request
6811 | 	 *
6812 | 	 * @example "Texas"
6813 | 	 */
6814 | 	region?: string;
6815 | 	/**
6816 | 	 * If known, the ISO 3166-2 code for the first-level region associated with
6817 | 	 * the IP address of the incoming request
6818 | 	 *
6819 | 	 * @example "TX"
6820 | 	 */
6821 | 	regionCode?: string;
6822 | 	/**
6823 | 	 * Metro code (DMA) of the incoming request
6824 | 	 *
6825 | 	 * @example "635"
6826 | 	 */
6827 | 	metroCode?: string;
6828 | }
6829 | /** Data about the incoming request's TLS certificate */
6830 | interface IncomingRequestCfPropertiesTLSClientAuth {
6831 | 	/** Always `"1"`, indicating that the certificate was presented */
6832 | 	certPresented: "1";
6833 | 	/**
6834 | 	 * Result of certificate verification.
6835 | 	 *
6836 | 	 * @example "FAILED:self signed certificate"
6837 | 	 */
6838 | 	certVerified: Exclude<CertVerificationStatus, "NONE">;
6839 | 	/** The presented certificate's revokation status.
6840 | 	 *
6841 | 	 * - A value of `"1"` indicates the certificate has been revoked
6842 | 	 * - A value of `"0"` indicates the certificate has not been revoked
6843 | 	 */
6844 | 	certRevoked: "1" | "0";
6845 | 	/**
6846 | 	 * The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html)
6847 | 	 *
6848 | 	 * @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"
6849 | 	 */
6850 | 	certIssuerDN: string;
6851 | 	/**
6852 | 	 * The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html)
6853 | 	 *
6854 | 	 * @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"
6855 | 	 */
6856 | 	certSubjectDN: string;
6857 | 	/**
6858 | 	 * The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted)
6859 | 	 *
6860 | 	 * @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"
6861 | 	 */
6862 | 	certIssuerDNRFC2253: string;
6863 | 	/**
6864 | 	 * The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted)
6865 | 	 *
6866 | 	 * @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"
6867 | 	 */
6868 | 	certSubjectDNRFC2253: string;
6869 | 	/** The certificate issuer's distinguished name (legacy policies) */
6870 | 	certIssuerDNLegacy: string;
6871 | 	/** The certificate subject's distinguished name (legacy policies) */
6872 | 	certSubjectDNLegacy: string;
6873 | 	/**
6874 | 	 * The certificate's serial number
6875 | 	 *
6876 | 	 * @example "00936EACBE07F201DF"
6877 | 	 */
6878 | 	certSerial: string;
6879 | 	/**
6880 | 	 * The certificate issuer's serial number
6881 | 	 *
6882 | 	 * @example "2489002934BDFEA34"
6883 | 	 */
6884 | 	certIssuerSerial: string;
6885 | 	/**
6886 | 	 * The certificate's Subject Key Identifier
6887 | 	 *
6888 | 	 * @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4"
6889 | 	 */
6890 | 	certSKI: string;
6891 | 	/**
6892 | 	 * The certificate issuer's Subject Key Identifier
6893 | 	 *
6894 | 	 * @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4"
6895 | 	 */
6896 | 	certIssuerSKI: string;
6897 | 	/**
6898 | 	 * The certificate's SHA-1 fingerprint
6899 | 	 *
6900 | 	 * @example "6b9109f323999e52259cda7373ff0b4d26bd232e"
6901 | 	 */
6902 | 	certFingerprintSHA1: string;
6903 | 	/**
6904 | 	 * The certificate's SHA-256 fingerprint
6905 | 	 *
6906 | 	 * @example "acf77cf37b4156a2708e34c4eb755f9b5dbbe5ebb55adfec8f11493438d19e6ad3f157f81fa3b98278453d5652b0c1fd1d71e5695ae4d709803a4d3f39de9dea"
6907 | 	 */
6908 | 	certFingerprintSHA256: string;
6909 | 	/**
6910 | 	 * The effective starting date of the certificate
6911 | 	 *
6912 | 	 * @example "Dec 22 19:39:00 2018 GMT"
6913 | 	 */
6914 | 	certNotBefore: string;
6915 | 	/**
6916 | 	 * The effective expiration date of the certificate
6917 | 	 *
6918 | 	 * @example "Dec 22 19:39:00 2018 GMT"
6919 | 	 */
6920 | 	certNotAfter: string;
6921 | }
6922 | /** Placeholder values for TLS Client Authorization */
6923 | interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
6924 | 	certPresented: "0";
6925 | 	certVerified: "NONE";
6926 | 	certRevoked: "0";
6927 | 	certIssuerDN: "";
6928 | 	certSubjectDN: "";
6929 | 	certIssuerDNRFC2253: "";
6930 | 	certSubjectDNRFC2253: "";
6931 | 	certIssuerDNLegacy: "";
6932 | 	certSubjectDNLegacy: "";
6933 | 	certSerial: "";
6934 | 	certIssuerSerial: "";
6935 | 	certSKI: "";
6936 | 	certIssuerSKI: "";
6937 | 	certFingerprintSHA1: "";
6938 | 	certFingerprintSHA256: "";
6939 | 	certNotBefore: "";
6940 | 	certNotAfter: "";
6941 | }
6942 | /** Possible outcomes of TLS verification */
6943 | declare type CertVerificationStatus =
6944 | 	/** Authentication succeeded */
6945 | 	| "SUCCESS"
6946 | 	/** No certificate was presented */
6947 | 	| "NONE"
6948 | 	/** Failed because the certificate was self-signed */
6949 | 	| "FAILED:self signed certificate"
6950 | 	/** Failed because the certificate failed a trust chain check */
6951 | 	| "FAILED:unable to verify the first certificate"
6952 | 	/** Failed because the certificate not yet valid */
6953 | 	| "FAILED:certificate is not yet valid"
6954 | 	/** Failed because the certificate is expired */
6955 | 	| "FAILED:certificate has expired"
6956 | 	/** Failed for another unspecified reason */
6957 | 	| "FAILED";
6958 | /**
6959 |  * An upstream endpoint's response to a TCP `keepalive` message from Cloudflare.
6960 |  */
6961 | declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
6962 | 	| 0 /** Unknown */
6963 | 	| 1 /** no keepalives (not found) */
6964 | 	| 2 /** no connection re-use, opening keepalive connection failed */
6965 | 	| 3 /** no connection re-use, keepalive accepted and saved */
6966 | 	| 4 /** connection re-use, refused by the origin server (`TCP FIN`) */
6967 | 	| 5; /** connection re-use, accepted by the origin server */
6968 | /** ISO 3166-1 Alpha-2 codes */
6969 | declare type Iso3166Alpha2Code =
6970 | 	| "AD"
6971 | 	| "AE"
6972 | 	| "AF"
6973 | 	| "AG"
6974 | 	| "AI"
6975 | 	| "AL"
6976 | 	| "AM"
6977 | 	| "AO"
6978 | 	| "AQ"
6979 | 	| "AR"
6980 | 	| "AS"
6981 | 	| "AT"
6982 | 	| "AU"
6983 | 	| "AW"
6984 | 	| "AX"
6985 | 	| "AZ"
6986 | 	| "BA"
6987 | 	| "BB"
6988 | 	| "BD"
6989 | 	| "BE"
6990 | 	| "BF"
6991 | 	| "BG"
6992 | 	| "BH"
6993 | 	| "BI"
6994 | 	| "BJ"
6995 | 	| "BL"
6996 | 	| "BM"
6997 | 	| "BN"
6998 | 	| "BO"
6999 | 	| "BQ"
7000 | 	| "BR"
7001 | 	| "BS"
7002 | 	| "BT"
7003 | 	| "BV"
7004 | 	| "BW"
7005 | 	| "BY"
7006 | 	| "BZ"
7007 | 	| "CA"
7008 | 	| "CC"
7009 | 	| "CD"
7010 | 	| "CF"
7011 | 	| "CG"
7012 | 	| "CH"
7013 | 	| "CI"
7014 | 	| "CK"
7015 | 	| "CL"
7016 | 	| "CM"
7017 | 	| "CN"
7018 | 	| "CO"
7019 | 	| "CR"
7020 | 	| "CU"
7021 | 	| "CV"
7022 | 	| "CW"
7023 | 	| "CX"
7024 | 	| "CY"
7025 | 	| "CZ"
7026 | 	| "DE"
7027 | 	| "DJ"
7028 | 	| "DK"
7029 | 	| "DM"
7030 | 	| "DO"
7031 | 	| "DZ"
7032 | 	| "EC"
7033 | 	| "EE"
7034 | 	| "EG"
7035 | 	| "EH"
7036 | 	| "ER"
7037 | 	| "ES"
7038 | 	| "ET"
7039 | 	| "FI"
7040 | 	| "FJ"
7041 | 	| "FK"
7042 | 	| "FM"
7043 | 	| "FO"
7044 | 	| "FR"
7045 | 	| "GA"
7046 | 	| "GB"
7047 | 	| "GD"
7048 | 	| "GE"
7049 | 	| "GF"
7050 | 	| "GG"
7051 | 	| "GH"
7052 | 	| "GI"
7053 | 	| "GL"
7054 | 	| "GM"
7055 | 	| "GN"
7056 | 	| "GP"
7057 | 	| "GQ"
7058 | 	| "GR"
7059 | 	| "GS"
7060 | 	| "GT"
7061 | 	| "GU"
7062 | 	| "GW"
7063 | 	| "GY"
7064 | 	| "HK"
7065 | 	| "HM"
7066 | 	| "HN"
7067 | 	| "HR"
7068 | 	| "HT"
7069 | 	| "HU"
7070 | 	| "ID"
7071 | 	| "IE"
7072 | 	| "IL"
7073 | 	| "IM"
7074 | 	| "IN"
7075 | 	| "IO"
7076 | 	| "IQ"
7077 | 	| "IR"
7078 | 	| "IS"
7079 | 	| "IT"
7080 | 	| "JE"
7081 | 	| "JM"
7082 | 	| "JO"
7083 | 	| "JP"
7084 | 	| "KE"
7085 | 	| "KG"
7086 | 	| "KH"
7087 | 	| "KI"
7088 | 	| "KM"
7089 | 	| "KN"
7090 | 	| "KP"
7091 | 	| "KR"
7092 | 	| "KW"
7093 | 	| "KY"
7094 | 	| "KZ"
7095 | 	| "LA"
7096 | 	| "LB"
7097 | 	| "LC"
7098 | 	| "LI"
7099 | 	| "LK"
7100 | 	| "LR"
7101 | 	| "LS"
7102 | 	| "LT"
7103 | 	| "LU"
7104 | 	| "LV"
7105 | 	| "LY"
7106 | 	| "MA"
7107 | 	| "MC"
7108 | 	| "MD"
7109 | 	| "ME"
7110 | 	| "MF"
7111 | 	| "MG"
7112 | 	| "MH"
7113 | 	| "MK"
7114 | 	| "ML"
7115 | 	| "MM"
7116 | 	| "MN"
7117 | 	| "MO"
7118 | 	| "MP"
7119 | 	| "MQ"
7120 | 	| "MR"
7121 | 	| "MS"
7122 | 	| "MT"
7123 | 	| "MU"
7124 | 	| "MV"
7125 | 	| "MW"
7126 | 	| "MX"
7127 | 	| "MY"
7128 | 	| "MZ"
7129 | 	| "NA"
7130 | 	| "NC"
7131 | 	| "NE"
7132 | 	| "NF"
7133 | 	| "NG"
7134 | 	| "NI"
7135 | 	| "NL"
7136 | 	| "NO"
7137 | 	| "NP"
7138 | 	| "NR"
7139 | 	| "NU"
7140 | 	| "NZ"
7141 | 	| "OM"
7142 | 	| "PA"
7143 | 	| "PE"
7144 | 	| "PF"
7145 | 	| "PG"
7146 | 	| "PH"
7147 | 	| "PK"
7148 | 	| "PL"
7149 | 	| "PM"
7150 | 	| "PN"
7151 | 	| "PR"
7152 | 	| "PS"
7153 | 	| "PT"
7154 | 	| "PW"
7155 | 	| "PY"
7156 | 	| "QA"
7157 | 	| "RE"
7158 | 	| "RO"
7159 | 	| "RS"
7160 | 	| "RU"
7161 | 	| "RW"
7162 | 	| "SA"
7163 | 	| "SB"
7164 | 	| "SC"
7165 | 	| "SD"
7166 | 	| "SE"
7167 | 	| "SG"
7168 | 	| "SH"
7169 | 	| "SI"
7170 | 	| "SJ"
7171 | 	| "SK"
7172 | 	| "SL"
7173 | 	| "SM"
7174 | 	| "SN"
7175 | 	| "SO"
7176 | 	| "SR"
7177 | 	| "SS"
7178 | 	| "ST"
7179 | 	| "SV"
7180 | 	| "SX"
7181 | 	| "SY"
7182 | 	| "SZ"
7183 | 	| "TC"
7184 | 	| "TD"
7185 | 	| "TF"
7186 | 	| "TG"
7187 | 	| "TH"
7188 | 	| "TJ"
7189 | 	| "TK"
7190 | 	| "TL"
7191 | 	| "TM"
7192 | 	| "TN"
7193 | 	| "TO"
7194 | 	| "TR"
7195 | 	| "TT"
7196 | 	| "TV"
7197 | 	| "TW"
7198 | 	| "TZ"
7199 | 	| "UA"
7200 | 	| "UG"
7201 | 	| "UM"
7202 | 	| "US"
7203 | 	| "UY"
7204 | 	| "UZ"
7205 | 	| "VA"
7206 | 	| "VC"
7207 | 	| "VE"
7208 | 	| "VG"
7209 | 	| "VI"
7210 | 	| "VN"
7211 | 	| "VU"
7212 | 	| "WF"
7213 | 	| "WS"
7214 | 	| "YE"
7215 | 	| "YT"
7216 | 	| "ZA"
7217 | 	| "ZM"
7218 | 	| "ZW";
7219 | /** The 2-letter continent codes Cloudflare uses */
7220 | declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
7221 | type CfProperties<HostMetadata = unknown> =
7222 | 	| IncomingRequestCfProperties<HostMetadata>
7223 | 	| RequestInitCfProperties;
7224 | interface D1Meta {
7225 | 	duration: number;
7226 | 	size_after: number;
7227 | 	rows_read: number;
7228 | 	rows_written: number;
7229 | 	last_row_id: number;
7230 | 	changed_db: boolean;
7231 | 	changes: number;
7232 | 	/**
7233 | 	 * The region of the database instance that executed the query.
7234 | 	 */
7235 | 	served_by_region?: string;
7236 | 	/**
7237 | 	 * True if-and-only-if the database instance that executed the query was the primary.
7238 | 	 */
7239 | 	served_by_primary?: boolean;
7240 | 	timings?: {
7241 | 		/**
7242 | 		 * The duration of the SQL query execution by the database instance. It doesn't include any network time.
7243 | 		 */
7244 | 		sql_duration_ms: number;
7245 | 	};
7246 | }
7247 | interface D1Response {
7248 | 	success: true;
7249 | 	meta: D1Meta & Record<string, unknown>;
7250 | 	error?: never;
7251 | }
7252 | type D1Result<T = unknown> = D1Response & {
7253 | 	results: T[];
7254 | };
7255 | interface D1ExecResult {
7256 | 	count: number;
7257 | 	duration: number;
7258 | }
7259 | type D1SessionConstraint =
7260 | 	// Indicates that the first query should go to the primary, and the rest queries
7261 | 	// using the same D1DatabaseSession will go to any replica that is consistent with
7262 | 	// the bookmark maintained by the session (returned by the first query).
7263 | 	| "first-primary"
7264 | 	// Indicates that the first query can go anywhere (primary or replica), and the rest queries
7265 | 	// using the same D1DatabaseSession will go to any replica that is consistent with
7266 | 	// the bookmark maintained by the session (returned by the first query).
7267 | 	| "first-unconstrained";
7268 | type D1SessionBookmark = string;
7269 | declare abstract class D1Database {
7270 | 	prepare(query: string): D1PreparedStatement;
7271 | 	batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
7272 | 	exec(query: string): Promise<D1ExecResult>;
7273 | 	/**
7274 | 	 * Creates a new D1 Session anchored at the given constraint or the bookmark.
7275 | 	 * All queries executed using the created session will have sequential consistency,
7276 | 	 * meaning that all writes done through the session will be visible in subsequent reads.
7277 | 	 *
7278 | 	 * @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
7279 | 	 */
7280 | 	withSession(
7281 | 		constraintOrBookmark?: D1SessionBookmark | D1SessionConstraint,
7282 | 	): D1DatabaseSession;
7283 | 	/**
7284 | 	 * @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
7285 | 	 */
7286 | 	dump(): Promise<ArrayBuffer>;
7287 | }
7288 | declare abstract class D1DatabaseSession {
7289 | 	prepare(query: string): D1PreparedStatement;
7290 | 	batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
7291 | 	/**
7292 | 	 * @returns The latest session bookmark across all executed queries on the session.
7293 | 	 *          If no query has been executed yet, `null` is returned.
7294 | 	 */
7295 | 	getBookmark(): D1SessionBookmark | null;
7296 | }
7297 | declare abstract class D1PreparedStatement {
7298 | 	bind(...values: unknown[]): D1PreparedStatement;
7299 | 	first<T = unknown>(colName: string): Promise<T | null>;
7300 | 	first<T = Record<string, unknown>>(): Promise<T | null>;
7301 | 	run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
7302 | 	all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
7303 | 	raw<T = unknown[]>(options: {
7304 | 		columnNames: true;
7305 | 	}): Promise<[string[], ...T[]]>;
7306 | 	raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
7307 | }
7308 | // `Disposable` was added to TypeScript's standard lib types in version 5.2.
7309 | // To support older TypeScript versions, define an empty `Disposable` interface.
7310 | // Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
7311 | // but this will ensure type checking on older versions still passes.
7312 | // TypeScript's interface merging will ensure our empty interface is effectively
7313 | // ignored when `Disposable` is included in the standard lib.
7314 | interface Disposable {}
7315 | /**
7316 |  * An email message that can be sent from a Worker.
7317 |  */
7318 | interface EmailMessage {
7319 | 	/**
7320 | 	 * Envelope From attribute of the email message.
7321 | 	 */
7322 | 	readonly from: string;
7323 | 	/**
7324 | 	 * Envelope To attribute of the email message.
7325 | 	 */
7326 | 	readonly to: string;
7327 | }
7328 | /**
7329 |  * An email message that is sent to a consumer Worker and can be rejected/forwarded.
7330 |  */
7331 | interface ForwardableEmailMessage extends EmailMessage {
7332 | 	/**
7333 | 	 * Stream of the email message content.
7334 | 	 */
7335 | 	readonly raw: ReadableStream<Uint8Array>;
7336 | 	/**
7337 | 	 * An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
7338 | 	 */
7339 | 	readonly headers: Headers;
7340 | 	/**
7341 | 	 * Size of the email message content.
7342 | 	 */
7343 | 	readonly rawSize: number;
7344 | 	/**
7345 | 	 * Reject this email message by returning a permanent SMTP error back to the connecting client including the given reason.
7346 | 	 * @param reason The reject reason.
7347 | 	 * @returns void
7348 | 	 */
7349 | 	setReject(reason: string): void;
7350 | 	/**
7351 | 	 * Forward this email message to a verified destination address of the account.
7352 | 	 * @param rcptTo Verified destination address.
7353 | 	 * @param headers A [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
7354 | 	 * @returns A promise that resolves when the email message is forwarded.
7355 | 	 */
7356 | 	forward(rcptTo: string, headers?: Headers): Promise<void>;
7357 | 	/**
7358 | 	 * Reply to the sender of this email message with a new EmailMessage object.
7359 | 	 * @param message The reply message.
7360 | 	 * @returns A promise that resolves when the email message is replied.
7361 | 	 */
7362 | 	reply(message: EmailMessage): Promise<void>;
7363 | }
7364 | /**
7365 |  * A binding that allows a Worker to send email messages.
7366 |  */
7367 | interface SendEmail {
7368 | 	send(message: EmailMessage): Promise<void>;
7369 | }
7370 | declare abstract class EmailEvent extends ExtendableEvent {
7371 | 	readonly message: ForwardableEmailMessage;
7372 | }
7373 | declare type EmailExportedHandler<Env = unknown> = (
7374 | 	message: ForwardableEmailMessage,
7375 | 	env: Env,
7376 | 	ctx: ExecutionContext,
7377 | ) => void | Promise<void>;
7378 | declare module "cloudflare:email" {
7379 | 	let _EmailMessage: {
7380 | 		prototype: EmailMessage;
7381 | 		new (from: string, to: string, raw: ReadableStream | string): EmailMessage;
7382 | 	};
7383 | 	export { _EmailMessage as EmailMessage };
7384 | }
7385 | /**
7386 |  * Hello World binding to serve as an explanatory example. DO NOT USE
7387 |  */
7388 | interface HelloWorldBinding {
7389 | 	/**
7390 | 	 * Retrieve the current stored value
7391 | 	 */
7392 | 	get(): Promise<{
7393 | 		value: string;
7394 | 		ms?: number;
7395 | 	}>;
7396 | 	/**
7397 | 	 * Set a new stored value
7398 | 	 */
7399 | 	set(value: string): Promise<void>;
7400 | }
7401 | interface Hyperdrive {
7402 | 	/**
7403 | 	 * Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
7404 | 	 *
7405 | 	 * Calling this method returns an idential socket to if you call
7406 | 	 * `connect("host:port")` using the `host` and `port` fields from this object.
7407 | 	 * Pick whichever approach works better with your preferred DB client library.
7408 | 	 *
7409 | 	 * Note that this socket is not yet authenticated -- it's expected that your
7410 | 	 * code (or preferably, the client library of your choice) will authenticate
7411 | 	 * using the information in this class's readonly fields.
7412 | 	 */
7413 | 	connect(): Socket;
7414 | 	/**
7415 | 	 * A valid DB connection string that can be passed straight into the typical
7416 | 	 * client library/driver/ORM. This will typically be the easiest way to use
7417 | 	 * Hyperdrive.
7418 | 	 */
7419 | 	readonly connectionString: string;
7420 | 	/*
7421 | 	 * A randomly generated hostname that is only valid within the context of the
7422 | 	 * currently running Worker which, when passed into `connect()` function from
7423 | 	 * the "cloudflare:sockets" module, will connect to the Hyperdrive instance
7424 | 	 * for your database.
7425 | 	 */
7426 | 	readonly host: string;
7427 | 	/*
7428 | 	 * The port that must be paired the the host field when connecting.
7429 | 	 */
7430 | 	readonly port: number;
7431 | 	/*
7432 | 	 * The username to use when authenticating to your database via Hyperdrive.
7433 | 	 * Unlike the host and password, this will be the same every time
7434 | 	 */
7435 | 	readonly user: string;
7436 | 	/*
7437 | 	 * The randomly generated password to use when authenticating to your
7438 | 	 * database via Hyperdrive. Like the host field, this password is only valid
7439 | 	 * within the context of the currently running Worker instance from which
7440 | 	 * it's read.
7441 | 	 */
7442 | 	readonly password: string;
7443 | 	/*
7444 | 	 * The name of the database to connect to.
7445 | 	 */
7446 | 	readonly database: string;
7447 | }
7448 | // Copyright (c) 2024 Cloudflare, Inc.
7449 | // Licensed under the Apache 2.0 license found in the LICENSE file or at:
7450 | //     https://opensource.org/licenses/Apache-2.0
7451 | type ImageInfoResponse =
7452 | 	| {
7453 | 			format: "image/svg+xml";
7454 | 	  }
7455 | 	| {
7456 | 			format: string;
7457 | 			fileSize: number;
7458 | 			width: number;
7459 | 			height: number;
7460 | 	  };
7461 | type ImageTransform = {
7462 | 	width?: number;
7463 | 	height?: number;
7464 | 	background?: string;
7465 | 	blur?: number;
7466 | 	border?:
7467 | 		| {
7468 | 				color?: string;
7469 | 				width?: number;
7470 | 		  }
7471 | 		| {
7472 | 				top?: number;
7473 | 				bottom?: number;
7474 | 				left?: number;
7475 | 				right?: number;
7476 | 		  };
7477 | 	brightness?: number;
7478 | 	contrast?: number;
7479 | 	fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
7480 | 	flip?: "h" | "v" | "hv";
7481 | 	gamma?: number;
7482 | 	gravity?:
7483 | 		| "left"
7484 | 		| "right"
7485 | 		| "top"
7486 | 		| "bottom"
7487 | 		| "center"
7488 | 		| "auto"
7489 | 		| "entropy"
7490 | 		| {
7491 | 				x?: number;
7492 | 				y?: number;
7493 | 				mode: "remainder" | "box-center";
7494 | 		  };
7495 | 	rotate?: 0 | 90 | 180 | 270;
7496 | 	saturation?: number;
7497 | 	sharpen?: number;
7498 | 	trim?:
7499 | 		| "border"
7500 | 		| {
7501 | 				top?: number;
7502 | 				bottom?: number;
7503 | 				left?: number;
7504 | 				right?: number;
7505 | 				width?: number;
7506 | 				height?: number;
7507 | 				border?:
7508 | 					| boolean
7509 | 					| {
7510 | 							color?: string;
7511 | 							tolerance?: number;
7512 | 							keep?: number;
7513 | 					  };
7514 | 		  };
7515 | };
7516 | type ImageDrawOptions = {
7517 | 	opacity?: number;
7518 | 	repeat?: boolean | string;
7519 | 	top?: number;
7520 | 	left?: number;
7521 | 	bottom?: number;
7522 | 	right?: number;
7523 | };
7524 | type ImageInputOptions = {
7525 | 	encoding?: "base64";
7526 | };
7527 | type ImageOutputOptions = {
7528 | 	format:
7529 | 		| "image/jpeg"
7530 | 		| "image/png"
7531 | 		| "image/gif"
7532 | 		| "image/webp"
7533 | 		| "image/avif"
7534 | 		| "rgb"
7535 | 		| "rgba";
7536 | 	quality?: number;
7537 | 	background?: string;
7538 | };
7539 | interface ImagesBinding {
7540 | 	/**
7541 | 	 * Get image metadata (type, width and height)
7542 | 	 * @throws {@link ImagesError} with code 9412 if input is not an image
7543 | 	 * @param stream The image bytes
7544 | 	 */
7545 | 	info(
7546 | 		stream: ReadableStream<Uint8Array>,
7547 | 		options?: ImageInputOptions,
7548 | 	): Promise<ImageInfoResponse>;
7549 | 	/**
7550 | 	 * Begin applying a series of transformations to an image
7551 | 	 * @param stream The image bytes
7552 | 	 * @returns A transform handle
7553 | 	 */
7554 | 	input(
7555 | 		stream: ReadableStream<Uint8Array>,
7556 | 		options?: ImageInputOptions,
7557 | 	): ImageTransformer;
7558 | }
7559 | interface ImageTransformer {
7560 | 	/**
7561 | 	 * Apply transform next, returning a transform handle.
7562 | 	 * You can then apply more transformations, draw, or retrieve the output.
7563 | 	 * @param transform
7564 | 	 */
7565 | 	transform(transform: ImageTransform): ImageTransformer;
7566 | 	/**
7567 | 	 * Draw an image on this transformer, returning a transform handle.
7568 | 	 * You can then apply more transformations, draw, or retrieve the output.
7569 | 	 * @param image The image (or transformer that will give the image) to draw
7570 | 	 * @param options The options configuring how to draw the image
7571 | 	 */
7572 | 	draw(
7573 | 		image: ReadableStream<Uint8Array> | ImageTransformer,
7574 | 		options?: ImageDrawOptions,
7575 | 	): ImageTransformer;
7576 | 	/**
7577 | 	 * Retrieve the image that results from applying the transforms to the
7578 | 	 * provided input
7579 | 	 * @param options Options that apply to the output e.g. output format
7580 | 	 */
7581 | 	output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
7582 | }
7583 | type ImageTransformationOutputOptions = {
7584 | 	encoding?: "base64";
7585 | };
7586 | interface ImageTransformationResult {
7587 | 	/**
7588 | 	 * The image as a response, ready to store in cache or return to users
7589 | 	 */
7590 | 	response(): Response;
7591 | 	/**
7592 | 	 * The content type of the returned image
7593 | 	 */
7594 | 	contentType(): string;
7595 | 	/**
7596 | 	 * The bytes of the response
7597 | 	 */
7598 | 	image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array>;
7599 | }
7600 | interface ImagesError extends Error {
7601 | 	readonly code: number;
7602 | 	readonly message: string;
7603 | 	readonly stack?: string;
7604 | }
7605 | type Params<P extends string = any> = Record<P, string | string[]>;
7606 | type EventContext<Env, P extends string, Data> = {
7607 | 	request: Request<unknown, IncomingRequestCfProperties<unknown>>;
7608 | 	functionPath: string;
7609 | 	waitUntil: (promise: Promise<any>) => void;
7610 | 	passThroughOnException: () => void;
7611 | 	next: (input?: Request | string, init?: RequestInit) => Promise<Response>;
7612 | 	env: Env & {
7613 | 		ASSETS: {
7614 | 			fetch: typeof fetch;
7615 | 		};
7616 | 	};
7617 | 	params: Params<P>;
7618 | 	data: Data;
7619 | };
7620 | type PagesFunction<
7621 | 	Env = unknown,
7622 | 	Params extends string = any,
7623 | 	Data extends Record<string, unknown> = Record<string, unknown>,
7624 | > = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
7625 | type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
7626 | 	request: Request<unknown, IncomingRequestCfProperties<unknown>>;
7627 | 	functionPath: string;
7628 | 	waitUntil: (promise: Promise<any>) => void;
7629 | 	passThroughOnException: () => void;
7630 | 	next: (input?: Request | string, init?: RequestInit) => Promise<Response>;
7631 | 	env: Env & {
7632 | 		ASSETS: {
7633 | 			fetch: typeof fetch;
7634 | 		};
7635 | 	};
7636 | 	params: Params<P>;
7637 | 	data: Data;
7638 | 	pluginArgs: PluginArgs;
7639 | };
7640 | type PagesPluginFunction<
7641 | 	Env = unknown,
7642 | 	Params extends string = any,
7643 | 	Data extends Record<string, unknown> = Record<string, unknown>,
7644 | 	PluginArgs = unknown,
7645 | > = (
7646 | 	context: EventPluginContext<Env, Params, Data, PluginArgs>,
7647 | ) => Response | Promise<Response>;
7648 | declare module "assets:*" {
7649 | 	export const onRequest: PagesFunction;
7650 | }
7651 | // Copyright (c) 2022-2023 Cloudflare, Inc.
7652 | // Licensed under the Apache 2.0 license found in the LICENSE file or at:
7653 | //     https://opensource.org/licenses/Apache-2.0
7654 | declare module "cloudflare:pipelines" {
7655 | 	export abstract class PipelineTransformationEntrypoint<
7656 | 		Env = unknown,
7657 | 		I extends PipelineRecord = PipelineRecord,
7658 | 		O extends PipelineRecord = PipelineRecord,
7659 | 	> {
7660 | 		protected env: Env;
7661 | 		protected ctx: ExecutionContext;
7662 | 		constructor(ctx: ExecutionContext, env: Env);
7663 | 		/**
7664 | 		 * run recieves an array of PipelineRecord which can be
7665 | 		 * transformed and returned to the pipeline
7666 | 		 * @param records Incoming records from the pipeline to be transformed
7667 | 		 * @param metadata Information about the specific pipeline calling the transformation entrypoint
7668 | 		 * @returns A promise containing the transformed PipelineRecord array
7669 | 		 */
7670 | 		public run(records: I[], metadata: PipelineBatchMetadata): Promise<O[]>;
7671 | 	}
7672 | 	export type PipelineRecord = Record<string, unknown>;
7673 | 	export type PipelineBatchMetadata = {
7674 | 		pipelineId: string;
7675 | 		pipelineName: string;
7676 | 	};
7677 | 	export interface Pipeline<T extends PipelineRecord = PipelineRecord> {
7678 | 		/**
7679 | 		 * The Pipeline interface represents the type of a binding to a Pipeline
7680 | 		 *
7681 | 		 * @param records The records to send to the pipeline
7682 | 		 */
7683 | 		send(records: T[]): Promise<void>;
7684 | 	}
7685 | }
7686 | // PubSubMessage represents an incoming PubSub message.
7687 | // The message includes metadata about the broker, the client, and the payload
7688 | // itself.
7689 | // https://developers.cloudflare.com/pub-sub/
7690 | interface PubSubMessage {
7691 | 	// Message ID
7692 | 	readonly mid: number;
7693 | 	// MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
7694 | 	readonly broker: string;
7695 | 	// The MQTT topic the message was sent on.
7696 | 	readonly topic: string;
7697 | 	// The client ID of the client that published this message.
7698 | 	readonly clientId: string;
7699 | 	// The unique identifier (JWT ID) used by the client to authenticate, if token
7700 | 	// auth was used.
7701 | 	readonly jti?: string;
7702 | 	// A Unix timestamp (seconds from Jan 1, 1970), set when the Pub/Sub Broker
7703 | 	// received the message from the client.
7704 | 	readonly receivedAt: number;
7705 | 	// An (optional) string with the MIME type of the payload, if set by the
7706 | 	// client.
7707 | 	readonly contentType: string;
7708 | 	// Set to 1 when the payload is a UTF-8 string
7709 | 	// https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901063
7710 | 	readonly payloadFormatIndicator: number;
7711 | 	// Pub/Sub (MQTT) payloads can be UTF-8 strings, or byte arrays.
7712 | 	// You can use payloadFormatIndicator to inspect this before decoding.
7713 | 	payload: string | Uint8Array;
7714 | }
7715 | // JsonWebKey extended by kid parameter
7716 | interface JsonWebKeyWithKid extends JsonWebKey {
7717 | 	// Key Identifier of the JWK
7718 | 	readonly kid: string;
7719 | }
7720 | interface RateLimitOptions {
7721 | 	key: string;
7722 | }
7723 | interface RateLimitOutcome {
7724 | 	success: boolean;
7725 | }
7726 | interface RateLimit {
7727 | 	/**
7728 | 	 * Rate limit a request based on the provided options.
7729 | 	 * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
7730 | 	 * @returns A promise that resolves with the outcome of the rate limit.
7731 | 	 */
7732 | 	limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
7733 | }
7734 | // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
7735 | // to referenced by `Fetcher`. This is included in the "importable" version of the types which
7736 | // strips all `module` blocks.
7737 | declare namespace Rpc {
7738 | 	// Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
7739 | 	// TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
7740 | 	// For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
7741 | 	// accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
7742 | 	export const __RPC_STUB_BRAND: "__RPC_STUB_BRAND";
7743 | 	export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
7744 | 	export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
7745 | 	export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
7746 | 	export const __WORKFLOW_ENTRYPOINT_BRAND: "__WORKFLOW_ENTRYPOINT_BRAND";
7747 | 	export interface RpcTargetBranded {
7748 | 		[__RPC_TARGET_BRAND]: never;
7749 | 	}
7750 | 	export interface WorkerEntrypointBranded {
7751 | 		[__WORKER_ENTRYPOINT_BRAND]: never;
7752 | 	}
7753 | 	export interface DurableObjectBranded {
7754 | 		[__DURABLE_OBJECT_BRAND]: never;
7755 | 	}
7756 | 	export interface WorkflowEntrypointBranded {
7757 | 		[__WORKFLOW_ENTRYPOINT_BRAND]: never;
7758 | 	}
7759 | 	export type EntrypointBranded =
7760 | 		| WorkerEntrypointBranded
7761 | 		| DurableObjectBranded
7762 | 		| WorkflowEntrypointBranded;
7763 | 	// Types that can be used through `Stub`s
7764 | 	export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
7765 | 	// Types that can be passed over RPC
7766 | 	// The reason for using a generic type here is to build a serializable subset of structured
7767 | 	//   cloneable composite types. This allows types defined with the "interface" keyword to pass the
7768 | 	//   serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
7769 | 	type Serializable<T> =
7770 | 		// Structured cloneables
7771 | 		| BaseType
7772 | 		// Structured cloneable composites
7773 | 		| Map<
7774 | 				T extends Map<infer U, unknown> ? Serializable<U> : never,
7775 | 				T extends Map<unknown, infer U> ? Serializable<U> : never
7776 | 		  >
7777 | 		| Set<T extends Set<infer U> ? Serializable<U> : never>
7778 | 		| ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
7779 | 		| {
7780 | 				[K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
7781 | 		  }
7782 | 		// Special types
7783 | 		| Stub<Stubable>
7784 | 		// Serialized as stubs, see `Stubify`
7785 | 		| Stubable;
7786 | 	// Base type for all RPC stubs, including common memory management methods.
7787 | 	// `T` is used as a marker type for unwrapping `Stub`s later.
7788 | 	interface StubBase<T extends Stubable> extends Disposable {
7789 | 		[__RPC_STUB_BRAND]: T;
7790 | 		dup(): this;
7791 | 	}
7792 | 	export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
7793 | 	// This represents all the types that can be sent as-is over an RPC boundary
7794 | 	type BaseType =
7795 | 		| void
7796 | 		| undefined
7797 | 		| null
7798 | 		| boolean
7799 | 		| number
7800 | 		| bigint
7801 | 		| string
7802 | 		| TypedArray
7803 | 		| ArrayBuffer
7804 | 		| DataView
7805 | 		| Date
7806 | 		| Error
7807 | 		| RegExp
7808 | 		| ReadableStream<Uint8Array>
7809 | 		| WritableStream<Uint8Array>
7810 | 		| Request
7811 | 		| Response
7812 | 		| Headers;
7813 | 	// Recursively rewrite all `Stubable` types with `Stub`s
7814 | 	// prettier-ignore
7815 | 	type Stubify<T> = T extends Stubable
7816 | 		? Stub<T>
7817 | 		: T extends Map<infer K, infer V>
7818 | 			? Map<Stubify<K>, Stubify<V>>
7819 | 			: T extends Set<infer V>
7820 | 				? Set<Stubify<V>>
7821 | 				: T extends Array<infer V>
7822 | 					? Array<Stubify<V>>
7823 | 					: T extends ReadonlyArray<infer V>
7824 | 						? ReadonlyArray<Stubify<V>>
7825 | 						: T extends BaseType
7826 | 							? T
7827 | 							: T extends {
7828 | 										[key: string | number]: any;
7829 | 									}
7830 | 								? {
7831 | 										[K in keyof T]: Stubify<T[K]>;
7832 | 									}
7833 | 								: T;
7834 | 	// Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
7835 | 	// Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
7836 | 	// `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
7837 | 	// prettier-ignore
7838 | 	type Unstubify<T> = T extends StubBase<infer V>
7839 | 		? V
7840 | 		: T extends Map<infer K, infer V>
7841 | 			? Map<Unstubify<K>, Unstubify<V>>
7842 | 			: T extends Set<infer V>
7843 | 				? Set<Unstubify<V>>
7844 | 				: T extends Array<infer V>
7845 | 					? Array<Unstubify<V>>
7846 | 					: T extends ReadonlyArray<infer V>
7847 | 						? ReadonlyArray<Unstubify<V>>
7848 | 						: T extends BaseType
7849 | 							? T
7850 | 							: T extends {
7851 | 										[key: string | number]: unknown;
7852 | 									}
7853 | 								? {
7854 | 										[K in keyof T]: Unstubify<T[K]>;
7855 | 									}
7856 | 								: T;
7857 | 	type UnstubifyAll<A extends any[]> = {
7858 | 		[I in keyof A]: Unstubify<A[I]>;
7859 | 	};
7860 | 	// Utility type for adding `Provider`/`Disposable`s to `object` types only.
7861 | 	// Note `unknown & T` is equivalent to `T`.
7862 | 	type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
7863 | 	type MaybeDisposable<T> = T extends object ? Disposable : unknown;
7864 | 	// Type for method return or property on an RPC interface.
7865 | 	// - Stubable types are replaced by stubs.
7866 | 	// - Serializable types are passed by value, with stubable types replaced by stubs
7867 | 	//   and a top-level `Disposer`.
7868 | 	// Everything else can't be passed over PRC.
7869 | 	// Technically, we use custom thenables here, but they quack like `Promise`s.
7870 | 	// Intersecting with `(Maybe)Provider` allows pipelining.
7871 | 	// prettier-ignore
7872 | 	type Result<R> = R extends Stubable
7873 | 		? Promise<Stub<R>> & Provider<R>
7874 | 		: R extends Serializable<R>
7875 | 			? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
7876 | 			: never;
7877 | 	// Type for method or property on an RPC interface.
7878 | 	// For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
7879 | 	// Unwrapping `Stub`s allows calling with `Stubable` arguments.
7880 | 	// For properties, rewrite types to be `Result`s.
7881 | 	// In each case, unwrap `Promise`s.
7882 | 	type MethodOrProperty<V> = V extends (...args: infer P) => infer R
7883 | 		? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
7884 | 		: Result<Awaited<V>>;
7885 | 	// Type for the callable part of an `Provider` if `T` is callable.
7886 | 	// This is intersected with methods/properties.
7887 | 	type MaybeCallableProvider<T> = T extends (...args: any[]) => any
7888 | 		? MethodOrProperty<T>
7889 | 		: unknown;
7890 | 	// Base type for all other types providing RPC-like interfaces.
7891 | 	// Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
7892 | 	// `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
7893 | 	export type Provider<
7894 | 		T extends object,
7895 | 		Reserved extends string = never,
7896 | 	> = MaybeCallableProvider<T> & {
7897 | 		[K in Exclude<
7898 | 			keyof T,
7899 | 			Reserved | symbol | keyof StubBase<never>
7900 | 		>]: MethodOrProperty<T[K]>;
7901 | 	};
7902 | }
7903 | declare namespace Cloudflare {
7904 | 	interface Env {}
7905 | }
7906 | declare module "cloudflare:node" {
7907 | 	export interface DefaultHandler {
7908 | 		fetch?(request: Request): Response | Promise<Response>;
7909 | 		tail?(events: TraceItem[]): void | Promise<void>;
7910 | 		trace?(traces: TraceItem[]): void | Promise<void>;
7911 | 		scheduled?(controller: ScheduledController): void | Promise<void>;
7912 | 		queue?(batch: MessageBatch<unknown>): void | Promise<void>;
7913 | 		test?(controller: TestController): void | Promise<void>;
7914 | 	}
7915 | 	export function httpServerHandler(
7916 | 		options: {
7917 | 			port: number;
7918 | 		},
7919 | 		handlers?: Omit<DefaultHandler, "fetch">,
7920 | 	): DefaultHandler;
7921 | }
7922 | declare module "cloudflare:workers" {
7923 | 	export type RpcStub<T extends Rpc.Stubable> = Rpc.Stub<T>;
7924 | 	export const RpcStub: {
7925 | 		new <T extends Rpc.Stubable>(value: T): Rpc.Stub<T>;
7926 | 	};
7927 | 	export abstract class RpcTarget implements Rpc.RpcTargetBranded {
7928 | 		[Rpc.__RPC_TARGET_BRAND]: never;
7929 | 	}
7930 | 	// `protected` fields don't appear in `keyof`s, so can't be accessed over RPC
7931 | 	export abstract class WorkerEntrypoint<Env = unknown>
7932 | 		implements Rpc.WorkerEntrypointBranded
7933 | 	{
7934 | 		[Rpc.__WORKER_ENTRYPOINT_BRAND]: never;
7935 | 		protected ctx: ExecutionContext;
7936 | 		protected env: Env;
7937 | 		constructor(ctx: ExecutionContext, env: Env);
7938 | 		fetch?(request: Request): Response | Promise<Response>;
7939 | 		tail?(events: TraceItem[]): void | Promise<void>;
7940 | 		trace?(traces: TraceItem[]): void | Promise<void>;
7941 | 		scheduled?(controller: ScheduledController): void | Promise<void>;
7942 | 		queue?(batch: MessageBatch<unknown>): void | Promise<void>;
7943 | 		test?(controller: TestController): void | Promise<void>;
7944 | 	}
7945 | 	export abstract class DurableObject<Env = unknown>
7946 | 		implements Rpc.DurableObjectBranded
7947 | 	{
7948 | 		[Rpc.__DURABLE_OBJECT_BRAND]: never;
7949 | 		protected ctx: DurableObjectState;
7950 | 		protected env: Env;
7951 | 		constructor(ctx: DurableObjectState, env: Env);
7952 | 		fetch?(request: Request): Response | Promise<Response>;
7953 | 		alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
7954 | 		webSocketMessage?(
7955 | 			ws: WebSocket,
7956 | 			message: string | ArrayBuffer,
7957 | 		): void | Promise<void>;
7958 | 		webSocketClose?(
7959 | 			ws: WebSocket,
7960 | 			code: number,
7961 | 			reason: string,
7962 | 			wasClean: boolean,
7963 | 		): void | Promise<void>;
7964 | 		webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
7965 | 	}
7966 | 	export type WorkflowDurationLabel =
7967 | 		| "second"
7968 | 		| "minute"
7969 | 		| "hour"
7970 | 		| "day"
7971 | 		| "week"
7972 | 		| "month"
7973 | 		| "year";
7974 | 	export type WorkflowSleepDuration =
7975 | 		| `${number} ${WorkflowDurationLabel}${"s" | ""}`
7976 | 		| number;
7977 | 	export type WorkflowDelayDuration = WorkflowSleepDuration;
7978 | 	export type WorkflowTimeoutDuration = WorkflowSleepDuration;
7979 | 	export type WorkflowRetentionDuration = WorkflowSleepDuration;
7980 | 	export type WorkflowBackoff = "constant" | "linear" | "exponential";
7981 | 	export type WorkflowStepConfig = {
7982 | 		retries?: {
7983 | 			limit: number;
7984 | 			delay: WorkflowDelayDuration | number;
7985 | 			backoff?: WorkflowBackoff;
7986 | 		};
7987 | 		timeout?: WorkflowTimeoutDuration | number;
7988 | 	};
7989 | 	export type WorkflowEvent<T> = {
7990 | 		payload: Readonly<T>;
7991 | 		timestamp: Date;
7992 | 		instanceId: string;
7993 | 	};
7994 | 	export type WorkflowStepEvent<T> = {
7995 | 		payload: Readonly<T>;
7996 | 		timestamp: Date;
7997 | 		type: string;
7998 | 	};
7999 | 	export abstract class WorkflowStep {
8000 | 		do<T extends Rpc.Serializable<T>>(
8001 | 			name: string,
8002 | 			callback: () => Promise<T>,
8003 | 		): Promise<T>;
8004 | 		do<T extends Rpc.Serializable<T>>(
8005 | 			name: string,
8006 | 			config: WorkflowStepConfig,
8007 | 			callback: () => Promise<T>,
8008 | 		): Promise<T>;
8009 | 		sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
8010 | 		sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
8011 | 		waitForEvent<T extends Rpc.Serializable<T>>(
8012 | 			name: string,
8013 | 			options: {
8014 | 				type: string;
8015 | 				timeout?: WorkflowTimeoutDuration | number;
8016 | 			},
8017 | 		): Promise<WorkflowStepEvent<T>>;
8018 | 	}
8019 | 	export abstract class WorkflowEntrypoint<
8020 | 		Env = unknown,
8021 | 		T extends Rpc.Serializable<T> | unknown = unknown,
8022 | 	> implements Rpc.WorkflowEntrypointBranded
8023 | 	{
8024 | 		[Rpc.__WORKFLOW_ENTRYPOINT_BRAND]: never;
8025 | 		protected ctx: ExecutionContext;
8026 | 		protected env: Env;
8027 | 		constructor(ctx: ExecutionContext, env: Env);
8028 | 		run(
8029 | 			event: Readonly<WorkflowEvent<T>>,
8030 | 			step: WorkflowStep,
8031 | 		): Promise<unknown>;
8032 | 	}
8033 | 	export function waitUntil(promise: Promise<unknown>): void;
8034 | 	export const env: Cloudflare.Env;
8035 | }
8036 | interface SecretsStoreSecret {
8037 | 	/**
8038 | 	 * Get a secret from the Secrets Store, returning a string of the secret value
8039 | 	 * if it exists, or throws an error if it does not exist
8040 | 	 */
8041 | 	get(): Promise<string>;
8042 | }
8043 | declare module "cloudflare:sockets" {
8044 | 	function _connect(
8045 | 		address: string | SocketAddress,
8046 | 		options?: SocketOptions,
8047 | 	): Socket;
8048 | 	export { _connect as connect };
8049 | }
8050 | declare namespace TailStream {
8051 | 	interface Header {
8052 | 		readonly name: string;
8053 | 		readonly value: string;
8054 | 	}
8055 | 	interface FetchEventInfo {
8056 | 		readonly type: "fetch";
8057 | 		readonly method: string;
8058 | 		readonly url: string;
8059 | 		readonly cfJson?: object;
8060 | 		readonly headers: Header[];
8061 | 	}
8062 | 	interface JsRpcEventInfo {
8063 | 		readonly type: "jsrpc";
8064 | 		readonly methodName: string;
8065 | 	}
8066 | 	interface ScheduledEventInfo {
8067 | 		readonly type: "scheduled";
8068 | 		readonly scheduledTime: Date;
8069 | 		readonly cron: string;
8070 | 	}
8071 | 	interface AlarmEventInfo {
8072 | 		readonly type: "alarm";
8073 | 		readonly scheduledTime: Date;
8074 | 	}
8075 | 	interface QueueEventInfo {
8076 | 		readonly type: "queue";
8077 | 		readonly queueName: string;
8078 | 		readonly batchSize: number;
8079 | 	}
8080 | 	interface EmailEventInfo {
8081 | 		readonly type: "email";
8082 | 		readonly mailFrom: string;
8083 | 		readonly rcptTo: string;
8084 | 		readonly rawSize: number;
8085 | 	}
8086 | 	interface TraceEventInfo {
8087 | 		readonly type: "trace";
8088 | 		readonly traces: (string | null)[];
8089 | 	}
8090 | 	interface HibernatableWebSocketEventInfoMessage {
8091 | 		readonly type: "message";
8092 | 	}
8093 | 	interface HibernatableWebSocketEventInfoError {
8094 | 		readonly type: "error";
8095 | 	}
8096 | 	interface HibernatableWebSocketEventInfoClose {
8097 | 		readonly type: "close";
8098 | 		readonly code: number;
8099 | 		readonly wasClean: boolean;
8100 | 	}
8101 | 	interface HibernatableWebSocketEventInfo {
8102 | 		readonly type: "hibernatableWebSocket";
8103 | 		readonly info:
8104 | 			| HibernatableWebSocketEventInfoClose
8105 | 			| HibernatableWebSocketEventInfoError
8106 | 			| HibernatableWebSocketEventInfoMessage;
8107 | 	}
8108 | 	interface CustomEventInfo {
8109 | 		readonly type: "custom";
8110 | 	}
8111 | 	interface FetchResponseInfo {
8112 | 		readonly type: "fetch";
8113 | 		readonly statusCode: number;
8114 | 	}
8115 | 	type EventOutcome =
8116 | 		| "ok"
8117 | 		| "canceled"
8118 | 		| "exception"
8119 | 		| "unknown"
8120 | 		| "killSwitch"
8121 | 		| "daemonDown"
8122 | 		| "exceededCpu"
8123 | 		| "exceededMemory"
8124 | 		| "loadShed"
8125 | 		| "responseStreamDisconnected"
8126 | 		| "scriptNotFound";
8127 | 	interface ScriptVersion {
8128 | 		readonly id: string;
8129 | 		readonly tag?: string;
8130 | 		readonly message?: string;
8131 | 	}
8132 | 	interface Trigger {
8133 | 		readonly traceId: string;
8134 | 		readonly invocationId: string;
8135 | 		readonly spanId: string;
8136 | 	}
8137 | 	interface Onset {
8138 | 		readonly type: "onset";
8139 | 		readonly dispatchNamespace?: string;
8140 | 		readonly entrypoint?: string;
8141 | 		readonly executionModel: string;
8142 | 		readonly scriptName?: string;
8143 | 		readonly scriptTags?: string[];
8144 | 		readonly scriptVersion?: ScriptVersion;
8145 | 		readonly trigger?: Trigger;
8146 | 		readonly info:
8147 | 			| FetchEventInfo
8148 | 			| JsRpcEventInfo
8149 | 			| ScheduledEventInfo
8150 | 			| AlarmEventInfo
8151 | 			| QueueEventInfo
8152 | 			| EmailEventInfo
8153 | 			| TraceEventInfo
8154 | 			| HibernatableWebSocketEventInfo
8155 | 			| CustomEventInfo;
8156 | 	}
8157 | 	interface Outcome {
8158 | 		readonly type: "outcome";
8159 | 		readonly outcome: EventOutcome;
8160 | 		readonly cpuTime: number;
8161 | 		readonly wallTime: number;
8162 | 	}
8163 | 	interface SpanOpen {
8164 | 		readonly type: "spanOpen";
8165 | 		readonly name: string;
8166 | 		readonly info?: FetchEventInfo | JsRpcEventInfo | Attributes;
8167 | 	}
8168 | 	interface SpanClose {
8169 | 		readonly type: "spanClose";
8170 | 		readonly outcome: EventOutcome;
8171 | 	}
8172 | 	interface DiagnosticChannelEvent {
8173 | 		readonly type: "diagnosticChannel";
8174 | 		readonly channel: string;
8175 | 		readonly message: any;
8176 | 	}
8177 | 	interface Exception {
8178 | 		readonly type: "exception";
8179 | 		readonly name: string;
8180 | 		readonly message: string;
8181 | 		readonly stack?: string;
8182 | 	}
8183 | 	interface Log {
8184 | 		readonly type: "log";
8185 | 		readonly level: "debug" | "error" | "info" | "log" | "warn";
8186 | 		readonly message: object;
8187 | 	}
8188 | 	interface Return {
8189 | 		readonly type: "return";
8190 | 		readonly info?: FetchResponseInfo;
8191 | 	}
8192 | 	interface Attribute {
8193 | 		readonly name: string;
8194 | 		readonly value:
8195 | 			| string
8196 | 			| string[]
8197 | 			| boolean
8198 | 			| boolean[]
8199 | 			| number
8200 | 			| number[]
8201 | 			| bigint
8202 | 			| bigint[];
8203 | 	}
8204 | 	interface Attributes {
8205 | 		readonly type: "attributes";
8206 | 		readonly info: Attribute[];
8207 | 	}
8208 | 	type EventType =
8209 | 		| Onset
8210 | 		| Outcome
8211 | 		| SpanOpen
8212 | 		| SpanClose
8213 | 		| DiagnosticChannelEvent
8214 | 		| Exception
8215 | 		| Log
8216 | 		| Return
8217 | 		| Attributes;
8218 | 	interface TailEvent<Event extends EventType> {
8219 | 		readonly invocationId: string;
8220 | 		readonly spanId: string;
8221 | 		readonly timestamp: Date;
8222 | 		readonly sequence: number;
8223 | 		readonly event: Event;
8224 | 	}
8225 | 	type TailEventHandler<Event extends EventType = EventType> = (
8226 | 		event: TailEvent<Event>,
8227 | 	) => void | Promise<void>;
8228 | 	type TailEventHandlerObject = {
8229 | 		outcome?: TailEventHandler<Outcome>;
8230 | 		spanOpen?: TailEventHandler<SpanOpen>;
8231 | 		spanClose?: TailEventHandler<SpanClose>;
8232 | 		diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent>;
8233 | 		exception?: TailEventHandler<Exception>;
8234 | 		log?: TailEventHandler<Log>;
8235 | 		return?: TailEventHandler<Return>;
8236 | 		attributes?: TailEventHandler<Attributes>;
8237 | 	};
8238 | 	type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;
8239 | }
8240 | // Copyright (c) 2022-2023 Cloudflare, Inc.
8241 | // Licensed under the Apache 2.0 license found in the LICENSE file or at:
8242 | //     https://opensource.org/licenses/Apache-2.0
8243 | /**
8244 |  * Data types supported for holding vector metadata.
8245 |  */
8246 | type VectorizeVectorMetadataValue = string | number | boolean | string[];
8247 | /**
8248 |  * Additional information to associate with a vector.
8249 |  */
8250 | type VectorizeVectorMetadata =
8251 | 	| VectorizeVectorMetadataValue
8252 | 	| Record<string, VectorizeVectorMetadataValue>;
8253 | type VectorFloatArray = Float32Array | Float64Array;
8254 | interface VectorizeError {
8255 | 	code?: number;
8256 | 	error: string;
8257 | }
8258 | /**
8259 |  * Comparison logic/operation to use for metadata filtering.
8260 |  *
8261 |  * This list is expected to grow as support for more operations are released.
8262 |  */
8263 | type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
8264 | /**
8265 |  * Filter criteria for vector metadata used to limit the retrieved query result set.
8266 |  */
8267 | type VectorizeVectorMetadataFilter = {
8268 | 	[field: string]:
8269 | 		| Exclude<VectorizeVectorMetadataValue, string[]>
8270 | 		| null
8271 | 		| {
8272 | 				[Op in VectorizeVectorMetadataFilterOp]?: Exclude<
8273 | 					VectorizeVectorMetadataValue,
8274 | 					string[]
8275 | 				> | null;
8276 | 		  };
8277 | };
8278 | /**
8279 |  * Supported distance metrics for an index.
8280 |  * Distance metrics determine how other "similar" vectors are determined.
8281 |  */
8282 | type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
8283 | /**
8284 |  * Metadata return levels for a Vectorize query.
8285 |  *
8286 |  * Default to "none".
8287 |  *
8288 |  * @property all      Full metadata for the vector return set, including all fields (including those un-indexed) without truncation. This is a more expensive retrieval, as it requires additional fetching & reading of un-indexed data.
8289 |  * @property indexed  Return all metadata fields configured for indexing in the vector return set. This level of retrieval is "free" in that no additional overhead is incurred returning this data. However, note that indexed metadata is subject to truncation (especially for larger strings).
8290 |  * @property none     No indexed metadata will be returned.
8291 |  */
8292 | type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
8293 | interface VectorizeQueryOptions {
8294 | 	topK?: number;
8295 | 	namespace?: string;
8296 | 	returnValues?: boolean;
8297 | 	returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
8298 | 	filter?: VectorizeVectorMetadataFilter;
8299 | }
8300 | /**
8301 |  * Information about the configuration of an index.
8302 |  */
8303 | type VectorizeIndexConfig =
8304 | 	| {
8305 | 			dimensions: number;
8306 | 			metric: VectorizeDistanceMetric;
8307 | 	  }
8308 | 	| {
8309 | 			preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity
8310 | 	  };
8311 | /**
8312 |  * Metadata about an existing index.
8313 |  *
8314 |  * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
8315 |  * See {@link VectorizeIndexInfo} for its post-beta equivalent.
8316 |  */
8317 | interface VectorizeIndexDetails {
8318 | 	/** The unique ID of the index */
8319 | 	readonly id: string;
8320 | 	/** The name of the index. */
8321 | 	name: string;
8322 | 	/** (optional) A human readable description for the index. */
8323 | 	description?: string;
8324 | 	/** The index configuration, including the dimension size and distance metric. */
8325 | 	config: VectorizeIndexConfig;
8326 | 	/** The number of records containing vectors within the index. */
8327 | 	vectorsCount: number;
8328 | }
8329 | /**
8330 |  * Metadata about an existing index.
8331 |  */
8332 | interface VectorizeIndexInfo {
8333 | 	/** The number of records containing vectors within the index. */
8334 | 	vectorCount: number;
8335 | 	/** Number of dimensions the index has been configured for. */
8336 | 	dimensions: number;
8337 | 	/** ISO 8601 datetime of the last processed mutation on in the index. All changes before this mutation will be reflected in the index state. */
8338 | 	processedUpToDatetime: number;
8339 | 	/** UUIDv4 of the last mutation processed by the index. All changes before this mutation will be reflected in the index state. */
8340 | 	processedUpToMutation: number;
8341 | }
8342 | /**
8343 |  * Represents a single vector value set along with its associated metadata.
8344 |  */
8345 | interface VectorizeVector {
8346 | 	/** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */
8347 | 	id: string;
8348 | 	/** The vector values */
8349 | 	values: VectorFloatArray | number[];
8350 | 	/** The namespace this vector belongs to. */
8351 | 	namespace?: string;
8352 | 	/** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
8353 | 	metadata?: Record<string, VectorizeVectorMetadata>;
8354 | }
8355 | /**
8356 |  * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
8357 |  */
8358 | type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
8359 | 	Omit<VectorizeVector, "values"> & {
8360 | 		/** The score or rank for similarity, when returned as a result */
8361 | 		score: number;
8362 | 	};
8363 | /**
8364 |  * A set of matching {@link VectorizeMatch} for a particular query.
8365 |  */
8366 | interface VectorizeMatches {
8367 | 	matches: VectorizeMatch[];
8368 | 	count: number;
8369 | }
8370 | /**
8371 |  * Results of an operation that performed a mutation on a set of vectors.
8372 |  * Here, `ids` is a list of vectors that were successfully processed.
8373 |  *
8374 |  * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
8375 |  * See {@link VectorizeAsyncMutation} for its post-beta equivalent.
8376 |  */
8377 | interface VectorizeVectorMutation {
8378 | 	/* List of ids of vectors that were successfully processed. */
8379 | 	ids: string[];
8380 | 	/* Total count of the number of processed vectors. */
8381 | 	count: number;
8382 | }
8383 | /**
8384 |  * Result type indicating a mutation on the Vectorize Index.
8385 |  * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
8386 |  */
8387 | interface VectorizeAsyncMutation {
8388 | 	/** The unique identifier for the async mutation operation containing the changeset. */
8389 | 	mutationId: string;
8390 | }
8391 | /**
8392 |  * A Vectorize Vector Search Index for querying vectors/embeddings.
8393 |  *
8394 |  * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
8395 |  * See {@link Vectorize} for its new implementation.
8396 |  */
8397 | declare abstract class VectorizeIndex {
8398 | 	/**
8399 | 	 * Get information about the currently bound index.
8400 | 	 * @returns A promise that resolves with information about the current index.
8401 | 	 */
8402 | 	public describe(): Promise<VectorizeIndexDetails>;
8403 | 	/**
8404 | 	 * Use the provided vector to perform a similarity search across the index.
8405 | 	 * @param vector Input vector that will be used to drive the similarity search.
8406 | 	 * @param options Configuration options to massage the returned data.
8407 | 	 * @returns A promise that resolves with matched and scored vectors.
8408 | 	 */
8409 | 	public query(
8410 | 		vector: VectorFloatArray | number[],
8411 | 		options?: VectorizeQueryOptions,
8412 | 	): Promise<VectorizeMatches>;
8413 | 	/**
8414 | 	 * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
8415 | 	 * @param vectors List of vectors that will be inserted.
8416 | 	 * @returns A promise that resolves with the ids & count of records that were successfully processed.
8417 | 	 */
8418 | 	public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
8419 | 	/**
8420 | 	 * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
8421 | 	 * @param vectors List of vectors that will be upserted.
8422 | 	 * @returns A promise that resolves with the ids & count of records that were successfully processed.
8423 | 	 */
8424 | 	public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
8425 | 	/**
8426 | 	 * Delete a list of vectors with a matching id.
8427 | 	 * @param ids List of vector ids that should be deleted.
8428 | 	 * @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted).
8429 | 	 */
8430 | 	public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation>;
8431 | 	/**
8432 | 	 * Get a list of vectors with a matching id.
8433 | 	 * @param ids List of vector ids that should be returned.
8434 | 	 * @returns A promise that resolves with the raw unscored vectors matching the id set.
8435 | 	 */
8436 | 	public getByIds(ids: string[]): Promise<VectorizeVector[]>;
8437 | }
8438 | /**
8439 |  * A Vectorize Vector Search Index for querying vectors/embeddings.
8440 |  *
8441 |  * Mutations in this version are async, returning a mutation id.
8442 |  */
8443 | declare abstract class Vectorize {
8444 | 	/**
8445 | 	 * Get information about the currently bound index.
8446 | 	 * @returns A promise that resolves with information about the current index.
8447 | 	 */
8448 | 	public describe(): Promise<VectorizeIndexInfo>;
8449 | 	/**
8450 | 	 * Use the provided vector to perform a similarity search across the index.
8451 | 	 * @param vector Input vector that will be used to drive the similarity search.
8452 | 	 * @param options Configuration options to massage the returned data.
8453 | 	 * @returns A promise that resolves with matched and scored vectors.
8454 | 	 */
8455 | 	public query(
8456 | 		vector: VectorFloatArray | number[],
8457 | 		options?: VectorizeQueryOptions,
8458 | 	): Promise<VectorizeMatches>;
8459 | 	/**
8460 | 	 * Use the provided vector-id to perform a similarity search across the index.
8461 | 	 * @param vectorId Id for a vector in the index against which the index should be queried.
8462 | 	 * @param options Configuration options to massage the returned data.
8463 | 	 * @returns A promise that resolves with matched and scored vectors.
8464 | 	 */
8465 | 	public queryById(
8466 | 		vectorId: string,
8467 | 		options?: VectorizeQueryOptions,
8468 | 	): Promise<VectorizeMatches>;
8469 | 	/**
8470 | 	 * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
8471 | 	 * @param vectors List of vectors that will be inserted.
8472 | 	 * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
8473 | 	 */
8474 | 	public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
8475 | 	/**
8476 | 	 * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
8477 | 	 * @param vectors List of vectors that will be upserted.
8478 | 	 * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
8479 | 	 */
8480 | 	public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
8481 | 	/**
8482 | 	 * Delete a list of vectors with a matching id.
8483 | 	 * @param ids List of vector ids that should be deleted.
8484 | 	 * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
8485 | 	 */
8486 | 	public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
8487 | 	/**
8488 | 	 * Get a list of vectors with a matching id.
8489 | 	 * @param ids List of vector ids that should be returned.
8490 | 	 * @returns A promise that resolves with the raw unscored vectors matching the id set.
8491 | 	 */
8492 | 	public getByIds(ids: string[]): Promise<VectorizeVector[]>;
8493 | }
8494 | /**
8495 |  * The interface for "version_metadata" binding
8496 |  * providing metadata about the Worker Version using this binding.
8497 |  */
8498 | type WorkerVersionMetadata = {
8499 | 	/** The ID of the Worker Version using this binding */
8500 | 	id: string;
8501 | 	/** The tag of the Worker Version using this binding */
8502 | 	tag: string;
8503 | 	/** The timestamp of when the Worker Version was uploaded */
8504 | 	timestamp: string;
8505 | };
8506 | interface DynamicDispatchLimits {
8507 | 	/**
8508 | 	 * Limit CPU time in milliseconds.
8509 | 	 */
8510 | 	cpuMs?: number;
8511 | 	/**
8512 | 	 * Limit number of subrequests.
8513 | 	 */
8514 | 	subRequests?: number;
8515 | }
8516 | interface DynamicDispatchOptions {
8517 | 	/**
8518 | 	 * Limit resources of invoked Worker script.
8519 | 	 */
8520 | 	limits?: DynamicDispatchLimits;
8521 | 	/**
8522 | 	 * Arguments for outbound Worker script, if configured.
8523 | 	 */
8524 | 	outbound?: {
8525 | 		[key: string]: any;
8526 | 	};
8527 | }
8528 | interface DispatchNamespace {
8529 | 	/**
8530 | 	 * @param name Name of the Worker script.
8531 | 	 * @param args Arguments to Worker script.
8532 | 	 * @param options Options for Dynamic Dispatch invocation.
8533 | 	 * @returns A Fetcher object that allows you to send requests to the Worker script.
8534 | 	 * @throws If the Worker script does not exist in this dispatch namespace, an error will be thrown.
8535 | 	 */
8536 | 	get(
8537 | 		name: string,
8538 | 		args?: {
8539 | 			[key: string]: any;
8540 | 		},
8541 | 		options?: DynamicDispatchOptions,
8542 | 	): Fetcher;
8543 | }
8544 | declare module "cloudflare:workflows" {
8545 | 	/**
8546 | 	 * NonRetryableError allows for a user to throw a fatal error
8547 | 	 * that makes a Workflow instance fail immediately without triggering a retry
8548 | 	 */
8549 | 	export class NonRetryableError extends Error {
8550 | 		public constructor(message: string, name?: string);
8551 | 	}
8552 | }
8553 | declare abstract class Workflow<PARAMS = unknown> {
8554 | 	/**
8555 | 	 * Get a handle to an existing instance of the Workflow.
8556 | 	 * @param id Id for the instance of this Workflow
8557 | 	 * @returns A promise that resolves with a handle for the Instance
8558 | 	 */
8559 | 	public get(id: string): Promise<WorkflowInstance>;
8560 | 	/**
8561 | 	 * Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
8562 | 	 * @param options Options when creating an instance including id and params
8563 | 	 * @returns A promise that resolves with a handle for the Instance
8564 | 	 */
8565 | 	public create(
8566 | 		options?: WorkflowInstanceCreateOptions<PARAMS>,
8567 | 	): Promise<WorkflowInstance>;
8568 | 	/**
8569 | 	 * Create a batch of instances and return handle for all of them. If a provided id exists, an error will be thrown.
8570 | 	 * `createBatch` is limited at 100 instances at a time or when the RPC limit for the batch (1MiB) is reached.
8571 | 	 * @param batch List of Options when creating an instance including name and params
8572 | 	 * @returns A promise that resolves with a list of handles for the created instances.
8573 | 	 */
8574 | 	public createBatch(
8575 | 		batch: WorkflowInstanceCreateOptions<PARAMS>[],
8576 | 	): Promise<WorkflowInstance[]>;
8577 | }
8578 | type WorkflowDurationLabel =
8579 | 	| "second"
8580 | 	| "minute"
8581 | 	| "hour"
8582 | 	| "day"
8583 | 	| "week"
8584 | 	| "month"
8585 | 	| "year";
8586 | type WorkflowSleepDuration =
8587 | 	| `${number} ${WorkflowDurationLabel}${"s" | ""}`
8588 | 	| number;
8589 | type WorkflowRetentionDuration = WorkflowSleepDuration;
8590 | interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
8591 | 	/**
8592 | 	 * An id for your Workflow instance. Must be unique within the Workflow.
8593 | 	 */
8594 | 	id?: string;
8595 | 	/**
8596 | 	 * The event payload the Workflow instance is triggered with
8597 | 	 */
8598 | 	params?: PARAMS;
8599 | 	/**
8600 | 	 * The retention policy for Workflow instance.
8601 | 	 * Defaults to the maximum retention period available for the owner's account.
8602 | 	 */
8603 | 	retention?: {
8604 | 		successRetention?: WorkflowRetentionDuration;
8605 | 		errorRetention?: WorkflowRetentionDuration;
8606 | 	};
8607 | }
8608 | type InstanceStatus = {
8609 | 	status:
8610 | 		| "queued" // means that instance is waiting to be started (see concurrency limits)
8611 | 		| "running"
8612 | 		| "paused"
8613 | 		| "errored"
8614 | 		| "terminated" // user terminated the instance while it was running
8615 | 		| "complete"
8616 | 		| "waiting" // instance is hibernating and waiting for sleep or event to finish
8617 | 		| "waitingForPause" // instance is finishing the current work to pause
8618 | 		| "unknown";
8619 | 	error?: string;
8620 | 	output?: object;
8621 | };
8622 | interface WorkflowError {
8623 | 	code?: number;
8624 | 	message: string;
8625 | }
8626 | declare abstract class WorkflowInstance {
8627 | 	public id: string;
8628 | 	/**
8629 | 	 * Pause the instance.
8630 | 	 */
8631 | 	public pause(): Promise<void>;
8632 | 	/**
8633 | 	 * Resume the instance. If it is already running, an error will be thrown.
8634 | 	 */
8635 | 	public resume(): Promise<void>;
8636 | 	/**
8637 | 	 * Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
8638 | 	 */
8639 | 	public terminate(): Promise<void>;
8640 | 	/**
8641 | 	 * Restart the instance.
8642 | 	 */
8643 | 	public restart(): Promise<void>;
8644 | 	/**
8645 | 	 * Returns the current status of the instance.
8646 | 	 */
8647 | 	public status(): Promise<InstanceStatus>;
8648 | 	/**
8649 | 	 * Send an event to this instance.
8650 | 	 */
8651 | 	public sendEvent({
8652 | 		type,
8653 | 		payload,
8654 | 	}: {
8655 | 		type: string;
8656 | 		payload: unknown;
8657 | 	}): Promise<void>;
8658 | }
8659 | 
```
Page 67/67FirstPrevNextLast