mirror of
https://github.com/djdevin/recflare.git
synced 2026-10-27 16:08:58 -07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 619b4c772c |
+5
-6
@@ -24,12 +24,11 @@ RECFLARE_DOMAIN=rec.example.com
|
|||||||
# spliced in at deploy time. Required to deploy any worker that uses D1.
|
# spliced in at deploy time. Required to deploy any worker that uses D1.
|
||||||
# RECFLARE_D1=d44083e1-5bfe-4467-aa9a-f13c5c2496d5
|
# RECFLARE_D1=d44083e1-5bfe-4467-aa9a-f13c5c2496d5
|
||||||
|
|
||||||
# KV namespace ids, as a compact JSON object keyed by binding name. No worker binds a KV
|
# KV namespace ids, as a compact JSON object keyed by binding name. Each namespace
|
||||||
# namespace any more (player settings moved into the D1 `player_settings` table), so a
|
# is distinct (create with `wrangler kv namespace create <BINDING>`). Kept out of
|
||||||
# fresh deployment leaves this unset. A deployment that predates the move keeps its old
|
# the committed wrangler.jsonc (which uses "local" placeholders) and spliced in at
|
||||||
# RECFLARE_PLAYER_SETTINGS id here until `just settings-import-kv --remote` has copied the
|
# deploy time. Required to deploy any worker with the matching KV binding.
|
||||||
# namespace into D1 (see CLI.md); then delete the namespace and this line.
|
# RECFLARE_KV='{"RECFLARE_MATCH_PRESENCE":"9f53f04b7dd244658d59f515a14748b6","RECFLARE_PLAYER_SETTINGS":"d33a90014e904b0eac720bddcbe0b036"}'
|
||||||
# RECFLARE_KV='{"RECFLARE_PLAYER_SETTINGS":"d33a90014e904b0eac720bddcbe0b036"}'
|
|
||||||
|
|
||||||
# Id of the shared Secrets Store that holds the `JWT_SECRET` signing key (create it
|
# Id of the shared Secrets Store that holds the `JWT_SECRET` signing key (create it
|
||||||
# with `wrangler secrets-store store create recflare --scopes workers`). Every
|
# with `wrangler secrets-store store create recflare --scopes workers`). Every
|
||||||
|
|||||||
@@ -158,36 +158,6 @@ script names every item the storefront doesn't list. The
|
|||||||
committed `2025-1-cai.json` is already priced. Rarity isn't carried over, since the record
|
committed `2025-1-cai.json` is already priced. Rarity isn't carried over, since the record
|
||||||
has no field for it.
|
has no field for it.
|
||||||
|
|
||||||
### `settings-import-kv` — copy the old player-settings KV namespace into D1
|
|
||||||
|
|
||||||
```sh
|
|
||||||
bun runx admin settings-import-kv --dry-run --remote # count what the namespace holds
|
|
||||||
bun runx admin settings-import-kv --remote
|
|
||||||
bun runx admin settings-import-kv --remote --namespace-id <id> --overwrite
|
|
||||||
just settings-import-kv --remote # the same, as a recipe
|
|
||||||
```
|
|
||||||
|
|
||||||
Player settings used to live in a Workers KV namespace (`RECFLARE_PLAYER_SETTINGS`, one
|
|
||||||
`player:<id>` key per player holding their map as JSON); they now live in the
|
|
||||||
`player_settings` table on the shared D1, one JSON row per player. This copies the namespace
|
|
||||||
across for a deployment that predates the move. The namespace id comes from
|
|
||||||
`RECFLARE_PLAYER_SETTINGS` in `RECFLARE_KV` in `.env` (which the deploys used to read it from)
|
|
||||||
or from `--namespace-id`.
|
|
||||||
|
|
||||||
Upgrade in this order: `just migrate -F playersettings` (creates the table), this import,
|
|
||||||
`just deploy`, then this import AGAIN. The first run does the bulk while the KV-backed workers
|
|
||||||
are still live; the second picks up players and keys that appeared in KV in between. The import MERGES:
|
|
||||||
KV fills in what a row lacks, and the row wins any key it has moved off the seeded default.
|
|
||||||
A key still AT its default (`Recroom.OOBE` 77, `TUTORIAL_COMPLETE_MASK` 11,
|
|
||||||
`FIRST_TIME_IN_FLAGS` 0) loses to KV, because `GET /playersettings` seeds exactly those for a
|
|
||||||
player with no row, so a returning player who signed in before their map was imported keeps
|
|
||||||
their KV progress. The one thing it can't recover is a KV change made between the first
|
|
||||||
run and the deploy to a key the first run already imported off-default; keep that window
|
|
||||||
short. `--overwrite` makes the KV value win outright. Nothing is deleted on either side. A
|
|
||||||
value that is a number or boolean is imported as its string; a null, object or array value
|
|
||||||
drops only that key; a key that isn't a `player:<id>` holding a JSON object is reported and
|
|
||||||
skipped. Once the second run is done, the namespace (and the `RECFLARE_KV` line) can be deleted.
|
|
||||||
|
|
||||||
### `lookup` — print an account
|
### `lookup` — print an account
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -202,7 +172,7 @@ the account has a password, the developer role, and the moderator role.
|
|||||||
|
|
||||||
### Selecting an account
|
### Selecting an account
|
||||||
|
|
||||||
Every command except `reload-plus`, `cai-load` and `settings-import-kv` targets exactly one account, by **either**:
|
Every command except `reload-plus` and `cai-load` targets exactly one account, by **either**:
|
||||||
|
|
||||||
- `--account <id>` — numeric account id
|
- `--account <id>` — numeric account id
|
||||||
- `--username <name>` — username (case-insensitive)
|
- `--username <name>` — username (case-insensitive)
|
||||||
|
|||||||
+7
-10
@@ -23,6 +23,7 @@ These are the instructions for deploying the RecFlare infrastructure to Cloudfla
|
|||||||
well, we'll cross that bridge when we get to it.
|
well, we'll cross that bridge when we get to it.
|
||||||
- D1 (a SQLite-compatible distributed database)
|
- D1 (a SQLite-compatible distributed database)
|
||||||
- R2 (service like S3 for mass file hosting)
|
- R2 (service like S3 for mass file hosting)
|
||||||
|
- KV (service to distributed offer key/value stores)
|
||||||
- Durable Objects (for a notifications hub)
|
- Durable Objects (for a notifications hub)
|
||||||
|
|
||||||
## Do I have to use Cloudflare?
|
## Do I have to use Cloudflare?
|
||||||
@@ -33,12 +34,12 @@ AWS, Vercel, Netlify, Fly.io, a plain Node/Bun server, and so on.
|
|||||||
|
|
||||||
Long answer: the catch is everything _around_ the code. RecFlare leans on Cloudflare for the
|
Long answer: the catch is everything _around_ the code. RecFlare leans on Cloudflare for the
|
||||||
deployment (Wrangler) and infrastructure layer — custom-domain routing per service, plus the
|
deployment (Wrangler) and infrastructure layer — custom-domain routing per service, plus the
|
||||||
storage bindings (D1, R2, Durable Objects) the workers use. On another
|
storage bindings (D1, KV, R2, Durable Objects) the workers use. On another
|
||||||
provider you'll need to provide equivalents (per-service routing, databases,
|
provider you'll need to provide equivalents (per-service routing, databases,
|
||||||
object storage, a pub/sub or WebSocket layer) and wire up the deployment yourself.
|
object storage, a pub/sub or WebSocket layer) and wire up the deployment yourself.
|
||||||
|
|
||||||
So for example if you wanted to run on Vercel, you'd have to swap out D1 for another SQLite-compatible
|
So for example if you wanted to run on Vercel, you'd have to swap out KV for Redis, which are very similar
|
||||||
database (Turso, say) and R2 for S3, which are very similar services but would require small code changes.
|
services but would require small code changes.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -106,16 +107,12 @@ nothing in version control needs editing. Authenticate wrangler first
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
wrangler d1 create recflare
|
wrangler d1 create recflare
|
||||||
|
wrangler kv namespace create RECFLARE_MATCH_PRESENCE
|
||||||
|
wrangler kv namespace create RECFLARE_PLAYER_SETTINGS
|
||||||
wrangler secrets-store store create recflare --scopes workers
|
wrangler secrets-store store create recflare --scopes workers
|
||||||
```
|
```
|
||||||
|
|
||||||
Take the IDs output from the commands and put them into `.env` (`RECFLARE_D1` and
|
Take the IDs output from the commands and put them into `.env`. (or with CI: `RECFLARE_KV='{"RECFLARE_MATCH_PRESENCE":"<id>","RECFLARE_PLAYER_SETTINGS":"<id>"}'`)
|
||||||
`RECFLARE_SECRETS_STORE`; in CI, export the same names as secrets).
|
|
||||||
|
|
||||||
> Upgrading a deployment from before player settings moved into D1? They were in a
|
|
||||||
> `RECFLARE_PLAYER_SETTINGS` KV namespace; copy it across with
|
|
||||||
> `just settings-import-kv --remote` after `just migrate`, then again right after
|
|
||||||
> `just deploy` (see CLI.md).
|
|
||||||
|
|
||||||
The secrets store holds the shared `JWT_SECRET` HS256 signing key — every worker
|
The secrets store holds the shared `JWT_SECRET` HS256 signing key — every worker
|
||||||
binds it so tokens signed by `auth` verify everywhere. Record its id in `.env` as
|
binds it so tokens signed by `auth` verify everywhere. Record its id in `.env` as
|
||||||
|
|||||||
@@ -143,12 +143,3 @@ cai-load *args:
|
|||||||
[no-cd]
|
[no-cd]
|
||||||
catalog-load *args:
|
catalog-load *args:
|
||||||
bun runx catalog load "$@"
|
bun runx catalog load "$@"
|
||||||
|
|
||||||
# Copy the old RECFLARE_PLAYER_SETTINGS KV namespace into the player_settings D1 table (one-time
|
|
||||||
# upgrade for deployments that predate the move). Merges; existing rows keep what they have.
|
|
||||||
# Defaults to --local; pass --remote for production, --dry-run to only count. See CLI.md.
|
|
||||||
[group('4. utility')]
|
|
||||||
[positional-arguments]
|
|
||||||
[no-cd]
|
|
||||||
settings-import-kv *args:
|
|
||||||
bun runx admin settings-import-kv "$@"
|
|
||||||
|
|||||||
+2
-2
@@ -43,11 +43,11 @@ apex/`ns` host and isn't listed within it. Each implemented worker has its own
|
|||||||
| Leaderboard | `leaderboard` | `leaderboard` | Per-room stat leaderboards, one board per stat channel (D1) |
|
| Leaderboard | `leaderboard` | `leaderboard` | Per-room stat leaderboards, one board per stat channel (D1) |
|
||||||
| Link | `link` | `link` | Stub — deploys and answers, no link endpoints yet |
|
| Link | `link` | `link` | Stub — deploys and answers, no link endpoints yet |
|
||||||
| Lists | `lists` | `lists` | Curated & algorithmic discovery lists (canned — nothing ranks yet) |
|
| Lists | `lists` | `lists` | Curated & algorithmic discovery lists (canned — nothing ranks yet) |
|
||||||
| Matchmaking | `match` | `match` | Matchmaking & per-player presence (D1) |
|
| Matchmaking | `match` | `match` | Matchmaking & per-player presence (D1, KV) |
|
||||||
| Moderation | `moderation` | `moderation` | Stub — the reporting routes still live in `api`; see note below |
|
| Moderation | `moderation` | `moderation` | Stub — the reporting routes still live in `api`; see note below |
|
||||||
| Notifications | `notify` | `notify` | Real-time notifications over SignalR/WebSockets (Durable Object) |
|
| Notifications | `notify` | `notify` | Real-time notifications over SignalR/WebSockets (Durable Object) |
|
||||||
| PlatformNotifications | `platformnotifications` | `platformnotifications` | Stub — deploys and answers, no notification endpoints yet |
|
| PlatformNotifications | `platformnotifications` | `platformnotifications` | Stub — deploys and answers, no notification endpoints yet |
|
||||||
| PlayerSettings | `playersettings` | `playersettings` | Per-player settings (D1) |
|
| PlayerSettings | `playersettings` | `playersettings` | Per-player settings (KV) |
|
||||||
| RoomComments | `roomcomments` | `roomcomments` | Notes pinned in a room’s scene — read & create (D1) |
|
| RoomComments | `roomcomments` | `roomcomments` | Notes pinned in a room’s scene — read & create (D1) |
|
||||||
| RoomieIntegrations | `roomieintegrations` | — | Not yet implemented |
|
| RoomieIntegrations | `roomieintegrations` | — | Not yet implemented |
|
||||||
| Rooms | `rooms` | `rooms` | Room storage & queries; seeds the Dorm & Orientation rooms (D1) |
|
| Rooms | `rooms` | `rooms` | Room storage & queries; seeds the Dorm & Orientation rooms (D1) |
|
||||||
|
|||||||
+10
-6
@@ -33,12 +33,8 @@ export type Env = SharedHonoEnv & {
|
|||||||
* may sign in on it — so the version check never sends a supporter to update.
|
* may sign in on it — so the version check never sends a supporter to update.
|
||||||
*/
|
*/
|
||||||
ROLLOUT_GAME_VERSIONS?: string
|
ROLLOUT_GAME_VERSIONS?: string
|
||||||
// Shared `recflare` database. Rooms (owned by the `rooms` worker) are read here to
|
// Shared rooms database (schema/migrations owned by the `rooms` worker). Used
|
||||||
// resolve room roles for `/api/rooms/v1/verifyRole`; `player_settings` (owned by the
|
// read-only here to resolve room roles for `/api/rooms/v1/verifyRole`.
|
||||||
// `playersettings` worker — one JSON map per player) is read AND written by
|
|
||||||
// `GET|PUT /api/players/v1/playerPhotoTaggingSetting`, whose preference is one key
|
|
||||||
// (`playerPhotoTaggingSetting`) in that shared bag, so the write MERGES — see
|
|
||||||
// `writePhotoTaggingSetting`.
|
|
||||||
DB: D1Database
|
DB: D1Database
|
||||||
// Image bucket (shared with the `img` worker, which serves objects back by
|
// Image bucket (shared with the `img` worker, which serves objects back by
|
||||||
// key). Uploaded saved images are written here.
|
// key). Uploaded saved images are written here.
|
||||||
@@ -46,6 +42,14 @@ export type Env = SharedHonoEnv & {
|
|||||||
// Shared CDN bucket (owned by the `cdn` worker, written by `storage`). Read
|
// Shared CDN bucket (owned by the `cdn` worker, written by `storage`). Read
|
||||||
// here only to hash an invention's uploaded data blob under `invention/`.
|
// here only to hash an invention's uploaded data blob under `invention/`.
|
||||||
CDN_ASSETS: R2Bucket
|
CDN_ASSETS: R2Bucket
|
||||||
|
/**
|
||||||
|
* The per-player settings map the `playersettings` worker owns (`player:<id>` → JSON
|
||||||
|
* `{ key: value }`). Read and written here by
|
||||||
|
* `GET|PUT /api/players/v1/playerPhotoTaggingSetting`: the photo-tagging preference is
|
||||||
|
* one key (`playerPhotoTaggingSetting`) in that shared bag, not a store of its own, so
|
||||||
|
* the write MERGES — see `writePhotoTaggingSetting`.
|
||||||
|
*/
|
||||||
|
RECFLARE_PLAYER_SETTINGS: KVNamespace
|
||||||
// SignalR notifications hub (DO owned by the `notify` worker). Bound here to
|
// SignalR notifications hub (DO owned by the `notify` worker). Bound here to
|
||||||
// push RelationshipChanged notifications when a player's relationship changes.
|
// push RelationshipChanged notifications when a player's relationship changes.
|
||||||
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>
|
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>
|
||||||
|
|||||||
@@ -101,12 +101,12 @@ const OWN_VIEW_NOTE =
|
|||||||
*/
|
*/
|
||||||
const PHOTO_TAGGING_DEFAULT = 0
|
const PHOTO_TAGGING_DEFAULT = 0
|
||||||
|
|
||||||
/** The player's settings map, or null when they have none / the database is unreachable. */
|
/** The player's settings map, or null when they have none / KV is unreachable. */
|
||||||
async function getPlayerSettings(
|
async function getPlayerSettings(
|
||||||
env: App['Bindings'],
|
env: App['Bindings'],
|
||||||
accountId: number
|
accountId: number
|
||||||
): Promise<Record<string, string> | null> {
|
): Promise<Record<string, string> | null> {
|
||||||
return readPlayerSettings(env.DB, accountId).catch(() => null)
|
return readPlayerSettings(env.RECFLARE_PLAYER_SETTINGS, accountId).catch(() => null)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The caller's stored photo-tagging preference, or the default when they have none. */
|
/** The caller's stored photo-tagging preference, or the default when they have none. */
|
||||||
@@ -123,14 +123,14 @@ async function readPhotoTaggingSetting(env: App['Bindings'], accountId: number):
|
|||||||
* The write MERGES, as the `playersettings` worker's own PUT does: the map holds every
|
* The write MERGES, as the `playersettings` worker's own PUT does: the map holds every
|
||||||
* setting the player has (OOBE state, tutorial mask, …), so storing this one on its own
|
* setting the player has (OOBE state, tutorial mask, …), so storing this one on its own
|
||||||
* would wipe the rest. Re-posting the value already stored writes nothing — the client
|
* would wipe the rest. Re-posting the value already stored writes nothing — the client
|
||||||
* does that freely, and writes are the cost.
|
* does that freely, and KV writes are the cost.
|
||||||
*/
|
*/
|
||||||
async function writePhotoTaggingSetting(
|
async function writePhotoTaggingSetting(
|
||||||
env: App['Bindings'],
|
env: App['Bindings'],
|
||||||
accountId: number,
|
accountId: number,
|
||||||
setting: number
|
setting: number
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await mergePlayerSettings(env.DB, accountId, {
|
await mergePlayerSettings(env.RECFLARE_PLAYER_SETTINGS, accountId, {
|
||||||
[PHOTO_TAGGING_KEY]: String(setting),
|
[PHOTO_TAGGING_KEY]: String(setting),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,9 @@ import {
|
|||||||
MessageType,
|
MessageType,
|
||||||
NOTIFICATION_SCHEMA_DDL,
|
NOTIFICATION_SCHEMA_DDL,
|
||||||
OUTFIT_SCHEMA_DDL,
|
OUTFIT_SCHEMA_DDL,
|
||||||
PLAYER_SETTINGS_SCHEMA_DDL,
|
|
||||||
PRESENCE_SCHEMA_DDL,
|
PRESENCE_SCHEMA_DDL,
|
||||||
PRESENCE_TTL_SECONDS,
|
PRESENCE_TTL_SECONDS,
|
||||||
PROGRESSION_SCHEMA_DDL,
|
PROGRESSION_SCHEMA_DDL,
|
||||||
readPlayerSettings,
|
|
||||||
RELATIONSHIP_SCHEMA_DDL,
|
RELATIONSHIP_SCHEMA_DDL,
|
||||||
ROOM_INSTANCE_SCHEMA_DDL,
|
ROOM_INSTANCE_SCHEMA_DDL,
|
||||||
ROOM_SCHEMA_DDL,
|
ROOM_SCHEMA_DDL,
|
||||||
@@ -136,23 +134,6 @@ const TEST_ROOMS = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
/** Seed a player's `player_settings` row with raw JSON text — what the KV value used to be. */
|
|
||||||
const seedSettings = (playerId: number, data: string) =>
|
|
||||||
env.DB.prepare(
|
|
||||||
`INSERT INTO player_settings (account_id, data) VALUES (?1, ?2)
|
|
||||||
ON CONFLICT (account_id) DO UPDATE SET data = excluded.data`
|
|
||||||
)
|
|
||||||
.bind(playerId, data)
|
|
||||||
.run()
|
|
||||||
|
|
||||||
/** The row's `data` exactly as stored — a seeded value surviving a request means no write happened. */
|
|
||||||
const rawSettings = async (playerId: number) =>
|
|
||||||
(
|
|
||||||
await env.DB.prepare('SELECT data FROM player_settings WHERE account_id = ?1')
|
|
||||||
.bind(playerId)
|
|
||||||
.first<{ data: string }>()
|
|
||||||
)?.data ?? null
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// Seed the shared JWT signing key into the local Secrets Store so .get() resolves.
|
// Seed the shared JWT signing key into the local Secrets Store so .get() resolves.
|
||||||
await adminSecretsStore(env.JWT_SECRET).create('test-signing-key')
|
await adminSecretsStore(env.JWT_SECRET).create('test-signing-key')
|
||||||
@@ -196,10 +177,6 @@ beforeAll(async () => {
|
|||||||
// Outfit table (owned by the econ worker) — /outfits/me reads and writes slot 0.
|
// Outfit table (owned by the econ worker) — /outfits/me reads and writes slot 0.
|
||||||
for (const stmt of OUTFIT_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
for (const stmt of OUTFIT_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
||||||
|
|
||||||
// Player settings (owned by the playersettings worker) — the photo-tagging preference
|
|
||||||
// is one key in that per-player map.
|
|
||||||
for (const stmt of PLAYER_SETTINGS_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
|
||||||
|
|
||||||
// Inventions table (owned by the api worker) — invention save/mine use it.
|
// Inventions table (owned by the api worker) — invention save/mine use it.
|
||||||
for (const stmt of INVENTIONS_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
for (const stmt of INVENTIONS_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
||||||
|
|
||||||
@@ -7246,30 +7223,32 @@ describe('images', () => {
|
|||||||
expect(await (await read('710')).text()).toBe('2')
|
expect(await (await read('710')).text()).toBe('2')
|
||||||
|
|
||||||
// It's stored under `playerPhotoTaggingSetting` in the player's settings bag...
|
// It's stored under `playerPhotoTaggingSetting` in the player's settings bag...
|
||||||
const stored = await readPlayerSettings(env.DB, 710)
|
const stored = await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
|
'player:710',
|
||||||
|
'json'
|
||||||
|
)
|
||||||
expect(stored?.playerPhotoTaggingSetting).toBe('2')
|
expect(stored?.playerPhotoTaggingSetting).toBe('2')
|
||||||
|
|
||||||
// ...and the write MERGES: the player's other settings survive it.
|
// ...and the write MERGES: the player's other settings survive it.
|
||||||
await seedSettings(
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
711,
|
'player:711',
|
||||||
JSON.stringify({ 'Recroom.OOBE': '77', playerPhotoTaggingSetting: '1' })
|
JSON.stringify({ 'Recroom.OOBE': '77', playerPhotoTaggingSetting: '1' })
|
||||||
)
|
)
|
||||||
expect(await (await read('711')).text()).toBe('1')
|
expect(await (await read('711')).text()).toBe('1')
|
||||||
await write('711', { Setting: 0 })
|
await write('711', { Setting: 0 })
|
||||||
expect(await readPlayerSettings(env.DB, 711)).toEqual({
|
expect(
|
||||||
'Recroom.OOBE': '77',
|
await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>('player:711', 'json')
|
||||||
playerPhotoTaggingSetting: '0',
|
).toEqual({ 'Recroom.OOBE': '77', playerPhotoTaggingSetting: '0' })
|
||||||
})
|
|
||||||
|
|
||||||
// The setting is per-player.
|
// The setting is per-player.
|
||||||
expect(await (await read('710')).text()).toBe('2')
|
expect(await (await read('710')).text()).toBe('2')
|
||||||
|
|
||||||
// Re-posting the stored value writes nothing: the raw value is seeded with
|
// Re-posting the stored value writes nothing to KV: the raw value is seeded with
|
||||||
// whitespace JSON.stringify never produces, and it survives the PUT untouched.
|
// whitespace JSON.stringify never produces, and it survives the PUT untouched.
|
||||||
const padded = '{ "Recroom.OOBE": "77", "playerPhotoTaggingSetting": "1" }'
|
const padded = '{ "Recroom.OOBE": "77", "playerPhotoTaggingSetting": "1" }'
|
||||||
await seedSettings(712, padded)
|
await env.RECFLARE_PLAYER_SETTINGS.put('player:712', padded)
|
||||||
expect(await (await write('712', { Setting: 1 })).text()).toBe('1')
|
expect(await (await write('712', { Setting: 1 })).text()).toBe('1')
|
||||||
expect(await rawSettings(712)).toBe(padded)
|
expect(await env.RECFLARE_PLAYER_SETTINGS.get('player:712', 'text')).toBe(padded)
|
||||||
|
|
||||||
// A body with no readable Setting leaves the stored value alone rather than writing 0
|
// A body with no readable Setting leaves the stored value alone rather than writing 0
|
||||||
// — and answers what the player still has.
|
// — and answers what the player still has.
|
||||||
|
|||||||
+242
-953
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// Runtime types generated with workerd@1.20260831.1 2026-06-16 nodejs_compat
|
// Runtime types generated with workerd@1.20260625.1 2025-09-20 nodejs_compat
|
||||||
// Begin runtime types
|
// Begin runtime types
|
||||||
/*! *****************************************************************************
|
/*! *****************************************************************************
|
||||||
Copyright (c) Cloudflare. All rights reserved.
|
Copyright (c) Cloudflare. All rights reserved.
|
||||||
@@ -19,26 +19,26 @@ and limitations under the License.
|
|||||||
// noinspection JSUnusedGlobalSymbols
|
// noinspection JSUnusedGlobalSymbols
|
||||||
declare var onmessage: never;
|
declare var onmessage: never;
|
||||||
/**
|
/**
|
||||||
* The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs.
|
* The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
||||||
*/
|
*/
|
||||||
declare class DOMException extends Error {
|
declare class DOMException extends Error {
|
||||||
constructor(message?: string, name?: string);
|
constructor(message?: string, name?: string);
|
||||||
/**
|
/**
|
||||||
* The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name.
|
* The **`message`** read-only property of the a message or description associated with the given error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
||||||
*/
|
*/
|
||||||
readonly message: string;
|
readonly message: string;
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name.
|
* The **`name`** read-only property of the one of the strings associated with an error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
||||||
*/
|
*/
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
/**
|
/**
|
||||||
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match.
|
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
||||||
@@ -96,61 +96,61 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
clear(): void;
|
clear(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.count()`** static method logs the number of times that this particular call to count() has been called.
|
* The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
||||||
*/
|
*/
|
||||||
count(label?: string): void;
|
count(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.countReset()`** static method resets counter used with console.count().
|
* The **`console.countReset()`** static method resets counter used with console/count_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
||||||
*/
|
*/
|
||||||
countReset(label?: string): void;
|
countReset(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.debug()`** static method outputs a message to the console at the "debug" log level. The message is only displayed to the user if the console is configured to display debug output. In most cases, the log level is configured within the console UI. This log level might correspond to the Debug or Verbose log level.
|
* The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
||||||
*/
|
*/
|
||||||
debug(...data: any[]): void;
|
debug(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. In browser consoles, the output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
|
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
||||||
*/
|
*/
|
||||||
dir(item?: any, options?: any): void;
|
dir(item?: any, options?: any): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.
|
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
||||||
*/
|
*/
|
||||||
dirxml(...data: any[]): void;
|
dirxml(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.error()`** static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information.
|
* The **`console.error()`** static method outputs a message to the console at the 'error' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
||||||
*/
|
*/
|
||||||
error(...data: any[]): void;
|
error(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.
|
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
||||||
*/
|
*/
|
||||||
group(...data: any[]): void;
|
group(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupCollapsed()`** static method creates a new inline group in the console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.
|
* The **`console.groupCollapsed()`** static method creates a new inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
||||||
*/
|
*/
|
||||||
groupCollapsed(...data: any[]): void;
|
groupCollapsed(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupEnd()`** static method exits the current inline group in the console. See Using groups in the console in the console documentation for details and examples.
|
* The **`console.groupEnd()`** static method exits the current inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
||||||
*/
|
*/
|
||||||
groupEnd(): void;
|
groupEnd(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.info()`** static method outputs a message to the console at the "info" log level. The message is only displayed to the user if the console is configured to display info output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as a small "i" icon next to it.
|
* The **`console.info()`** static method outputs a message to the console at the 'info' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
||||||
*/
|
*/
|
||||||
@@ -168,24 +168,23 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
table(tabularData?: any, properties?: string[]): void;
|
table(tabularData?: any, properties?: string[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.
|
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
||||||
*/
|
*/
|
||||||
time(label?: string): void;
|
time(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console.time().
|
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
||||||
*/
|
*/
|
||||||
timeEnd(label?: string): void;
|
timeEnd(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console.time().
|
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
||||||
*/
|
*/
|
||||||
timeLog(label?: string, ...data: any[]): void;
|
timeLog(label?: string, ...data: any[]): void;
|
||||||
/* The **`console.timeStamp()`** static method adds a single marker to the browser's Performance tool (Firefox bug 1387528, Chrome). This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. */
|
|
||||||
timeStamp(label?: string): void;
|
timeStamp(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.trace()`** static method outputs a stack trace to the console.
|
* The **`console.trace()`** static method outputs a stack trace to the console.
|
||||||
@@ -194,7 +193,7 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
trace(...data: any[]): void;
|
trace(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.warn()`** static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon.
|
* The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
||||||
*/
|
*/
|
||||||
@@ -360,7 +359,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|||||||
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -405,7 +404,6 @@ declare const crypto: Crypto;
|
|||||||
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
||||||
*/
|
*/
|
||||||
declare const caches: CacheStorage;
|
declare const caches: CacheStorage;
|
||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scheduler) */
|
|
||||||
declare const scheduler: Scheduler;
|
declare const scheduler: Scheduler;
|
||||||
/**
|
/**
|
||||||
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
||||||
@@ -422,12 +420,10 @@ interface TestController {
|
|||||||
interface ExecutionContext<Props = unknown> {
|
interface ExecutionContext<Props = unknown> {
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
passThroughOnException(): void;
|
passThroughOnException(): void;
|
||||||
readonly exports: Cloudflare.Exports;
|
|
||||||
readonly props: Props;
|
readonly props: Props;
|
||||||
cache?: CacheContext;
|
cache?: CacheContext;
|
||||||
readonly access?: CloudflareAccessContext;
|
readonly access?: CloudflareAccessContext;
|
||||||
tracing: Tracing;
|
tracing: Tracing;
|
||||||
abort(reason?: any): void;
|
|
||||||
}
|
}
|
||||||
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
||||||
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
||||||
@@ -516,7 +512,7 @@ declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded
|
|||||||
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
||||||
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
||||||
}
|
}
|
||||||
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high" | "us";
|
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
|
||||||
interface DurableObjectNamespaceNewUniqueIdOptions {
|
interface DurableObjectNamespaceNewUniqueIdOptions {
|
||||||
jurisdiction?: DurableObjectJurisdiction;
|
jurisdiction?: DurableObjectJurisdiction;
|
||||||
}
|
}
|
||||||
@@ -530,7 +526,6 @@ interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = u
|
|||||||
}
|
}
|
||||||
interface DurableObjectState<Props = unknown> {
|
interface DurableObjectState<Props = unknown> {
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
readonly exports: Cloudflare.Exports;
|
|
||||||
readonly props: Props;
|
readonly props: Props;
|
||||||
readonly id: DurableObjectId;
|
readonly id: DurableObjectId;
|
||||||
readonly storage: DurableObjectStorage;
|
readonly storage: DurableObjectStorage;
|
||||||
@@ -545,7 +540,7 @@ interface DurableObjectState<Props = unknown> {
|
|||||||
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
||||||
getHibernatableWebSocketEventTimeout(): number | null;
|
getHibernatableWebSocketEventTimeout(): number | null;
|
||||||
getTags(ws: WebSocket): string[];
|
getTags(ws: WebSocket): string[];
|
||||||
abort(reason?: string, options?: DurableObjectAbortOptions): void;
|
abort(reason?: string): void;
|
||||||
}
|
}
|
||||||
interface DurableObjectTransaction {
|
interface DurableObjectTransaction {
|
||||||
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
||||||
@@ -581,9 +576,6 @@ interface DurableObjectStorage {
|
|||||||
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
||||||
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
||||||
}
|
}
|
||||||
interface DurableObjectAbortOptions {
|
|
||||||
retryAlarm?: boolean;
|
|
||||||
}
|
|
||||||
interface DurableObjectListOptions {
|
interface DurableObjectListOptions {
|
||||||
start?: string;
|
start?: string;
|
||||||
startAfter?: string;
|
startAfter?: string;
|
||||||
@@ -634,26 +626,26 @@ interface AnalyticsEngineDataPoint {
|
|||||||
blobs?: ((ArrayBuffer | string) | null)[];
|
blobs?: ((ArrayBuffer | string) | null)[];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`Event`** interface represents an event which takes place on an EventTarget.
|
* The **`Event`** interface represents an event which takes place on an `EventTarget`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
||||||
*/
|
*/
|
||||||
declare class Event {
|
declare class Event {
|
||||||
constructor(type: string, init?: EventInit);
|
constructor(type: string, init?: EventInit);
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error.
|
* The **`type`** read-only property of the Event interface returns a string containing the event's type.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated.
|
* The **`eventPhase`** read-only property of the being evaluated.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
||||||
*/
|
*/
|
||||||
get eventPhase(): number;
|
get eventPhase(): number;
|
||||||
/**
|
/**
|
||||||
* The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
* The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
||||||
*/
|
*/
|
||||||
@@ -690,13 +682,13 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get currentTarget(): EventTarget | undefined;
|
get currentTarget(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event.
|
* The read-only **`target`** property of the dispatched.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
||||||
*/
|
*/
|
||||||
get target(): EventTarget | undefined;
|
get target(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead.
|
* The deprecated **`Event.srcElement`** is an alias for the Event.target property.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
||||||
@@ -709,45 +701,45 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get timeStamp(): number;
|
get timeStamp(): number;
|
||||||
/**
|
/**
|
||||||
* The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents.
|
* The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
||||||
*/
|
*/
|
||||||
get isTrusted(): boolean;
|
get isTrusted(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
get cancelBubble(): boolean;
|
get cancelBubble(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
set cancelBubble(value: boolean);
|
set cancelBubble(value: boolean);
|
||||||
/**
|
/**
|
||||||
* The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called.
|
* The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
||||||
*/
|
*/
|
||||||
stopImmediatePropagation(): void;
|
stopImmediatePropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken.
|
* The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
||||||
*/
|
*/
|
||||||
preventDefault(): void;
|
preventDefault(): void;
|
||||||
/**
|
/**
|
||||||
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().
|
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
||||||
*/
|
*/
|
||||||
stopPropagation(): void;
|
stopPropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.
|
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
||||||
*/
|
*/
|
||||||
@@ -768,7 +760,7 @@ interface EventListenerObject<EventType extends Event = Event> {
|
|||||||
}
|
}
|
||||||
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
||||||
/**
|
/**
|
||||||
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. In other words, any target of events implements the three methods associated with this interface.
|
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
||||||
*/
|
*/
|
||||||
@@ -781,13 +773,13 @@ declare class EventTarget<EventMap extends Record<string, Event> = Record<string
|
|||||||
*/
|
*/
|
||||||
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
|
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
||||||
*/
|
*/
|
||||||
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -819,7 +811,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. This is able to abort fetch requests, the consumption of any response bodies, or streams.
|
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
||||||
*/
|
*/
|
||||||
@@ -832,7 +824,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
declare abstract class AbortSignal extends EventTarget {
|
declare abstract class AbortSignal extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).
|
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
||||||
*/
|
*/
|
||||||
@@ -844,13 +836,13 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
*/
|
*/
|
||||||
static timeout(delay: number): AbortSignal;
|
static timeout(delay: number): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal.
|
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
||||||
*/
|
*/
|
||||||
static any(signals: AbortSignal[]): AbortSignal;
|
static any(signals: AbortSignal[]): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false).
|
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
||||||
*/
|
*/
|
||||||
@@ -866,17 +858,12 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
||||||
set onabort(value: any | null);
|
set onabort(value: any | null);
|
||||||
/**
|
/**
|
||||||
* The **`throwIfAborted()`** method throws the signal's abort reason if the signal has been aborted; otherwise it does nothing.
|
* The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
||||||
*/
|
*/
|
||||||
throwIfAborted(): void;
|
throwIfAborted(): void;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`Scheduler`** interface of the Prioritized Task Scheduling API provides methods for scheduling prioritized tasks.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Scheduler)
|
|
||||||
*/
|
|
||||||
interface Scheduler {
|
interface Scheduler {
|
||||||
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
||||||
}
|
}
|
||||||
@@ -884,20 +871,20 @@ interface SchedulerWaitOptions {
|
|||||||
signal?: AbortSignal;
|
signal?: AbortSignal;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent`** interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
|
* The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class ExtendableEvent extends Event {
|
declare abstract class ExtendableEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful. In service workers, waitUntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the service worker if it wants that work to complete.
|
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
||||||
*/
|
*/
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CustomEvent`** interface can be used to attach custom data to an event generated by an application.
|
* The **`CustomEvent`** interface represents events initialized by an application for any purpose.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
||||||
*/
|
*/
|
||||||
@@ -936,7 +923,7 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`slice()`** method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it's called.
|
* The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
||||||
*/
|
*/
|
||||||
@@ -954,13 +941,13 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
bytes(): Promise<Uint8Array>;
|
bytes(): Promise<Uint8Array>;
|
||||||
/**
|
/**
|
||||||
* The **`text()`** method of the Blob interface returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8.
|
* The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
||||||
*/
|
*/
|
||||||
text(): Promise<string>;
|
text(): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.
|
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
||||||
*/
|
*/
|
||||||
@@ -977,13 +964,13 @@ interface BlobOptions {
|
|||||||
declare class File extends Blob {
|
declare class File extends Blob {
|
||||||
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object. For security reasons, the path is excluded from this property.
|
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
||||||
*/
|
*/
|
||||||
get name(): string;
|
get name(): string;
|
||||||
/**
|
/**
|
||||||
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
||||||
*/
|
*/
|
||||||
@@ -1000,7 +987,7 @@ interface FileOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class CacheStorage {
|
declare abstract class CacheStorage {
|
||||||
/**
|
/**
|
||||||
* The **`open()`** method of the CacheStorage interface returns a Promise that resolves to the Cache object matching the cacheName.
|
* The **`open()`** method of the the Cache object matching the `cacheName`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
||||||
*/
|
*/
|
||||||
@@ -1033,14 +1020,14 @@ interface CacheQueryOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class Crypto {
|
declare abstract class Crypto {
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.subtle`** read-only property returns a SubtleCrypto which can then be used to perform low-level cryptographic operations.
|
* The **`Crypto.subtle`** read-only property returns a cryptographic operations.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
||||||
*/
|
*/
|
||||||
get subtle(): SubtleCrypto;
|
get subtle(): SubtleCrypto;
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).
|
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
||||||
*/
|
*/
|
||||||
@@ -1068,7 +1055,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data. It takes as arguments a key to decrypt with, some optional extra parameters, and the data to decrypt (also known as "ciphertext"). It returns a Promise which will be fulfilled with the decrypted data (also known as "plaintext").
|
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
||||||
*/
|
*/
|
||||||
@@ -1086,7 +1073,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
||||||
/**
|
/**
|
||||||
* The **`digest()`** method of the SubtleCrypto interface generates a digest of the given data, using the specified hash function. A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value.
|
* The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
||||||
*/
|
*/
|
||||||
@@ -1104,7 +1091,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
||||||
/**
|
/**
|
||||||
* The **`deriveBits()`** method of the SubtleCrypto interface can be used to derive an array of bits from a base key.
|
* The **`deriveBits()`** method of the key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
||||||
*/
|
*/
|
||||||
@@ -1122,13 +1109,13 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
||||||
/**
|
/**
|
||||||
* The **`wrapKey()`** method of the SubtleCrypto interface "wraps" a key. This means that it exports the key in an external, portable format, then encrypts the exported key. Wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
|
* The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
||||||
*/
|
*/
|
||||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`unwrapKey()`** method of the SubtleCrypto interface "unwraps" a key. This means that it takes as its input a key that has been exported and then encrypted (also called "wrapped"). It decrypts the key and then imports it, returning a CryptoKey object that can be used in the Web Crypto API.
|
* The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
||||||
*/
|
*/
|
||||||
@@ -1136,20 +1123,20 @@ declare abstract class SubtleCrypto {
|
|||||||
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey().
|
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
||||||
*/
|
*/
|
||||||
declare abstract class CryptoKey {
|
declare abstract class CryptoKey {
|
||||||
/**
|
/**
|
||||||
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object. It can have the following values:
|
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
||||||
*/
|
*/
|
||||||
readonly type: string;
|
readonly type: string;
|
||||||
/**
|
/**
|
||||||
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using SubtleCrypto.exportKey() or SubtleCrypto.wrapKey().
|
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
||||||
*/
|
*/
|
||||||
@@ -1266,15 +1253,12 @@ interface CryptoKeyArbitraryKeyAlgorithm {
|
|||||||
length?: number;
|
length?: number;
|
||||||
}
|
}
|
||||||
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
||||||
constructor(algorithm: string | SubtleCryptoHashAlgorithm, options?: DigestStreamOptions);
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
||||||
readonly digest: Promise<ArrayBuffer>;
|
readonly digest: Promise<ArrayBuffer>;
|
||||||
get bytesWritten(): number | bigint;
|
get bytesWritten(): number | bigint;
|
||||||
}
|
}
|
||||||
interface DigestStreamOptions {
|
|
||||||
toWellFormed?: boolean;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
|
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
||||||
*/
|
*/
|
||||||
@@ -1291,20 +1275,20 @@ declare class TextDecoder {
|
|||||||
get ignoreBOM(): boolean;
|
get ignoreBOM(): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder`** interface enables you to encode a JavaScript string using UTF-8.
|
* The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
||||||
*/
|
*/
|
||||||
declare class TextEncoder {
|
declare class TextEncoder {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Uint8Array containing the string encoded using UTF-8.
|
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
||||||
*/
|
*/
|
||||||
encode(input?: string): Uint8Array;
|
encode(input?: string): Uint8Array;
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns an object indicating the progress of the encoding. This is potentially more performant than the encode() method — especially when the target buffer is a view into a Wasm heap.
|
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
||||||
*/
|
*/
|
||||||
@@ -1361,9 +1345,6 @@ declare class ErrorEvent extends Event {
|
|||||||
get error(): any;
|
get error(): any;
|
||||||
}
|
}
|
||||||
interface ErrorEventErrorEventInit {
|
interface ErrorEventErrorEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
message?: string;
|
message?: string;
|
||||||
filename?: string;
|
filename?: string;
|
||||||
lineno?: number;
|
lineno?: number;
|
||||||
@@ -1376,139 +1357,135 @@ interface ErrorEventErrorEventInit {
|
|||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
||||||
*/
|
*/
|
||||||
declare class MessageEvent extends Event {
|
declare class MessageEvent extends Event {
|
||||||
constructor(type: string, initializer?: MessageEventInit);
|
constructor(type: string, initializer: MessageEventInit);
|
||||||
/**
|
/**
|
||||||
* The **`data`** read-only property of the MessageEvent interface represents the data sent by the message emitter.
|
* The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
||||||
*/
|
*/
|
||||||
readonly data: any;
|
readonly data: any;
|
||||||
/**
|
/**
|
||||||
* The **`origin`** read-only property of the MessageEvent interface is a string representing the origin of the message emitter.
|
* The **`origin`** read-only property of the origin of the message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
||||||
*/
|
*/
|
||||||
readonly origin: string | null;
|
readonly origin: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`lastEventId`** read-only property of the MessageEvent interface is a string representing a unique ID for the event.
|
* The **`lastEventId`** read-only property of the unique ID for the event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
||||||
*/
|
*/
|
||||||
readonly lastEventId: string;
|
readonly lastEventId: string;
|
||||||
/**
|
/**
|
||||||
* The **`source`** read-only property of the MessageEvent interface is a MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter.
|
* The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
||||||
*/
|
*/
|
||||||
readonly source: MessagePort | null;
|
readonly source: MessagePort | null;
|
||||||
/**
|
/**
|
||||||
* The **`ports`** read-only property of the MessageEvent interface is an array of MessagePort objects containing all MessagePort objects sent with the message, in order.
|
* The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
||||||
*/
|
*/
|
||||||
readonly ports: MessagePort[];
|
readonly ports: MessagePort[];
|
||||||
}
|
}
|
||||||
interface MessageEventInit {
|
interface MessageEventInit {
|
||||||
bubbles?: boolean;
|
data: ArrayBuffer | string;
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
data?: any;
|
|
||||||
origin?: string;
|
|
||||||
lastEventId?: string;
|
|
||||||
source?: MessagePort;
|
|
||||||
ports?: MessagePort[];
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. These events are particularly useful for telemetry and debugging purposes.
|
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class PromiseRejectionEvent extends Event {
|
declare abstract class PromiseRejectionEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript Promise which was rejected. You can examine the event's PromiseRejectionEvent.reason property to learn why the promise was rejected.
|
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
||||||
*/
|
*/
|
||||||
readonly promise: Promise<any>;
|
readonly promise: Promise<any>;
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). This in theory provides information about why the promise was rejected.
|
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject().
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
||||||
*/
|
*/
|
||||||
readonly reason: any;
|
readonly reason: any;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the fetch(), XMLHttpRequest.send() or navigator.sendBeacon() methods. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
|
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
||||||
*/
|
*/
|
||||||
declare class FormData {
|
declare class FormData {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string | Blob): void;
|
append(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: Blob, filename?: string): void;
|
append(name: string, value: Blob, filename?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a FormData object.
|
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a FormData object. If you expect multiple values and want all of them, use the getAll() method instead.
|
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): (File | string) | null;
|
get(name: string): (File | string) | null;
|
||||||
/**
|
/**
|
||||||
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a FormData object.
|
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
||||||
*/
|
*/
|
||||||
getAll(name: string): (File | string)[];
|
getAll(name: string): (File | string)[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the FormData interface returns whether a FormData object contains a certain key.
|
* The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string | Blob): void;
|
set(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: Blob, filename?: string): void;
|
set(name: string, value: Blob, filename?: string): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the list. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: File | string
|
value: File | string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the list. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the list. */
|
||||||
values(): IterableIterator<(File | string)>;
|
values(): IterableIterator<(File | string)>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
@@ -1587,19 +1564,19 @@ interface DocumentEnd {
|
|||||||
append(content: string, options?: ContentOptions): DocumentEnd;
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class FetchEvent extends ExtendableEvent {
|
declare abstract class FetchEvent extends ExtendableEvent {
|
||||||
/**
|
/**
|
||||||
* The **`request`** read-only property of the FetchEvent interface returns the Request that triggered the event handler.
|
* The **`request`** read-only property of the the event handler.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
||||||
*/
|
*/
|
||||||
readonly request: Request;
|
readonly request: Request;
|
||||||
/**
|
/**
|
||||||
* The **`respondWith()`** method of FetchEvent prevents the browser's default fetch handling, and allows you to provide a promise for a Response yourself.
|
* The **`respondWith()`** method of allows you to provide a promise for a Response yourself.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
||||||
*/
|
*/
|
||||||
@@ -1608,62 +1585,65 @@ declare abstract class FetchEvent extends ExtendableEvent {
|
|||||||
}
|
}
|
||||||
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
||||||
/**
|
/**
|
||||||
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
|
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
||||||
*/
|
*/
|
||||||
declare class Headers {
|
declare class Headers {
|
||||||
constructor(init?: HeadersInit);
|
constructor(init?: HeadersInit);
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.
|
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): string | null;
|
get(name: string): string | null;
|
||||||
getAll(name: string): string[];
|
getAll(name: string): string[];
|
||||||
/**
|
/**
|
||||||
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. This allows Headers objects to handle having multiple Set-Cookie headers, which wasn't possible prior to its implementation.
|
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
||||||
*/
|
*/
|
||||||
getSetCookie(): string[];
|
getSetCookie(): string[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the Headers interface returns a boolean stating whether a Headers object contains a certain header.
|
* The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the Headers interface deletes a header from the current Headers object.
|
* The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
||||||
|
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
}
|
}
|
||||||
type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData | Iterable<ArrayBuffer | ArrayBufferView> | AsyncIterable<ArrayBuffer | ArrayBufferView>;
|
type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData;
|
||||||
declare abstract class Body {
|
declare abstract class Body {
|
||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
||||||
get body(): ReadableStream | null;
|
get body(): ReadableStream | null;
|
||||||
@@ -1719,7 +1699,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
statusText: string;
|
statusText: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Response interface contains the Headers object associated with the response.
|
* The **`headers`** read-only property of the with the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1737,7 +1717,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
redirected: boolean;
|
redirected: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects.
|
* The **`url`** read-only property of the Response interface contains the URL of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
||||||
*/
|
*/
|
||||||
@@ -1745,7 +1725,7 @@ interface Response extends Body {
|
|||||||
webSocket: WebSocket | null;
|
webSocket: WebSocket | null;
|
||||||
cf: any | undefined;
|
cf: any | undefined;
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers.
|
* The **`type`** read-only property of the Response interface contains the type of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
||||||
*/
|
*/
|
||||||
@@ -1776,13 +1756,13 @@ declare var Request: {
|
|||||||
*/
|
*/
|
||||||
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
||||||
/**
|
/**
|
||||||
* The **`clone()`** method of the Request interface creates a copy of the current Request object.
|
* The **`clone()`** method of the Request interface creates a copy of the current `Request` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
||||||
*/
|
*/
|
||||||
clone(): Request<CfHostMetadata, Cf>;
|
clone(): Request<CfHostMetadata, Cf>;
|
||||||
/**
|
/**
|
||||||
* The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.)
|
* The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
||||||
*/
|
*/
|
||||||
@@ -1794,7 +1774,7 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Request interface contains the Headers object associated with the request.
|
* The **`headers`** read-only property of the with the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1820,13 +1800,13 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
integrity: string;
|
integrity: string;
|
||||||
/**
|
/**
|
||||||
* The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
* The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
||||||
*/
|
*/
|
||||||
keepalive: boolean;
|
keepalive: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache.
|
* The **`cache`** read-only property of the Request interface contains the cache mode of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
||||||
*/
|
*/
|
||||||
@@ -2215,7 +2195,7 @@ type ReadableStreamReadResult<R = any> = {
|
|||||||
value?: undefined;
|
value?: undefined;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2233,13 +2213,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
getReader(): ReadableStreamDefaultReader<R>;
|
getReader(): ReadableStreamDefaultReader<R>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
@@ -2251,13 +2231,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
||||||
/**
|
/**
|
||||||
* The **`pipeTo()`** method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
* The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
||||||
*/
|
*/
|
||||||
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`tee()`** method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances.
|
* The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
||||||
*/
|
*/
|
||||||
@@ -2269,7 +2249,7 @@ interface ReadableStream<R = any> {
|
|||||||
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2301,7 +2281,7 @@ declare class ReadableStreamDefaultReader<R = any> {
|
|||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBReader`** interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. It is used for efficient copying from underlying sources where the data is delivered as an "anonymous" sequence of bytes, such as files.
|
* The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
||||||
*/
|
*/
|
||||||
@@ -2310,13 +2290,13 @@ declare class ReadableStreamBYOBReader {
|
|||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. A request for data will be satisfied from the stream's internal queues if there is any data present. If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source.
|
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
||||||
*/
|
*/
|
||||||
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. After the lock is released, the reader is no longer active.
|
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
||||||
*/
|
*/
|
||||||
@@ -2335,7 +2315,7 @@ interface ReadableStreamGetReaderOptions {
|
|||||||
mode: "byob";
|
mode: "byob";
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a "pull request" for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
||||||
*/
|
*/
|
||||||
@@ -2361,13 +2341,13 @@ declare abstract class ReadableStreamBYOBRequest {
|
|||||||
get atLeast(): number | null;
|
get atLeast(): number | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams.
|
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableStreamDefaultController<R = any> {
|
declare abstract class ReadableStreamDefaultController<R = any> {
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the required to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2379,32 +2359,32 @@ declare abstract class ReadableStreamDefaultController<R = any> {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.
|
* The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
||||||
*/
|
*/
|
||||||
enqueue(chunk?: R): void;
|
enqueue(chunk?: R): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. It allows control of the state and internal queue of a ReadableStream with an underlying byte source, and enables efficient zero-copy transfer of data from the underlying source to a consumer when the stream's internal queue is empty.
|
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableByteStreamController {
|
declare abstract class ReadableByteStreamController {
|
||||||
/**
|
/**
|
||||||
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests.
|
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
||||||
*/
|
*/
|
||||||
get byobRequest(): ReadableStreamBYOBRequest | null;
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its "desired size".
|
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2416,7 +2396,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is transferred into the stream's internal queues).
|
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
||||||
*/
|
*/
|
||||||
@@ -2429,7 +2409,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultController`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
@@ -2441,7 +2421,7 @@ declare abstract class WritableStreamDefaultController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the WritableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2466,7 +2446,7 @@ declare abstract class TransformStreamDefaultController<O = any> {
|
|||||||
*/
|
*/
|
||||||
enqueue(chunk?: O): void;
|
enqueue(chunk?: O): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
|
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2488,14 +2468,14 @@ interface ReadableWritablePair<R = any, W = any> {
|
|||||||
writable: WritableStream<W>;
|
writable: WritableStream<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
|
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
||||||
*/
|
*/
|
||||||
declare class WritableStream<W = any> {
|
declare class WritableStream<W = any> {
|
||||||
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
||||||
/**
|
/**
|
||||||
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.
|
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
||||||
*/
|
*/
|
||||||
@@ -2507,83 +2487,83 @@ declare class WritableStream<W = any> {
|
|||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled.
|
* The **`close()`** method of the WritableStream interface closes the associated stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. While the stream is locked, no other writer can be acquired until this one is released.
|
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
||||||
*/
|
*/
|
||||||
getWriter(): WritableStreamDefaultWriter<W>;
|
getWriter(): WritableStreamDefaultWriter<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
||||||
*/
|
*/
|
||||||
declare class WritableStreamDefaultWriter<W = any> {
|
declare class WritableStreamDefaultWriter<W = any> {
|
||||||
constructor(stream: WritableStream);
|
constructor(stream: WritableStream);
|
||||||
/**
|
/**
|
||||||
* The **`closed`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that fulfills if the stream becomes closed, or rejects if the stream errors or the writer's lock is released.
|
* The **`closed`** read-only property of the the stream errors or the writer's lock is released.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
||||||
*/
|
*/
|
||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`ready`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
* The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
||||||
*/
|
*/
|
||||||
get ready(): Promise<void>;
|
get ready(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the WritableStreamDefaultWriter interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
||||||
*/
|
*/
|
||||||
get desiredSize(): number | null;
|
get desiredSize(): number | null;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the WritableStreamDefaultWriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
* The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStreamDefaultWriter interface closes the associated writable stream.
|
* The **`close()`** method of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`write()`** method of the WritableStreamDefaultWriter interface writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation.
|
* The **`write()`** method of the operation.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
||||||
*/
|
*/
|
||||||
write(chunk?: W): Promise<void>;
|
write(chunk?: W): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the WritableStreamDefaultWriter interface releases the writer's lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
|
* The **`releaseLock()`** method of the corresponding stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
||||||
*/
|
*/
|
||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain transform stream concept.
|
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
||||||
*/
|
*/
|
||||||
declare class TransformStream<I = any, O = any> {
|
declare class TransformStream<I = any, O = any> {
|
||||||
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
||||||
/**
|
/**
|
||||||
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream. This stream emits the transformed output data.
|
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
||||||
*/
|
*/
|
||||||
get readable(): ReadableStream<O>;
|
get readable(): ReadableStream<O>;
|
||||||
/**
|
/**
|
||||||
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream. This stream accepts input data that will be transformed and emitted to the readable stream.
|
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
||||||
*/
|
*/
|
||||||
@@ -2602,7 +2582,7 @@ interface ReadableStreamValuesOptions {
|
|||||||
preventCancel?: boolean;
|
preventCancel?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CompressionStream`** interface of the Compression Streams API compresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2610,7 +2590,7 @@ declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBuffe
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`DecompressionStream`** interface of the Compression Streams API decompresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2618,7 +2598,7 @@ declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBuf
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2627,7 +2607,7 @@ declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
|
|||||||
get encoding(): string;
|
get encoding(): string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings. It is the streaming equivalent of TextDecoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2776,12 +2756,6 @@ interface TraceLog {
|
|||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
readonly level: string;
|
readonly level: string;
|
||||||
readonly message: any;
|
readonly message: any;
|
||||||
readonly errorInfo?: (TraceLogErrorInfo | null)[];
|
|
||||||
}
|
|
||||||
interface TraceLogErrorInfo {
|
|
||||||
name: string;
|
|
||||||
message: string;
|
|
||||||
stack?: string;
|
|
||||||
}
|
}
|
||||||
interface TraceException {
|
interface TraceException {
|
||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
@@ -2802,7 +2776,7 @@ interface UnsafeTraceMetrics {
|
|||||||
fromTrace(item: TraceItem): TraceMetrics;
|
fromTrace(item: TraceItem): TraceMetrics;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`URL`** interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.
|
* The **`URL`** interface is used to parse, construct, normalize, and encode URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
||||||
*/
|
*/
|
||||||
@@ -2827,121 +2801,121 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
set href(value: string);
|
set href(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
set protocol(value: string);
|
set protocol(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
set username(value: string);
|
set username(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
set password(value: string);
|
set password(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
get host(): string;
|
get host(): string;
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
set host(value: string);
|
set host(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
set hostname(value: string);
|
set hostname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
set port(value: string);
|
set port(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
set pathname(value: string);
|
set pathname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
set search(value: string);
|
set search(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
set hash(value: string);
|
set hash(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
|
* The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
||||||
*/
|
*/
|
||||||
get searchParams(): URLSearchParams;
|
get searchParams(): URLSearchParams;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().
|
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -2961,13 +2935,13 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
static parse(url: string, base?: string): URL | null;
|
static parse(url: string, base?: string): URL | null;
|
||||||
/**
|
/**
|
||||||
* The **`createObjectURL()`** static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.
|
* The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
||||||
*/
|
*/
|
||||||
static createObjectURL(object: File | Blob): string;
|
static createObjectURL(object: File | Blob): string;
|
||||||
/**
|
/**
|
||||||
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().
|
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
||||||
*/
|
*/
|
||||||
@@ -3017,22 +2991,25 @@ declare class URLSearchParams {
|
|||||||
*/
|
*/
|
||||||
has(name: string, value?: string): boolean;
|
has(name: string, value?: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.
|
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved).
|
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
||||||
*/
|
*/
|
||||||
sort(): void;
|
sort(): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the search params. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the search params. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
||||||
/*function toString() { [native code] }*/
|
/*function toString() { [native code] }*/
|
||||||
@@ -3042,78 +3019,18 @@ declare class URLSearchParams {
|
|||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern. The pattern can contain capturing groups that extract parts of the matched URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
|
|
||||||
*/
|
|
||||||
declare class URLPattern {
|
declare class URLPattern {
|
||||||
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
||||||
/**
|
|
||||||
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
||||||
*/
|
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
|
||||||
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
||||||
*/
|
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
|
||||||
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
||||||
*/
|
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
|
||||||
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
||||||
*/
|
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
|
||||||
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
||||||
*/
|
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
|
||||||
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
||||||
*/
|
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
|
||||||
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
||||||
*/
|
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
|
||||||
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
|
|
||||||
*/
|
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
|
||||||
* The **`hasRegExpGroups`** read-only property of the URLPattern interface is a boolean indicating whether or not any of the URLPattern components contain regular expression capturing groups.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
|
|
||||||
*/
|
|
||||||
get hasRegExpGroups(): boolean;
|
get hasRegExpGroups(): boolean;
|
||||||
/**
|
|
||||||
* The **`test()`** method of the URLPattern interface takes a URL string or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
|
|
||||||
*/
|
|
||||||
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
||||||
/**
|
|
||||||
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or null if the URL does not match the pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
|
|
||||||
*/
|
|
||||||
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
||||||
}
|
}
|
||||||
interface URLPatternInit {
|
interface URLPatternInit {
|
||||||
@@ -3146,7 +3063,7 @@ interface URLPatternOptions {
|
|||||||
ignoreCase?: boolean;
|
ignoreCase?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* A `CloseEvent` is sent to clients using WebSockets when the connection is closed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
||||||
*/
|
*/
|
||||||
@@ -3165,16 +3082,13 @@ declare class CloseEvent extends Event {
|
|||||||
*/
|
*/
|
||||||
readonly reason: string;
|
readonly reason: string;
|
||||||
/**
|
/**
|
||||||
* The **`wasClean`** read-only property of the CloseEvent interface returns true if the connection closed cleanly.
|
* The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
||||||
*/
|
*/
|
||||||
readonly wasClean: boolean;
|
readonly wasClean: boolean;
|
||||||
}
|
}
|
||||||
interface CloseEventInit {
|
interface CloseEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
code?: number;
|
code?: number;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
wasClean?: boolean;
|
wasClean?: boolean;
|
||||||
@@ -3186,7 +3100,7 @@ type WebSocketEventMap = {
|
|||||||
error: ErrorEvent;
|
error: ErrorEvent;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
@@ -3203,20 +3117,20 @@ declare var WebSocket: {
|
|||||||
readonly CLOSED: number;
|
readonly CLOSED: number;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
||||||
accept(options?: WebSocketAcceptOptions): void;
|
accept(options?: WebSocketAcceptOptions): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. The browser will throw an exception if you call send() when the connection is in the CONNECTING state. If you call send() when the connection is in the CLOSING or CLOSED states, the browser will silently discard the data.
|
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
||||||
*/
|
*/
|
||||||
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.close()`** method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.
|
* The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
||||||
*/
|
*/
|
||||||
@@ -3236,13 +3150,13 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|||||||
*/
|
*/
|
||||||
url: string | null;
|
url: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object, or the empty string if no connection is established.
|
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
||||||
*/
|
*/
|
||||||
protocol: string | null;
|
protocol: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.
|
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
||||||
*/
|
*/
|
||||||
@@ -3329,25 +3243,25 @@ interface SocketInfo {
|
|||||||
declare class EventSource extends EventTarget {
|
declare class EventSource extends EventTarget {
|
||||||
constructor(url: string, init?: EventSourceEventSourceInit);
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the EventSource.readyState attribute to 2 (closed).
|
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the EventSource interface returns a string representing the URL of the source.
|
* The **`url`** read-only property of the URL of the source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
||||||
*/
|
*/
|
||||||
get url(): string;
|
get url(): string;
|
||||||
/**
|
/**
|
||||||
* The **`withCredentials`** read-only property of the EventSource interface returns a boolean value indicating whether the EventSource object was instantiated with CORS credentials set.
|
* The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
||||||
*/
|
*/
|
||||||
get withCredentials(): boolean;
|
get withCredentials(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`readyState`** read-only property of the EventSource interface returns a number representing the state of the connection.
|
* The **`readyState`** read-only property of the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
||||||
*/
|
*/
|
||||||
@@ -3382,26 +3296,18 @@ interface ContainerExecOptions {
|
|||||||
cwd?: string;
|
cwd?: string;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
user?: string;
|
user?: string;
|
||||||
signal?: AbortSignal;
|
|
||||||
pty?: boolean | ContainerExecPtyOptions;
|
|
||||||
stdin?: ReadableStream | "pipe";
|
stdin?: ReadableStream | "pipe";
|
||||||
stdout?: "pipe" | "ignore";
|
stdout?: "pipe" | "ignore";
|
||||||
stderr?: "pipe" | "ignore" | "combined";
|
stderr?: "pipe" | "ignore" | "combined";
|
||||||
}
|
}
|
||||||
interface ContainerExecPtyOptions {
|
|
||||||
cols?: number;
|
|
||||||
rows?: number;
|
|
||||||
}
|
|
||||||
interface ExecProcess {
|
interface ExecProcess {
|
||||||
readonly stdin: WritableStream | null;
|
readonly stdin: WritableStream | null;
|
||||||
readonly stdout: ReadableStream | null;
|
readonly stdout: ReadableStream | null;
|
||||||
readonly stderr: ReadableStream | null;
|
readonly stderr: ReadableStream | null;
|
||||||
readonly pid: number;
|
readonly pid: number;
|
||||||
readonly isPty: boolean;
|
|
||||||
readonly exitCode: Promise<number>;
|
readonly exitCode: Promise<number>;
|
||||||
output(): Promise<ExecOutput>;
|
output(): Promise<ExecOutput>;
|
||||||
kill(signal?: number): void;
|
kill(signal?: number): void;
|
||||||
resize(cols: number, rows: number): void;
|
|
||||||
}
|
}
|
||||||
interface Container {
|
interface Container {
|
||||||
get running(): boolean;
|
get running(): boolean;
|
||||||
@@ -3428,42 +3334,25 @@ interface ContainerDirectorySnapshotOptions {
|
|||||||
dir: string;
|
dir: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerDirectorySnapshotRestoreParams = {
|
interface ContainerDirectorySnapshotRestoreParams {
|
||||||
snapshot: ContainerDirectorySnapshot;
|
snapshot: ContainerDirectorySnapshot;
|
||||||
mountPoint?: string;
|
mountPoint?: string;
|
||||||
} | {
|
}
|
||||||
snapshot?: undefined;
|
|
||||||
mountPoint: string;
|
|
||||||
};
|
|
||||||
interface ContainerSnapshot {
|
interface ContainerSnapshot {
|
||||||
id: string;
|
id: string;
|
||||||
size: number;
|
size: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
interface ContainerSnapshotRestoreParams {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
interface ContainerSnapshotOptions {
|
interface ContainerSnapshotOptions {
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerStartupOptions = {
|
interface ContainerStartupOptions {
|
||||||
entrypoint?: string[];
|
entrypoint?: string[];
|
||||||
enableInternet: boolean;
|
enableInternet: boolean;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
instance?: "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | ContainerStartResources;
|
|
||||||
labels?: Record<string, string>;
|
labels?: Record<string, string>;
|
||||||
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
||||||
} & ({
|
containerSnapshot?: ContainerSnapshot;
|
||||||
image: string;
|
|
||||||
containerSnapshot?: never;
|
|
||||||
} | {
|
|
||||||
image?: never;
|
|
||||||
containerSnapshot?: ContainerSnapshotRestoreParams;
|
|
||||||
});
|
|
||||||
interface ContainerStartResources {
|
|
||||||
vcpu: number;
|
|
||||||
memoryMib: number;
|
|
||||||
diskMb: number;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
||||||
@@ -3472,19 +3361,19 @@ interface ContainerStartResources {
|
|||||||
*/
|
*/
|
||||||
declare abstract class MessagePort extends EventTarget {
|
declare abstract class MessagePort extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`postMessage()`** method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
|
* The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
||||||
*/
|
*/
|
||||||
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.
|
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage.
|
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
||||||
*/
|
*/
|
||||||
@@ -3500,13 +3389,13 @@ declare abstract class MessagePort extends EventTarget {
|
|||||||
declare class MessageChannel {
|
declare class MessageChannel {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`port1`** read-only property of the MessageChannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
|
* The **`port1`** read-only property of the the port attached to the context that originated the channel.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
||||||
*/
|
*/
|
||||||
readonly port1: MessagePort;
|
readonly port1: MessagePort;
|
||||||
/**
|
/**
|
||||||
* The **`port2`** read-only property of the MessageChannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
|
* The **`port2`** read-only property of the the port attached to the context at the other end of the channel, which the message is initially sent to.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
||||||
*/
|
*/
|
||||||
@@ -3566,7 +3455,7 @@ interface WorkerLoaderModule {
|
|||||||
data?: ArrayBuffer;
|
data?: ArrayBuffer;
|
||||||
json?: any;
|
json?: any;
|
||||||
py?: string;
|
py?: string;
|
||||||
wasm?: ArrayBuffer | ArrayBufferView | WebAssembly.Module;
|
wasm?: ArrayBuffer;
|
||||||
}
|
}
|
||||||
interface WorkerLoaderWorkerCode {
|
interface WorkerLoaderWorkerCode {
|
||||||
compatibilityDate: string;
|
compatibilityDate: string;
|
||||||
@@ -3574,7 +3463,7 @@ interface WorkerLoaderWorkerCode {
|
|||||||
allowExperimental?: boolean;
|
allowExperimental?: boolean;
|
||||||
limits?: workerdResourceLimits;
|
limits?: workerdResourceLimits;
|
||||||
mainModule: string;
|
mainModule: string;
|
||||||
modules: Record<string, string | WebAssembly.Module | WorkerLoaderModule>;
|
modules: Record<string, WorkerLoaderModule | string>;
|
||||||
env?: any;
|
env?: any;
|
||||||
globalOutbound?: (Fetcher | null);
|
globalOutbound?: (Fetcher | null);
|
||||||
tails?: Fetcher[];
|
tails?: Fetcher[];
|
||||||
@@ -3596,7 +3485,7 @@ declare abstract class Performance {
|
|||||||
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
||||||
now(): number;
|
now(): number;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the Performance interface is a serializer; it returns a JSON representation of the Performance object.
|
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -3605,13 +3494,11 @@ declare abstract class Performance {
|
|||||||
interface Tracing {
|
interface Tracing {
|
||||||
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startSpan(name: string): Span;
|
|
||||||
Span: typeof Span;
|
Span: typeof Span;
|
||||||
}
|
}
|
||||||
declare abstract class Span {
|
declare abstract class Span {
|
||||||
get isTraced(): boolean;
|
get isTraced(): boolean;
|
||||||
setAttribute(key: string, value: boolean | number | string): this;
|
setAttribute(key: string, value?: (boolean | number | string)): void;
|
||||||
setAttributes(attributes: Record<string, boolean | number | string | undefined>): this;
|
|
||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -4251,13 +4138,6 @@ type AiSearchListItemsParams = {
|
|||||||
source?: string;
|
source?: string;
|
||||||
/** JSON-encoded Vectorize filter for metadata filtering. */
|
/** JSON-encoded Vectorize filter for metadata filtering. */
|
||||||
metadata_filter?: string;
|
metadata_filter?: string;
|
||||||
/** Filter items by their unique ID. Returns at most one item. */
|
|
||||||
item_id?: string;
|
|
||||||
/**
|
|
||||||
* Filter items by their exact key (object key / filename). Keys are unique
|
|
||||||
* per source, so combine with `source` to disambiguate across data sources.
|
|
||||||
*/
|
|
||||||
key?: string;
|
|
||||||
};
|
};
|
||||||
type AiSearchListItemsResponse = {
|
type AiSearchListItemsResponse = {
|
||||||
result: AiSearchItemInfo[];
|
result: AiSearchItemInfo[];
|
||||||
@@ -10155,163 +10035,6 @@ declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|||||||
inputs: ChatCompletionsInput;
|
inputs: ChatCompletionsInput;
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
postProcessedOutputs: ChatCompletionsOutput;
|
||||||
}
|
}
|
||||||
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_2 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input {
|
|
||||||
/**
|
|
||||||
* Which Moondream skill to run.
|
|
||||||
*/
|
|
||||||
task?: "query" | "caption" | "point" | "detect";
|
|
||||||
/**
|
|
||||||
* Input image as a public HTTPS URL or base64 data URI. Optional for `query`; required for `caption`, `point`, and `detect`.
|
|
||||||
*/
|
|
||||||
image?: string;
|
|
||||||
/**
|
|
||||||
* Question for the `query` task.
|
|
||||||
*/
|
|
||||||
question?: string;
|
|
||||||
/**
|
|
||||||
* Caption length for the `caption` task.
|
|
||||||
*/
|
|
||||||
caption_length?: "short" | "normal" | "long";
|
|
||||||
/**
|
|
||||||
* Object phrase to locate for `point` and `detect` tasks (e.g. 'person wearing a red shirt').
|
|
||||||
*/
|
|
||||||
target?: string;
|
|
||||||
/**
|
|
||||||
* Enable reasoning trace for the `query` task.
|
|
||||||
*/
|
|
||||||
reasoning?: boolean;
|
|
||||||
/**
|
|
||||||
* Sampling temperature.
|
|
||||||
*/
|
|
||||||
temperature?: number;
|
|
||||||
/**
|
|
||||||
* Top-p (nucleus) sampling.
|
|
||||||
*/
|
|
||||||
top_p?: number;
|
|
||||||
/**
|
|
||||||
* Max tokens to generate for `query` and `caption`.
|
|
||||||
*/
|
|
||||||
max_tokens?: number;
|
|
||||||
/**
|
|
||||||
* Max objects to return for `point` and `detect`.
|
|
||||||
*/
|
|
||||||
max_objects?: number;
|
|
||||||
/**
|
|
||||||
* Return incremental tokens for `query` and `caption`. `point` and `detect` do not support streaming.
|
|
||||||
*/
|
|
||||||
stream?: boolean;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output {
|
|
||||||
/**
|
|
||||||
* Reason the generation finished.
|
|
||||||
*/
|
|
||||||
finish_reason: string;
|
|
||||||
metrics: {
|
|
||||||
/**
|
|
||||||
* Number of input tokens consumed.
|
|
||||||
*/
|
|
||||||
input_tokens: number;
|
|
||||||
/**
|
|
||||||
* Number of output tokens generated.
|
|
||||||
*/
|
|
||||||
output_tokens: number;
|
|
||||||
/**
|
|
||||||
* Prefill time in milliseconds.
|
|
||||||
*/
|
|
||||||
prefill_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Decode time in milliseconds.
|
|
||||||
*/
|
|
||||||
decode_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Time to first token in milliseconds.
|
|
||||||
*/
|
|
||||||
ttft_ms: number;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Answer text for the `query` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
answer?: string;
|
|
||||||
/**
|
|
||||||
* Caption text for the `caption` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
caption?: string;
|
|
||||||
/**
|
|
||||||
* Located points for the `point` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
points?: {
|
|
||||||
/**
|
|
||||||
* X coordinate.
|
|
||||||
*/
|
|
||||||
x: number;
|
|
||||||
/**
|
|
||||||
* Y coordinate.
|
|
||||||
*/
|
|
||||||
y: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Detected bounding boxes for the `detect` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
objects?: {
|
|
||||||
/**
|
|
||||||
* Minimum X coordinate.
|
|
||||||
*/
|
|
||||||
x_min: number;
|
|
||||||
/**
|
|
||||||
* Minimum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_min: number;
|
|
||||||
/**
|
|
||||||
* Maximum X coordinate.
|
|
||||||
*/
|
|
||||||
x_max: number;
|
|
||||||
/**
|
|
||||||
* Maximum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_max: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Reasoning trace for the `query` task when reasoning=true. Null otherwise.
|
|
||||||
*/
|
|
||||||
reasoning?: {
|
|
||||||
/**
|
|
||||||
* Reasoning text.
|
|
||||||
*/
|
|
||||||
text: string;
|
|
||||||
/**
|
|
||||||
* Grounding information.
|
|
||||||
*/
|
|
||||||
grounding?: {}[];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B {
|
|
||||||
inputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input;
|
|
||||||
postProcessedOutputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Qwen_Qwen3_8_27B {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3_Flash {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface AiModels {
|
interface AiModels {
|
||||||
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
||||||
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
||||||
@@ -10404,13 +10127,6 @@ interface AiModels {
|
|||||||
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
||||||
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
||||||
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
||||||
"@cf/moonshotai/kimi-k2.7-code": Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code;
|
|
||||||
"@cf/zai-org/glm-5.2": Base_Ai_Cf_Zai_Org_Glm_5_2;
|
|
||||||
"@cf/moondream/moondream3.1-9B-A2B": Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-flash-0731": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-pro-0813": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813;
|
|
||||||
"@cf/qwen/qwen3.8-27b": Base_Ai_Cf_Qwen_Qwen3_8_27B;
|
|
||||||
"@cf/zai-org/glm-5.3-flash": Base_Ai_Cf_Zai_Org_Glm_5_3_Flash;
|
|
||||||
}
|
}
|
||||||
type AiOptions = {
|
type AiOptions = {
|
||||||
/**
|
/**
|
||||||
@@ -11077,15 +10793,6 @@ interface BrowserRunBaseOptions {
|
|||||||
*/
|
*/
|
||||||
cacheTTL?: number;
|
cacheTTL?: number;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Backend selection, mixed into the options of the quick actions that support it.
|
|
||||||
* Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
|
|
||||||
* reject an alternate backend, so they must not accept the field.
|
|
||||||
*/
|
|
||||||
interface BrowserRunAlternateBackendOptions {
|
|
||||||
/** Render with an alternate browser backend instead of the default one. */
|
|
||||||
browser?: 'kitesurf';
|
|
||||||
}
|
|
||||||
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
||||||
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
||||||
/** URL to navigate to, e.g. `"https://example.com"`. */
|
/** URL to navigate to, e.g. `"https://example.com"`. */
|
||||||
@@ -11120,7 +10827,7 @@ type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
|
|||||||
scrollPage?: boolean;
|
scrollPage?: boolean;
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
||||||
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
||||||
pdfOptions?: {
|
pdfOptions?: {
|
||||||
@@ -11156,7 +10863,7 @@ type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
|||||||
/** @default 30000 */
|
/** @default 30000 */
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
};
|
};
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
||||||
/** CSS selectors to scrape. At least one element is required. */
|
/** CSS selectors to scrape. At least one element is required. */
|
||||||
elements: Array<{
|
elements: Array<{
|
||||||
@@ -11169,29 +10876,10 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
|
|||||||
/** When true, exclude links pointing to external domains. @default false */
|
/** When true, exclude links pointing to external domains. @default false */
|
||||||
excludeExternalLinks?: boolean;
|
excludeExternalLinks?: boolean;
|
||||||
};
|
};
|
||||||
type BrowserRunSnapshotFormat = 'content' | 'screenshot' | 'markdown' | 'accessibilityTree';
|
|
||||||
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
||||||
/** Which representations of the page to return. At least two distinct formats
|
|
||||||
* are required; request a single format from its dedicated action instead.
|
|
||||||
* @default ["content","screenshot"]
|
|
||||||
*/
|
|
||||||
formats?: BrowserRunSnapshotFormat[];
|
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
||||||
};
|
};
|
||||||
/** Options for the `accessibilityTree` quick action. */
|
|
||||||
type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
|
|
||||||
/** When true, prune nodes that carry no semantic meaning, such as generic
|
|
||||||
* containers. Defaults to true, or to false when `root` is set so that the
|
|
||||||
* requested subtree is returned as-is.
|
|
||||||
*/
|
|
||||||
interestingOnly?: boolean;
|
|
||||||
/** CSS selector limiting the tree to the matching element's subtree.
|
|
||||||
* A selector that matches nothing yields `accessibilityTree: null` with
|
|
||||||
* HTTP 200; a malformed selector is an error.
|
|
||||||
*/
|
|
||||||
root?: string;
|
|
||||||
} & BrowserRunAlternateBackendOptions;
|
|
||||||
interface BrowserRunJsonBaseOptions {
|
interface BrowserRunJsonBaseOptions {
|
||||||
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
||||||
custom_ai?: Array<{
|
custom_ai?: Array<{
|
||||||
@@ -11205,7 +10893,7 @@ interface BrowserRunJsonBaseOptions {
|
|||||||
* Options for the `json` quick action.
|
* Options for the `json` quick action.
|
||||||
* At least one of `prompt` or `response_format` must be provided.
|
* At least one of `prompt` or `response_format` must be provided.
|
||||||
*/
|
*/
|
||||||
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions & BrowserRunJsonBaseOptions & ({
|
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunJsonBaseOptions & ({
|
||||||
/** Natural-language prompt describing what data to extract. */
|
/** Natural-language prompt describing what data to extract. */
|
||||||
prompt: string;
|
prompt: string;
|
||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
@@ -11216,80 +10904,14 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBacken
|
|||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
response_format: AiTextGenerationResponseFormat;
|
response_format: AiTextGenerationResponseFormat;
|
||||||
});
|
});
|
||||||
type BrowserRunContentOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunContentOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunMarkdownOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunRedirectHop = {
|
|
||||||
/** URL that returned the redirect. */
|
|
||||||
url: string;
|
|
||||||
/** HTTP status of the redirect. */
|
|
||||||
status: number;
|
|
||||||
/** Redirect response headers, including `location`. */
|
|
||||||
headers: Record<string, string>;
|
|
||||||
};
|
|
||||||
type BrowserRunResponseMeta = {
|
type BrowserRunResponseMeta = {
|
||||||
/** HTTP status code of the rendered page */
|
/** HTTP status code of the rendered page */
|
||||||
status: number;
|
status: number;
|
||||||
/** Page title */
|
/** Page title */
|
||||||
title: string;
|
title: string;
|
||||||
/** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
/** URL that served the response, after any redirects the browser followed. */
|
|
||||||
finalUrl?: string;
|
|
||||||
/** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
|
|
||||||
redirectChain?: BrowserRunRedirectHop[];
|
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* A node in the page's accessibility tree, as exposed to assistive technology.
|
|
||||||
* `role` is the only field always present; the rest are populated when the
|
|
||||||
* underlying element defines them.
|
|
||||||
* @see https://pptr.dev/api/puppeteer.serializedaxnode
|
|
||||||
*/
|
|
||||||
interface BrowserRunSerializedAXNode {
|
|
||||||
/** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
|
|
||||||
role: string;
|
|
||||||
/** The `aria-autocomplete` value. */
|
|
||||||
autocomplete?: string;
|
|
||||||
/** Checked state of a checkbox, radio, or menu item. */
|
|
||||||
checked?: boolean | 'mixed';
|
|
||||||
/** Accessible description, typically from `aria-describedby` or `title`. */
|
|
||||||
description?: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
expanded?: boolean;
|
|
||||||
/** Whether the element currently holds keyboard focus. */
|
|
||||||
focused?: boolean;
|
|
||||||
/** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
|
|
||||||
haspopup?: string;
|
|
||||||
/** The `aria-invalid` value. */
|
|
||||||
invalid?: string;
|
|
||||||
/** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
|
|
||||||
keyshortcuts?: string;
|
|
||||||
/** Hierarchical level, e.g. the heading level of an `<h2>`. */
|
|
||||||
level?: number;
|
|
||||||
/** Whether the element is a modal dialog. */
|
|
||||||
modal?: boolean;
|
|
||||||
/** Whether a text input accepts multiple lines. */
|
|
||||||
multiline?: boolean;
|
|
||||||
/** Whether more than one option can be selected. */
|
|
||||||
multiselectable?: boolean;
|
|
||||||
/** Accessible name, e.g. a button's label or an image's alt text. */
|
|
||||||
name?: string;
|
|
||||||
orientation?: string;
|
|
||||||
/** Pressed state of a toggle button. */
|
|
||||||
pressed?: boolean | 'mixed';
|
|
||||||
readonly?: boolean;
|
|
||||||
required?: boolean;
|
|
||||||
/** Author-supplied role description, from `aria-roledescription`. */
|
|
||||||
roledescription?: string;
|
|
||||||
selected?: boolean;
|
|
||||||
/** Current value of an input or range element. */
|
|
||||||
value?: string | number;
|
|
||||||
valuemax?: number;
|
|
||||||
valuemin?: number;
|
|
||||||
/** Human-readable form of `value`, from `aria-valuetext`. */
|
|
||||||
valuetext?: string;
|
|
||||||
/** Child nodes. Absent for leaf nodes. */
|
|
||||||
children?: BrowserRunSerializedAXNode[];
|
|
||||||
}
|
|
||||||
/** Success response for `content` action. */
|
/** Success response for `content` action. */
|
||||||
type BrowserRunContentSuccessResponse = {
|
type BrowserRunContentSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
@@ -11302,7 +10924,6 @@ type BrowserRunLinksSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** Extracted links */
|
/** Extracted links */
|
||||||
result: string[];
|
result: string[];
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `scrape` action. */
|
/** Success response for `scrape` action. */
|
||||||
type BrowserRunScrapeSuccessResponse = {
|
type BrowserRunScrapeSuccessResponse = {
|
||||||
@@ -11333,33 +10954,15 @@ type BrowserRunScrapeSuccessResponse = {
|
|||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `snapshot` action. Each field is present only when the
|
/** Success response for `snapshot` action. */
|
||||||
* corresponding entry was requested in `formats`.
|
|
||||||
*/
|
|
||||||
type BrowserRunSnapshotSuccessResponse = {
|
type BrowserRunSnapshotSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
result: {
|
result: {
|
||||||
/** HTML content of the page. */
|
/** HTML content of the page. */
|
||||||
content?: string;
|
content: string;
|
||||||
/** Base64-encoded screenshot image. */
|
/** Base64-encoded screenshot image. */
|
||||||
screenshot?: string;
|
screenshot: string;
|
||||||
/** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
|
|
||||||
* page provides that metadata.
|
|
||||||
*/
|
|
||||||
markdown?: string;
|
|
||||||
/** Root of the page's accessibility tree. */
|
|
||||||
accessibilityTree?: BrowserRunSerializedAXNode;
|
|
||||||
};
|
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
|
||||||
/** Success response for `accessibilityTree` action. */
|
|
||||||
type BrowserRunAccessibilityTreeSuccessResponse = {
|
|
||||||
success: true;
|
|
||||||
result: {
|
|
||||||
/** Root of the accessibility tree, or `null` when `root` matched no element. */
|
|
||||||
accessibilityTree: BrowserRunSerializedAXNode | null;
|
|
||||||
};
|
};
|
||||||
meta: BrowserRunResponseMeta;
|
meta: BrowserRunResponseMeta;
|
||||||
};
|
};
|
||||||
@@ -11368,14 +10971,12 @@ type BrowserRunJsonSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** JSON data extracted from the page using an AI model */
|
/** JSON data extracted from the page using an AI model */
|
||||||
result: Record<string, unknown>;
|
result: Record<string, unknown>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `markdown` action. */
|
/** Success response for `markdown` action. */
|
||||||
type BrowserRunMarkdownSuccessResponse = {
|
type BrowserRunMarkdownSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
/** Extracted markdown content */
|
/** Extracted markdown content */
|
||||||
result: string;
|
result: string;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Error response for BrowserRun actions. */
|
/** Error response for BrowserRun actions. */
|
||||||
type BrowserRunErrorResponse = {
|
type BrowserRunErrorResponse = {
|
||||||
@@ -11485,10 +11086,9 @@ declare abstract class BrowserRun {
|
|||||||
*/
|
*/
|
||||||
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
||||||
/**
|
/**
|
||||||
* Get several representations of a web page in one request.
|
* Get both the HTML content and a base64-encoded screenshot of a web page.
|
||||||
* @param action - Must be `'snapshot'`.
|
* @param action - Must be `'snapshot'`.
|
||||||
* @param options - Snapshot options including the `formats` to return and
|
* @param options - Snapshot options including screenshot settings (encoding is always base64).
|
||||||
* screenshot settings (encoding is always base64).
|
|
||||||
* @returns A `Response` containing one of:
|
* @returns A `Response` containing one of:
|
||||||
*
|
*
|
||||||
* **Success (HTTP 200):**
|
* **Success (HTTP 200):**
|
||||||
@@ -11536,26 +11136,6 @@ declare abstract class BrowserRun {
|
|||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
||||||
*/
|
*/
|
||||||
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
||||||
/**
|
|
||||||
* Get the accessibility tree of a web page.
|
|
||||||
* @param action - Must be `'accessibilityTree'`.
|
|
||||||
* @param options - Options to scope the tree to a subtree and to control
|
|
||||||
* whether semantically uninteresting nodes are pruned.
|
|
||||||
* @returns A `Response` containing one of:
|
|
||||||
*
|
|
||||||
* **Success (HTTP 200):**
|
|
||||||
* - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
|
|
||||||
* - `result.accessibilityTree` is `null` when `root` matched no element
|
|
||||||
*
|
|
||||||
* **Error:**
|
|
||||||
* - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
|
|
||||||
* - HTTP 422 for a malformed `root` selector
|
|
||||||
* - HTTP 500 with code `2017` or `2018` when the tree could not be built
|
|
||||||
*
|
|
||||||
* **Headers:**
|
|
||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
|
||||||
*/
|
|
||||||
quickAction(action: 'accessibilityTree', options: BrowserRunAccessibilityTreeOptions): Promise<Response>;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* In addition to the properties you can set in the RequestInit dict
|
* In addition to the properties you can set in the RequestInit dict
|
||||||
@@ -12626,13 +12206,6 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|||||||
* @returns A promise that resolves when the email message is replied.
|
* @returns A promise that resolves when the email message is replied.
|
||||||
*/
|
*/
|
||||||
reply(message: EmailMessage): Promise<EmailSendResult>;
|
reply(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
/**
|
|
||||||
* Reply to the sender of this email message with a message built from the given
|
|
||||||
* fields. Threading headers (In-Reply-To/References) are set automatically.
|
|
||||||
* @param builder The reply message contents.
|
|
||||||
* @returns A promise that resolves when the email message is replied.
|
|
||||||
*/
|
|
||||||
reply(builder: EmailReplyMessageBuilder): Promise<EmailSendResult>;
|
|
||||||
}
|
}
|
||||||
/** A file attachment for an email message */
|
/** A file attachment for an email message */
|
||||||
type EmailAttachment = {
|
type EmailAttachment = {
|
||||||
@@ -12653,46 +12226,23 @@ interface EmailAddress {
|
|||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Recipient fields for `SendEmail.send()`. At least one of `to`, `cc`, or
|
|
||||||
* `bcc` must be provided.
|
|
||||||
*/
|
|
||||||
type EmailDestinations = {
|
|
||||||
to?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
cc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} & ({
|
|
||||||
to: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
cc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
bcc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* Fields shared by all composed emails (no recipients). Used directly by
|
|
||||||
* `ForwardableEmailMessage.reply()`, which always replies to the original
|
|
||||||
* sender, and extended by `EmailMessageBuilder` for `SendEmail.send()`.
|
|
||||||
*/
|
|
||||||
interface EmailReplyMessageBuilder {
|
|
||||||
from: string | EmailAddress;
|
|
||||||
subject: string;
|
|
||||||
replyTo?: string | EmailAddress;
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
text?: string;
|
|
||||||
html?: string;
|
|
||||||
attachments?: EmailAttachment[];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Fields for composing an email without constructing raw MIME, for
|
|
||||||
* `SendEmail.send()`. Requires at least one of `to`, `cc`, or `bcc`.
|
|
||||||
*/
|
|
||||||
type EmailMessageBuilder = EmailReplyMessageBuilder & EmailDestinations;
|
|
||||||
/**
|
/**
|
||||||
* A binding that allows a Worker to send email messages.
|
* A binding that allows a Worker to send email messages.
|
||||||
*/
|
*/
|
||||||
interface SendEmail {
|
interface SendEmail {
|
||||||
send(message: EmailMessage): Promise<EmailSendResult>;
|
send(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
send(builder: EmailMessageBuilder): Promise<EmailSendResult>;
|
send(builder: {
|
||||||
|
from: string | EmailAddress;
|
||||||
|
to: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
subject: string;
|
||||||
|
replyTo?: string | EmailAddress;
|
||||||
|
cc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
headers?: Record<string, string>;
|
||||||
|
text?: string;
|
||||||
|
html?: string;
|
||||||
|
attachments?: EmailAttachment[];
|
||||||
|
}): Promise<EmailSendResult>;
|
||||||
}
|
}
|
||||||
declare abstract class EmailEvent extends ExtendableEvent {
|
declare abstract class EmailEvent extends ExtendableEvent {
|
||||||
readonly message: ForwardableEmailMessage;
|
readonly message: ForwardableEmailMessage;
|
||||||
@@ -12846,15 +12396,6 @@ interface Hyperdrive {
|
|||||||
* for your database.
|
* for your database.
|
||||||
*/
|
*/
|
||||||
readonly host: string;
|
readonly host: string;
|
||||||
/*
|
|
||||||
* A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
|
|
||||||
* host field, is only valid within the context of the currently running
|
|
||||||
* Worker and, when passed into the `connect()` function from the
|
|
||||||
* "cloudflare:sockets" module, will connect to the Hyperdrive instance for
|
|
||||||
* your database. This is provided for database drivers that require the host
|
|
||||||
* to be an IP literal rather than a hostname.
|
|
||||||
*/
|
|
||||||
readonly ip: string;
|
|
||||||
/*
|
/*
|
||||||
* The port that must be paired the the host field when connecting.
|
* The port that must be paired the the host field when connecting.
|
||||||
*/
|
*/
|
||||||
@@ -12876,78 +12417,6 @@ interface Hyperdrive {
|
|||||||
*/
|
*/
|
||||||
readonly database: string;
|
readonly database: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* A handle to a dynamically-provisioned Hyperdrive connection, returned by
|
|
||||||
* `HyperdriveApi.get()`.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamic extends Disposable {
|
|
||||||
/**
|
|
||||||
* The database name to use when connecting through this Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly database: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated user to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly user: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated password to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly password: Promise<string>;
|
|
||||||
/**
|
|
||||||
* Open a TCP socket to the target database through this Hyperdrive.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
connect(): Promise<Socket>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Binding that provisions Hyperdrive connections at request time, rather than
|
|
||||||
* from static configuration.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicApi {
|
|
||||||
/**
|
|
||||||
* Provision a connection for the database described by `args`.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
|
|
||||||
/**
|
|
||||||
* Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
|
|
||||||
*/
|
|
||||||
getHyperdriveConnectionString(connectionString: string): Promise<string>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Parameters identifying the database that a dynamically-provisioned
|
|
||||||
* Hyperdrive connection should target.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicConfig {
|
|
||||||
/**
|
|
||||||
* Generated connection string to pass into the dynamic worker.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
dynamicHyperdriveConnectionString: string;
|
|
||||||
/**
|
|
||||||
* Connection string for the origin database Hyperdrive should connect to.
|
|
||||||
* Contains credentials, so treat it as a secret.
|
|
||||||
*
|
|
||||||
* The scheme selects the database engine. PostgreSQL origins are supported.
|
|
||||||
*/
|
|
||||||
connectionString: string;
|
|
||||||
/**
|
|
||||||
* Region in which to place the connection pool. See the Hyperdrive
|
|
||||||
* documentation for the set of supported regions.
|
|
||||||
*/
|
|
||||||
targetRegion: string;
|
|
||||||
/**
|
|
||||||
* Whether Hyperdrive should cache query results for this connection.
|
|
||||||
*/
|
|
||||||
cachingEnabled?: boolean;
|
|
||||||
/**
|
|
||||||
* Maximum number of connections the pool may open to the origin database.
|
|
||||||
* Defaults to 60.
|
|
||||||
*/
|
|
||||||
maxConnections?: number;
|
|
||||||
}
|
|
||||||
// Copyright (c) 2024 Cloudflare, Inc.
|
// Copyright (c) 2024 Cloudflare, Inc.
|
||||||
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
||||||
// https://opensource.org/licenses/Apache-2.0
|
// https://opensource.org/licenses/Apache-2.0
|
||||||
@@ -12959,27 +12428,6 @@ type ImageInfoResponse = {
|
|||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* Parameters for rasterizing text into an image.
|
|
||||||
*/
|
|
||||||
type TextRasterize = {
|
|
||||||
/** The text content to render */
|
|
||||||
content: string;
|
|
||||||
/** rasterization options for the text **/
|
|
||||||
options: TextOptions;
|
|
||||||
};
|
|
||||||
type TextOptions = {
|
|
||||||
/** Font configuration */
|
|
||||||
font: {
|
|
||||||
/** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
/** Font size in points (pt) */
|
|
||||||
size?: number;
|
|
||||||
/** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
|
|
||||||
color?: string;
|
|
||||||
};
|
|
||||||
type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
|
|
||||||
type ImageTransform = {
|
type ImageTransform = {
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
@@ -13069,9 +12517,6 @@ interface ImageUploadOptions {
|
|||||||
requireSignedURLs?: boolean;
|
requireSignedURLs?: boolean;
|
||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
/**
|
|
||||||
* If 'base64', the input data will be decoded from base64 before processing
|
|
||||||
*/
|
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
}
|
}
|
||||||
interface ImageUpdateOptions {
|
interface ImageUpdateOptions {
|
||||||
@@ -13079,40 +12524,11 @@ interface ImageUpdateOptions {
|
|||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
}
|
}
|
||||||
type ImageMetadataFilterOperators = {
|
|
||||||
eq?: string | number | boolean;
|
|
||||||
in?: string[] | number[];
|
|
||||||
gt?: number;
|
|
||||||
gte?: number;
|
|
||||||
lt?: number;
|
|
||||||
lte?: number;
|
|
||||||
};
|
|
||||||
type ImageMetadataFilterValue = string | number | boolean | ImageMetadataFilterOperators;
|
|
||||||
interface ImageListFilter {
|
|
||||||
metadata?: Record<string, ImageMetadataFilterValue>;
|
|
||||||
}
|
|
||||||
interface ImageListOptions {
|
interface ImageListOptions {
|
||||||
limit?: number;
|
limit?: number;
|
||||||
cursor?: string;
|
cursor?: string;
|
||||||
sortOrder?: 'asc' | 'desc';
|
sortOrder?: 'asc' | 'desc';
|
||||||
creator?: string;
|
creator?: string;
|
||||||
filter?: ImageListFilter;
|
|
||||||
}
|
|
||||||
interface ImageSignedUrlOptions {
|
|
||||||
variant: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
keyName?: string;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadOptions {
|
|
||||||
id?: string;
|
|
||||||
requireSignedURLs?: boolean;
|
|
||||||
metadata?: Record<string, unknown>;
|
|
||||||
creator?: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadResult {
|
|
||||||
id: string;
|
|
||||||
uploadURL: string;
|
|
||||||
}
|
}
|
||||||
interface ImageList {
|
interface ImageList {
|
||||||
images: ImageMetadata[];
|
images: ImageMetadata[];
|
||||||
@@ -13130,13 +12546,6 @@ interface ImageHandle {
|
|||||||
* @returns ReadableStream of image bytes, or null if not found
|
* @returns ReadableStream of image bytes, or null if not found
|
||||||
*/
|
*/
|
||||||
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
||||||
/**
|
|
||||||
* Generate a signed delivery URL for this hosted image.
|
|
||||||
* @param options Signing configuration
|
|
||||||
* @returns A signed image delivery URL
|
|
||||||
* @throws {@link ImagesError} if signing fails
|
|
||||||
*/
|
|
||||||
signedUrl(options: ImageSignedUrlOptions): Promise<string>;
|
|
||||||
/**
|
/**
|
||||||
* Update hosted image metadata
|
* Update hosted image metadata
|
||||||
* @param options Properties to update
|
* @param options Properties to update
|
||||||
@@ -13172,14 +12581,6 @@ interface HostedImagesBinding {
|
|||||||
* @throws {@link ImagesError} if list fails
|
* @throws {@link ImagesError} if list fails
|
||||||
*/
|
*/
|
||||||
list(options?: ImageListOptions): Promise<ImageList>;
|
list(options?: ImageListOptions): Promise<ImageList>;
|
||||||
/**
|
|
||||||
* Create a Direct Creator Upload link, letting an end user upload an
|
|
||||||
* image straight to Cloudflare without exposing an API token
|
|
||||||
* @param options Upload link configuration
|
|
||||||
* @returns The new image ID and the upload URL to hand to the end user
|
|
||||||
* @throws {@link ImagesError} if creation fails
|
|
||||||
*/
|
|
||||||
createDirectUpload(options?: ImageDirectUploadOptions): Promise<ImageDirectUploadResult>;
|
|
||||||
}
|
}
|
||||||
interface ImagesBinding {
|
interface ImagesBinding {
|
||||||
/**
|
/**
|
||||||
@@ -13194,13 +12595,6 @@ interface ImagesBinding {
|
|||||||
* @returns A transform handle
|
* @returns A transform handle
|
||||||
*/
|
*/
|
||||||
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
||||||
/**
|
|
||||||
* Begin applying a series of transformations to text
|
|
||||||
* @param content string to be rendered
|
|
||||||
* @param options font, optional color and size to use in rendering text
|
|
||||||
* @returns A transform handle
|
|
||||||
*/
|
|
||||||
text(content: string, options: TextOptions): ImageTransformer;
|
|
||||||
/**
|
/**
|
||||||
* Access hosted images CRUD operations
|
* Access hosted images CRUD operations
|
||||||
*/
|
*/
|
||||||
@@ -13230,15 +12624,11 @@ interface ImageTransformer {
|
|||||||
type ImageTransformationOutputOptions = {
|
type ImageTransformationOutputOptions = {
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
};
|
};
|
||||||
type ImageTransformationResponseOptions = {
|
|
||||||
headers?: HeadersInit;
|
|
||||||
};
|
|
||||||
interface ImageTransformationResult {
|
interface ImageTransformationResult {
|
||||||
/**
|
/**
|
||||||
* The image as a response, ready to store in cache or return to users
|
* The image as a response, ready to store in cache or return to users
|
||||||
* @param options Options that apply to the returned response, e.g. additional headers
|
|
||||||
*/
|
*/
|
||||||
response(options?: ImageTransformationResponseOptions): Response;
|
response(): Response;
|
||||||
/**
|
/**
|
||||||
* The content type of the returned image
|
* The content type of the returned image
|
||||||
*/
|
*/
|
||||||
@@ -13674,11 +13064,6 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowDynamicDelayContext = {
|
|
||||||
ctx: WorkflowStepContext<WorkflowDelayFunction>;
|
|
||||||
error: Error;
|
|
||||||
};
|
|
||||||
export type WorkflowDelayFunction = (input: WorkflowDynamicDelayContext) => WorkflowDelayDuration | Promise<WorkflowDelayDuration>;
|
|
||||||
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
||||||
@@ -13686,32 +13071,12 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowStepConfig = {
|
export type WorkflowStepConfig = {
|
||||||
retries?: {
|
retries?: {
|
||||||
limit: number;
|
limit: number;
|
||||||
delay: WorkflowDelayDuration | number | WorkflowDelayFunction;
|
delay: WorkflowDelayDuration | number;
|
||||||
backoff?: WorkflowBackoff;
|
backoff?: WorkflowBackoff;
|
||||||
};
|
};
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
timeout?: WorkflowTimeoutDuration | number;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
// Internal discriminators used only for `WorkflowStep.do` overload
|
|
||||||
// resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
|
|
||||||
// single kind so the callback context can be narrowed based on the shape of
|
|
||||||
// the config argument (rather than on an inferred type parameter, which is
|
|
||||||
// lost when the caller supplies an explicit return-type argument). Not
|
|
||||||
// exported: they must not widen the public type surface.
|
|
||||||
type WorkflowStepConfigWithStaticDelay = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
type WorkflowStepConfigWithDelayFunction = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayFunction;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
||||||
export type WorkflowCronSchedule = {
|
export type WorkflowCronSchedule = {
|
||||||
/** Cron expression that triggered this event. */
|
/** Cron expression that triggered this event. */
|
||||||
@@ -13732,51 +13097,28 @@ declare namespace CloudflareWorkersModule {
|
|||||||
type: string;
|
type: string;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
export type WorkflowStepContext<Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepContext = {
|
||||||
step: {
|
step: {
|
||||||
name: string;
|
name: string;
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
attempt: number;
|
attempt: number;
|
||||||
config: {
|
config: WorkflowStepConfig;
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
} & (Delay extends WorkflowDelayFunction ? {} : {
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
});
|
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
|
||||||
sensitive?: WorkflowStepSensitivity;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
// The rollback handler receives the step context, so it mirrors the same
|
export type WorkflowRollbackContext<T = unknown> = {
|
||||||
// delay discriminant as the step callback: when the step was configured with
|
ctx: WorkflowStepContext;
|
||||||
// a dynamic delay function the resolved `config.retries.delay` is omitted,
|
|
||||||
// otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
|
|
||||||
// overload that matched the step config.
|
|
||||||
export type WorkflowRollbackContext<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
||||||
ctx: WorkflowStepContext<Delay>;
|
|
||||||
error: Error;
|
error: Error;
|
||||||
output: T | undefined;
|
output: T | undefined;
|
||||||
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
||||||
stepName: string;
|
stepName: string;
|
||||||
};
|
};
|
||||||
export type WorkflowRollbackHandler<T = unknown, Delay = WorkflowDelayDuration | number> = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
|
export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
|
||||||
export type WorkflowStepRollbackOptions<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepRollbackOptions<T = unknown> = {
|
||||||
rollback: WorkflowRollbackHandler<T, Delay>;
|
rollback: WorkflowRollbackHandler<T>;
|
||||||
rollbackConfig?: WorkflowStepRollbackConfig;
|
rollbackConfig?: WorkflowStepRollbackConfig;
|
||||||
};
|
};
|
||||||
export abstract class WorkflowStep {
|
export abstract class WorkflowStep {
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
// The config overloads discriminate on the shape of `config.retries.delay`
|
|
||||||
// so the callback context reflects whether the resolved delay is present
|
|
||||||
// (static delay) or omitted (dynamic delay function). Each has a single
|
|
||||||
// type parameter, so an explicit return-type argument (`do<T>(...)`) still
|
|
||||||
// resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
|
|
||||||
// fallback MUST remain last, otherwise it shadows the discriminating
|
|
||||||
// overloads and narrowing is silently lost.
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithDelayFunction, callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithStaticDelay, callback: (ctx: WorkflowStepContext<WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayDuration | number>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
||||||
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
||||||
@@ -14552,12 +13894,11 @@ type MarkdownDocument = {
|
|||||||
name: string;
|
name: string;
|
||||||
blob: Blob;
|
blob: Blob;
|
||||||
};
|
};
|
||||||
type OutputFormat = 'markdown' | 'text';
|
|
||||||
type ConversionResponse = {
|
type ConversionResponse = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
mimeType: string;
|
mimeType: string;
|
||||||
format: OutputFormat;
|
format: 'markdown';
|
||||||
tokens: number;
|
tokens: number;
|
||||||
data: string;
|
data: string;
|
||||||
} | {
|
} | {
|
||||||
@@ -14574,11 +13915,7 @@ type EmbeddedImageConversionOptions = ImageConversionOptions & {
|
|||||||
convert?: boolean;
|
convert?: boolean;
|
||||||
maxConvertedImages?: number;
|
maxConvertedImages?: number;
|
||||||
};
|
};
|
||||||
type ConversionOutputOptions = {
|
|
||||||
format?: OutputFormat;
|
|
||||||
};
|
|
||||||
type ConversionOptions = {
|
type ConversionOptions = {
|
||||||
output?: ConversionOutputOptions;
|
|
||||||
html?: {
|
html?: {
|
||||||
images?: EmbeddedImageConversionOptions & {
|
images?: EmbeddedImageConversionOptions & {
|
||||||
convertOGImage?: boolean;
|
convertOGImage?: boolean;
|
||||||
@@ -14673,7 +14010,7 @@ declare namespace TailStream {
|
|||||||
interface ConnectEventInfo {
|
interface ConnectEventInfo {
|
||||||
readonly type: "connect";
|
readonly type: "connect";
|
||||||
}
|
}
|
||||||
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime" | "aborted";
|
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime";
|
||||||
interface ScriptVersion {
|
interface ScriptVersion {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly tag?: string;
|
readonly tag?: string;
|
||||||
@@ -14692,7 +14029,6 @@ declare namespace TailStream {
|
|||||||
readonly dispatchNamespace?: string;
|
readonly dispatchNamespace?: string;
|
||||||
readonly entrypoint?: string;
|
readonly entrypoint?: string;
|
||||||
readonly executionModel: string;
|
readonly executionModel: string;
|
||||||
readonly durableObjectId?: string;
|
|
||||||
readonly scriptName?: string;
|
readonly scriptName?: string;
|
||||||
readonly scriptTags?: string[];
|
readonly scriptTags?: string[];
|
||||||
readonly scriptVersion?: ScriptVersion;
|
readonly scriptVersion?: ScriptVersion;
|
||||||
@@ -14727,22 +14063,11 @@ declare namespace TailStream {
|
|||||||
readonly message: string;
|
readonly message: string;
|
||||||
readonly stack?: string;
|
readonly stack?: string;
|
||||||
}
|
}
|
||||||
interface TailStreamErrorInfo {
|
interface Log {
|
||||||
readonly name: string;
|
|
||||||
readonly message: string;
|
|
||||||
readonly stack?: string;
|
|
||||||
}
|
|
||||||
type Log = {
|
|
||||||
readonly type: "log";
|
readonly type: "log";
|
||||||
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
||||||
readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
|
|
||||||
} & ({
|
|
||||||
readonly message: object;
|
readonly message: object;
|
||||||
readonly truncated?: false;
|
}
|
||||||
} | {
|
|
||||||
readonly message: string;
|
|
||||||
readonly truncated: true;
|
|
||||||
});
|
|
||||||
interface DroppedEventsDiagnostic {
|
interface DroppedEventsDiagnostic {
|
||||||
readonly diagnosticsType: "droppedEvents";
|
readonly diagnosticsType: "droppedEvents";
|
||||||
readonly count: number;
|
readonly count: number;
|
||||||
@@ -15220,31 +14545,10 @@ declare abstract class Workflow<PARAMS = unknown> {
|
|||||||
* @returns A promise that resolves with a list of handles for the created instances.
|
* @returns A promise that resolves with a list of handles for the created instances.
|
||||||
*/
|
*/
|
||||||
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
||||||
/**
|
|
||||||
* Delete a batch of Workflow instances and their stored state.
|
|
||||||
* `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
|
|
||||||
* The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
|
|
||||||
* @param instanceIds IDs of the Workflow instances to delete
|
|
||||||
* @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
|
|
||||||
*/
|
|
||||||
public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
|
|
||||||
}
|
}
|
||||||
type WorkflowBatchDeleteResult = {
|
|
||||||
deleted: {
|
|
||||||
id: string;
|
|
||||||
}[];
|
|
||||||
errors: {
|
|
||||||
id: string;
|
|
||||||
code: number;
|
|
||||||
message: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
/** Geographic regions supported when creating a Workflow instance.
|
|
||||||
* Location hints are best-effort placement preferences. */
|
|
||||||
type WorkflowInstanceLocationHint = 'wnam' | 'enam' | 'sam' | 'weur' | 'eeur' | 'apac' | 'apac-ne' | 'apac-se' | 'oc' | 'afr' | 'me';
|
|
||||||
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
||||||
/**
|
/**
|
||||||
* An id for your Workflow instance. Must be unique within the Workflow.
|
* An id for your Workflow instance. Must be unique within the Workflow.
|
||||||
@@ -15262,9 +14566,6 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|||||||
successRetention?: WorkflowRetentionDuration;
|
successRetention?: WorkflowRetentionDuration;
|
||||||
errorRetention?: WorkflowRetentionDuration;
|
errorRetention?: WorkflowRetentionDuration;
|
||||||
};
|
};
|
||||||
/** A best-effort geographic placement preference for the Workflow instance.
|
|
||||||
* See `WorkflowInstanceLocationHint` for supported regions. */
|
|
||||||
locationHint?: WorkflowInstanceLocationHint;
|
|
||||||
}
|
}
|
||||||
type InstanceStatus = {
|
type InstanceStatus = {
|
||||||
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
||||||
@@ -15282,13 +14583,6 @@ interface WorkflowError {
|
|||||||
code?: number;
|
code?: number;
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
interface WorkflowInstanceTerminateOptions {
|
|
||||||
/**
|
|
||||||
* If true, run registered rollback handlers before terminating the instance.
|
|
||||||
* Only steps that registered rollback handlers are rolled back.
|
|
||||||
*/
|
|
||||||
rollback?: boolean;
|
|
||||||
}
|
|
||||||
interface WorkflowInstanceRestartOptions {
|
interface WorkflowInstanceRestartOptions {
|
||||||
/**
|
/**
|
||||||
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
||||||
@@ -15322,19 +14616,14 @@ declare abstract class WorkflowInstance {
|
|||||||
public resume(): Promise<void>;
|
public resume(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
||||||
* @param options Options for termination, including whether registered rollback handlers should run.
|
|
||||||
*/
|
*/
|
||||||
public terminate(options?: WorkflowInstanceTerminateOptions): Promise<void>;
|
public terminate(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Restart the instance. Optionally restart from a specific step, preserving
|
* Restart the instance. Optionally restart from a specific step, preserving
|
||||||
* cached results for all steps before it.
|
* cached results for all steps before it.
|
||||||
* @param options Options for the restart, including an optional step to restart from.
|
* @param options Options for the restart, including an optional step to restart from.
|
||||||
*/
|
*/
|
||||||
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
||||||
/**
|
|
||||||
* Delete the instance and its stored state.
|
|
||||||
*/
|
|
||||||
public delete(): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Returns the current status of the instance.
|
* Returns the current status of the instance.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,6 +35,16 @@
|
|||||||
"bucket_name": "recflare-cdn"
|
"bucket_name": "recflare-cdn"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
// Per-player settings KV, owned by the `playersettings` worker. Read AND written here,
|
||||||
|
// for the photo-tagging preference (`/api/players/v1/playerPhotoTaggingSetting`), which
|
||||||
|
// is one key in that same bag rather than storage of its own. The "local" id placeholder
|
||||||
|
// is replaced with the real id from RECFLARE_KV at deploy time.
|
||||||
|
"kv_namespaces": [
|
||||||
|
{
|
||||||
|
"binding": "RECFLARE_PLAYER_SETTINGS",
|
||||||
|
"id": "local"
|
||||||
|
}
|
||||||
|
],
|
||||||
// Cross-worker binding to the SignalR notifications hub DO (owned/migrated by
|
// Cross-worker binding to the SignalR notifications hub DO (owned/migrated by
|
||||||
// the `notify` worker). We only invoke its RPC methods; no migration here.
|
// the `notify` worker). We only invoke its RPC methods; no migration here.
|
||||||
"durable_objects": {
|
"durable_objects": {
|
||||||
|
|||||||
@@ -198,12 +198,12 @@ function parseChatPrivacy(value: string | undefined): ChatPrivacyValue | undefin
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The player's settings map from the `player_settings` table the `playersettings` worker owns. */
|
/** The player's settings map from the KV the `playersettings` worker owns. */
|
||||||
async function getPlayerSettings(
|
async function getPlayerSettings(
|
||||||
env: Env,
|
env: Env,
|
||||||
accountId: number
|
accountId: number
|
||||||
): Promise<Record<string, string> | null> {
|
): Promise<Record<string, string> | null> {
|
||||||
return readPlayerSettings(env.DB, accountId).catch(() => null)
|
return readPlayerSettings(env.RECFLARE_PLAYER_SETTINGS, accountId).catch(() => null)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -258,7 +258,7 @@ async function mergePlayerSettings(
|
|||||||
accountId: number,
|
accountId: number,
|
||||||
patch: Record<string, string>
|
patch: Record<string, string>
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await mergeStoredPlayerSettings(env.DB, accountId, patch)
|
await mergeStoredPlayerSettings(env.RECFLARE_PLAYER_SETTINGS, accountId, patch)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ export type Env = SharedHonoEnv & {
|
|||||||
// with `await env.JWT_SECRET.get()`; all workers bind the same store so tokens
|
// with `await env.JWT_SECRET.get()`; all workers bind the same store so tokens
|
||||||
// signed by `auth` verify here.
|
// signed by `auth` verify here.
|
||||||
JWT_SECRET: SecretsStoreSecret
|
JWT_SECRET: SecretsStoreSecret
|
||||||
/**
|
/** Shared `recflare` D1 — this worker owns the `message` and thread tables. */
|
||||||
* Shared `recflare` D1 — this worker owns the `message` and thread tables. The
|
|
||||||
* caller's chat privacy settings (`/thread/chatPrivacySetting`) and `LatestPartyChat`
|
|
||||||
* live in `player_settings` (owned by the `playersettings` worker), alongside their
|
|
||||||
* other toggles.
|
|
||||||
*/
|
|
||||||
DB: D1Database
|
DB: D1Database
|
||||||
|
/**
|
||||||
|
* Per-player settings KV, owned by the `playersettings` worker. Holds the caller's
|
||||||
|
* chat privacy settings (`/thread/chatPrivacySetting`) alongside their other toggles.
|
||||||
|
*/
|
||||||
|
RECFLARE_PLAYER_SETTINGS: KVNamespace
|
||||||
/** The `notify` worker's NotificationsHub DO — pushes ChatMessageReceived to members. */
|
/** The `notify` worker's NotificationsHub DO — pushes ChatMessageReceived to members. */
|
||||||
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>
|
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import { beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|||||||
|
|
||||||
import '../../chat.app'
|
import '../../chat.app'
|
||||||
|
|
||||||
import { deletePlayerSettings, PLAYER_SETTINGS_SCHEMA_DDL, readPlayerSettings } from '@repo/domain'
|
|
||||||
|
|
||||||
import { NotificationType } from '../../../../notify/src/notification-types'
|
import { NotificationType } from '../../../../notify/src/notification-types'
|
||||||
import {
|
import {
|
||||||
ChatModerationState,
|
ChatModerationState,
|
||||||
@@ -17,11 +15,11 @@ import {
|
|||||||
addThreadMember,
|
addThreadMember,
|
||||||
ChatThreadType,
|
ChatThreadType,
|
||||||
createThread,
|
createThread,
|
||||||
|
joinedChatContents,
|
||||||
findThreadWithMembers,
|
findThreadWithMembers,
|
||||||
getThreadForPlayer,
|
getThreadForPlayer,
|
||||||
getThreadsForPlayer,
|
getThreadsForPlayer,
|
||||||
isThreadMember,
|
isThreadMember,
|
||||||
joinedChatContents,
|
|
||||||
leftChatContents,
|
leftChatContents,
|
||||||
markThreadRead,
|
markThreadRead,
|
||||||
postMessage,
|
postMessage,
|
||||||
@@ -68,31 +66,11 @@ async function bearer(sub: number, version?: string): Promise<Record<string, str
|
|||||||
return { Authorization: `Bearer ${signingInput}.${b64url(sig)}` }
|
return { Authorization: `Bearer ${signingInput}.${b64url(sig)}` }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Seed a player's `player_settings` row with raw JSON text — what the KV value used to be. */
|
|
||||||
const seedSettings = (playerId: number, data: string) =>
|
|
||||||
env.DB.prepare(
|
|
||||||
`INSERT INTO player_settings (account_id, data) VALUES (?1, ?2)
|
|
||||||
ON CONFLICT (account_id) DO UPDATE SET data = excluded.data`
|
|
||||||
)
|
|
||||||
.bind(playerId, data)
|
|
||||||
.run()
|
|
||||||
|
|
||||||
/** The row's `data` exactly as stored — a seeded value surviving a request means no write happened. */
|
|
||||||
const rawSettings = async (playerId: number) =>
|
|
||||||
(
|
|
||||||
await env.DB.prepare('SELECT data FROM player_settings WHERE account_id = ?1')
|
|
||||||
.bind(playerId)
|
|
||||||
.first<{ data: string }>()
|
|
||||||
)?.data ?? null
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// Seed the shared JWT signing key into the local Secrets Store so .get() resolves.
|
// Seed the shared JWT signing key into the local Secrets Store so .get() resolves.
|
||||||
await adminSecretsStore(env.JWT_SECRET).create(TEST_SECRET)
|
await adminSecretsStore(env.JWT_SECRET).create(TEST_SECRET)
|
||||||
for (const stmt of SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
for (const stmt of SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
||||||
for (const stmt of THREAD_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
for (const stmt of THREAD_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
||||||
// Player settings (owned by the playersettings worker) — chat privacy and LatestPartyChat
|
|
||||||
// are keys in that per-player map.
|
|
||||||
for (const stmt of PLAYER_SETTINGS_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('chat endpoints', () => {
|
describe('chat endpoints', () => {
|
||||||
@@ -435,7 +413,12 @@ describe('GET /settings/partyinvite', () => {
|
|||||||
// player setting — as the BARE thread, where the POST wraps the same projection.
|
// player setting — as the BARE thread, where the POST wraps the same projection.
|
||||||
describe('GET /thread/party', () => {
|
describe('GET /thread/party', () => {
|
||||||
async function settings(playerId: number): Promise<Record<string, string>> {
|
async function settings(playerId: number): Promise<Record<string, string>> {
|
||||||
return (await readPlayerSettings(env.DB, playerId)) ?? {}
|
return (
|
||||||
|
(await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
|
`player:${playerId}`,
|
||||||
|
'json'
|
||||||
|
)) ?? {}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
it('answers the party named by LatestPartyChat, bare — no ChatResult wrapper', async () => {
|
it('answers the party named by LatestPartyChat, bare — no ChatResult wrapper', async () => {
|
||||||
@@ -467,7 +450,10 @@ describe('GET /thread/party', () => {
|
|||||||
|
|
||||||
it('POST records the thread id in the caller’s LatestPartyChat setting', async () => {
|
it('POST records the thread id in the caller’s LatestPartyChat setting', async () => {
|
||||||
const caller = 883202
|
const caller = 883202
|
||||||
await seedSettings(caller, JSON.stringify({ OobeState: 'Complete' }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
`player:${caller}`,
|
||||||
|
JSON.stringify({ OobeState: 'Complete' })
|
||||||
|
)
|
||||||
const created = await SELF.fetch(`${ORIGIN}/thread/party`, {
|
const created = await SELF.fetch(`${ORIGIN}/thread/party`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: await bearer(caller),
|
headers: await bearer(caller),
|
||||||
@@ -541,7 +527,10 @@ describe('GET /thread/party', () => {
|
|||||||
headers: await bearer(host),
|
headers: await bearer(host),
|
||||||
})
|
})
|
||||||
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
||||||
await seedSettings(guest, JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
`player:${guest}`,
|
||||||
|
JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) })
|
||||||
|
)
|
||||||
expect(await isThreadMember(env.DB, ChatThread.ChatThreadId, guest)).toBe(false)
|
expect(await isThreadMember(env.DB, ChatThread.ChatThreadId, guest)).toBe(false)
|
||||||
|
|
||||||
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(guest) })
|
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(guest) })
|
||||||
@@ -596,7 +585,7 @@ describe('GET /thread/party', () => {
|
|||||||
headers: await bearer(caller),
|
headers: await bearer(caller),
|
||||||
})
|
})
|
||||||
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
||||||
await deletePlayerSettings(env.DB, caller)
|
await env.RECFLARE_PLAYER_SETTINGS.delete(`player:${caller}`)
|
||||||
|
|
||||||
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(caller) })
|
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(caller) })
|
||||||
expect(((await res.json()) as { ChatThreadId: number }).ChatThreadId).toBe(
|
expect(((await res.json()) as { ChatThreadId: number }).ChatThreadId).toBe(
|
||||||
@@ -637,8 +626,8 @@ describe('GET /thread/party', () => {
|
|||||||
})
|
})
|
||||||
const own = (await mine.json()) as { ChatThread: { ChatThreadId: number } }
|
const own = (await mine.json()) as { ChatThread: { ChatThreadId: number } }
|
||||||
const theirs = (await other.json()) as { ChatThread: { ChatThreadId: number } }
|
const theirs = (await other.json()) as { ChatThread: { ChatThreadId: number } }
|
||||||
await seedSettings(
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
caller,
|
`player:${caller}`,
|
||||||
JSON.stringify({ LatestPartyChat: String(theirs.ChatThread.ChatThreadId) })
|
JSON.stringify({ LatestPartyChat: String(theirs.ChatThread.ChatThreadId) })
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -665,8 +654,8 @@ describe('GET /thread/party', () => {
|
|||||||
})
|
})
|
||||||
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
||||||
await openedMinutesAgo(ChatThread.ChatThreadId, 61)
|
await openedMinutesAgo(ChatThread.ChatThreadId, 61)
|
||||||
await seedSettings(
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
latecomer,
|
`player:${latecomer}`,
|
||||||
JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) })
|
JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) })
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -685,7 +674,10 @@ describe('GET /thread/party', () => {
|
|||||||
})
|
})
|
||||||
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
||||||
await openedMinutesAgo(ChatThread.ChatThreadId, 59)
|
await openedMinutesAgo(ChatThread.ChatThreadId, 59)
|
||||||
await seedSettings(guest, JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
`player:${guest}`,
|
||||||
|
JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) })
|
||||||
|
)
|
||||||
|
|
||||||
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(guest) })
|
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(guest) })
|
||||||
expect(((await res.json()) as { PlayerIds: number[] }).PlayerIds).toEqual([host, guest])
|
expect(((await res.json()) as { PlayerIds: number[] }).PlayerIds).toEqual([host, guest])
|
||||||
@@ -719,8 +711,8 @@ describe('GET /thread/party', () => {
|
|||||||
await env.DB.prepare('UPDATE message_thread SET created_at = ?2 WHERE chat_thread_id = ?1')
|
await env.DB.prepare('UPDATE message_thread SET created_at = ?2 WHERE chat_thread_id = ?1')
|
||||||
.bind(ChatThread.ChatThreadId, 'not-a-timestamp')
|
.bind(ChatThread.ChatThreadId, 'not-a-timestamp')
|
||||||
.run()
|
.run()
|
||||||
await seedSettings(
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
stranger,
|
`player:${stranger}`,
|
||||||
JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) })
|
JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) })
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -734,7 +726,10 @@ describe('GET /thread/party', () => {
|
|||||||
// put the caller in it.
|
// put the caller in it.
|
||||||
const caller = 883207
|
const caller = 883207
|
||||||
const dm = await createThread(env.DB, [883208, 883213])
|
const dm = await createThread(env.DB, [883208, 883213])
|
||||||
await seedSettings(caller, JSON.stringify({ LatestPartyChat: String(dm) }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
`player:${caller}`,
|
||||||
|
JSON.stringify({ LatestPartyChat: String(dm) })
|
||||||
|
)
|
||||||
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(caller) })
|
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(caller) })
|
||||||
expect(await res.json()).toEqual({})
|
expect(await res.json()).toEqual({})
|
||||||
expect(await isThreadMember(env.DB, dm, caller)).toBe(false)
|
expect(await isThreadMember(env.DB, dm, caller)).toBe(false)
|
||||||
@@ -742,7 +737,10 @@ describe('GET /thread/party', () => {
|
|||||||
|
|
||||||
it('answers {} when the setting names a thread that doesn’t exist', async () => {
|
it('answers {} when the setting names a thread that doesn’t exist', async () => {
|
||||||
const caller = 883214
|
const caller = 883214
|
||||||
await seedSettings(caller, JSON.stringify({ LatestPartyChat: '99999' }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
`player:${caller}`,
|
||||||
|
JSON.stringify({ LatestPartyChat: '99999' })
|
||||||
|
)
|
||||||
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(caller) })
|
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(caller) })
|
||||||
expect(await res.json()).toEqual({})
|
expect(await res.json()).toEqual({})
|
||||||
expect(await isThreadMember(env.DB, 99999, caller)).toBe(false)
|
expect(await isThreadMember(env.DB, 99999, caller)).toBe(false)
|
||||||
@@ -750,7 +748,10 @@ describe('GET /thread/party', () => {
|
|||||||
|
|
||||||
it('answers {} for an unparseable stored id', async () => {
|
it('answers {} for an unparseable stored id', async () => {
|
||||||
const caller = 883209
|
const caller = 883209
|
||||||
await seedSettings(caller, JSON.stringify({ LatestPartyChat: 'not-an-id' }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
`player:${caller}`,
|
||||||
|
JSON.stringify({ LatestPartyChat: 'not-an-id' })
|
||||||
|
)
|
||||||
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(caller) })
|
const res = await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(caller) })
|
||||||
expect(await res.json()).toEqual({})
|
expect(await res.json()).toEqual({})
|
||||||
})
|
})
|
||||||
@@ -865,8 +866,8 @@ describe('GET /thread/chatPrivacySetting', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('reads the stored settings out of the player settings map', async () => {
|
it('reads the stored settings out of the player settings map', async () => {
|
||||||
await seedSettings(
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
886003,
|
'player:886003',
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
directMessagePrivacySetting: 'Favorites',
|
directMessagePrivacySetting: 'Favorites',
|
||||||
groupChatPrivacySetting: 'NoOne',
|
groupChatPrivacySetting: 'NoOne',
|
||||||
@@ -883,7 +884,10 @@ describe('GET /thread/chatPrivacySetting', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('falls back to Friends for a stored value it can’t parse', async () => {
|
it('falls back to Friends for a stored value it can’t parse', async () => {
|
||||||
await seedSettings(886004, JSON.stringify({ directMessagePrivacySetting: 'Nobody at all' }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
'player:886004',
|
||||||
|
JSON.stringify({ directMessagePrivacySetting: 'Nobody at all' })
|
||||||
|
)
|
||||||
const res = await SELF.fetch(`${ORIGIN}/thread/chatPrivacySetting`, {
|
const res = await SELF.fetch(`${ORIGIN}/thread/chatPrivacySetting`, {
|
||||||
headers: await bearer(886004),
|
headers: await bearer(886004),
|
||||||
})
|
})
|
||||||
@@ -917,7 +921,8 @@ describe('PUT /thread/chatPrivacySetting', () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const settings = async (playerId: number) => readPlayerSettings(env.DB, playerId)
|
const settings = async (playerId: number) =>
|
||||||
|
env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(`player:${playerId}`, 'json')
|
||||||
|
|
||||||
it('stores the DM setting and answers the resulting settings', async () => {
|
it('stores the DM setting and answers the resulting settings', async () => {
|
||||||
const res = await put(887001, { directMessagePrivacySetting: 'Favorites' })
|
const res = await put(887001, { directMessagePrivacySetting: 'Favorites' })
|
||||||
@@ -952,7 +957,10 @@ describe('PUT /thread/chatPrivacySetting', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('merges, leaving the player’s other settings untouched', async () => {
|
it('merges, leaving the player’s other settings untouched', async () => {
|
||||||
await seedSettings(887004, JSON.stringify({ 'Recroom.OOBE': '77' }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
'player:887004',
|
||||||
|
JSON.stringify({ 'Recroom.OOBE': '77' })
|
||||||
|
)
|
||||||
await put(887004, { directMessagePrivacySetting: 'Favorites' })
|
await put(887004, { directMessagePrivacySetting: 'Favorites' })
|
||||||
expect(await settings(887004)).toEqual({
|
expect(await settings(887004)).toEqual({
|
||||||
'Recroom.OOBE': '77',
|
'Recroom.OOBE': '77',
|
||||||
@@ -963,12 +971,12 @@ describe('PUT /thread/chatPrivacySetting', () => {
|
|||||||
// Re-posting the stored value writes nothing to KV — writes are the cost, and the client
|
// Re-posting the stored value writes nothing to KV — writes are the cost, and the client
|
||||||
// posts these freely. The raw value is seeded with whitespace JSON.stringify never
|
// posts these freely. The raw value is seeded with whitespace JSON.stringify never
|
||||||
// produces; surviving the PUT untouched means no write happened.
|
// produces; surviving the PUT untouched means no write happened.
|
||||||
it('does not write when the value is already stored', async () => {
|
it('does not write KV when the value is already stored', async () => {
|
||||||
const padded = '{ "Recroom.OOBE": "77", "directMessagePrivacySetting": "Favorites" }'
|
const padded = '{ "Recroom.OOBE": "77", "directMessagePrivacySetting": "Favorites" }'
|
||||||
await seedSettings(887010, padded)
|
await env.RECFLARE_PLAYER_SETTINGS.put('player:887010', padded)
|
||||||
const res = await put(887010, { directMessagePrivacySetting: 'Favorites' })
|
const res = await put(887010, { directMessagePrivacySetting: 'Favorites' })
|
||||||
expect(await res.json()).toMatchObject({ directMessagePrivacySetting: 1 })
|
expect(await res.json()).toMatchObject({ directMessagePrivacySetting: 1 })
|
||||||
expect(await rawSettings(887010)).toBe(padded)
|
expect(await env.RECFLARE_PLAYER_SETTINGS.get('player:887010', 'text')).toBe(padded)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('accepts the enum by ordinal too, and is case-insensitive about the name', async () => {
|
it('accepts the enum by ordinal too, and is case-insensitive about the name', async () => {
|
||||||
@@ -1569,7 +1577,10 @@ describe('ChatMessageReceived push', () => {
|
|||||||
headers: await bearer(host),
|
headers: await bearer(host),
|
||||||
})
|
})
|
||||||
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
||||||
await seedSettings(guest, JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
`player:${guest}`,
|
||||||
|
JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) })
|
||||||
|
)
|
||||||
await hub.getByName('global').takeSent()
|
await hub.getByName('global').takeSent()
|
||||||
|
|
||||||
await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(guest) })
|
await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(guest) })
|
||||||
@@ -1593,7 +1604,10 @@ describe('ChatMessageReceived push', () => {
|
|||||||
headers: await bearer(host),
|
headers: await bearer(host),
|
||||||
})
|
})
|
||||||
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
const { ChatThread } = (await created.json()) as { ChatThread: { ChatThreadId: number } }
|
||||||
await seedSettings(guest, JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
`player:${guest}`,
|
||||||
|
JSON.stringify({ LatestPartyChat: String(ChatThread.ChatThreadId) })
|
||||||
|
)
|
||||||
|
|
||||||
await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(guest) })
|
await SELF.fetch(`${ORIGIN}/thread/party`, { headers: await bearer(guest) })
|
||||||
await hub.getByName('global').takeSent()
|
await hub.getByName('global').takeSent()
|
||||||
|
|||||||
+242
-953
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// Runtime types generated with workerd@1.20260831.1 2026-06-16 nodejs_compat
|
// Runtime types generated with workerd@1.20260625.1 2025-09-20 nodejs_compat
|
||||||
// Begin runtime types
|
// Begin runtime types
|
||||||
/*! *****************************************************************************
|
/*! *****************************************************************************
|
||||||
Copyright (c) Cloudflare. All rights reserved.
|
Copyright (c) Cloudflare. All rights reserved.
|
||||||
@@ -19,26 +19,26 @@ and limitations under the License.
|
|||||||
// noinspection JSUnusedGlobalSymbols
|
// noinspection JSUnusedGlobalSymbols
|
||||||
declare var onmessage: never;
|
declare var onmessage: never;
|
||||||
/**
|
/**
|
||||||
* The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs.
|
* The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
||||||
*/
|
*/
|
||||||
declare class DOMException extends Error {
|
declare class DOMException extends Error {
|
||||||
constructor(message?: string, name?: string);
|
constructor(message?: string, name?: string);
|
||||||
/**
|
/**
|
||||||
* The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name.
|
* The **`message`** read-only property of the a message or description associated with the given error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
||||||
*/
|
*/
|
||||||
readonly message: string;
|
readonly message: string;
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name.
|
* The **`name`** read-only property of the one of the strings associated with an error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
||||||
*/
|
*/
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
/**
|
/**
|
||||||
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match.
|
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
||||||
@@ -96,61 +96,61 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
clear(): void;
|
clear(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.count()`** static method logs the number of times that this particular call to count() has been called.
|
* The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
||||||
*/
|
*/
|
||||||
count(label?: string): void;
|
count(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.countReset()`** static method resets counter used with console.count().
|
* The **`console.countReset()`** static method resets counter used with console/count_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
||||||
*/
|
*/
|
||||||
countReset(label?: string): void;
|
countReset(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.debug()`** static method outputs a message to the console at the "debug" log level. The message is only displayed to the user if the console is configured to display debug output. In most cases, the log level is configured within the console UI. This log level might correspond to the Debug or Verbose log level.
|
* The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
||||||
*/
|
*/
|
||||||
debug(...data: any[]): void;
|
debug(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. In browser consoles, the output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
|
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
||||||
*/
|
*/
|
||||||
dir(item?: any, options?: any): void;
|
dir(item?: any, options?: any): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.
|
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
||||||
*/
|
*/
|
||||||
dirxml(...data: any[]): void;
|
dirxml(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.error()`** static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information.
|
* The **`console.error()`** static method outputs a message to the console at the 'error' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
||||||
*/
|
*/
|
||||||
error(...data: any[]): void;
|
error(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.
|
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
||||||
*/
|
*/
|
||||||
group(...data: any[]): void;
|
group(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupCollapsed()`** static method creates a new inline group in the console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.
|
* The **`console.groupCollapsed()`** static method creates a new inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
||||||
*/
|
*/
|
||||||
groupCollapsed(...data: any[]): void;
|
groupCollapsed(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupEnd()`** static method exits the current inline group in the console. See Using groups in the console in the console documentation for details and examples.
|
* The **`console.groupEnd()`** static method exits the current inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
||||||
*/
|
*/
|
||||||
groupEnd(): void;
|
groupEnd(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.info()`** static method outputs a message to the console at the "info" log level. The message is only displayed to the user if the console is configured to display info output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as a small "i" icon next to it.
|
* The **`console.info()`** static method outputs a message to the console at the 'info' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
||||||
*/
|
*/
|
||||||
@@ -168,24 +168,23 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
table(tabularData?: any, properties?: string[]): void;
|
table(tabularData?: any, properties?: string[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.
|
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
||||||
*/
|
*/
|
||||||
time(label?: string): void;
|
time(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console.time().
|
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
||||||
*/
|
*/
|
||||||
timeEnd(label?: string): void;
|
timeEnd(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console.time().
|
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
||||||
*/
|
*/
|
||||||
timeLog(label?: string, ...data: any[]): void;
|
timeLog(label?: string, ...data: any[]): void;
|
||||||
/* The **`console.timeStamp()`** static method adds a single marker to the browser's Performance tool (Firefox bug 1387528, Chrome). This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. */
|
|
||||||
timeStamp(label?: string): void;
|
timeStamp(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.trace()`** static method outputs a stack trace to the console.
|
* The **`console.trace()`** static method outputs a stack trace to the console.
|
||||||
@@ -194,7 +193,7 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
trace(...data: any[]): void;
|
trace(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.warn()`** static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon.
|
* The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
||||||
*/
|
*/
|
||||||
@@ -360,7 +359,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|||||||
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -405,7 +404,6 @@ declare const crypto: Crypto;
|
|||||||
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
||||||
*/
|
*/
|
||||||
declare const caches: CacheStorage;
|
declare const caches: CacheStorage;
|
||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scheduler) */
|
|
||||||
declare const scheduler: Scheduler;
|
declare const scheduler: Scheduler;
|
||||||
/**
|
/**
|
||||||
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
||||||
@@ -422,12 +420,10 @@ interface TestController {
|
|||||||
interface ExecutionContext<Props = unknown> {
|
interface ExecutionContext<Props = unknown> {
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
passThroughOnException(): void;
|
passThroughOnException(): void;
|
||||||
readonly exports: Cloudflare.Exports;
|
|
||||||
readonly props: Props;
|
readonly props: Props;
|
||||||
cache?: CacheContext;
|
cache?: CacheContext;
|
||||||
readonly access?: CloudflareAccessContext;
|
readonly access?: CloudflareAccessContext;
|
||||||
tracing: Tracing;
|
tracing: Tracing;
|
||||||
abort(reason?: any): void;
|
|
||||||
}
|
}
|
||||||
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
||||||
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
||||||
@@ -516,7 +512,7 @@ declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded
|
|||||||
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
||||||
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
||||||
}
|
}
|
||||||
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high" | "us";
|
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
|
||||||
interface DurableObjectNamespaceNewUniqueIdOptions {
|
interface DurableObjectNamespaceNewUniqueIdOptions {
|
||||||
jurisdiction?: DurableObjectJurisdiction;
|
jurisdiction?: DurableObjectJurisdiction;
|
||||||
}
|
}
|
||||||
@@ -530,7 +526,6 @@ interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = u
|
|||||||
}
|
}
|
||||||
interface DurableObjectState<Props = unknown> {
|
interface DurableObjectState<Props = unknown> {
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
readonly exports: Cloudflare.Exports;
|
|
||||||
readonly props: Props;
|
readonly props: Props;
|
||||||
readonly id: DurableObjectId;
|
readonly id: DurableObjectId;
|
||||||
readonly storage: DurableObjectStorage;
|
readonly storage: DurableObjectStorage;
|
||||||
@@ -545,7 +540,7 @@ interface DurableObjectState<Props = unknown> {
|
|||||||
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
||||||
getHibernatableWebSocketEventTimeout(): number | null;
|
getHibernatableWebSocketEventTimeout(): number | null;
|
||||||
getTags(ws: WebSocket): string[];
|
getTags(ws: WebSocket): string[];
|
||||||
abort(reason?: string, options?: DurableObjectAbortOptions): void;
|
abort(reason?: string): void;
|
||||||
}
|
}
|
||||||
interface DurableObjectTransaction {
|
interface DurableObjectTransaction {
|
||||||
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
||||||
@@ -581,9 +576,6 @@ interface DurableObjectStorage {
|
|||||||
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
||||||
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
||||||
}
|
}
|
||||||
interface DurableObjectAbortOptions {
|
|
||||||
retryAlarm?: boolean;
|
|
||||||
}
|
|
||||||
interface DurableObjectListOptions {
|
interface DurableObjectListOptions {
|
||||||
start?: string;
|
start?: string;
|
||||||
startAfter?: string;
|
startAfter?: string;
|
||||||
@@ -634,26 +626,26 @@ interface AnalyticsEngineDataPoint {
|
|||||||
blobs?: ((ArrayBuffer | string) | null)[];
|
blobs?: ((ArrayBuffer | string) | null)[];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`Event`** interface represents an event which takes place on an EventTarget.
|
* The **`Event`** interface represents an event which takes place on an `EventTarget`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
||||||
*/
|
*/
|
||||||
declare class Event {
|
declare class Event {
|
||||||
constructor(type: string, init?: EventInit);
|
constructor(type: string, init?: EventInit);
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error.
|
* The **`type`** read-only property of the Event interface returns a string containing the event's type.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated.
|
* The **`eventPhase`** read-only property of the being evaluated.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
||||||
*/
|
*/
|
||||||
get eventPhase(): number;
|
get eventPhase(): number;
|
||||||
/**
|
/**
|
||||||
* The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
* The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
||||||
*/
|
*/
|
||||||
@@ -690,13 +682,13 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get currentTarget(): EventTarget | undefined;
|
get currentTarget(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event.
|
* The read-only **`target`** property of the dispatched.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
||||||
*/
|
*/
|
||||||
get target(): EventTarget | undefined;
|
get target(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead.
|
* The deprecated **`Event.srcElement`** is an alias for the Event.target property.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
||||||
@@ -709,45 +701,45 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get timeStamp(): number;
|
get timeStamp(): number;
|
||||||
/**
|
/**
|
||||||
* The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents.
|
* The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
||||||
*/
|
*/
|
||||||
get isTrusted(): boolean;
|
get isTrusted(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
get cancelBubble(): boolean;
|
get cancelBubble(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
set cancelBubble(value: boolean);
|
set cancelBubble(value: boolean);
|
||||||
/**
|
/**
|
||||||
* The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called.
|
* The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
||||||
*/
|
*/
|
||||||
stopImmediatePropagation(): void;
|
stopImmediatePropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken.
|
* The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
||||||
*/
|
*/
|
||||||
preventDefault(): void;
|
preventDefault(): void;
|
||||||
/**
|
/**
|
||||||
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().
|
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
||||||
*/
|
*/
|
||||||
stopPropagation(): void;
|
stopPropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.
|
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
||||||
*/
|
*/
|
||||||
@@ -768,7 +760,7 @@ interface EventListenerObject<EventType extends Event = Event> {
|
|||||||
}
|
}
|
||||||
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
||||||
/**
|
/**
|
||||||
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. In other words, any target of events implements the three methods associated with this interface.
|
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
||||||
*/
|
*/
|
||||||
@@ -781,13 +773,13 @@ declare class EventTarget<EventMap extends Record<string, Event> = Record<string
|
|||||||
*/
|
*/
|
||||||
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
|
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
||||||
*/
|
*/
|
||||||
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -819,7 +811,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. This is able to abort fetch requests, the consumption of any response bodies, or streams.
|
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
||||||
*/
|
*/
|
||||||
@@ -832,7 +824,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
declare abstract class AbortSignal extends EventTarget {
|
declare abstract class AbortSignal extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).
|
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
||||||
*/
|
*/
|
||||||
@@ -844,13 +836,13 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
*/
|
*/
|
||||||
static timeout(delay: number): AbortSignal;
|
static timeout(delay: number): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal.
|
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
||||||
*/
|
*/
|
||||||
static any(signals: AbortSignal[]): AbortSignal;
|
static any(signals: AbortSignal[]): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false).
|
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
||||||
*/
|
*/
|
||||||
@@ -866,17 +858,12 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
||||||
set onabort(value: any | null);
|
set onabort(value: any | null);
|
||||||
/**
|
/**
|
||||||
* The **`throwIfAborted()`** method throws the signal's abort reason if the signal has been aborted; otherwise it does nothing.
|
* The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
||||||
*/
|
*/
|
||||||
throwIfAborted(): void;
|
throwIfAborted(): void;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`Scheduler`** interface of the Prioritized Task Scheduling API provides methods for scheduling prioritized tasks.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Scheduler)
|
|
||||||
*/
|
|
||||||
interface Scheduler {
|
interface Scheduler {
|
||||||
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
||||||
}
|
}
|
||||||
@@ -884,20 +871,20 @@ interface SchedulerWaitOptions {
|
|||||||
signal?: AbortSignal;
|
signal?: AbortSignal;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent`** interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
|
* The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class ExtendableEvent extends Event {
|
declare abstract class ExtendableEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful. In service workers, waitUntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the service worker if it wants that work to complete.
|
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
||||||
*/
|
*/
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CustomEvent`** interface can be used to attach custom data to an event generated by an application.
|
* The **`CustomEvent`** interface represents events initialized by an application for any purpose.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
||||||
*/
|
*/
|
||||||
@@ -936,7 +923,7 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`slice()`** method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it's called.
|
* The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
||||||
*/
|
*/
|
||||||
@@ -954,13 +941,13 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
bytes(): Promise<Uint8Array>;
|
bytes(): Promise<Uint8Array>;
|
||||||
/**
|
/**
|
||||||
* The **`text()`** method of the Blob interface returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8.
|
* The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
||||||
*/
|
*/
|
||||||
text(): Promise<string>;
|
text(): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.
|
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
||||||
*/
|
*/
|
||||||
@@ -977,13 +964,13 @@ interface BlobOptions {
|
|||||||
declare class File extends Blob {
|
declare class File extends Blob {
|
||||||
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object. For security reasons, the path is excluded from this property.
|
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
||||||
*/
|
*/
|
||||||
get name(): string;
|
get name(): string;
|
||||||
/**
|
/**
|
||||||
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
||||||
*/
|
*/
|
||||||
@@ -1000,7 +987,7 @@ interface FileOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class CacheStorage {
|
declare abstract class CacheStorage {
|
||||||
/**
|
/**
|
||||||
* The **`open()`** method of the CacheStorage interface returns a Promise that resolves to the Cache object matching the cacheName.
|
* The **`open()`** method of the the Cache object matching the `cacheName`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
||||||
*/
|
*/
|
||||||
@@ -1033,14 +1020,14 @@ interface CacheQueryOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class Crypto {
|
declare abstract class Crypto {
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.subtle`** read-only property returns a SubtleCrypto which can then be used to perform low-level cryptographic operations.
|
* The **`Crypto.subtle`** read-only property returns a cryptographic operations.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
||||||
*/
|
*/
|
||||||
get subtle(): SubtleCrypto;
|
get subtle(): SubtleCrypto;
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).
|
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
||||||
*/
|
*/
|
||||||
@@ -1068,7 +1055,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data. It takes as arguments a key to decrypt with, some optional extra parameters, and the data to decrypt (also known as "ciphertext"). It returns a Promise which will be fulfilled with the decrypted data (also known as "plaintext").
|
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
||||||
*/
|
*/
|
||||||
@@ -1086,7 +1073,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
||||||
/**
|
/**
|
||||||
* The **`digest()`** method of the SubtleCrypto interface generates a digest of the given data, using the specified hash function. A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value.
|
* The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
||||||
*/
|
*/
|
||||||
@@ -1104,7 +1091,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
||||||
/**
|
/**
|
||||||
* The **`deriveBits()`** method of the SubtleCrypto interface can be used to derive an array of bits from a base key.
|
* The **`deriveBits()`** method of the key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
||||||
*/
|
*/
|
||||||
@@ -1122,13 +1109,13 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
||||||
/**
|
/**
|
||||||
* The **`wrapKey()`** method of the SubtleCrypto interface "wraps" a key. This means that it exports the key in an external, portable format, then encrypts the exported key. Wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
|
* The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
||||||
*/
|
*/
|
||||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`unwrapKey()`** method of the SubtleCrypto interface "unwraps" a key. This means that it takes as its input a key that has been exported and then encrypted (also called "wrapped"). It decrypts the key and then imports it, returning a CryptoKey object that can be used in the Web Crypto API.
|
* The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
||||||
*/
|
*/
|
||||||
@@ -1136,20 +1123,20 @@ declare abstract class SubtleCrypto {
|
|||||||
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey().
|
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
||||||
*/
|
*/
|
||||||
declare abstract class CryptoKey {
|
declare abstract class CryptoKey {
|
||||||
/**
|
/**
|
||||||
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object. It can have the following values:
|
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
||||||
*/
|
*/
|
||||||
readonly type: string;
|
readonly type: string;
|
||||||
/**
|
/**
|
||||||
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using SubtleCrypto.exportKey() or SubtleCrypto.wrapKey().
|
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
||||||
*/
|
*/
|
||||||
@@ -1266,15 +1253,12 @@ interface CryptoKeyArbitraryKeyAlgorithm {
|
|||||||
length?: number;
|
length?: number;
|
||||||
}
|
}
|
||||||
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
||||||
constructor(algorithm: string | SubtleCryptoHashAlgorithm, options?: DigestStreamOptions);
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
||||||
readonly digest: Promise<ArrayBuffer>;
|
readonly digest: Promise<ArrayBuffer>;
|
||||||
get bytesWritten(): number | bigint;
|
get bytesWritten(): number | bigint;
|
||||||
}
|
}
|
||||||
interface DigestStreamOptions {
|
|
||||||
toWellFormed?: boolean;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
|
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
||||||
*/
|
*/
|
||||||
@@ -1291,20 +1275,20 @@ declare class TextDecoder {
|
|||||||
get ignoreBOM(): boolean;
|
get ignoreBOM(): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder`** interface enables you to encode a JavaScript string using UTF-8.
|
* The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
||||||
*/
|
*/
|
||||||
declare class TextEncoder {
|
declare class TextEncoder {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Uint8Array containing the string encoded using UTF-8.
|
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
||||||
*/
|
*/
|
||||||
encode(input?: string): Uint8Array;
|
encode(input?: string): Uint8Array;
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns an object indicating the progress of the encoding. This is potentially more performant than the encode() method — especially when the target buffer is a view into a Wasm heap.
|
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
||||||
*/
|
*/
|
||||||
@@ -1361,9 +1345,6 @@ declare class ErrorEvent extends Event {
|
|||||||
get error(): any;
|
get error(): any;
|
||||||
}
|
}
|
||||||
interface ErrorEventErrorEventInit {
|
interface ErrorEventErrorEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
message?: string;
|
message?: string;
|
||||||
filename?: string;
|
filename?: string;
|
||||||
lineno?: number;
|
lineno?: number;
|
||||||
@@ -1376,139 +1357,135 @@ interface ErrorEventErrorEventInit {
|
|||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
||||||
*/
|
*/
|
||||||
declare class MessageEvent extends Event {
|
declare class MessageEvent extends Event {
|
||||||
constructor(type: string, initializer?: MessageEventInit);
|
constructor(type: string, initializer: MessageEventInit);
|
||||||
/**
|
/**
|
||||||
* The **`data`** read-only property of the MessageEvent interface represents the data sent by the message emitter.
|
* The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
||||||
*/
|
*/
|
||||||
readonly data: any;
|
readonly data: any;
|
||||||
/**
|
/**
|
||||||
* The **`origin`** read-only property of the MessageEvent interface is a string representing the origin of the message emitter.
|
* The **`origin`** read-only property of the origin of the message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
||||||
*/
|
*/
|
||||||
readonly origin: string | null;
|
readonly origin: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`lastEventId`** read-only property of the MessageEvent interface is a string representing a unique ID for the event.
|
* The **`lastEventId`** read-only property of the unique ID for the event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
||||||
*/
|
*/
|
||||||
readonly lastEventId: string;
|
readonly lastEventId: string;
|
||||||
/**
|
/**
|
||||||
* The **`source`** read-only property of the MessageEvent interface is a MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter.
|
* The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
||||||
*/
|
*/
|
||||||
readonly source: MessagePort | null;
|
readonly source: MessagePort | null;
|
||||||
/**
|
/**
|
||||||
* The **`ports`** read-only property of the MessageEvent interface is an array of MessagePort objects containing all MessagePort objects sent with the message, in order.
|
* The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
||||||
*/
|
*/
|
||||||
readonly ports: MessagePort[];
|
readonly ports: MessagePort[];
|
||||||
}
|
}
|
||||||
interface MessageEventInit {
|
interface MessageEventInit {
|
||||||
bubbles?: boolean;
|
data: ArrayBuffer | string;
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
data?: any;
|
|
||||||
origin?: string;
|
|
||||||
lastEventId?: string;
|
|
||||||
source?: MessagePort;
|
|
||||||
ports?: MessagePort[];
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. These events are particularly useful for telemetry and debugging purposes.
|
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class PromiseRejectionEvent extends Event {
|
declare abstract class PromiseRejectionEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript Promise which was rejected. You can examine the event's PromiseRejectionEvent.reason property to learn why the promise was rejected.
|
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
||||||
*/
|
*/
|
||||||
readonly promise: Promise<any>;
|
readonly promise: Promise<any>;
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). This in theory provides information about why the promise was rejected.
|
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject().
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
||||||
*/
|
*/
|
||||||
readonly reason: any;
|
readonly reason: any;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the fetch(), XMLHttpRequest.send() or navigator.sendBeacon() methods. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
|
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
||||||
*/
|
*/
|
||||||
declare class FormData {
|
declare class FormData {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string | Blob): void;
|
append(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: Blob, filename?: string): void;
|
append(name: string, value: Blob, filename?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a FormData object.
|
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a FormData object. If you expect multiple values and want all of them, use the getAll() method instead.
|
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): (File | string) | null;
|
get(name: string): (File | string) | null;
|
||||||
/**
|
/**
|
||||||
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a FormData object.
|
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
||||||
*/
|
*/
|
||||||
getAll(name: string): (File | string)[];
|
getAll(name: string): (File | string)[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the FormData interface returns whether a FormData object contains a certain key.
|
* The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string | Blob): void;
|
set(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: Blob, filename?: string): void;
|
set(name: string, value: Blob, filename?: string): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the list. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: File | string
|
value: File | string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the list. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the list. */
|
||||||
values(): IterableIterator<(File | string)>;
|
values(): IterableIterator<(File | string)>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
@@ -1587,19 +1564,19 @@ interface DocumentEnd {
|
|||||||
append(content: string, options?: ContentOptions): DocumentEnd;
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class FetchEvent extends ExtendableEvent {
|
declare abstract class FetchEvent extends ExtendableEvent {
|
||||||
/**
|
/**
|
||||||
* The **`request`** read-only property of the FetchEvent interface returns the Request that triggered the event handler.
|
* The **`request`** read-only property of the the event handler.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
||||||
*/
|
*/
|
||||||
readonly request: Request;
|
readonly request: Request;
|
||||||
/**
|
/**
|
||||||
* The **`respondWith()`** method of FetchEvent prevents the browser's default fetch handling, and allows you to provide a promise for a Response yourself.
|
* The **`respondWith()`** method of allows you to provide a promise for a Response yourself.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
||||||
*/
|
*/
|
||||||
@@ -1608,62 +1585,65 @@ declare abstract class FetchEvent extends ExtendableEvent {
|
|||||||
}
|
}
|
||||||
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
||||||
/**
|
/**
|
||||||
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
|
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
||||||
*/
|
*/
|
||||||
declare class Headers {
|
declare class Headers {
|
||||||
constructor(init?: HeadersInit);
|
constructor(init?: HeadersInit);
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.
|
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): string | null;
|
get(name: string): string | null;
|
||||||
getAll(name: string): string[];
|
getAll(name: string): string[];
|
||||||
/**
|
/**
|
||||||
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. This allows Headers objects to handle having multiple Set-Cookie headers, which wasn't possible prior to its implementation.
|
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
||||||
*/
|
*/
|
||||||
getSetCookie(): string[];
|
getSetCookie(): string[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the Headers interface returns a boolean stating whether a Headers object contains a certain header.
|
* The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the Headers interface deletes a header from the current Headers object.
|
* The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
||||||
|
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
}
|
}
|
||||||
type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData | Iterable<ArrayBuffer | ArrayBufferView> | AsyncIterable<ArrayBuffer | ArrayBufferView>;
|
type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData;
|
||||||
declare abstract class Body {
|
declare abstract class Body {
|
||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
||||||
get body(): ReadableStream | null;
|
get body(): ReadableStream | null;
|
||||||
@@ -1719,7 +1699,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
statusText: string;
|
statusText: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Response interface contains the Headers object associated with the response.
|
* The **`headers`** read-only property of the with the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1737,7 +1717,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
redirected: boolean;
|
redirected: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects.
|
* The **`url`** read-only property of the Response interface contains the URL of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
||||||
*/
|
*/
|
||||||
@@ -1745,7 +1725,7 @@ interface Response extends Body {
|
|||||||
webSocket: WebSocket | null;
|
webSocket: WebSocket | null;
|
||||||
cf: any | undefined;
|
cf: any | undefined;
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers.
|
* The **`type`** read-only property of the Response interface contains the type of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
||||||
*/
|
*/
|
||||||
@@ -1776,13 +1756,13 @@ declare var Request: {
|
|||||||
*/
|
*/
|
||||||
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
||||||
/**
|
/**
|
||||||
* The **`clone()`** method of the Request interface creates a copy of the current Request object.
|
* The **`clone()`** method of the Request interface creates a copy of the current `Request` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
||||||
*/
|
*/
|
||||||
clone(): Request<CfHostMetadata, Cf>;
|
clone(): Request<CfHostMetadata, Cf>;
|
||||||
/**
|
/**
|
||||||
* The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.)
|
* The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
||||||
*/
|
*/
|
||||||
@@ -1794,7 +1774,7 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Request interface contains the Headers object associated with the request.
|
* The **`headers`** read-only property of the with the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1820,13 +1800,13 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
integrity: string;
|
integrity: string;
|
||||||
/**
|
/**
|
||||||
* The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
* The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
||||||
*/
|
*/
|
||||||
keepalive: boolean;
|
keepalive: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache.
|
* The **`cache`** read-only property of the Request interface contains the cache mode of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
||||||
*/
|
*/
|
||||||
@@ -2215,7 +2195,7 @@ type ReadableStreamReadResult<R = any> = {
|
|||||||
value?: undefined;
|
value?: undefined;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2233,13 +2213,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
getReader(): ReadableStreamDefaultReader<R>;
|
getReader(): ReadableStreamDefaultReader<R>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
@@ -2251,13 +2231,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
||||||
/**
|
/**
|
||||||
* The **`pipeTo()`** method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
* The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
||||||
*/
|
*/
|
||||||
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`tee()`** method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances.
|
* The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
||||||
*/
|
*/
|
||||||
@@ -2269,7 +2249,7 @@ interface ReadableStream<R = any> {
|
|||||||
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2301,7 +2281,7 @@ declare class ReadableStreamDefaultReader<R = any> {
|
|||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBReader`** interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. It is used for efficient copying from underlying sources where the data is delivered as an "anonymous" sequence of bytes, such as files.
|
* The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
||||||
*/
|
*/
|
||||||
@@ -2310,13 +2290,13 @@ declare class ReadableStreamBYOBReader {
|
|||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. A request for data will be satisfied from the stream's internal queues if there is any data present. If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source.
|
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
||||||
*/
|
*/
|
||||||
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. After the lock is released, the reader is no longer active.
|
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
||||||
*/
|
*/
|
||||||
@@ -2335,7 +2315,7 @@ interface ReadableStreamGetReaderOptions {
|
|||||||
mode: "byob";
|
mode: "byob";
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a "pull request" for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
||||||
*/
|
*/
|
||||||
@@ -2361,13 +2341,13 @@ declare abstract class ReadableStreamBYOBRequest {
|
|||||||
get atLeast(): number | null;
|
get atLeast(): number | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams.
|
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableStreamDefaultController<R = any> {
|
declare abstract class ReadableStreamDefaultController<R = any> {
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the required to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2379,32 +2359,32 @@ declare abstract class ReadableStreamDefaultController<R = any> {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.
|
* The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
||||||
*/
|
*/
|
||||||
enqueue(chunk?: R): void;
|
enqueue(chunk?: R): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. It allows control of the state and internal queue of a ReadableStream with an underlying byte source, and enables efficient zero-copy transfer of data from the underlying source to a consumer when the stream's internal queue is empty.
|
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableByteStreamController {
|
declare abstract class ReadableByteStreamController {
|
||||||
/**
|
/**
|
||||||
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests.
|
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
||||||
*/
|
*/
|
||||||
get byobRequest(): ReadableStreamBYOBRequest | null;
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its "desired size".
|
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2416,7 +2396,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is transferred into the stream's internal queues).
|
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
||||||
*/
|
*/
|
||||||
@@ -2429,7 +2409,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultController`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
@@ -2441,7 +2421,7 @@ declare abstract class WritableStreamDefaultController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the WritableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2466,7 +2446,7 @@ declare abstract class TransformStreamDefaultController<O = any> {
|
|||||||
*/
|
*/
|
||||||
enqueue(chunk?: O): void;
|
enqueue(chunk?: O): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
|
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2488,14 +2468,14 @@ interface ReadableWritablePair<R = any, W = any> {
|
|||||||
writable: WritableStream<W>;
|
writable: WritableStream<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
|
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
||||||
*/
|
*/
|
||||||
declare class WritableStream<W = any> {
|
declare class WritableStream<W = any> {
|
||||||
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
||||||
/**
|
/**
|
||||||
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.
|
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
||||||
*/
|
*/
|
||||||
@@ -2507,83 +2487,83 @@ declare class WritableStream<W = any> {
|
|||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled.
|
* The **`close()`** method of the WritableStream interface closes the associated stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. While the stream is locked, no other writer can be acquired until this one is released.
|
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
||||||
*/
|
*/
|
||||||
getWriter(): WritableStreamDefaultWriter<W>;
|
getWriter(): WritableStreamDefaultWriter<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
||||||
*/
|
*/
|
||||||
declare class WritableStreamDefaultWriter<W = any> {
|
declare class WritableStreamDefaultWriter<W = any> {
|
||||||
constructor(stream: WritableStream);
|
constructor(stream: WritableStream);
|
||||||
/**
|
/**
|
||||||
* The **`closed`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that fulfills if the stream becomes closed, or rejects if the stream errors or the writer's lock is released.
|
* The **`closed`** read-only property of the the stream errors or the writer's lock is released.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
||||||
*/
|
*/
|
||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`ready`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
* The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
||||||
*/
|
*/
|
||||||
get ready(): Promise<void>;
|
get ready(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the WritableStreamDefaultWriter interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
||||||
*/
|
*/
|
||||||
get desiredSize(): number | null;
|
get desiredSize(): number | null;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the WritableStreamDefaultWriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
* The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStreamDefaultWriter interface closes the associated writable stream.
|
* The **`close()`** method of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`write()`** method of the WritableStreamDefaultWriter interface writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation.
|
* The **`write()`** method of the operation.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
||||||
*/
|
*/
|
||||||
write(chunk?: W): Promise<void>;
|
write(chunk?: W): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the WritableStreamDefaultWriter interface releases the writer's lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
|
* The **`releaseLock()`** method of the corresponding stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
||||||
*/
|
*/
|
||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain transform stream concept.
|
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
||||||
*/
|
*/
|
||||||
declare class TransformStream<I = any, O = any> {
|
declare class TransformStream<I = any, O = any> {
|
||||||
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
||||||
/**
|
/**
|
||||||
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream. This stream emits the transformed output data.
|
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
||||||
*/
|
*/
|
||||||
get readable(): ReadableStream<O>;
|
get readable(): ReadableStream<O>;
|
||||||
/**
|
/**
|
||||||
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream. This stream accepts input data that will be transformed and emitted to the readable stream.
|
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
||||||
*/
|
*/
|
||||||
@@ -2602,7 +2582,7 @@ interface ReadableStreamValuesOptions {
|
|||||||
preventCancel?: boolean;
|
preventCancel?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CompressionStream`** interface of the Compression Streams API compresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2610,7 +2590,7 @@ declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBuffe
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`DecompressionStream`** interface of the Compression Streams API decompresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2618,7 +2598,7 @@ declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBuf
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2627,7 +2607,7 @@ declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
|
|||||||
get encoding(): string;
|
get encoding(): string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings. It is the streaming equivalent of TextDecoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2776,12 +2756,6 @@ interface TraceLog {
|
|||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
readonly level: string;
|
readonly level: string;
|
||||||
readonly message: any;
|
readonly message: any;
|
||||||
readonly errorInfo?: (TraceLogErrorInfo | null)[];
|
|
||||||
}
|
|
||||||
interface TraceLogErrorInfo {
|
|
||||||
name: string;
|
|
||||||
message: string;
|
|
||||||
stack?: string;
|
|
||||||
}
|
}
|
||||||
interface TraceException {
|
interface TraceException {
|
||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
@@ -2802,7 +2776,7 @@ interface UnsafeTraceMetrics {
|
|||||||
fromTrace(item: TraceItem): TraceMetrics;
|
fromTrace(item: TraceItem): TraceMetrics;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`URL`** interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.
|
* The **`URL`** interface is used to parse, construct, normalize, and encode URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
||||||
*/
|
*/
|
||||||
@@ -2827,121 +2801,121 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
set href(value: string);
|
set href(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
set protocol(value: string);
|
set protocol(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
set username(value: string);
|
set username(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
set password(value: string);
|
set password(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
get host(): string;
|
get host(): string;
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
set host(value: string);
|
set host(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
set hostname(value: string);
|
set hostname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
set port(value: string);
|
set port(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
set pathname(value: string);
|
set pathname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
set search(value: string);
|
set search(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
set hash(value: string);
|
set hash(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
|
* The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
||||||
*/
|
*/
|
||||||
get searchParams(): URLSearchParams;
|
get searchParams(): URLSearchParams;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().
|
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -2961,13 +2935,13 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
static parse(url: string, base?: string): URL | null;
|
static parse(url: string, base?: string): URL | null;
|
||||||
/**
|
/**
|
||||||
* The **`createObjectURL()`** static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.
|
* The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
||||||
*/
|
*/
|
||||||
static createObjectURL(object: File | Blob): string;
|
static createObjectURL(object: File | Blob): string;
|
||||||
/**
|
/**
|
||||||
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().
|
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
||||||
*/
|
*/
|
||||||
@@ -3017,22 +2991,25 @@ declare class URLSearchParams {
|
|||||||
*/
|
*/
|
||||||
has(name: string, value?: string): boolean;
|
has(name: string, value?: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.
|
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved).
|
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
||||||
*/
|
*/
|
||||||
sort(): void;
|
sort(): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the search params. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the search params. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
||||||
/*function toString() { [native code] }*/
|
/*function toString() { [native code] }*/
|
||||||
@@ -3042,78 +3019,18 @@ declare class URLSearchParams {
|
|||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern. The pattern can contain capturing groups that extract parts of the matched URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
|
|
||||||
*/
|
|
||||||
declare class URLPattern {
|
declare class URLPattern {
|
||||||
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
||||||
/**
|
|
||||||
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
||||||
*/
|
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
|
||||||
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
||||||
*/
|
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
|
||||||
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
||||||
*/
|
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
|
||||||
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
||||||
*/
|
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
|
||||||
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
||||||
*/
|
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
|
||||||
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
||||||
*/
|
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
|
||||||
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
||||||
*/
|
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
|
||||||
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
|
|
||||||
*/
|
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
|
||||||
* The **`hasRegExpGroups`** read-only property of the URLPattern interface is a boolean indicating whether or not any of the URLPattern components contain regular expression capturing groups.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
|
|
||||||
*/
|
|
||||||
get hasRegExpGroups(): boolean;
|
get hasRegExpGroups(): boolean;
|
||||||
/**
|
|
||||||
* The **`test()`** method of the URLPattern interface takes a URL string or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
|
|
||||||
*/
|
|
||||||
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
||||||
/**
|
|
||||||
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or null if the URL does not match the pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
|
|
||||||
*/
|
|
||||||
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
||||||
}
|
}
|
||||||
interface URLPatternInit {
|
interface URLPatternInit {
|
||||||
@@ -3146,7 +3063,7 @@ interface URLPatternOptions {
|
|||||||
ignoreCase?: boolean;
|
ignoreCase?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* A `CloseEvent` is sent to clients using WebSockets when the connection is closed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
||||||
*/
|
*/
|
||||||
@@ -3165,16 +3082,13 @@ declare class CloseEvent extends Event {
|
|||||||
*/
|
*/
|
||||||
readonly reason: string;
|
readonly reason: string;
|
||||||
/**
|
/**
|
||||||
* The **`wasClean`** read-only property of the CloseEvent interface returns true if the connection closed cleanly.
|
* The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
||||||
*/
|
*/
|
||||||
readonly wasClean: boolean;
|
readonly wasClean: boolean;
|
||||||
}
|
}
|
||||||
interface CloseEventInit {
|
interface CloseEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
code?: number;
|
code?: number;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
wasClean?: boolean;
|
wasClean?: boolean;
|
||||||
@@ -3186,7 +3100,7 @@ type WebSocketEventMap = {
|
|||||||
error: ErrorEvent;
|
error: ErrorEvent;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
@@ -3203,20 +3117,20 @@ declare var WebSocket: {
|
|||||||
readonly CLOSED: number;
|
readonly CLOSED: number;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
||||||
accept(options?: WebSocketAcceptOptions): void;
|
accept(options?: WebSocketAcceptOptions): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. The browser will throw an exception if you call send() when the connection is in the CONNECTING state. If you call send() when the connection is in the CLOSING or CLOSED states, the browser will silently discard the data.
|
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
||||||
*/
|
*/
|
||||||
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.close()`** method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.
|
* The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
||||||
*/
|
*/
|
||||||
@@ -3236,13 +3150,13 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|||||||
*/
|
*/
|
||||||
url: string | null;
|
url: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object, or the empty string if no connection is established.
|
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
||||||
*/
|
*/
|
||||||
protocol: string | null;
|
protocol: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.
|
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
||||||
*/
|
*/
|
||||||
@@ -3329,25 +3243,25 @@ interface SocketInfo {
|
|||||||
declare class EventSource extends EventTarget {
|
declare class EventSource extends EventTarget {
|
||||||
constructor(url: string, init?: EventSourceEventSourceInit);
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the EventSource.readyState attribute to 2 (closed).
|
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the EventSource interface returns a string representing the URL of the source.
|
* The **`url`** read-only property of the URL of the source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
||||||
*/
|
*/
|
||||||
get url(): string;
|
get url(): string;
|
||||||
/**
|
/**
|
||||||
* The **`withCredentials`** read-only property of the EventSource interface returns a boolean value indicating whether the EventSource object was instantiated with CORS credentials set.
|
* The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
||||||
*/
|
*/
|
||||||
get withCredentials(): boolean;
|
get withCredentials(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`readyState`** read-only property of the EventSource interface returns a number representing the state of the connection.
|
* The **`readyState`** read-only property of the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
||||||
*/
|
*/
|
||||||
@@ -3382,26 +3296,18 @@ interface ContainerExecOptions {
|
|||||||
cwd?: string;
|
cwd?: string;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
user?: string;
|
user?: string;
|
||||||
signal?: AbortSignal;
|
|
||||||
pty?: boolean | ContainerExecPtyOptions;
|
|
||||||
stdin?: ReadableStream | "pipe";
|
stdin?: ReadableStream | "pipe";
|
||||||
stdout?: "pipe" | "ignore";
|
stdout?: "pipe" | "ignore";
|
||||||
stderr?: "pipe" | "ignore" | "combined";
|
stderr?: "pipe" | "ignore" | "combined";
|
||||||
}
|
}
|
||||||
interface ContainerExecPtyOptions {
|
|
||||||
cols?: number;
|
|
||||||
rows?: number;
|
|
||||||
}
|
|
||||||
interface ExecProcess {
|
interface ExecProcess {
|
||||||
readonly stdin: WritableStream | null;
|
readonly stdin: WritableStream | null;
|
||||||
readonly stdout: ReadableStream | null;
|
readonly stdout: ReadableStream | null;
|
||||||
readonly stderr: ReadableStream | null;
|
readonly stderr: ReadableStream | null;
|
||||||
readonly pid: number;
|
readonly pid: number;
|
||||||
readonly isPty: boolean;
|
|
||||||
readonly exitCode: Promise<number>;
|
readonly exitCode: Promise<number>;
|
||||||
output(): Promise<ExecOutput>;
|
output(): Promise<ExecOutput>;
|
||||||
kill(signal?: number): void;
|
kill(signal?: number): void;
|
||||||
resize(cols: number, rows: number): void;
|
|
||||||
}
|
}
|
||||||
interface Container {
|
interface Container {
|
||||||
get running(): boolean;
|
get running(): boolean;
|
||||||
@@ -3428,42 +3334,25 @@ interface ContainerDirectorySnapshotOptions {
|
|||||||
dir: string;
|
dir: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerDirectorySnapshotRestoreParams = {
|
interface ContainerDirectorySnapshotRestoreParams {
|
||||||
snapshot: ContainerDirectorySnapshot;
|
snapshot: ContainerDirectorySnapshot;
|
||||||
mountPoint?: string;
|
mountPoint?: string;
|
||||||
} | {
|
}
|
||||||
snapshot?: undefined;
|
|
||||||
mountPoint: string;
|
|
||||||
};
|
|
||||||
interface ContainerSnapshot {
|
interface ContainerSnapshot {
|
||||||
id: string;
|
id: string;
|
||||||
size: number;
|
size: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
interface ContainerSnapshotRestoreParams {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
interface ContainerSnapshotOptions {
|
interface ContainerSnapshotOptions {
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerStartupOptions = {
|
interface ContainerStartupOptions {
|
||||||
entrypoint?: string[];
|
entrypoint?: string[];
|
||||||
enableInternet: boolean;
|
enableInternet: boolean;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
instance?: "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | ContainerStartResources;
|
|
||||||
labels?: Record<string, string>;
|
labels?: Record<string, string>;
|
||||||
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
||||||
} & ({
|
containerSnapshot?: ContainerSnapshot;
|
||||||
image: string;
|
|
||||||
containerSnapshot?: never;
|
|
||||||
} | {
|
|
||||||
image?: never;
|
|
||||||
containerSnapshot?: ContainerSnapshotRestoreParams;
|
|
||||||
});
|
|
||||||
interface ContainerStartResources {
|
|
||||||
vcpu: number;
|
|
||||||
memoryMib: number;
|
|
||||||
diskMb: number;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
||||||
@@ -3472,19 +3361,19 @@ interface ContainerStartResources {
|
|||||||
*/
|
*/
|
||||||
declare abstract class MessagePort extends EventTarget {
|
declare abstract class MessagePort extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`postMessage()`** method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
|
* The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
||||||
*/
|
*/
|
||||||
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.
|
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage.
|
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
||||||
*/
|
*/
|
||||||
@@ -3500,13 +3389,13 @@ declare abstract class MessagePort extends EventTarget {
|
|||||||
declare class MessageChannel {
|
declare class MessageChannel {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`port1`** read-only property of the MessageChannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
|
* The **`port1`** read-only property of the the port attached to the context that originated the channel.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
||||||
*/
|
*/
|
||||||
readonly port1: MessagePort;
|
readonly port1: MessagePort;
|
||||||
/**
|
/**
|
||||||
* The **`port2`** read-only property of the MessageChannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
|
* The **`port2`** read-only property of the the port attached to the context at the other end of the channel, which the message is initially sent to.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
||||||
*/
|
*/
|
||||||
@@ -3566,7 +3455,7 @@ interface WorkerLoaderModule {
|
|||||||
data?: ArrayBuffer;
|
data?: ArrayBuffer;
|
||||||
json?: any;
|
json?: any;
|
||||||
py?: string;
|
py?: string;
|
||||||
wasm?: ArrayBuffer | ArrayBufferView | WebAssembly.Module;
|
wasm?: ArrayBuffer;
|
||||||
}
|
}
|
||||||
interface WorkerLoaderWorkerCode {
|
interface WorkerLoaderWorkerCode {
|
||||||
compatibilityDate: string;
|
compatibilityDate: string;
|
||||||
@@ -3574,7 +3463,7 @@ interface WorkerLoaderWorkerCode {
|
|||||||
allowExperimental?: boolean;
|
allowExperimental?: boolean;
|
||||||
limits?: workerdResourceLimits;
|
limits?: workerdResourceLimits;
|
||||||
mainModule: string;
|
mainModule: string;
|
||||||
modules: Record<string, string | WebAssembly.Module | WorkerLoaderModule>;
|
modules: Record<string, WorkerLoaderModule | string>;
|
||||||
env?: any;
|
env?: any;
|
||||||
globalOutbound?: (Fetcher | null);
|
globalOutbound?: (Fetcher | null);
|
||||||
tails?: Fetcher[];
|
tails?: Fetcher[];
|
||||||
@@ -3596,7 +3485,7 @@ declare abstract class Performance {
|
|||||||
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
||||||
now(): number;
|
now(): number;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the Performance interface is a serializer; it returns a JSON representation of the Performance object.
|
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -3605,13 +3494,11 @@ declare abstract class Performance {
|
|||||||
interface Tracing {
|
interface Tracing {
|
||||||
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startSpan(name: string): Span;
|
|
||||||
Span: typeof Span;
|
Span: typeof Span;
|
||||||
}
|
}
|
||||||
declare abstract class Span {
|
declare abstract class Span {
|
||||||
get isTraced(): boolean;
|
get isTraced(): boolean;
|
||||||
setAttribute(key: string, value: boolean | number | string): this;
|
setAttribute(key: string, value?: (boolean | number | string)): void;
|
||||||
setAttributes(attributes: Record<string, boolean | number | string | undefined>): this;
|
|
||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -4251,13 +4138,6 @@ type AiSearchListItemsParams = {
|
|||||||
source?: string;
|
source?: string;
|
||||||
/** JSON-encoded Vectorize filter for metadata filtering. */
|
/** JSON-encoded Vectorize filter for metadata filtering. */
|
||||||
metadata_filter?: string;
|
metadata_filter?: string;
|
||||||
/** Filter items by their unique ID. Returns at most one item. */
|
|
||||||
item_id?: string;
|
|
||||||
/**
|
|
||||||
* Filter items by their exact key (object key / filename). Keys are unique
|
|
||||||
* per source, so combine with `source` to disambiguate across data sources.
|
|
||||||
*/
|
|
||||||
key?: string;
|
|
||||||
};
|
};
|
||||||
type AiSearchListItemsResponse = {
|
type AiSearchListItemsResponse = {
|
||||||
result: AiSearchItemInfo[];
|
result: AiSearchItemInfo[];
|
||||||
@@ -10155,163 +10035,6 @@ declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|||||||
inputs: ChatCompletionsInput;
|
inputs: ChatCompletionsInput;
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
postProcessedOutputs: ChatCompletionsOutput;
|
||||||
}
|
}
|
||||||
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_2 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input {
|
|
||||||
/**
|
|
||||||
* Which Moondream skill to run.
|
|
||||||
*/
|
|
||||||
task?: "query" | "caption" | "point" | "detect";
|
|
||||||
/**
|
|
||||||
* Input image as a public HTTPS URL or base64 data URI. Optional for `query`; required for `caption`, `point`, and `detect`.
|
|
||||||
*/
|
|
||||||
image?: string;
|
|
||||||
/**
|
|
||||||
* Question for the `query` task.
|
|
||||||
*/
|
|
||||||
question?: string;
|
|
||||||
/**
|
|
||||||
* Caption length for the `caption` task.
|
|
||||||
*/
|
|
||||||
caption_length?: "short" | "normal" | "long";
|
|
||||||
/**
|
|
||||||
* Object phrase to locate for `point` and `detect` tasks (e.g. 'person wearing a red shirt').
|
|
||||||
*/
|
|
||||||
target?: string;
|
|
||||||
/**
|
|
||||||
* Enable reasoning trace for the `query` task.
|
|
||||||
*/
|
|
||||||
reasoning?: boolean;
|
|
||||||
/**
|
|
||||||
* Sampling temperature.
|
|
||||||
*/
|
|
||||||
temperature?: number;
|
|
||||||
/**
|
|
||||||
* Top-p (nucleus) sampling.
|
|
||||||
*/
|
|
||||||
top_p?: number;
|
|
||||||
/**
|
|
||||||
* Max tokens to generate for `query` and `caption`.
|
|
||||||
*/
|
|
||||||
max_tokens?: number;
|
|
||||||
/**
|
|
||||||
* Max objects to return for `point` and `detect`.
|
|
||||||
*/
|
|
||||||
max_objects?: number;
|
|
||||||
/**
|
|
||||||
* Return incremental tokens for `query` and `caption`. `point` and `detect` do not support streaming.
|
|
||||||
*/
|
|
||||||
stream?: boolean;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output {
|
|
||||||
/**
|
|
||||||
* Reason the generation finished.
|
|
||||||
*/
|
|
||||||
finish_reason: string;
|
|
||||||
metrics: {
|
|
||||||
/**
|
|
||||||
* Number of input tokens consumed.
|
|
||||||
*/
|
|
||||||
input_tokens: number;
|
|
||||||
/**
|
|
||||||
* Number of output tokens generated.
|
|
||||||
*/
|
|
||||||
output_tokens: number;
|
|
||||||
/**
|
|
||||||
* Prefill time in milliseconds.
|
|
||||||
*/
|
|
||||||
prefill_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Decode time in milliseconds.
|
|
||||||
*/
|
|
||||||
decode_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Time to first token in milliseconds.
|
|
||||||
*/
|
|
||||||
ttft_ms: number;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Answer text for the `query` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
answer?: string;
|
|
||||||
/**
|
|
||||||
* Caption text for the `caption` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
caption?: string;
|
|
||||||
/**
|
|
||||||
* Located points for the `point` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
points?: {
|
|
||||||
/**
|
|
||||||
* X coordinate.
|
|
||||||
*/
|
|
||||||
x: number;
|
|
||||||
/**
|
|
||||||
* Y coordinate.
|
|
||||||
*/
|
|
||||||
y: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Detected bounding boxes for the `detect` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
objects?: {
|
|
||||||
/**
|
|
||||||
* Minimum X coordinate.
|
|
||||||
*/
|
|
||||||
x_min: number;
|
|
||||||
/**
|
|
||||||
* Minimum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_min: number;
|
|
||||||
/**
|
|
||||||
* Maximum X coordinate.
|
|
||||||
*/
|
|
||||||
x_max: number;
|
|
||||||
/**
|
|
||||||
* Maximum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_max: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Reasoning trace for the `query` task when reasoning=true. Null otherwise.
|
|
||||||
*/
|
|
||||||
reasoning?: {
|
|
||||||
/**
|
|
||||||
* Reasoning text.
|
|
||||||
*/
|
|
||||||
text: string;
|
|
||||||
/**
|
|
||||||
* Grounding information.
|
|
||||||
*/
|
|
||||||
grounding?: {}[];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B {
|
|
||||||
inputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input;
|
|
||||||
postProcessedOutputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Qwen_Qwen3_8_27B {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3_Flash {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface AiModels {
|
interface AiModels {
|
||||||
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
||||||
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
||||||
@@ -10404,13 +10127,6 @@ interface AiModels {
|
|||||||
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
||||||
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
||||||
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
||||||
"@cf/moonshotai/kimi-k2.7-code": Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code;
|
|
||||||
"@cf/zai-org/glm-5.2": Base_Ai_Cf_Zai_Org_Glm_5_2;
|
|
||||||
"@cf/moondream/moondream3.1-9B-A2B": Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-flash-0731": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-pro-0813": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813;
|
|
||||||
"@cf/qwen/qwen3.8-27b": Base_Ai_Cf_Qwen_Qwen3_8_27B;
|
|
||||||
"@cf/zai-org/glm-5.3-flash": Base_Ai_Cf_Zai_Org_Glm_5_3_Flash;
|
|
||||||
}
|
}
|
||||||
type AiOptions = {
|
type AiOptions = {
|
||||||
/**
|
/**
|
||||||
@@ -11077,15 +10793,6 @@ interface BrowserRunBaseOptions {
|
|||||||
*/
|
*/
|
||||||
cacheTTL?: number;
|
cacheTTL?: number;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Backend selection, mixed into the options of the quick actions that support it.
|
|
||||||
* Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
|
|
||||||
* reject an alternate backend, so they must not accept the field.
|
|
||||||
*/
|
|
||||||
interface BrowserRunAlternateBackendOptions {
|
|
||||||
/** Render with an alternate browser backend instead of the default one. */
|
|
||||||
browser?: 'kitesurf';
|
|
||||||
}
|
|
||||||
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
||||||
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
||||||
/** URL to navigate to, e.g. `"https://example.com"`. */
|
/** URL to navigate to, e.g. `"https://example.com"`. */
|
||||||
@@ -11120,7 +10827,7 @@ type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
|
|||||||
scrollPage?: boolean;
|
scrollPage?: boolean;
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
||||||
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
||||||
pdfOptions?: {
|
pdfOptions?: {
|
||||||
@@ -11156,7 +10863,7 @@ type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
|||||||
/** @default 30000 */
|
/** @default 30000 */
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
};
|
};
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
||||||
/** CSS selectors to scrape. At least one element is required. */
|
/** CSS selectors to scrape. At least one element is required. */
|
||||||
elements: Array<{
|
elements: Array<{
|
||||||
@@ -11169,29 +10876,10 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
|
|||||||
/** When true, exclude links pointing to external domains. @default false */
|
/** When true, exclude links pointing to external domains. @default false */
|
||||||
excludeExternalLinks?: boolean;
|
excludeExternalLinks?: boolean;
|
||||||
};
|
};
|
||||||
type BrowserRunSnapshotFormat = 'content' | 'screenshot' | 'markdown' | 'accessibilityTree';
|
|
||||||
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
||||||
/** Which representations of the page to return. At least two distinct formats
|
|
||||||
* are required; request a single format from its dedicated action instead.
|
|
||||||
* @default ["content","screenshot"]
|
|
||||||
*/
|
|
||||||
formats?: BrowserRunSnapshotFormat[];
|
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
||||||
};
|
};
|
||||||
/** Options for the `accessibilityTree` quick action. */
|
|
||||||
type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
|
|
||||||
/** When true, prune nodes that carry no semantic meaning, such as generic
|
|
||||||
* containers. Defaults to true, or to false when `root` is set so that the
|
|
||||||
* requested subtree is returned as-is.
|
|
||||||
*/
|
|
||||||
interestingOnly?: boolean;
|
|
||||||
/** CSS selector limiting the tree to the matching element's subtree.
|
|
||||||
* A selector that matches nothing yields `accessibilityTree: null` with
|
|
||||||
* HTTP 200; a malformed selector is an error.
|
|
||||||
*/
|
|
||||||
root?: string;
|
|
||||||
} & BrowserRunAlternateBackendOptions;
|
|
||||||
interface BrowserRunJsonBaseOptions {
|
interface BrowserRunJsonBaseOptions {
|
||||||
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
||||||
custom_ai?: Array<{
|
custom_ai?: Array<{
|
||||||
@@ -11205,7 +10893,7 @@ interface BrowserRunJsonBaseOptions {
|
|||||||
* Options for the `json` quick action.
|
* Options for the `json` quick action.
|
||||||
* At least one of `prompt` or `response_format` must be provided.
|
* At least one of `prompt` or `response_format` must be provided.
|
||||||
*/
|
*/
|
||||||
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions & BrowserRunJsonBaseOptions & ({
|
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunJsonBaseOptions & ({
|
||||||
/** Natural-language prompt describing what data to extract. */
|
/** Natural-language prompt describing what data to extract. */
|
||||||
prompt: string;
|
prompt: string;
|
||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
@@ -11216,80 +10904,14 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBacken
|
|||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
response_format: AiTextGenerationResponseFormat;
|
response_format: AiTextGenerationResponseFormat;
|
||||||
});
|
});
|
||||||
type BrowserRunContentOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunContentOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunMarkdownOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunRedirectHop = {
|
|
||||||
/** URL that returned the redirect. */
|
|
||||||
url: string;
|
|
||||||
/** HTTP status of the redirect. */
|
|
||||||
status: number;
|
|
||||||
/** Redirect response headers, including `location`. */
|
|
||||||
headers: Record<string, string>;
|
|
||||||
};
|
|
||||||
type BrowserRunResponseMeta = {
|
type BrowserRunResponseMeta = {
|
||||||
/** HTTP status code of the rendered page */
|
/** HTTP status code of the rendered page */
|
||||||
status: number;
|
status: number;
|
||||||
/** Page title */
|
/** Page title */
|
||||||
title: string;
|
title: string;
|
||||||
/** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
/** URL that served the response, after any redirects the browser followed. */
|
|
||||||
finalUrl?: string;
|
|
||||||
/** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
|
|
||||||
redirectChain?: BrowserRunRedirectHop[];
|
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* A node in the page's accessibility tree, as exposed to assistive technology.
|
|
||||||
* `role` is the only field always present; the rest are populated when the
|
|
||||||
* underlying element defines them.
|
|
||||||
* @see https://pptr.dev/api/puppeteer.serializedaxnode
|
|
||||||
*/
|
|
||||||
interface BrowserRunSerializedAXNode {
|
|
||||||
/** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
|
|
||||||
role: string;
|
|
||||||
/** The `aria-autocomplete` value. */
|
|
||||||
autocomplete?: string;
|
|
||||||
/** Checked state of a checkbox, radio, or menu item. */
|
|
||||||
checked?: boolean | 'mixed';
|
|
||||||
/** Accessible description, typically from `aria-describedby` or `title`. */
|
|
||||||
description?: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
expanded?: boolean;
|
|
||||||
/** Whether the element currently holds keyboard focus. */
|
|
||||||
focused?: boolean;
|
|
||||||
/** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
|
|
||||||
haspopup?: string;
|
|
||||||
/** The `aria-invalid` value. */
|
|
||||||
invalid?: string;
|
|
||||||
/** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
|
|
||||||
keyshortcuts?: string;
|
|
||||||
/** Hierarchical level, e.g. the heading level of an `<h2>`. */
|
|
||||||
level?: number;
|
|
||||||
/** Whether the element is a modal dialog. */
|
|
||||||
modal?: boolean;
|
|
||||||
/** Whether a text input accepts multiple lines. */
|
|
||||||
multiline?: boolean;
|
|
||||||
/** Whether more than one option can be selected. */
|
|
||||||
multiselectable?: boolean;
|
|
||||||
/** Accessible name, e.g. a button's label or an image's alt text. */
|
|
||||||
name?: string;
|
|
||||||
orientation?: string;
|
|
||||||
/** Pressed state of a toggle button. */
|
|
||||||
pressed?: boolean | 'mixed';
|
|
||||||
readonly?: boolean;
|
|
||||||
required?: boolean;
|
|
||||||
/** Author-supplied role description, from `aria-roledescription`. */
|
|
||||||
roledescription?: string;
|
|
||||||
selected?: boolean;
|
|
||||||
/** Current value of an input or range element. */
|
|
||||||
value?: string | number;
|
|
||||||
valuemax?: number;
|
|
||||||
valuemin?: number;
|
|
||||||
/** Human-readable form of `value`, from `aria-valuetext`. */
|
|
||||||
valuetext?: string;
|
|
||||||
/** Child nodes. Absent for leaf nodes. */
|
|
||||||
children?: BrowserRunSerializedAXNode[];
|
|
||||||
}
|
|
||||||
/** Success response for `content` action. */
|
/** Success response for `content` action. */
|
||||||
type BrowserRunContentSuccessResponse = {
|
type BrowserRunContentSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
@@ -11302,7 +10924,6 @@ type BrowserRunLinksSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** Extracted links */
|
/** Extracted links */
|
||||||
result: string[];
|
result: string[];
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `scrape` action. */
|
/** Success response for `scrape` action. */
|
||||||
type BrowserRunScrapeSuccessResponse = {
|
type BrowserRunScrapeSuccessResponse = {
|
||||||
@@ -11333,33 +10954,15 @@ type BrowserRunScrapeSuccessResponse = {
|
|||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `snapshot` action. Each field is present only when the
|
/** Success response for `snapshot` action. */
|
||||||
* corresponding entry was requested in `formats`.
|
|
||||||
*/
|
|
||||||
type BrowserRunSnapshotSuccessResponse = {
|
type BrowserRunSnapshotSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
result: {
|
result: {
|
||||||
/** HTML content of the page. */
|
/** HTML content of the page. */
|
||||||
content?: string;
|
content: string;
|
||||||
/** Base64-encoded screenshot image. */
|
/** Base64-encoded screenshot image. */
|
||||||
screenshot?: string;
|
screenshot: string;
|
||||||
/** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
|
|
||||||
* page provides that metadata.
|
|
||||||
*/
|
|
||||||
markdown?: string;
|
|
||||||
/** Root of the page's accessibility tree. */
|
|
||||||
accessibilityTree?: BrowserRunSerializedAXNode;
|
|
||||||
};
|
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
|
||||||
/** Success response for `accessibilityTree` action. */
|
|
||||||
type BrowserRunAccessibilityTreeSuccessResponse = {
|
|
||||||
success: true;
|
|
||||||
result: {
|
|
||||||
/** Root of the accessibility tree, or `null` when `root` matched no element. */
|
|
||||||
accessibilityTree: BrowserRunSerializedAXNode | null;
|
|
||||||
};
|
};
|
||||||
meta: BrowserRunResponseMeta;
|
meta: BrowserRunResponseMeta;
|
||||||
};
|
};
|
||||||
@@ -11368,14 +10971,12 @@ type BrowserRunJsonSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** JSON data extracted from the page using an AI model */
|
/** JSON data extracted from the page using an AI model */
|
||||||
result: Record<string, unknown>;
|
result: Record<string, unknown>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `markdown` action. */
|
/** Success response for `markdown` action. */
|
||||||
type BrowserRunMarkdownSuccessResponse = {
|
type BrowserRunMarkdownSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
/** Extracted markdown content */
|
/** Extracted markdown content */
|
||||||
result: string;
|
result: string;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Error response for BrowserRun actions. */
|
/** Error response for BrowserRun actions. */
|
||||||
type BrowserRunErrorResponse = {
|
type BrowserRunErrorResponse = {
|
||||||
@@ -11485,10 +11086,9 @@ declare abstract class BrowserRun {
|
|||||||
*/
|
*/
|
||||||
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
||||||
/**
|
/**
|
||||||
* Get several representations of a web page in one request.
|
* Get both the HTML content and a base64-encoded screenshot of a web page.
|
||||||
* @param action - Must be `'snapshot'`.
|
* @param action - Must be `'snapshot'`.
|
||||||
* @param options - Snapshot options including the `formats` to return and
|
* @param options - Snapshot options including screenshot settings (encoding is always base64).
|
||||||
* screenshot settings (encoding is always base64).
|
|
||||||
* @returns A `Response` containing one of:
|
* @returns A `Response` containing one of:
|
||||||
*
|
*
|
||||||
* **Success (HTTP 200):**
|
* **Success (HTTP 200):**
|
||||||
@@ -11536,26 +11136,6 @@ declare abstract class BrowserRun {
|
|||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
||||||
*/
|
*/
|
||||||
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
||||||
/**
|
|
||||||
* Get the accessibility tree of a web page.
|
|
||||||
* @param action - Must be `'accessibilityTree'`.
|
|
||||||
* @param options - Options to scope the tree to a subtree and to control
|
|
||||||
* whether semantically uninteresting nodes are pruned.
|
|
||||||
* @returns A `Response` containing one of:
|
|
||||||
*
|
|
||||||
* **Success (HTTP 200):**
|
|
||||||
* - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
|
|
||||||
* - `result.accessibilityTree` is `null` when `root` matched no element
|
|
||||||
*
|
|
||||||
* **Error:**
|
|
||||||
* - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
|
|
||||||
* - HTTP 422 for a malformed `root` selector
|
|
||||||
* - HTTP 500 with code `2017` or `2018` when the tree could not be built
|
|
||||||
*
|
|
||||||
* **Headers:**
|
|
||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
|
||||||
*/
|
|
||||||
quickAction(action: 'accessibilityTree', options: BrowserRunAccessibilityTreeOptions): Promise<Response>;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* In addition to the properties you can set in the RequestInit dict
|
* In addition to the properties you can set in the RequestInit dict
|
||||||
@@ -12626,13 +12206,6 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|||||||
* @returns A promise that resolves when the email message is replied.
|
* @returns A promise that resolves when the email message is replied.
|
||||||
*/
|
*/
|
||||||
reply(message: EmailMessage): Promise<EmailSendResult>;
|
reply(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
/**
|
|
||||||
* Reply to the sender of this email message with a message built from the given
|
|
||||||
* fields. Threading headers (In-Reply-To/References) are set automatically.
|
|
||||||
* @param builder The reply message contents.
|
|
||||||
* @returns A promise that resolves when the email message is replied.
|
|
||||||
*/
|
|
||||||
reply(builder: EmailReplyMessageBuilder): Promise<EmailSendResult>;
|
|
||||||
}
|
}
|
||||||
/** A file attachment for an email message */
|
/** A file attachment for an email message */
|
||||||
type EmailAttachment = {
|
type EmailAttachment = {
|
||||||
@@ -12653,46 +12226,23 @@ interface EmailAddress {
|
|||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Recipient fields for `SendEmail.send()`. At least one of `to`, `cc`, or
|
|
||||||
* `bcc` must be provided.
|
|
||||||
*/
|
|
||||||
type EmailDestinations = {
|
|
||||||
to?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
cc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} & ({
|
|
||||||
to: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
cc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
bcc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* Fields shared by all composed emails (no recipients). Used directly by
|
|
||||||
* `ForwardableEmailMessage.reply()`, which always replies to the original
|
|
||||||
* sender, and extended by `EmailMessageBuilder` for `SendEmail.send()`.
|
|
||||||
*/
|
|
||||||
interface EmailReplyMessageBuilder {
|
|
||||||
from: string | EmailAddress;
|
|
||||||
subject: string;
|
|
||||||
replyTo?: string | EmailAddress;
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
text?: string;
|
|
||||||
html?: string;
|
|
||||||
attachments?: EmailAttachment[];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Fields for composing an email without constructing raw MIME, for
|
|
||||||
* `SendEmail.send()`. Requires at least one of `to`, `cc`, or `bcc`.
|
|
||||||
*/
|
|
||||||
type EmailMessageBuilder = EmailReplyMessageBuilder & EmailDestinations;
|
|
||||||
/**
|
/**
|
||||||
* A binding that allows a Worker to send email messages.
|
* A binding that allows a Worker to send email messages.
|
||||||
*/
|
*/
|
||||||
interface SendEmail {
|
interface SendEmail {
|
||||||
send(message: EmailMessage): Promise<EmailSendResult>;
|
send(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
send(builder: EmailMessageBuilder): Promise<EmailSendResult>;
|
send(builder: {
|
||||||
|
from: string | EmailAddress;
|
||||||
|
to: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
subject: string;
|
||||||
|
replyTo?: string | EmailAddress;
|
||||||
|
cc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
headers?: Record<string, string>;
|
||||||
|
text?: string;
|
||||||
|
html?: string;
|
||||||
|
attachments?: EmailAttachment[];
|
||||||
|
}): Promise<EmailSendResult>;
|
||||||
}
|
}
|
||||||
declare abstract class EmailEvent extends ExtendableEvent {
|
declare abstract class EmailEvent extends ExtendableEvent {
|
||||||
readonly message: ForwardableEmailMessage;
|
readonly message: ForwardableEmailMessage;
|
||||||
@@ -12846,15 +12396,6 @@ interface Hyperdrive {
|
|||||||
* for your database.
|
* for your database.
|
||||||
*/
|
*/
|
||||||
readonly host: string;
|
readonly host: string;
|
||||||
/*
|
|
||||||
* A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
|
|
||||||
* host field, is only valid within the context of the currently running
|
|
||||||
* Worker and, when passed into the `connect()` function from the
|
|
||||||
* "cloudflare:sockets" module, will connect to the Hyperdrive instance for
|
|
||||||
* your database. This is provided for database drivers that require the host
|
|
||||||
* to be an IP literal rather than a hostname.
|
|
||||||
*/
|
|
||||||
readonly ip: string;
|
|
||||||
/*
|
/*
|
||||||
* The port that must be paired the the host field when connecting.
|
* The port that must be paired the the host field when connecting.
|
||||||
*/
|
*/
|
||||||
@@ -12876,78 +12417,6 @@ interface Hyperdrive {
|
|||||||
*/
|
*/
|
||||||
readonly database: string;
|
readonly database: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* A handle to a dynamically-provisioned Hyperdrive connection, returned by
|
|
||||||
* `HyperdriveApi.get()`.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamic extends Disposable {
|
|
||||||
/**
|
|
||||||
* The database name to use when connecting through this Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly database: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated user to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly user: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated password to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly password: Promise<string>;
|
|
||||||
/**
|
|
||||||
* Open a TCP socket to the target database through this Hyperdrive.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
connect(): Promise<Socket>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Binding that provisions Hyperdrive connections at request time, rather than
|
|
||||||
* from static configuration.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicApi {
|
|
||||||
/**
|
|
||||||
* Provision a connection for the database described by `args`.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
|
|
||||||
/**
|
|
||||||
* Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
|
|
||||||
*/
|
|
||||||
getHyperdriveConnectionString(connectionString: string): Promise<string>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Parameters identifying the database that a dynamically-provisioned
|
|
||||||
* Hyperdrive connection should target.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicConfig {
|
|
||||||
/**
|
|
||||||
* Generated connection string to pass into the dynamic worker.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
dynamicHyperdriveConnectionString: string;
|
|
||||||
/**
|
|
||||||
* Connection string for the origin database Hyperdrive should connect to.
|
|
||||||
* Contains credentials, so treat it as a secret.
|
|
||||||
*
|
|
||||||
* The scheme selects the database engine. PostgreSQL origins are supported.
|
|
||||||
*/
|
|
||||||
connectionString: string;
|
|
||||||
/**
|
|
||||||
* Region in which to place the connection pool. See the Hyperdrive
|
|
||||||
* documentation for the set of supported regions.
|
|
||||||
*/
|
|
||||||
targetRegion: string;
|
|
||||||
/**
|
|
||||||
* Whether Hyperdrive should cache query results for this connection.
|
|
||||||
*/
|
|
||||||
cachingEnabled?: boolean;
|
|
||||||
/**
|
|
||||||
* Maximum number of connections the pool may open to the origin database.
|
|
||||||
* Defaults to 60.
|
|
||||||
*/
|
|
||||||
maxConnections?: number;
|
|
||||||
}
|
|
||||||
// Copyright (c) 2024 Cloudflare, Inc.
|
// Copyright (c) 2024 Cloudflare, Inc.
|
||||||
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
||||||
// https://opensource.org/licenses/Apache-2.0
|
// https://opensource.org/licenses/Apache-2.0
|
||||||
@@ -12959,27 +12428,6 @@ type ImageInfoResponse = {
|
|||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* Parameters for rasterizing text into an image.
|
|
||||||
*/
|
|
||||||
type TextRasterize = {
|
|
||||||
/** The text content to render */
|
|
||||||
content: string;
|
|
||||||
/** rasterization options for the text **/
|
|
||||||
options: TextOptions;
|
|
||||||
};
|
|
||||||
type TextOptions = {
|
|
||||||
/** Font configuration */
|
|
||||||
font: {
|
|
||||||
/** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
/** Font size in points (pt) */
|
|
||||||
size?: number;
|
|
||||||
/** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
|
|
||||||
color?: string;
|
|
||||||
};
|
|
||||||
type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
|
|
||||||
type ImageTransform = {
|
type ImageTransform = {
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
@@ -13069,9 +12517,6 @@ interface ImageUploadOptions {
|
|||||||
requireSignedURLs?: boolean;
|
requireSignedURLs?: boolean;
|
||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
/**
|
|
||||||
* If 'base64', the input data will be decoded from base64 before processing
|
|
||||||
*/
|
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
}
|
}
|
||||||
interface ImageUpdateOptions {
|
interface ImageUpdateOptions {
|
||||||
@@ -13079,40 +12524,11 @@ interface ImageUpdateOptions {
|
|||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
}
|
}
|
||||||
type ImageMetadataFilterOperators = {
|
|
||||||
eq?: string | number | boolean;
|
|
||||||
in?: string[] | number[];
|
|
||||||
gt?: number;
|
|
||||||
gte?: number;
|
|
||||||
lt?: number;
|
|
||||||
lte?: number;
|
|
||||||
};
|
|
||||||
type ImageMetadataFilterValue = string | number | boolean | ImageMetadataFilterOperators;
|
|
||||||
interface ImageListFilter {
|
|
||||||
metadata?: Record<string, ImageMetadataFilterValue>;
|
|
||||||
}
|
|
||||||
interface ImageListOptions {
|
interface ImageListOptions {
|
||||||
limit?: number;
|
limit?: number;
|
||||||
cursor?: string;
|
cursor?: string;
|
||||||
sortOrder?: 'asc' | 'desc';
|
sortOrder?: 'asc' | 'desc';
|
||||||
creator?: string;
|
creator?: string;
|
||||||
filter?: ImageListFilter;
|
|
||||||
}
|
|
||||||
interface ImageSignedUrlOptions {
|
|
||||||
variant: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
keyName?: string;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadOptions {
|
|
||||||
id?: string;
|
|
||||||
requireSignedURLs?: boolean;
|
|
||||||
metadata?: Record<string, unknown>;
|
|
||||||
creator?: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadResult {
|
|
||||||
id: string;
|
|
||||||
uploadURL: string;
|
|
||||||
}
|
}
|
||||||
interface ImageList {
|
interface ImageList {
|
||||||
images: ImageMetadata[];
|
images: ImageMetadata[];
|
||||||
@@ -13130,13 +12546,6 @@ interface ImageHandle {
|
|||||||
* @returns ReadableStream of image bytes, or null if not found
|
* @returns ReadableStream of image bytes, or null if not found
|
||||||
*/
|
*/
|
||||||
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
||||||
/**
|
|
||||||
* Generate a signed delivery URL for this hosted image.
|
|
||||||
* @param options Signing configuration
|
|
||||||
* @returns A signed image delivery URL
|
|
||||||
* @throws {@link ImagesError} if signing fails
|
|
||||||
*/
|
|
||||||
signedUrl(options: ImageSignedUrlOptions): Promise<string>;
|
|
||||||
/**
|
/**
|
||||||
* Update hosted image metadata
|
* Update hosted image metadata
|
||||||
* @param options Properties to update
|
* @param options Properties to update
|
||||||
@@ -13172,14 +12581,6 @@ interface HostedImagesBinding {
|
|||||||
* @throws {@link ImagesError} if list fails
|
* @throws {@link ImagesError} if list fails
|
||||||
*/
|
*/
|
||||||
list(options?: ImageListOptions): Promise<ImageList>;
|
list(options?: ImageListOptions): Promise<ImageList>;
|
||||||
/**
|
|
||||||
* Create a Direct Creator Upload link, letting an end user upload an
|
|
||||||
* image straight to Cloudflare without exposing an API token
|
|
||||||
* @param options Upload link configuration
|
|
||||||
* @returns The new image ID and the upload URL to hand to the end user
|
|
||||||
* @throws {@link ImagesError} if creation fails
|
|
||||||
*/
|
|
||||||
createDirectUpload(options?: ImageDirectUploadOptions): Promise<ImageDirectUploadResult>;
|
|
||||||
}
|
}
|
||||||
interface ImagesBinding {
|
interface ImagesBinding {
|
||||||
/**
|
/**
|
||||||
@@ -13194,13 +12595,6 @@ interface ImagesBinding {
|
|||||||
* @returns A transform handle
|
* @returns A transform handle
|
||||||
*/
|
*/
|
||||||
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
||||||
/**
|
|
||||||
* Begin applying a series of transformations to text
|
|
||||||
* @param content string to be rendered
|
|
||||||
* @param options font, optional color and size to use in rendering text
|
|
||||||
* @returns A transform handle
|
|
||||||
*/
|
|
||||||
text(content: string, options: TextOptions): ImageTransformer;
|
|
||||||
/**
|
/**
|
||||||
* Access hosted images CRUD operations
|
* Access hosted images CRUD operations
|
||||||
*/
|
*/
|
||||||
@@ -13230,15 +12624,11 @@ interface ImageTransformer {
|
|||||||
type ImageTransformationOutputOptions = {
|
type ImageTransformationOutputOptions = {
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
};
|
};
|
||||||
type ImageTransformationResponseOptions = {
|
|
||||||
headers?: HeadersInit;
|
|
||||||
};
|
|
||||||
interface ImageTransformationResult {
|
interface ImageTransformationResult {
|
||||||
/**
|
/**
|
||||||
* The image as a response, ready to store in cache or return to users
|
* The image as a response, ready to store in cache or return to users
|
||||||
* @param options Options that apply to the returned response, e.g. additional headers
|
|
||||||
*/
|
*/
|
||||||
response(options?: ImageTransformationResponseOptions): Response;
|
response(): Response;
|
||||||
/**
|
/**
|
||||||
* The content type of the returned image
|
* The content type of the returned image
|
||||||
*/
|
*/
|
||||||
@@ -13674,11 +13064,6 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowDynamicDelayContext = {
|
|
||||||
ctx: WorkflowStepContext<WorkflowDelayFunction>;
|
|
||||||
error: Error;
|
|
||||||
};
|
|
||||||
export type WorkflowDelayFunction = (input: WorkflowDynamicDelayContext) => WorkflowDelayDuration | Promise<WorkflowDelayDuration>;
|
|
||||||
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
||||||
@@ -13686,32 +13071,12 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowStepConfig = {
|
export type WorkflowStepConfig = {
|
||||||
retries?: {
|
retries?: {
|
||||||
limit: number;
|
limit: number;
|
||||||
delay: WorkflowDelayDuration | number | WorkflowDelayFunction;
|
delay: WorkflowDelayDuration | number;
|
||||||
backoff?: WorkflowBackoff;
|
backoff?: WorkflowBackoff;
|
||||||
};
|
};
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
timeout?: WorkflowTimeoutDuration | number;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
// Internal discriminators used only for `WorkflowStep.do` overload
|
|
||||||
// resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
|
|
||||||
// single kind so the callback context can be narrowed based on the shape of
|
|
||||||
// the config argument (rather than on an inferred type parameter, which is
|
|
||||||
// lost when the caller supplies an explicit return-type argument). Not
|
|
||||||
// exported: they must not widen the public type surface.
|
|
||||||
type WorkflowStepConfigWithStaticDelay = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
type WorkflowStepConfigWithDelayFunction = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayFunction;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
||||||
export type WorkflowCronSchedule = {
|
export type WorkflowCronSchedule = {
|
||||||
/** Cron expression that triggered this event. */
|
/** Cron expression that triggered this event. */
|
||||||
@@ -13732,51 +13097,28 @@ declare namespace CloudflareWorkersModule {
|
|||||||
type: string;
|
type: string;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
export type WorkflowStepContext<Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepContext = {
|
||||||
step: {
|
step: {
|
||||||
name: string;
|
name: string;
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
attempt: number;
|
attempt: number;
|
||||||
config: {
|
config: WorkflowStepConfig;
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
} & (Delay extends WorkflowDelayFunction ? {} : {
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
});
|
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
|
||||||
sensitive?: WorkflowStepSensitivity;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
// The rollback handler receives the step context, so it mirrors the same
|
export type WorkflowRollbackContext<T = unknown> = {
|
||||||
// delay discriminant as the step callback: when the step was configured with
|
ctx: WorkflowStepContext;
|
||||||
// a dynamic delay function the resolved `config.retries.delay` is omitted,
|
|
||||||
// otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
|
|
||||||
// overload that matched the step config.
|
|
||||||
export type WorkflowRollbackContext<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
||||||
ctx: WorkflowStepContext<Delay>;
|
|
||||||
error: Error;
|
error: Error;
|
||||||
output: T | undefined;
|
output: T | undefined;
|
||||||
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
||||||
stepName: string;
|
stepName: string;
|
||||||
};
|
};
|
||||||
export type WorkflowRollbackHandler<T = unknown, Delay = WorkflowDelayDuration | number> = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
|
export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
|
||||||
export type WorkflowStepRollbackOptions<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepRollbackOptions<T = unknown> = {
|
||||||
rollback: WorkflowRollbackHandler<T, Delay>;
|
rollback: WorkflowRollbackHandler<T>;
|
||||||
rollbackConfig?: WorkflowStepRollbackConfig;
|
rollbackConfig?: WorkflowStepRollbackConfig;
|
||||||
};
|
};
|
||||||
export abstract class WorkflowStep {
|
export abstract class WorkflowStep {
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
// The config overloads discriminate on the shape of `config.retries.delay`
|
|
||||||
// so the callback context reflects whether the resolved delay is present
|
|
||||||
// (static delay) or omitted (dynamic delay function). Each has a single
|
|
||||||
// type parameter, so an explicit return-type argument (`do<T>(...)`) still
|
|
||||||
// resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
|
|
||||||
// fallback MUST remain last, otherwise it shadows the discriminating
|
|
||||||
// overloads and narrowing is silently lost.
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithDelayFunction, callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithStaticDelay, callback: (ctx: WorkflowStepContext<WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayDuration | number>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
||||||
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
||||||
@@ -14552,12 +13894,11 @@ type MarkdownDocument = {
|
|||||||
name: string;
|
name: string;
|
||||||
blob: Blob;
|
blob: Blob;
|
||||||
};
|
};
|
||||||
type OutputFormat = 'markdown' | 'text';
|
|
||||||
type ConversionResponse = {
|
type ConversionResponse = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
mimeType: string;
|
mimeType: string;
|
||||||
format: OutputFormat;
|
format: 'markdown';
|
||||||
tokens: number;
|
tokens: number;
|
||||||
data: string;
|
data: string;
|
||||||
} | {
|
} | {
|
||||||
@@ -14574,11 +13915,7 @@ type EmbeddedImageConversionOptions = ImageConversionOptions & {
|
|||||||
convert?: boolean;
|
convert?: boolean;
|
||||||
maxConvertedImages?: number;
|
maxConvertedImages?: number;
|
||||||
};
|
};
|
||||||
type ConversionOutputOptions = {
|
|
||||||
format?: OutputFormat;
|
|
||||||
};
|
|
||||||
type ConversionOptions = {
|
type ConversionOptions = {
|
||||||
output?: ConversionOutputOptions;
|
|
||||||
html?: {
|
html?: {
|
||||||
images?: EmbeddedImageConversionOptions & {
|
images?: EmbeddedImageConversionOptions & {
|
||||||
convertOGImage?: boolean;
|
convertOGImage?: boolean;
|
||||||
@@ -14673,7 +14010,7 @@ declare namespace TailStream {
|
|||||||
interface ConnectEventInfo {
|
interface ConnectEventInfo {
|
||||||
readonly type: "connect";
|
readonly type: "connect";
|
||||||
}
|
}
|
||||||
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime" | "aborted";
|
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime";
|
||||||
interface ScriptVersion {
|
interface ScriptVersion {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly tag?: string;
|
readonly tag?: string;
|
||||||
@@ -14692,7 +14029,6 @@ declare namespace TailStream {
|
|||||||
readonly dispatchNamespace?: string;
|
readonly dispatchNamespace?: string;
|
||||||
readonly entrypoint?: string;
|
readonly entrypoint?: string;
|
||||||
readonly executionModel: string;
|
readonly executionModel: string;
|
||||||
readonly durableObjectId?: string;
|
|
||||||
readonly scriptName?: string;
|
readonly scriptName?: string;
|
||||||
readonly scriptTags?: string[];
|
readonly scriptTags?: string[];
|
||||||
readonly scriptVersion?: ScriptVersion;
|
readonly scriptVersion?: ScriptVersion;
|
||||||
@@ -14727,22 +14063,11 @@ declare namespace TailStream {
|
|||||||
readonly message: string;
|
readonly message: string;
|
||||||
readonly stack?: string;
|
readonly stack?: string;
|
||||||
}
|
}
|
||||||
interface TailStreamErrorInfo {
|
interface Log {
|
||||||
readonly name: string;
|
|
||||||
readonly message: string;
|
|
||||||
readonly stack?: string;
|
|
||||||
}
|
|
||||||
type Log = {
|
|
||||||
readonly type: "log";
|
readonly type: "log";
|
||||||
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
||||||
readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
|
|
||||||
} & ({
|
|
||||||
readonly message: object;
|
readonly message: object;
|
||||||
readonly truncated?: false;
|
}
|
||||||
} | {
|
|
||||||
readonly message: string;
|
|
||||||
readonly truncated: true;
|
|
||||||
});
|
|
||||||
interface DroppedEventsDiagnostic {
|
interface DroppedEventsDiagnostic {
|
||||||
readonly diagnosticsType: "droppedEvents";
|
readonly diagnosticsType: "droppedEvents";
|
||||||
readonly count: number;
|
readonly count: number;
|
||||||
@@ -15220,31 +14545,10 @@ declare abstract class Workflow<PARAMS = unknown> {
|
|||||||
* @returns A promise that resolves with a list of handles for the created instances.
|
* @returns A promise that resolves with a list of handles for the created instances.
|
||||||
*/
|
*/
|
||||||
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
||||||
/**
|
|
||||||
* Delete a batch of Workflow instances and their stored state.
|
|
||||||
* `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
|
|
||||||
* The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
|
|
||||||
* @param instanceIds IDs of the Workflow instances to delete
|
|
||||||
* @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
|
|
||||||
*/
|
|
||||||
public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
|
|
||||||
}
|
}
|
||||||
type WorkflowBatchDeleteResult = {
|
|
||||||
deleted: {
|
|
||||||
id: string;
|
|
||||||
}[];
|
|
||||||
errors: {
|
|
||||||
id: string;
|
|
||||||
code: number;
|
|
||||||
message: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
/** Geographic regions supported when creating a Workflow instance.
|
|
||||||
* Location hints are best-effort placement preferences. */
|
|
||||||
type WorkflowInstanceLocationHint = 'wnam' | 'enam' | 'sam' | 'weur' | 'eeur' | 'apac' | 'apac-ne' | 'apac-se' | 'oc' | 'afr' | 'me';
|
|
||||||
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
||||||
/**
|
/**
|
||||||
* An id for your Workflow instance. Must be unique within the Workflow.
|
* An id for your Workflow instance. Must be unique within the Workflow.
|
||||||
@@ -15262,9 +14566,6 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|||||||
successRetention?: WorkflowRetentionDuration;
|
successRetention?: WorkflowRetentionDuration;
|
||||||
errorRetention?: WorkflowRetentionDuration;
|
errorRetention?: WorkflowRetentionDuration;
|
||||||
};
|
};
|
||||||
/** A best-effort geographic placement preference for the Workflow instance.
|
|
||||||
* See `WorkflowInstanceLocationHint` for supported regions. */
|
|
||||||
locationHint?: WorkflowInstanceLocationHint;
|
|
||||||
}
|
}
|
||||||
type InstanceStatus = {
|
type InstanceStatus = {
|
||||||
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
||||||
@@ -15282,13 +14583,6 @@ interface WorkflowError {
|
|||||||
code?: number;
|
code?: number;
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
interface WorkflowInstanceTerminateOptions {
|
|
||||||
/**
|
|
||||||
* If true, run registered rollback handlers before terminating the instance.
|
|
||||||
* Only steps that registered rollback handlers are rolled back.
|
|
||||||
*/
|
|
||||||
rollback?: boolean;
|
|
||||||
}
|
|
||||||
interface WorkflowInstanceRestartOptions {
|
interface WorkflowInstanceRestartOptions {
|
||||||
/**
|
/**
|
||||||
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
||||||
@@ -15322,19 +14616,14 @@ declare abstract class WorkflowInstance {
|
|||||||
public resume(): Promise<void>;
|
public resume(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
||||||
* @param options Options for termination, including whether registered rollback handlers should run.
|
|
||||||
*/
|
*/
|
||||||
public terminate(options?: WorkflowInstanceTerminateOptions): Promise<void>;
|
public terminate(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Restart the instance. Optionally restart from a specific step, preserving
|
* Restart the instance. Optionally restart from a specific step, preserving
|
||||||
* cached results for all steps before it.
|
* cached results for all steps before it.
|
||||||
* @param options Options for the restart, including an optional step to restart from.
|
* @param options Options for the restart, including an optional step to restart from.
|
||||||
*/
|
*/
|
||||||
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
||||||
/**
|
|
||||||
* Delete the instance and its stored state.
|
|
||||||
*/
|
|
||||||
public delete(): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Returns the current status of the instance.
|
* Returns the current status of the instance.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,9 +7,7 @@
|
|||||||
// Shared `recflare` DB (created manually with `wrangler d1 create recflare`; the
|
// Shared `recflare` DB (created manually with `wrangler d1 create recflare`; the
|
||||||
// "local" placeholder is spliced out at deploy time). The `chat` worker owns the
|
// "local" placeholder is spliced out at deploy time). The `chat` worker owns the
|
||||||
// `message` table (schema/migration here); its own migrations_table keeps history
|
// `message` table (schema/migration here); its own migrations_table keeps history
|
||||||
// separate from the other workers' migrations on the shared database. Chat keeps its
|
// separate from the other workers' migrations on the shared database.
|
||||||
// two chat-privacy settings in `player_settings` (owned by the `playersettings` worker)
|
|
||||||
// rather than in a table of its own, so they sit with the player's other toggles.
|
|
||||||
"d1_databases": [
|
"d1_databases": [
|
||||||
{
|
{
|
||||||
"binding": "DB",
|
"binding": "DB",
|
||||||
@@ -19,6 +17,16 @@
|
|||||||
"migrations_table": "d1_migrations_chat"
|
"migrations_table": "d1_migrations_chat"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
// Per-player settings KV, owned by the `playersettings` worker. Chat keeps the two
|
||||||
|
// chat-privacy settings in it rather than in a table of its own, so they sit with the
|
||||||
|
// player's other toggles. The "local" id placeholder is replaced with the real id from
|
||||||
|
// RECFLARE_KV at deploy time.
|
||||||
|
"kv_namespaces": [
|
||||||
|
{
|
||||||
|
"binding": "RECFLARE_PLAYER_SETTINGS",
|
||||||
|
"id": "local"
|
||||||
|
}
|
||||||
|
],
|
||||||
"logpush": false,
|
"logpush": false,
|
||||||
// Shared Secrets Store holding the HS256 JWT signing key. Every worker binds the
|
// Shared Secrets Store holding the HS256 JWT signing key. Every worker binds the
|
||||||
// same store as JWT_SECRET so tokens signed by `auth` verify here. The "local"
|
// same store as JWT_SECRET so tokens signed by `auth` verify here. The "local"
|
||||||
|
|||||||
@@ -120,10 +120,11 @@ substitutes the same as asking by id.
|
|||||||
|
|
||||||
## Bindings
|
## Bindings
|
||||||
|
|
||||||
| Binding | Type | Notes |
|
| Binding | Type | Notes |
|
||||||
| ------------ | ------------- | ----------------------------------------------------------------------------- |
|
| -------------------------- | ------------- | ------------------------------------------------------------ |
|
||||||
| `DB` | D1 | Shared `recflare` database — rooms, room instances, presence, player settings |
|
| `DB` | D1 | Shared `recflare` database — rooms, room instances, presence |
|
||||||
| `JWT_SECRET` | Secrets Store | Shared HS256 signing key (see the `auth` README) |
|
| `JWT_SECRET` | Secrets Store | Shared HS256 signing key (see the `auth` README) |
|
||||||
|
| `RECFLARE_PLAYER_SETTINGS` | KV | The `playersettings` map — `/player/avoidjuniors` |
|
||||||
|
|
||||||
The `presence` and `room_instance` tables are owned/migrated by the `rooms` worker. This
|
The `presence` and `room_instance` tables are owned/migrated by the `rooms` worker. This
|
||||||
worker owns one table of its own, `room_invite` (`migrations/0001_room_invite.sql`, applied
|
worker owns one table of its own, `room_invite` (`migrations/0001_room_invite.sql`, applied
|
||||||
@@ -133,10 +134,9 @@ invite the `RoomInviteId` the response carries. Its `created_at` is epoch second
|
|||||||
`rooms` worker's cron deletes rows older than `ROOM_INVITE_TTL_SECONDS` (5 minutes), and a
|
`rooms` worker's cron deletes rows older than `ROOM_INVITE_TTL_SECONDS` (5 minutes), and a
|
||||||
redeem that misses the row answers `RoomInviteExpired`.
|
redeem that misses the row answers `RoomInviteExpired`.
|
||||||
|
|
||||||
The `player_settings` table (one JSON map per player) is owned by the `playersettings`
|
The settings KV is owned by the `playersettings` worker; this worker touches exactly one
|
||||||
worker; this worker touches exactly one key in it, the "avoid juniors" preference
|
key in it, the "avoid juniors" preference, and its write merges (as that worker's own PUT
|
||||||
(`/player/avoidjuniors`), and its write merges (as that worker's own PUT does) so the rest
|
does) so the rest of the player's settings survive.
|
||||||
of the player's settings survive.
|
|
||||||
|
|
||||||
## Known gaps
|
## Known gaps
|
||||||
|
|
||||||
|
|||||||
@@ -13,17 +13,20 @@ export type Env = SharedHonoEnv & {
|
|||||||
// player's personal dorm room on first entry, and holds player presence — the
|
// player's personal dorm room on first entry, and holds player presence — the
|
||||||
// room instance each player is currently in (written by matchmake/heartbeat,
|
// room instance each player is currently in (written by matchmake/heartbeat,
|
||||||
// read by the heartbeat and the batch `/player` lookup). See @repo/domain's
|
// read by the heartbeat and the batch `/player` lookup). See @repo/domain's
|
||||||
// presence-db (table owned/migrated by the `rooms` worker). Also holds the
|
// presence-db (table owned/migrated by the `rooms` worker).
|
||||||
// per-player settings map (`player_settings`, owned by the `playersettings`
|
|
||||||
// worker), touched only by `GET|PUT /player/avoidjuniors`: the "avoid juniors"
|
|
||||||
// preference is a matchmaking question the client asks this worker, but it is
|
|
||||||
// stored with the rest of the player's settings, not in presence.
|
|
||||||
DB: D1Database
|
DB: D1Database
|
||||||
/**
|
/**
|
||||||
* The `notify` worker's NotificationsHub DO — pushes websocket notifications to a
|
* The `notify` worker's NotificationsHub DO — pushes websocket notifications to a
|
||||||
* player. Used by `POST /invite` to deliver the game-invite message to the invitee.
|
* player. Used by `POST /invite` to deliver the game-invite message to the invitee.
|
||||||
*/
|
*/
|
||||||
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>
|
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>
|
||||||
|
/**
|
||||||
|
* The per-player settings map the `playersettings` worker owns (`player:<id>` → JSON
|
||||||
|
* `{ key: value }`). Read-only here, and only by `GET /player/avoidjuniors`: the
|
||||||
|
* "avoid juniors" preference is a matchmaking question the client asks this worker,
|
||||||
|
* but it is stored with the rest of the player's settings, not in presence.
|
||||||
|
*/
|
||||||
|
RECFLARE_PLAYER_SETTINGS: KVNamespace
|
||||||
/**
|
/**
|
||||||
* Room substitutions applied at matchmake time, as comma-separated `<fromRoomId>=<to>`
|
* Room substitutions applied at matchmake time, as comma-separated `<fromRoomId>=<to>`
|
||||||
* pairs — e.g. `2=100` or `2=MyHub,3=100` — where `from` is the room id the client
|
* pairs — e.g. `2=100` or `2=MyHub,3=100` — where `from` is the room id the client
|
||||||
|
|||||||
@@ -468,12 +468,12 @@ function parseSettingBool(value: unknown): boolean | undefined {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The player's settings map from the `player_settings` table the `playersettings` worker owns. */
|
/** The player's settings map from the KV the `playersettings` worker owns. */
|
||||||
async function getPlayerSettings(
|
async function getPlayerSettings(
|
||||||
env: Env,
|
env: Env,
|
||||||
accountId: number
|
accountId: number
|
||||||
): Promise<Record<string, string> | null> {
|
): Promise<Record<string, string> | null> {
|
||||||
return readPlayerSettings(env.DB, accountId).catch(() => null)
|
return readPlayerSettings(env.RECFLARE_PLAYER_SETTINGS, accountId).catch(() => null)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -496,14 +496,14 @@ async function readAvoidJuniors(env: Env, accountId: number): Promise<boolean> {
|
|||||||
* every setting the player has (OOBE state, tutorial mask, …), so storing this one on its
|
* every setting the player has (OOBE state, tutorial mask, …), so storing this one on its
|
||||||
* own would wipe the rest. The key is whichever spelling the map already carries, which is
|
* own would wipe the rest. The key is whichever spelling the map already carries, which is
|
||||||
* why this doesn't go through `mergePlayerSettings` — but like it, re-posting the stored
|
* why this doesn't go through `mergePlayerSettings` — but like it, re-posting the stored
|
||||||
* value writes nothing. A read failure throws (a 500) rather than reading as an empty
|
* value writes nothing. A KV read failure throws (a 500) rather than reading as an empty
|
||||||
* map, which would store this one key over everything the player had.
|
* map, which would store this one key over everything the player had.
|
||||||
*/
|
*/
|
||||||
async function writeAvoidJuniors(env: Env, accountId: number, value: boolean): Promise<void> {
|
async function writeAvoidJuniors(env: Env, accountId: number, value: boolean): Promise<void> {
|
||||||
const stored = await readPlayerSettings(env.DB, accountId)
|
const stored = await readPlayerSettings(env.RECFLARE_PLAYER_SETTINGS, accountId)
|
||||||
const merged: Record<string, string> = { ...stored }
|
const merged: Record<string, string> = { ...stored }
|
||||||
merged[findAvoidJuniorsKey(merged) ?? AVOID_JUNIORS_KEY] = value ? 'True' : 'False'
|
merged[findAvoidJuniorsKey(merged) ?? AVOID_JUNIORS_KEY] = value ? 'True' : 'False'
|
||||||
await putPlayerSettingsIfChanged(env.DB, accountId, stored, merged)
|
await putPlayerSettingsIfChanged(env.RECFLARE_PLAYER_SETTINGS, accountId, stored, merged)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ import {
|
|||||||
GAME_VERSION,
|
GAME_VERSION,
|
||||||
getRoomInstance,
|
getRoomInstance,
|
||||||
modifySubRoom,
|
modifySubRoom,
|
||||||
PLAYER_SETTINGS_SCHEMA_DDL,
|
|
||||||
PRESENCE_SCHEMA_DDL,
|
PRESENCE_SCHEMA_DDL,
|
||||||
readPlayerSettings,
|
|
||||||
recordRoomVisit,
|
recordRoomVisit,
|
||||||
ROOM_INSTANCE_SCHEMA_DDL,
|
ROOM_INSTANCE_SCHEMA_DDL,
|
||||||
ROOM_INVITE_SCHEMA_DDL,
|
ROOM_INVITE_SCHEMA_DDL,
|
||||||
@@ -140,23 +138,6 @@ const TEST_ROOMS = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
/** Seed a player's `player_settings` row with raw JSON text — what the KV value used to be. */
|
|
||||||
const seedSettings = (playerId: number, data: string) =>
|
|
||||||
env.DB.prepare(
|
|
||||||
`INSERT INTO player_settings (account_id, data) VALUES (?1, ?2)
|
|
||||||
ON CONFLICT (account_id) DO UPDATE SET data = excluded.data`
|
|
||||||
)
|
|
||||||
.bind(playerId, data)
|
|
||||||
.run()
|
|
||||||
|
|
||||||
/** The row's `data` exactly as stored — a seeded value surviving a request means no write happened. */
|
|
||||||
const rawSettings = async (playerId: number) =>
|
|
||||||
(
|
|
||||||
await env.DB.prepare('SELECT data FROM player_settings WHERE account_id = ?1')
|
|
||||||
.bind(playerId)
|
|
||||||
.first<{ data: string }>()
|
|
||||||
)?.data ?? null
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// Seed the shared JWT signing key into the local Secrets Store so .get() resolves.
|
// Seed the shared JWT signing key into the local Secrets Store so .get() resolves.
|
||||||
await adminSecretsStore(env.JWT_SECRET).create('test-signing-key')
|
await adminSecretsStore(env.JWT_SECRET).create('test-signing-key')
|
||||||
@@ -174,8 +155,6 @@ beforeAll(async () => {
|
|||||||
for (const stmt of ROOM_INVITE_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
for (const stmt of ROOM_INVITE_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
||||||
// Stats (owned by this worker) — the presence cron samples the online count into it.
|
// Stats (owned by this worker) — the presence cron samples the online count into it.
|
||||||
for (const stmt of STAT_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
for (const stmt of STAT_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
||||||
// Player settings (owned by the playersettings worker) — /player/avoidjuniors is one key.
|
|
||||||
for (const stmt of PLAYER_SETTINGS_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
|
||||||
|
|
||||||
// Accounts table (owned by the auth worker) — dorm creation reads the username
|
// Accounts table (owned by the auth worker) — dorm creation reads the username
|
||||||
// to name the room. Seed the players the dorm tests authenticate as.
|
// to name the room. Seed the players the dorm tests authenticate as.
|
||||||
@@ -569,11 +548,11 @@ describe('public endpoints', () => {
|
|||||||
expect(players[0]).toMatchObject({ playerId: 1, isOnline: true, appVersion: GAME_VERSION })
|
expect(players[0]).toMatchObject({ playerId: 1, isOnline: true, appVersion: GAME_VERSION })
|
||||||
})
|
})
|
||||||
|
|
||||||
// The "avoid juniors" preference lives in the playersettings map, not in presence.
|
// The "avoid juniors" preference lives in the playersettings KV map, not in presence.
|
||||||
// The body is a BARE boolean — the client reads the whole body as the value.
|
// The body is a BARE boolean — the client reads the whole body as the value.
|
||||||
describe('GET /player/avoidjuniors', () => {
|
describe('GET /player/avoidjuniors', () => {
|
||||||
const settings = async (playerId: number, map: Record<string, string>) =>
|
const settings = async (playerId: number, map: Record<string, string>) =>
|
||||||
seedSettings(playerId, JSON.stringify(map))
|
env.RECFLARE_PLAYER_SETTINGS.put(`player:${playerId}`, JSON.stringify(map))
|
||||||
|
|
||||||
const read = async (playerId: number) => {
|
const read = async (playerId: number) => {
|
||||||
const res = await exports.default.fetch(`${ORIGIN}/player/avoidjuniors`, {
|
const res = await exports.default.fetch(`${ORIGIN}/player/avoidjuniors`, {
|
||||||
@@ -618,7 +597,8 @@ describe('public endpoints', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('PUT /player/avoidjuniors', () => {
|
describe('PUT /player/avoidjuniors', () => {
|
||||||
const stored = async (playerId: number) => readPlayerSettings(env.DB, playerId)
|
const stored = async (playerId: number) =>
|
||||||
|
env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(`player:${playerId}`, 'json')
|
||||||
|
|
||||||
const write = async (playerId: number, body: string) => {
|
const write = async (playerId: number, body: string) => {
|
||||||
const res = await exports.default.fetch(`${ORIGIN}/player/avoidjuniors`, {
|
const res = await exports.default.fetch(`${ORIGIN}/player/avoidjuniors`, {
|
||||||
@@ -651,8 +631,8 @@ describe('public endpoints', () => {
|
|||||||
|
|
||||||
// The map holds every setting the player has, so the write must not replace it.
|
// The map holds every setting the player has, so the write must not replace it.
|
||||||
test('merges into the player’s other settings', async () => {
|
test('merges into the player’s other settings', async () => {
|
||||||
await seedSettings(
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
3201,
|
'player:3201',
|
||||||
JSON.stringify({ 'Recroom.OOBE': '77', TUTORIAL_COMPLETE_MASK: '11' })
|
JSON.stringify({ 'Recroom.OOBE': '77', TUTORIAL_COMPLETE_MASK: '11' })
|
||||||
)
|
)
|
||||||
await write(3201, 'avoidJuniors=True')
|
await write(3201, 'avoidJuniors=True')
|
||||||
@@ -666,21 +646,24 @@ describe('public endpoints', () => {
|
|||||||
// Whichever spelling the player's map already carries is the one overwritten —
|
// Whichever spelling the player's map already carries is the one overwritten —
|
||||||
// two keys for one preference would make the read depend on their order.
|
// two keys for one preference would make the read depend on their order.
|
||||||
test('overwrites an existing key rather than adding a second one', async () => {
|
test('overwrites an existing key rather than adding a second one', async () => {
|
||||||
await seedSettings(3202, JSON.stringify({ AVOID_JUNIORS: 'True' }))
|
await env.RECFLARE_PLAYER_SETTINGS.put(
|
||||||
|
'player:3202',
|
||||||
|
JSON.stringify({ AVOID_JUNIORS: 'True' })
|
||||||
|
)
|
||||||
expect(await write(3202, 'avoidJuniors=False')).toBe(false)
|
expect(await write(3202, 'avoidJuniors=False')).toBe(false)
|
||||||
expect(await stored(3202)).toEqual({ AVOID_JUNIORS: 'False' })
|
expect(await stored(3202)).toEqual({ AVOID_JUNIORS: 'False' })
|
||||||
})
|
})
|
||||||
|
|
||||||
// Re-posting the stored value writes nothing — writes are the cost, and the
|
// Re-posting the stored value writes nothing to KV — writes are the cost, and the
|
||||||
// client posts this freely. The raw value is seeded with whitespace JSON.stringify
|
// client posts this freely. The raw value is seeded with whitespace JSON.stringify
|
||||||
// never produces; surviving the PUT untouched means no write happened. Holds across
|
// never produces; surviving the PUT untouched means no write happened. Holds across
|
||||||
// the loose key match too: `AVOID_JUNIORS: 'True'` already says what `avoidJuniors=True`
|
// the loose key match too: `AVOID_JUNIORS: 'True'` already says what `avoidJuniors=True`
|
||||||
// asks for.
|
// asks for.
|
||||||
test('does not write when the value is already stored', async () => {
|
test('does not write KV when the value is already stored', async () => {
|
||||||
const padded = '{ "Recroom.OOBE": "77", "AVOID_JUNIORS": "True" }'
|
const padded = '{ "Recroom.OOBE": "77", "AVOID_JUNIORS": "True" }'
|
||||||
await seedSettings(3205, padded)
|
await env.RECFLARE_PLAYER_SETTINGS.put('player:3205', padded)
|
||||||
expect(await write(3205, 'avoidJuniors=True')).toBe(true)
|
expect(await write(3205, 'avoidJuniors=True')).toBe(true)
|
||||||
expect(await rawSettings(3205)).toBe(padded)
|
expect(await env.RECFLARE_PLAYER_SETTINGS.get('player:3205', 'text')).toBe(padded)
|
||||||
|
|
||||||
expect(await write(3205, 'avoidJuniors=False')).toBe(false)
|
expect(await write(3205, 'avoidJuniors=False')).toBe(false)
|
||||||
expect(await stored(3205)).toEqual({ 'Recroom.OOBE': '77', AVOID_JUNIORS: 'False' })
|
expect(await stored(3205)).toEqual({ 'Recroom.OOBE': '77', AVOID_JUNIORS: 'False' })
|
||||||
|
|||||||
+241
-950
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// Runtime types generated with workerd@1.20260831.1 2026-06-16 nodejs_compat
|
// Runtime types generated with workerd@1.20260625.1 2026-06-16 nodejs_compat
|
||||||
// Begin runtime types
|
// Begin runtime types
|
||||||
/*! *****************************************************************************
|
/*! *****************************************************************************
|
||||||
Copyright (c) Cloudflare. All rights reserved.
|
Copyright (c) Cloudflare. All rights reserved.
|
||||||
@@ -19,26 +19,26 @@ and limitations under the License.
|
|||||||
// noinspection JSUnusedGlobalSymbols
|
// noinspection JSUnusedGlobalSymbols
|
||||||
declare var onmessage: never;
|
declare var onmessage: never;
|
||||||
/**
|
/**
|
||||||
* The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs.
|
* The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
||||||
*/
|
*/
|
||||||
declare class DOMException extends Error {
|
declare class DOMException extends Error {
|
||||||
constructor(message?: string, name?: string);
|
constructor(message?: string, name?: string);
|
||||||
/**
|
/**
|
||||||
* The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name.
|
* The **`message`** read-only property of the a message or description associated with the given error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
||||||
*/
|
*/
|
||||||
readonly message: string;
|
readonly message: string;
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name.
|
* The **`name`** read-only property of the one of the strings associated with an error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
||||||
*/
|
*/
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
/**
|
/**
|
||||||
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match.
|
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
||||||
@@ -96,61 +96,61 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
clear(): void;
|
clear(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.count()`** static method logs the number of times that this particular call to count() has been called.
|
* The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
||||||
*/
|
*/
|
||||||
count(label?: string): void;
|
count(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.countReset()`** static method resets counter used with console.count().
|
* The **`console.countReset()`** static method resets counter used with console/count_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
||||||
*/
|
*/
|
||||||
countReset(label?: string): void;
|
countReset(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.debug()`** static method outputs a message to the console at the "debug" log level. The message is only displayed to the user if the console is configured to display debug output. In most cases, the log level is configured within the console UI. This log level might correspond to the Debug or Verbose log level.
|
* The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
||||||
*/
|
*/
|
||||||
debug(...data: any[]): void;
|
debug(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. In browser consoles, the output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
|
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
||||||
*/
|
*/
|
||||||
dir(item?: any, options?: any): void;
|
dir(item?: any, options?: any): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.
|
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
||||||
*/
|
*/
|
||||||
dirxml(...data: any[]): void;
|
dirxml(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.error()`** static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information.
|
* The **`console.error()`** static method outputs a message to the console at the 'error' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
||||||
*/
|
*/
|
||||||
error(...data: any[]): void;
|
error(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.
|
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
||||||
*/
|
*/
|
||||||
group(...data: any[]): void;
|
group(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupCollapsed()`** static method creates a new inline group in the console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.
|
* The **`console.groupCollapsed()`** static method creates a new inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
||||||
*/
|
*/
|
||||||
groupCollapsed(...data: any[]): void;
|
groupCollapsed(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupEnd()`** static method exits the current inline group in the console. See Using groups in the console in the console documentation for details and examples.
|
* The **`console.groupEnd()`** static method exits the current inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
||||||
*/
|
*/
|
||||||
groupEnd(): void;
|
groupEnd(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.info()`** static method outputs a message to the console at the "info" log level. The message is only displayed to the user if the console is configured to display info output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as a small "i" icon next to it.
|
* The **`console.info()`** static method outputs a message to the console at the 'info' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
||||||
*/
|
*/
|
||||||
@@ -168,24 +168,23 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
table(tabularData?: any, properties?: string[]): void;
|
table(tabularData?: any, properties?: string[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.
|
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
||||||
*/
|
*/
|
||||||
time(label?: string): void;
|
time(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console.time().
|
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
||||||
*/
|
*/
|
||||||
timeEnd(label?: string): void;
|
timeEnd(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console.time().
|
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
||||||
*/
|
*/
|
||||||
timeLog(label?: string, ...data: any[]): void;
|
timeLog(label?: string, ...data: any[]): void;
|
||||||
/* The **`console.timeStamp()`** static method adds a single marker to the browser's Performance tool (Firefox bug 1387528, Chrome). This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. */
|
|
||||||
timeStamp(label?: string): void;
|
timeStamp(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.trace()`** static method outputs a stack trace to the console.
|
* The **`console.trace()`** static method outputs a stack trace to the console.
|
||||||
@@ -194,7 +193,7 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
trace(...data: any[]): void;
|
trace(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.warn()`** static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon.
|
* The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
||||||
*/
|
*/
|
||||||
@@ -360,7 +359,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|||||||
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -405,7 +404,6 @@ declare const crypto: Crypto;
|
|||||||
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
||||||
*/
|
*/
|
||||||
declare const caches: CacheStorage;
|
declare const caches: CacheStorage;
|
||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scheduler) */
|
|
||||||
declare const scheduler: Scheduler;
|
declare const scheduler: Scheduler;
|
||||||
/**
|
/**
|
||||||
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
||||||
@@ -427,7 +425,6 @@ interface ExecutionContext<Props = unknown> {
|
|||||||
cache?: CacheContext;
|
cache?: CacheContext;
|
||||||
readonly access?: CloudflareAccessContext;
|
readonly access?: CloudflareAccessContext;
|
||||||
tracing: Tracing;
|
tracing: Tracing;
|
||||||
abort(reason?: any): void;
|
|
||||||
}
|
}
|
||||||
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
||||||
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
||||||
@@ -516,7 +513,7 @@ declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded
|
|||||||
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
||||||
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
||||||
}
|
}
|
||||||
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high" | "us";
|
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
|
||||||
interface DurableObjectNamespaceNewUniqueIdOptions {
|
interface DurableObjectNamespaceNewUniqueIdOptions {
|
||||||
jurisdiction?: DurableObjectJurisdiction;
|
jurisdiction?: DurableObjectJurisdiction;
|
||||||
}
|
}
|
||||||
@@ -545,7 +542,7 @@ interface DurableObjectState<Props = unknown> {
|
|||||||
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
||||||
getHibernatableWebSocketEventTimeout(): number | null;
|
getHibernatableWebSocketEventTimeout(): number | null;
|
||||||
getTags(ws: WebSocket): string[];
|
getTags(ws: WebSocket): string[];
|
||||||
abort(reason?: string, options?: DurableObjectAbortOptions): void;
|
abort(reason?: string): void;
|
||||||
}
|
}
|
||||||
interface DurableObjectTransaction {
|
interface DurableObjectTransaction {
|
||||||
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
||||||
@@ -581,9 +578,6 @@ interface DurableObjectStorage {
|
|||||||
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
||||||
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
||||||
}
|
}
|
||||||
interface DurableObjectAbortOptions {
|
|
||||||
retryAlarm?: boolean;
|
|
||||||
}
|
|
||||||
interface DurableObjectListOptions {
|
interface DurableObjectListOptions {
|
||||||
start?: string;
|
start?: string;
|
||||||
startAfter?: string;
|
startAfter?: string;
|
||||||
@@ -634,26 +628,26 @@ interface AnalyticsEngineDataPoint {
|
|||||||
blobs?: ((ArrayBuffer | string) | null)[];
|
blobs?: ((ArrayBuffer | string) | null)[];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`Event`** interface represents an event which takes place on an EventTarget.
|
* The **`Event`** interface represents an event which takes place on an `EventTarget`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
||||||
*/
|
*/
|
||||||
declare class Event {
|
declare class Event {
|
||||||
constructor(type: string, init?: EventInit);
|
constructor(type: string, init?: EventInit);
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error.
|
* The **`type`** read-only property of the Event interface returns a string containing the event's type.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated.
|
* The **`eventPhase`** read-only property of the being evaluated.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
||||||
*/
|
*/
|
||||||
get eventPhase(): number;
|
get eventPhase(): number;
|
||||||
/**
|
/**
|
||||||
* The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
* The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
||||||
*/
|
*/
|
||||||
@@ -690,13 +684,13 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get currentTarget(): EventTarget | undefined;
|
get currentTarget(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event.
|
* The read-only **`target`** property of the dispatched.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
||||||
*/
|
*/
|
||||||
get target(): EventTarget | undefined;
|
get target(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead.
|
* The deprecated **`Event.srcElement`** is an alias for the Event.target property.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
||||||
@@ -709,45 +703,45 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get timeStamp(): number;
|
get timeStamp(): number;
|
||||||
/**
|
/**
|
||||||
* The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents.
|
* The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
||||||
*/
|
*/
|
||||||
get isTrusted(): boolean;
|
get isTrusted(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
get cancelBubble(): boolean;
|
get cancelBubble(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
set cancelBubble(value: boolean);
|
set cancelBubble(value: boolean);
|
||||||
/**
|
/**
|
||||||
* The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called.
|
* The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
||||||
*/
|
*/
|
||||||
stopImmediatePropagation(): void;
|
stopImmediatePropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken.
|
* The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
||||||
*/
|
*/
|
||||||
preventDefault(): void;
|
preventDefault(): void;
|
||||||
/**
|
/**
|
||||||
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().
|
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
||||||
*/
|
*/
|
||||||
stopPropagation(): void;
|
stopPropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.
|
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
||||||
*/
|
*/
|
||||||
@@ -768,7 +762,7 @@ interface EventListenerObject<EventType extends Event = Event> {
|
|||||||
}
|
}
|
||||||
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
||||||
/**
|
/**
|
||||||
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. In other words, any target of events implements the three methods associated with this interface.
|
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
||||||
*/
|
*/
|
||||||
@@ -781,13 +775,13 @@ declare class EventTarget<EventMap extends Record<string, Event> = Record<string
|
|||||||
*/
|
*/
|
||||||
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
|
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
||||||
*/
|
*/
|
||||||
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -819,7 +813,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. This is able to abort fetch requests, the consumption of any response bodies, or streams.
|
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
||||||
*/
|
*/
|
||||||
@@ -832,7 +826,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
declare abstract class AbortSignal extends EventTarget {
|
declare abstract class AbortSignal extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).
|
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
||||||
*/
|
*/
|
||||||
@@ -844,13 +838,13 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
*/
|
*/
|
||||||
static timeout(delay: number): AbortSignal;
|
static timeout(delay: number): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal.
|
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
||||||
*/
|
*/
|
||||||
static any(signals: AbortSignal[]): AbortSignal;
|
static any(signals: AbortSignal[]): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false).
|
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
||||||
*/
|
*/
|
||||||
@@ -866,17 +860,12 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
||||||
set onabort(value: any | null);
|
set onabort(value: any | null);
|
||||||
/**
|
/**
|
||||||
* The **`throwIfAborted()`** method throws the signal's abort reason if the signal has been aborted; otherwise it does nothing.
|
* The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
||||||
*/
|
*/
|
||||||
throwIfAborted(): void;
|
throwIfAborted(): void;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`Scheduler`** interface of the Prioritized Task Scheduling API provides methods for scheduling prioritized tasks.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Scheduler)
|
|
||||||
*/
|
|
||||||
interface Scheduler {
|
interface Scheduler {
|
||||||
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
||||||
}
|
}
|
||||||
@@ -884,20 +873,20 @@ interface SchedulerWaitOptions {
|
|||||||
signal?: AbortSignal;
|
signal?: AbortSignal;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent`** interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
|
* The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class ExtendableEvent extends Event {
|
declare abstract class ExtendableEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful. In service workers, waitUntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the service worker if it wants that work to complete.
|
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
||||||
*/
|
*/
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CustomEvent`** interface can be used to attach custom data to an event generated by an application.
|
* The **`CustomEvent`** interface represents events initialized by an application for any purpose.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
||||||
*/
|
*/
|
||||||
@@ -936,7 +925,7 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`slice()`** method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it's called.
|
* The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
||||||
*/
|
*/
|
||||||
@@ -954,13 +943,13 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
bytes(): Promise<Uint8Array>;
|
bytes(): Promise<Uint8Array>;
|
||||||
/**
|
/**
|
||||||
* The **`text()`** method of the Blob interface returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8.
|
* The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
||||||
*/
|
*/
|
||||||
text(): Promise<string>;
|
text(): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.
|
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
||||||
*/
|
*/
|
||||||
@@ -977,13 +966,13 @@ interface BlobOptions {
|
|||||||
declare class File extends Blob {
|
declare class File extends Blob {
|
||||||
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object. For security reasons, the path is excluded from this property.
|
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
||||||
*/
|
*/
|
||||||
get name(): string;
|
get name(): string;
|
||||||
/**
|
/**
|
||||||
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
||||||
*/
|
*/
|
||||||
@@ -1000,7 +989,7 @@ interface FileOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class CacheStorage {
|
declare abstract class CacheStorage {
|
||||||
/**
|
/**
|
||||||
* The **`open()`** method of the CacheStorage interface returns a Promise that resolves to the Cache object matching the cacheName.
|
* The **`open()`** method of the the Cache object matching the `cacheName`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
||||||
*/
|
*/
|
||||||
@@ -1033,14 +1022,14 @@ interface CacheQueryOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class Crypto {
|
declare abstract class Crypto {
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.subtle`** read-only property returns a SubtleCrypto which can then be used to perform low-level cryptographic operations.
|
* The **`Crypto.subtle`** read-only property returns a cryptographic operations.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
||||||
*/
|
*/
|
||||||
get subtle(): SubtleCrypto;
|
get subtle(): SubtleCrypto;
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).
|
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
||||||
*/
|
*/
|
||||||
@@ -1068,7 +1057,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data. It takes as arguments a key to decrypt with, some optional extra parameters, and the data to decrypt (also known as "ciphertext"). It returns a Promise which will be fulfilled with the decrypted data (also known as "plaintext").
|
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
||||||
*/
|
*/
|
||||||
@@ -1086,7 +1075,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
||||||
/**
|
/**
|
||||||
* The **`digest()`** method of the SubtleCrypto interface generates a digest of the given data, using the specified hash function. A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value.
|
* The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
||||||
*/
|
*/
|
||||||
@@ -1104,7 +1093,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
||||||
/**
|
/**
|
||||||
* The **`deriveBits()`** method of the SubtleCrypto interface can be used to derive an array of bits from a base key.
|
* The **`deriveBits()`** method of the key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
||||||
*/
|
*/
|
||||||
@@ -1122,13 +1111,13 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
||||||
/**
|
/**
|
||||||
* The **`wrapKey()`** method of the SubtleCrypto interface "wraps" a key. This means that it exports the key in an external, portable format, then encrypts the exported key. Wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
|
* The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
||||||
*/
|
*/
|
||||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`unwrapKey()`** method of the SubtleCrypto interface "unwraps" a key. This means that it takes as its input a key that has been exported and then encrypted (also called "wrapped"). It decrypts the key and then imports it, returning a CryptoKey object that can be used in the Web Crypto API.
|
* The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
||||||
*/
|
*/
|
||||||
@@ -1136,20 +1125,20 @@ declare abstract class SubtleCrypto {
|
|||||||
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey().
|
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
||||||
*/
|
*/
|
||||||
declare abstract class CryptoKey {
|
declare abstract class CryptoKey {
|
||||||
/**
|
/**
|
||||||
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object. It can have the following values:
|
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
||||||
*/
|
*/
|
||||||
readonly type: string;
|
readonly type: string;
|
||||||
/**
|
/**
|
||||||
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using SubtleCrypto.exportKey() or SubtleCrypto.wrapKey().
|
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
||||||
*/
|
*/
|
||||||
@@ -1266,15 +1255,12 @@ interface CryptoKeyArbitraryKeyAlgorithm {
|
|||||||
length?: number;
|
length?: number;
|
||||||
}
|
}
|
||||||
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
||||||
constructor(algorithm: string | SubtleCryptoHashAlgorithm, options?: DigestStreamOptions);
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
||||||
readonly digest: Promise<ArrayBuffer>;
|
readonly digest: Promise<ArrayBuffer>;
|
||||||
get bytesWritten(): number | bigint;
|
get bytesWritten(): number | bigint;
|
||||||
}
|
}
|
||||||
interface DigestStreamOptions {
|
|
||||||
toWellFormed?: boolean;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
|
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
||||||
*/
|
*/
|
||||||
@@ -1291,20 +1277,20 @@ declare class TextDecoder {
|
|||||||
get ignoreBOM(): boolean;
|
get ignoreBOM(): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder`** interface enables you to encode a JavaScript string using UTF-8.
|
* The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
||||||
*/
|
*/
|
||||||
declare class TextEncoder {
|
declare class TextEncoder {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Uint8Array containing the string encoded using UTF-8.
|
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
||||||
*/
|
*/
|
||||||
encode(input?: string): Uint8Array;
|
encode(input?: string): Uint8Array;
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns an object indicating the progress of the encoding. This is potentially more performant than the encode() method — especially when the target buffer is a view into a Wasm heap.
|
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
||||||
*/
|
*/
|
||||||
@@ -1361,9 +1347,6 @@ declare class ErrorEvent extends Event {
|
|||||||
get error(): any;
|
get error(): any;
|
||||||
}
|
}
|
||||||
interface ErrorEventErrorEventInit {
|
interface ErrorEventErrorEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
message?: string;
|
message?: string;
|
||||||
filename?: string;
|
filename?: string;
|
||||||
lineno?: number;
|
lineno?: number;
|
||||||
@@ -1376,139 +1359,135 @@ interface ErrorEventErrorEventInit {
|
|||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
||||||
*/
|
*/
|
||||||
declare class MessageEvent extends Event {
|
declare class MessageEvent extends Event {
|
||||||
constructor(type: string, initializer?: MessageEventInit);
|
constructor(type: string, initializer: MessageEventInit);
|
||||||
/**
|
/**
|
||||||
* The **`data`** read-only property of the MessageEvent interface represents the data sent by the message emitter.
|
* The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
||||||
*/
|
*/
|
||||||
readonly data: any;
|
readonly data: any;
|
||||||
/**
|
/**
|
||||||
* The **`origin`** read-only property of the MessageEvent interface is a string representing the origin of the message emitter.
|
* The **`origin`** read-only property of the origin of the message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
||||||
*/
|
*/
|
||||||
readonly origin: string | null;
|
readonly origin: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`lastEventId`** read-only property of the MessageEvent interface is a string representing a unique ID for the event.
|
* The **`lastEventId`** read-only property of the unique ID for the event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
||||||
*/
|
*/
|
||||||
readonly lastEventId: string;
|
readonly lastEventId: string;
|
||||||
/**
|
/**
|
||||||
* The **`source`** read-only property of the MessageEvent interface is a MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter.
|
* The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
||||||
*/
|
*/
|
||||||
readonly source: MessagePort | null;
|
readonly source: MessagePort | null;
|
||||||
/**
|
/**
|
||||||
* The **`ports`** read-only property of the MessageEvent interface is an array of MessagePort objects containing all MessagePort objects sent with the message, in order.
|
* The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
||||||
*/
|
*/
|
||||||
readonly ports: MessagePort[];
|
readonly ports: MessagePort[];
|
||||||
}
|
}
|
||||||
interface MessageEventInit {
|
interface MessageEventInit {
|
||||||
bubbles?: boolean;
|
data: ArrayBuffer | string;
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
data?: any;
|
|
||||||
origin?: string;
|
|
||||||
lastEventId?: string;
|
|
||||||
source?: MessagePort;
|
|
||||||
ports?: MessagePort[];
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. These events are particularly useful for telemetry and debugging purposes.
|
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class PromiseRejectionEvent extends Event {
|
declare abstract class PromiseRejectionEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript Promise which was rejected. You can examine the event's PromiseRejectionEvent.reason property to learn why the promise was rejected.
|
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
||||||
*/
|
*/
|
||||||
readonly promise: Promise<any>;
|
readonly promise: Promise<any>;
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). This in theory provides information about why the promise was rejected.
|
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject().
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
||||||
*/
|
*/
|
||||||
readonly reason: any;
|
readonly reason: any;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the fetch(), XMLHttpRequest.send() or navigator.sendBeacon() methods. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
|
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
||||||
*/
|
*/
|
||||||
declare class FormData {
|
declare class FormData {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string | Blob): void;
|
append(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: Blob, filename?: string): void;
|
append(name: string, value: Blob, filename?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a FormData object.
|
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a FormData object. If you expect multiple values and want all of them, use the getAll() method instead.
|
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): (File | string) | null;
|
get(name: string): (File | string) | null;
|
||||||
/**
|
/**
|
||||||
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a FormData object.
|
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
||||||
*/
|
*/
|
||||||
getAll(name: string): (File | string)[];
|
getAll(name: string): (File | string)[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the FormData interface returns whether a FormData object contains a certain key.
|
* The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string | Blob): void;
|
set(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: Blob, filename?: string): void;
|
set(name: string, value: Blob, filename?: string): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the list. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: File | string
|
value: File | string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the list. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the list. */
|
||||||
values(): IterableIterator<(File | string)>;
|
values(): IterableIterator<(File | string)>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
@@ -1587,19 +1566,19 @@ interface DocumentEnd {
|
|||||||
append(content: string, options?: ContentOptions): DocumentEnd;
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class FetchEvent extends ExtendableEvent {
|
declare abstract class FetchEvent extends ExtendableEvent {
|
||||||
/**
|
/**
|
||||||
* The **`request`** read-only property of the FetchEvent interface returns the Request that triggered the event handler.
|
* The **`request`** read-only property of the the event handler.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
||||||
*/
|
*/
|
||||||
readonly request: Request;
|
readonly request: Request;
|
||||||
/**
|
/**
|
||||||
* The **`respondWith()`** method of FetchEvent prevents the browser's default fetch handling, and allows you to provide a promise for a Response yourself.
|
* The **`respondWith()`** method of allows you to provide a promise for a Response yourself.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
||||||
*/
|
*/
|
||||||
@@ -1608,55 +1587,58 @@ declare abstract class FetchEvent extends ExtendableEvent {
|
|||||||
}
|
}
|
||||||
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
||||||
/**
|
/**
|
||||||
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
|
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
||||||
*/
|
*/
|
||||||
declare class Headers {
|
declare class Headers {
|
||||||
constructor(init?: HeadersInit);
|
constructor(init?: HeadersInit);
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.
|
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): string | null;
|
get(name: string): string | null;
|
||||||
getAll(name: string): string[];
|
getAll(name: string): string[];
|
||||||
/**
|
/**
|
||||||
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. This allows Headers objects to handle having multiple Set-Cookie headers, which wasn't possible prior to its implementation.
|
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
||||||
*/
|
*/
|
||||||
getSetCookie(): string[];
|
getSetCookie(): string[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the Headers interface returns a boolean stating whether a Headers object contains a certain header.
|
* The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the Headers interface deletes a header from the current Headers object.
|
* The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
||||||
|
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
@@ -1719,7 +1701,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
statusText: string;
|
statusText: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Response interface contains the Headers object associated with the response.
|
* The **`headers`** read-only property of the with the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1737,7 +1719,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
redirected: boolean;
|
redirected: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects.
|
* The **`url`** read-only property of the Response interface contains the URL of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
||||||
*/
|
*/
|
||||||
@@ -1745,7 +1727,7 @@ interface Response extends Body {
|
|||||||
webSocket: WebSocket | null;
|
webSocket: WebSocket | null;
|
||||||
cf: any | undefined;
|
cf: any | undefined;
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers.
|
* The **`type`** read-only property of the Response interface contains the type of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
||||||
*/
|
*/
|
||||||
@@ -1776,13 +1758,13 @@ declare var Request: {
|
|||||||
*/
|
*/
|
||||||
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
||||||
/**
|
/**
|
||||||
* The **`clone()`** method of the Request interface creates a copy of the current Request object.
|
* The **`clone()`** method of the Request interface creates a copy of the current `Request` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
||||||
*/
|
*/
|
||||||
clone(): Request<CfHostMetadata, Cf>;
|
clone(): Request<CfHostMetadata, Cf>;
|
||||||
/**
|
/**
|
||||||
* The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.)
|
* The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
||||||
*/
|
*/
|
||||||
@@ -1794,7 +1776,7 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Request interface contains the Headers object associated with the request.
|
* The **`headers`** read-only property of the with the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1820,13 +1802,13 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
integrity: string;
|
integrity: string;
|
||||||
/**
|
/**
|
||||||
* The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
* The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
||||||
*/
|
*/
|
||||||
keepalive: boolean;
|
keepalive: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache.
|
* The **`cache`** read-only property of the Request interface contains the cache mode of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
||||||
*/
|
*/
|
||||||
@@ -2215,7 +2197,7 @@ type ReadableStreamReadResult<R = any> = {
|
|||||||
value?: undefined;
|
value?: undefined;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2233,13 +2215,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
getReader(): ReadableStreamDefaultReader<R>;
|
getReader(): ReadableStreamDefaultReader<R>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
@@ -2251,13 +2233,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
||||||
/**
|
/**
|
||||||
* The **`pipeTo()`** method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
* The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
||||||
*/
|
*/
|
||||||
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`tee()`** method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances.
|
* The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
||||||
*/
|
*/
|
||||||
@@ -2269,7 +2251,7 @@ interface ReadableStream<R = any> {
|
|||||||
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2301,7 +2283,7 @@ declare class ReadableStreamDefaultReader<R = any> {
|
|||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBReader`** interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. It is used for efficient copying from underlying sources where the data is delivered as an "anonymous" sequence of bytes, such as files.
|
* The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
||||||
*/
|
*/
|
||||||
@@ -2310,13 +2292,13 @@ declare class ReadableStreamBYOBReader {
|
|||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. A request for data will be satisfied from the stream's internal queues if there is any data present. If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source.
|
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
||||||
*/
|
*/
|
||||||
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. After the lock is released, the reader is no longer active.
|
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
||||||
*/
|
*/
|
||||||
@@ -2335,7 +2317,7 @@ interface ReadableStreamGetReaderOptions {
|
|||||||
mode: "byob";
|
mode: "byob";
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a "pull request" for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
||||||
*/
|
*/
|
||||||
@@ -2361,13 +2343,13 @@ declare abstract class ReadableStreamBYOBRequest {
|
|||||||
get atLeast(): number | null;
|
get atLeast(): number | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams.
|
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableStreamDefaultController<R = any> {
|
declare abstract class ReadableStreamDefaultController<R = any> {
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the required to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2379,32 +2361,32 @@ declare abstract class ReadableStreamDefaultController<R = any> {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.
|
* The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
||||||
*/
|
*/
|
||||||
enqueue(chunk?: R): void;
|
enqueue(chunk?: R): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. It allows control of the state and internal queue of a ReadableStream with an underlying byte source, and enables efficient zero-copy transfer of data from the underlying source to a consumer when the stream's internal queue is empty.
|
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableByteStreamController {
|
declare abstract class ReadableByteStreamController {
|
||||||
/**
|
/**
|
||||||
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests.
|
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
||||||
*/
|
*/
|
||||||
get byobRequest(): ReadableStreamBYOBRequest | null;
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its "desired size".
|
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2416,7 +2398,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is transferred into the stream's internal queues).
|
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
||||||
*/
|
*/
|
||||||
@@ -2429,7 +2411,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultController`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
@@ -2441,7 +2423,7 @@ declare abstract class WritableStreamDefaultController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the WritableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2466,7 +2448,7 @@ declare abstract class TransformStreamDefaultController<O = any> {
|
|||||||
*/
|
*/
|
||||||
enqueue(chunk?: O): void;
|
enqueue(chunk?: O): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
|
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2488,14 +2470,14 @@ interface ReadableWritablePair<R = any, W = any> {
|
|||||||
writable: WritableStream<W>;
|
writable: WritableStream<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
|
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
||||||
*/
|
*/
|
||||||
declare class WritableStream<W = any> {
|
declare class WritableStream<W = any> {
|
||||||
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
||||||
/**
|
/**
|
||||||
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.
|
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
||||||
*/
|
*/
|
||||||
@@ -2507,83 +2489,83 @@ declare class WritableStream<W = any> {
|
|||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled.
|
* The **`close()`** method of the WritableStream interface closes the associated stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. While the stream is locked, no other writer can be acquired until this one is released.
|
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
||||||
*/
|
*/
|
||||||
getWriter(): WritableStreamDefaultWriter<W>;
|
getWriter(): WritableStreamDefaultWriter<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
||||||
*/
|
*/
|
||||||
declare class WritableStreamDefaultWriter<W = any> {
|
declare class WritableStreamDefaultWriter<W = any> {
|
||||||
constructor(stream: WritableStream);
|
constructor(stream: WritableStream);
|
||||||
/**
|
/**
|
||||||
* The **`closed`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that fulfills if the stream becomes closed, or rejects if the stream errors or the writer's lock is released.
|
* The **`closed`** read-only property of the the stream errors or the writer's lock is released.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
||||||
*/
|
*/
|
||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`ready`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
* The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
||||||
*/
|
*/
|
||||||
get ready(): Promise<void>;
|
get ready(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the WritableStreamDefaultWriter interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
||||||
*/
|
*/
|
||||||
get desiredSize(): number | null;
|
get desiredSize(): number | null;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the WritableStreamDefaultWriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
* The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStreamDefaultWriter interface closes the associated writable stream.
|
* The **`close()`** method of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`write()`** method of the WritableStreamDefaultWriter interface writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation.
|
* The **`write()`** method of the operation.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
||||||
*/
|
*/
|
||||||
write(chunk?: W): Promise<void>;
|
write(chunk?: W): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the WritableStreamDefaultWriter interface releases the writer's lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
|
* The **`releaseLock()`** method of the corresponding stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
||||||
*/
|
*/
|
||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain transform stream concept.
|
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
||||||
*/
|
*/
|
||||||
declare class TransformStream<I = any, O = any> {
|
declare class TransformStream<I = any, O = any> {
|
||||||
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
||||||
/**
|
/**
|
||||||
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream. This stream emits the transformed output data.
|
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
||||||
*/
|
*/
|
||||||
get readable(): ReadableStream<O>;
|
get readable(): ReadableStream<O>;
|
||||||
/**
|
/**
|
||||||
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream. This stream accepts input data that will be transformed and emitted to the readable stream.
|
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
||||||
*/
|
*/
|
||||||
@@ -2602,7 +2584,7 @@ interface ReadableStreamValuesOptions {
|
|||||||
preventCancel?: boolean;
|
preventCancel?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CompressionStream`** interface of the Compression Streams API compresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2610,7 +2592,7 @@ declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBuffe
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`DecompressionStream`** interface of the Compression Streams API decompresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2618,7 +2600,7 @@ declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBuf
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2627,7 +2609,7 @@ declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
|
|||||||
get encoding(): string;
|
get encoding(): string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings. It is the streaming equivalent of TextDecoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2776,12 +2758,6 @@ interface TraceLog {
|
|||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
readonly level: string;
|
readonly level: string;
|
||||||
readonly message: any;
|
readonly message: any;
|
||||||
readonly errorInfo?: (TraceLogErrorInfo | null)[];
|
|
||||||
}
|
|
||||||
interface TraceLogErrorInfo {
|
|
||||||
name: string;
|
|
||||||
message: string;
|
|
||||||
stack?: string;
|
|
||||||
}
|
}
|
||||||
interface TraceException {
|
interface TraceException {
|
||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
@@ -2802,7 +2778,7 @@ interface UnsafeTraceMetrics {
|
|||||||
fromTrace(item: TraceItem): TraceMetrics;
|
fromTrace(item: TraceItem): TraceMetrics;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`URL`** interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.
|
* The **`URL`** interface is used to parse, construct, normalize, and encode URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
||||||
*/
|
*/
|
||||||
@@ -2827,121 +2803,121 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
set href(value: string);
|
set href(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
set protocol(value: string);
|
set protocol(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
set username(value: string);
|
set username(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
set password(value: string);
|
set password(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
get host(): string;
|
get host(): string;
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
set host(value: string);
|
set host(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
set hostname(value: string);
|
set hostname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
set port(value: string);
|
set port(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
set pathname(value: string);
|
set pathname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
set search(value: string);
|
set search(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
set hash(value: string);
|
set hash(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
|
* The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
||||||
*/
|
*/
|
||||||
get searchParams(): URLSearchParams;
|
get searchParams(): URLSearchParams;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().
|
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -2961,13 +2937,13 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
static parse(url: string, base?: string): URL | null;
|
static parse(url: string, base?: string): URL | null;
|
||||||
/**
|
/**
|
||||||
* The **`createObjectURL()`** static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.
|
* The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
||||||
*/
|
*/
|
||||||
static createObjectURL(object: File | Blob): string;
|
static createObjectURL(object: File | Blob): string;
|
||||||
/**
|
/**
|
||||||
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().
|
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
||||||
*/
|
*/
|
||||||
@@ -3017,22 +2993,25 @@ declare class URLSearchParams {
|
|||||||
*/
|
*/
|
||||||
has(name: string, value?: string): boolean;
|
has(name: string, value?: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.
|
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved).
|
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
||||||
*/
|
*/
|
||||||
sort(): void;
|
sort(): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the search params. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the search params. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
||||||
/*function toString() { [native code] }*/
|
/*function toString() { [native code] }*/
|
||||||
@@ -3042,78 +3021,18 @@ declare class URLSearchParams {
|
|||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern. The pattern can contain capturing groups that extract parts of the matched URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
|
|
||||||
*/
|
|
||||||
declare class URLPattern {
|
declare class URLPattern {
|
||||||
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
||||||
/**
|
|
||||||
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
||||||
*/
|
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
|
||||||
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
||||||
*/
|
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
|
||||||
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
||||||
*/
|
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
|
||||||
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
||||||
*/
|
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
|
||||||
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
||||||
*/
|
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
|
||||||
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
||||||
*/
|
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
|
||||||
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
||||||
*/
|
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
|
||||||
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
|
|
||||||
*/
|
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
|
||||||
* The **`hasRegExpGroups`** read-only property of the URLPattern interface is a boolean indicating whether or not any of the URLPattern components contain regular expression capturing groups.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
|
|
||||||
*/
|
|
||||||
get hasRegExpGroups(): boolean;
|
get hasRegExpGroups(): boolean;
|
||||||
/**
|
|
||||||
* The **`test()`** method of the URLPattern interface takes a URL string or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
|
|
||||||
*/
|
|
||||||
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
||||||
/**
|
|
||||||
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or null if the URL does not match the pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
|
|
||||||
*/
|
|
||||||
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
||||||
}
|
}
|
||||||
interface URLPatternInit {
|
interface URLPatternInit {
|
||||||
@@ -3146,7 +3065,7 @@ interface URLPatternOptions {
|
|||||||
ignoreCase?: boolean;
|
ignoreCase?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* A `CloseEvent` is sent to clients using WebSockets when the connection is closed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
||||||
*/
|
*/
|
||||||
@@ -3165,16 +3084,13 @@ declare class CloseEvent extends Event {
|
|||||||
*/
|
*/
|
||||||
readonly reason: string;
|
readonly reason: string;
|
||||||
/**
|
/**
|
||||||
* The **`wasClean`** read-only property of the CloseEvent interface returns true if the connection closed cleanly.
|
* The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
||||||
*/
|
*/
|
||||||
readonly wasClean: boolean;
|
readonly wasClean: boolean;
|
||||||
}
|
}
|
||||||
interface CloseEventInit {
|
interface CloseEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
code?: number;
|
code?: number;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
wasClean?: boolean;
|
wasClean?: boolean;
|
||||||
@@ -3186,7 +3102,7 @@ type WebSocketEventMap = {
|
|||||||
error: ErrorEvent;
|
error: ErrorEvent;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
@@ -3203,20 +3119,20 @@ declare var WebSocket: {
|
|||||||
readonly CLOSED: number;
|
readonly CLOSED: number;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
||||||
accept(options?: WebSocketAcceptOptions): void;
|
accept(options?: WebSocketAcceptOptions): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. The browser will throw an exception if you call send() when the connection is in the CONNECTING state. If you call send() when the connection is in the CLOSING or CLOSED states, the browser will silently discard the data.
|
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
||||||
*/
|
*/
|
||||||
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.close()`** method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.
|
* The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
||||||
*/
|
*/
|
||||||
@@ -3236,13 +3152,13 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|||||||
*/
|
*/
|
||||||
url: string | null;
|
url: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object, or the empty string if no connection is established.
|
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
||||||
*/
|
*/
|
||||||
protocol: string | null;
|
protocol: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.
|
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
||||||
*/
|
*/
|
||||||
@@ -3329,25 +3245,25 @@ interface SocketInfo {
|
|||||||
declare class EventSource extends EventTarget {
|
declare class EventSource extends EventTarget {
|
||||||
constructor(url: string, init?: EventSourceEventSourceInit);
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the EventSource.readyState attribute to 2 (closed).
|
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the EventSource interface returns a string representing the URL of the source.
|
* The **`url`** read-only property of the URL of the source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
||||||
*/
|
*/
|
||||||
get url(): string;
|
get url(): string;
|
||||||
/**
|
/**
|
||||||
* The **`withCredentials`** read-only property of the EventSource interface returns a boolean value indicating whether the EventSource object was instantiated with CORS credentials set.
|
* The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
||||||
*/
|
*/
|
||||||
get withCredentials(): boolean;
|
get withCredentials(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`readyState`** read-only property of the EventSource interface returns a number representing the state of the connection.
|
* The **`readyState`** read-only property of the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
||||||
*/
|
*/
|
||||||
@@ -3382,26 +3298,18 @@ interface ContainerExecOptions {
|
|||||||
cwd?: string;
|
cwd?: string;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
user?: string;
|
user?: string;
|
||||||
signal?: AbortSignal;
|
|
||||||
pty?: boolean | ContainerExecPtyOptions;
|
|
||||||
stdin?: ReadableStream | "pipe";
|
stdin?: ReadableStream | "pipe";
|
||||||
stdout?: "pipe" | "ignore";
|
stdout?: "pipe" | "ignore";
|
||||||
stderr?: "pipe" | "ignore" | "combined";
|
stderr?: "pipe" | "ignore" | "combined";
|
||||||
}
|
}
|
||||||
interface ContainerExecPtyOptions {
|
|
||||||
cols?: number;
|
|
||||||
rows?: number;
|
|
||||||
}
|
|
||||||
interface ExecProcess {
|
interface ExecProcess {
|
||||||
readonly stdin: WritableStream | null;
|
readonly stdin: WritableStream | null;
|
||||||
readonly stdout: ReadableStream | null;
|
readonly stdout: ReadableStream | null;
|
||||||
readonly stderr: ReadableStream | null;
|
readonly stderr: ReadableStream | null;
|
||||||
readonly pid: number;
|
readonly pid: number;
|
||||||
readonly isPty: boolean;
|
|
||||||
readonly exitCode: Promise<number>;
|
readonly exitCode: Promise<number>;
|
||||||
output(): Promise<ExecOutput>;
|
output(): Promise<ExecOutput>;
|
||||||
kill(signal?: number): void;
|
kill(signal?: number): void;
|
||||||
resize(cols: number, rows: number): void;
|
|
||||||
}
|
}
|
||||||
interface Container {
|
interface Container {
|
||||||
get running(): boolean;
|
get running(): boolean;
|
||||||
@@ -3428,42 +3336,25 @@ interface ContainerDirectorySnapshotOptions {
|
|||||||
dir: string;
|
dir: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerDirectorySnapshotRestoreParams = {
|
interface ContainerDirectorySnapshotRestoreParams {
|
||||||
snapshot: ContainerDirectorySnapshot;
|
snapshot: ContainerDirectorySnapshot;
|
||||||
mountPoint?: string;
|
mountPoint?: string;
|
||||||
} | {
|
}
|
||||||
snapshot?: undefined;
|
|
||||||
mountPoint: string;
|
|
||||||
};
|
|
||||||
interface ContainerSnapshot {
|
interface ContainerSnapshot {
|
||||||
id: string;
|
id: string;
|
||||||
size: number;
|
size: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
interface ContainerSnapshotRestoreParams {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
interface ContainerSnapshotOptions {
|
interface ContainerSnapshotOptions {
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerStartupOptions = {
|
interface ContainerStartupOptions {
|
||||||
entrypoint?: string[];
|
entrypoint?: string[];
|
||||||
enableInternet: boolean;
|
enableInternet: boolean;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
instance?: "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | ContainerStartResources;
|
|
||||||
labels?: Record<string, string>;
|
labels?: Record<string, string>;
|
||||||
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
||||||
} & ({
|
containerSnapshot?: ContainerSnapshot;
|
||||||
image: string;
|
|
||||||
containerSnapshot?: never;
|
|
||||||
} | {
|
|
||||||
image?: never;
|
|
||||||
containerSnapshot?: ContainerSnapshotRestoreParams;
|
|
||||||
});
|
|
||||||
interface ContainerStartResources {
|
|
||||||
vcpu: number;
|
|
||||||
memoryMib: number;
|
|
||||||
diskMb: number;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
||||||
@@ -3472,19 +3363,19 @@ interface ContainerStartResources {
|
|||||||
*/
|
*/
|
||||||
declare abstract class MessagePort extends EventTarget {
|
declare abstract class MessagePort extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`postMessage()`** method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
|
* The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
||||||
*/
|
*/
|
||||||
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.
|
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage.
|
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
||||||
*/
|
*/
|
||||||
@@ -3500,13 +3391,13 @@ declare abstract class MessagePort extends EventTarget {
|
|||||||
declare class MessageChannel {
|
declare class MessageChannel {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`port1`** read-only property of the MessageChannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
|
* The **`port1`** read-only property of the the port attached to the context that originated the channel.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
||||||
*/
|
*/
|
||||||
readonly port1: MessagePort;
|
readonly port1: MessagePort;
|
||||||
/**
|
/**
|
||||||
* The **`port2`** read-only property of the MessageChannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
|
* The **`port2`** read-only property of the the port attached to the context at the other end of the channel, which the message is initially sent to.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
||||||
*/
|
*/
|
||||||
@@ -3566,7 +3457,7 @@ interface WorkerLoaderModule {
|
|||||||
data?: ArrayBuffer;
|
data?: ArrayBuffer;
|
||||||
json?: any;
|
json?: any;
|
||||||
py?: string;
|
py?: string;
|
||||||
wasm?: ArrayBuffer | ArrayBufferView | WebAssembly.Module;
|
wasm?: ArrayBuffer;
|
||||||
}
|
}
|
||||||
interface WorkerLoaderWorkerCode {
|
interface WorkerLoaderWorkerCode {
|
||||||
compatibilityDate: string;
|
compatibilityDate: string;
|
||||||
@@ -3574,7 +3465,7 @@ interface WorkerLoaderWorkerCode {
|
|||||||
allowExperimental?: boolean;
|
allowExperimental?: boolean;
|
||||||
limits?: workerdResourceLimits;
|
limits?: workerdResourceLimits;
|
||||||
mainModule: string;
|
mainModule: string;
|
||||||
modules: Record<string, string | WebAssembly.Module | WorkerLoaderModule>;
|
modules: Record<string, WorkerLoaderModule | string>;
|
||||||
env?: any;
|
env?: any;
|
||||||
globalOutbound?: (Fetcher | null);
|
globalOutbound?: (Fetcher | null);
|
||||||
tails?: Fetcher[];
|
tails?: Fetcher[];
|
||||||
@@ -3596,7 +3487,7 @@ declare abstract class Performance {
|
|||||||
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
||||||
now(): number;
|
now(): number;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the Performance interface is a serializer; it returns a JSON representation of the Performance object.
|
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -3605,13 +3496,11 @@ declare abstract class Performance {
|
|||||||
interface Tracing {
|
interface Tracing {
|
||||||
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startSpan(name: string): Span;
|
|
||||||
Span: typeof Span;
|
Span: typeof Span;
|
||||||
}
|
}
|
||||||
declare abstract class Span {
|
declare abstract class Span {
|
||||||
get isTraced(): boolean;
|
get isTraced(): boolean;
|
||||||
setAttribute(key: string, value: boolean | number | string): this;
|
setAttribute(key: string, value?: (boolean | number | string)): void;
|
||||||
setAttributes(attributes: Record<string, boolean | number | string | undefined>): this;
|
|
||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -4251,13 +4140,6 @@ type AiSearchListItemsParams = {
|
|||||||
source?: string;
|
source?: string;
|
||||||
/** JSON-encoded Vectorize filter for metadata filtering. */
|
/** JSON-encoded Vectorize filter for metadata filtering. */
|
||||||
metadata_filter?: string;
|
metadata_filter?: string;
|
||||||
/** Filter items by their unique ID. Returns at most one item. */
|
|
||||||
item_id?: string;
|
|
||||||
/**
|
|
||||||
* Filter items by their exact key (object key / filename). Keys are unique
|
|
||||||
* per source, so combine with `source` to disambiguate across data sources.
|
|
||||||
*/
|
|
||||||
key?: string;
|
|
||||||
};
|
};
|
||||||
type AiSearchListItemsResponse = {
|
type AiSearchListItemsResponse = {
|
||||||
result: AiSearchItemInfo[];
|
result: AiSearchItemInfo[];
|
||||||
@@ -10155,163 +10037,6 @@ declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|||||||
inputs: ChatCompletionsInput;
|
inputs: ChatCompletionsInput;
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
postProcessedOutputs: ChatCompletionsOutput;
|
||||||
}
|
}
|
||||||
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_2 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input {
|
|
||||||
/**
|
|
||||||
* Which Moondream skill to run.
|
|
||||||
*/
|
|
||||||
task?: "query" | "caption" | "point" | "detect";
|
|
||||||
/**
|
|
||||||
* Input image as a public HTTPS URL or base64 data URI. Optional for `query`; required for `caption`, `point`, and `detect`.
|
|
||||||
*/
|
|
||||||
image?: string;
|
|
||||||
/**
|
|
||||||
* Question for the `query` task.
|
|
||||||
*/
|
|
||||||
question?: string;
|
|
||||||
/**
|
|
||||||
* Caption length for the `caption` task.
|
|
||||||
*/
|
|
||||||
caption_length?: "short" | "normal" | "long";
|
|
||||||
/**
|
|
||||||
* Object phrase to locate for `point` and `detect` tasks (e.g. 'person wearing a red shirt').
|
|
||||||
*/
|
|
||||||
target?: string;
|
|
||||||
/**
|
|
||||||
* Enable reasoning trace for the `query` task.
|
|
||||||
*/
|
|
||||||
reasoning?: boolean;
|
|
||||||
/**
|
|
||||||
* Sampling temperature.
|
|
||||||
*/
|
|
||||||
temperature?: number;
|
|
||||||
/**
|
|
||||||
* Top-p (nucleus) sampling.
|
|
||||||
*/
|
|
||||||
top_p?: number;
|
|
||||||
/**
|
|
||||||
* Max tokens to generate for `query` and `caption`.
|
|
||||||
*/
|
|
||||||
max_tokens?: number;
|
|
||||||
/**
|
|
||||||
* Max objects to return for `point` and `detect`.
|
|
||||||
*/
|
|
||||||
max_objects?: number;
|
|
||||||
/**
|
|
||||||
* Return incremental tokens for `query` and `caption`. `point` and `detect` do not support streaming.
|
|
||||||
*/
|
|
||||||
stream?: boolean;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output {
|
|
||||||
/**
|
|
||||||
* Reason the generation finished.
|
|
||||||
*/
|
|
||||||
finish_reason: string;
|
|
||||||
metrics: {
|
|
||||||
/**
|
|
||||||
* Number of input tokens consumed.
|
|
||||||
*/
|
|
||||||
input_tokens: number;
|
|
||||||
/**
|
|
||||||
* Number of output tokens generated.
|
|
||||||
*/
|
|
||||||
output_tokens: number;
|
|
||||||
/**
|
|
||||||
* Prefill time in milliseconds.
|
|
||||||
*/
|
|
||||||
prefill_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Decode time in milliseconds.
|
|
||||||
*/
|
|
||||||
decode_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Time to first token in milliseconds.
|
|
||||||
*/
|
|
||||||
ttft_ms: number;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Answer text for the `query` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
answer?: string;
|
|
||||||
/**
|
|
||||||
* Caption text for the `caption` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
caption?: string;
|
|
||||||
/**
|
|
||||||
* Located points for the `point` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
points?: {
|
|
||||||
/**
|
|
||||||
* X coordinate.
|
|
||||||
*/
|
|
||||||
x: number;
|
|
||||||
/**
|
|
||||||
* Y coordinate.
|
|
||||||
*/
|
|
||||||
y: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Detected bounding boxes for the `detect` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
objects?: {
|
|
||||||
/**
|
|
||||||
* Minimum X coordinate.
|
|
||||||
*/
|
|
||||||
x_min: number;
|
|
||||||
/**
|
|
||||||
* Minimum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_min: number;
|
|
||||||
/**
|
|
||||||
* Maximum X coordinate.
|
|
||||||
*/
|
|
||||||
x_max: number;
|
|
||||||
/**
|
|
||||||
* Maximum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_max: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Reasoning trace for the `query` task when reasoning=true. Null otherwise.
|
|
||||||
*/
|
|
||||||
reasoning?: {
|
|
||||||
/**
|
|
||||||
* Reasoning text.
|
|
||||||
*/
|
|
||||||
text: string;
|
|
||||||
/**
|
|
||||||
* Grounding information.
|
|
||||||
*/
|
|
||||||
grounding?: {}[];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B {
|
|
||||||
inputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input;
|
|
||||||
postProcessedOutputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Qwen_Qwen3_8_27B {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3_Flash {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface AiModels {
|
interface AiModels {
|
||||||
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
||||||
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
||||||
@@ -10404,13 +10129,6 @@ interface AiModels {
|
|||||||
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
||||||
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
||||||
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
||||||
"@cf/moonshotai/kimi-k2.7-code": Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code;
|
|
||||||
"@cf/zai-org/glm-5.2": Base_Ai_Cf_Zai_Org_Glm_5_2;
|
|
||||||
"@cf/moondream/moondream3.1-9B-A2B": Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-flash-0731": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-pro-0813": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813;
|
|
||||||
"@cf/qwen/qwen3.8-27b": Base_Ai_Cf_Qwen_Qwen3_8_27B;
|
|
||||||
"@cf/zai-org/glm-5.3-flash": Base_Ai_Cf_Zai_Org_Glm_5_3_Flash;
|
|
||||||
}
|
}
|
||||||
type AiOptions = {
|
type AiOptions = {
|
||||||
/**
|
/**
|
||||||
@@ -11077,15 +10795,6 @@ interface BrowserRunBaseOptions {
|
|||||||
*/
|
*/
|
||||||
cacheTTL?: number;
|
cacheTTL?: number;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Backend selection, mixed into the options of the quick actions that support it.
|
|
||||||
* Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
|
|
||||||
* reject an alternate backend, so they must not accept the field.
|
|
||||||
*/
|
|
||||||
interface BrowserRunAlternateBackendOptions {
|
|
||||||
/** Render with an alternate browser backend instead of the default one. */
|
|
||||||
browser?: 'kitesurf';
|
|
||||||
}
|
|
||||||
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
||||||
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
||||||
/** URL to navigate to, e.g. `"https://example.com"`. */
|
/** URL to navigate to, e.g. `"https://example.com"`. */
|
||||||
@@ -11120,7 +10829,7 @@ type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
|
|||||||
scrollPage?: boolean;
|
scrollPage?: boolean;
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
||||||
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
||||||
pdfOptions?: {
|
pdfOptions?: {
|
||||||
@@ -11156,7 +10865,7 @@ type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
|||||||
/** @default 30000 */
|
/** @default 30000 */
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
};
|
};
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
||||||
/** CSS selectors to scrape. At least one element is required. */
|
/** CSS selectors to scrape. At least one element is required. */
|
||||||
elements: Array<{
|
elements: Array<{
|
||||||
@@ -11169,29 +10878,10 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
|
|||||||
/** When true, exclude links pointing to external domains. @default false */
|
/** When true, exclude links pointing to external domains. @default false */
|
||||||
excludeExternalLinks?: boolean;
|
excludeExternalLinks?: boolean;
|
||||||
};
|
};
|
||||||
type BrowserRunSnapshotFormat = 'content' | 'screenshot' | 'markdown' | 'accessibilityTree';
|
|
||||||
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
||||||
/** Which representations of the page to return. At least two distinct formats
|
|
||||||
* are required; request a single format from its dedicated action instead.
|
|
||||||
* @default ["content","screenshot"]
|
|
||||||
*/
|
|
||||||
formats?: BrowserRunSnapshotFormat[];
|
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
||||||
};
|
};
|
||||||
/** Options for the `accessibilityTree` quick action. */
|
|
||||||
type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
|
|
||||||
/** When true, prune nodes that carry no semantic meaning, such as generic
|
|
||||||
* containers. Defaults to true, or to false when `root` is set so that the
|
|
||||||
* requested subtree is returned as-is.
|
|
||||||
*/
|
|
||||||
interestingOnly?: boolean;
|
|
||||||
/** CSS selector limiting the tree to the matching element's subtree.
|
|
||||||
* A selector that matches nothing yields `accessibilityTree: null` with
|
|
||||||
* HTTP 200; a malformed selector is an error.
|
|
||||||
*/
|
|
||||||
root?: string;
|
|
||||||
} & BrowserRunAlternateBackendOptions;
|
|
||||||
interface BrowserRunJsonBaseOptions {
|
interface BrowserRunJsonBaseOptions {
|
||||||
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
||||||
custom_ai?: Array<{
|
custom_ai?: Array<{
|
||||||
@@ -11205,7 +10895,7 @@ interface BrowserRunJsonBaseOptions {
|
|||||||
* Options for the `json` quick action.
|
* Options for the `json` quick action.
|
||||||
* At least one of `prompt` or `response_format` must be provided.
|
* At least one of `prompt` or `response_format` must be provided.
|
||||||
*/
|
*/
|
||||||
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions & BrowserRunJsonBaseOptions & ({
|
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunJsonBaseOptions & ({
|
||||||
/** Natural-language prompt describing what data to extract. */
|
/** Natural-language prompt describing what data to extract. */
|
||||||
prompt: string;
|
prompt: string;
|
||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
@@ -11216,80 +10906,14 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBacken
|
|||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
response_format: AiTextGenerationResponseFormat;
|
response_format: AiTextGenerationResponseFormat;
|
||||||
});
|
});
|
||||||
type BrowserRunContentOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunContentOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunMarkdownOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunRedirectHop = {
|
|
||||||
/** URL that returned the redirect. */
|
|
||||||
url: string;
|
|
||||||
/** HTTP status of the redirect. */
|
|
||||||
status: number;
|
|
||||||
/** Redirect response headers, including `location`. */
|
|
||||||
headers: Record<string, string>;
|
|
||||||
};
|
|
||||||
type BrowserRunResponseMeta = {
|
type BrowserRunResponseMeta = {
|
||||||
/** HTTP status code of the rendered page */
|
/** HTTP status code of the rendered page */
|
||||||
status: number;
|
status: number;
|
||||||
/** Page title */
|
/** Page title */
|
||||||
title: string;
|
title: string;
|
||||||
/** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
/** URL that served the response, after any redirects the browser followed. */
|
|
||||||
finalUrl?: string;
|
|
||||||
/** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
|
|
||||||
redirectChain?: BrowserRunRedirectHop[];
|
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* A node in the page's accessibility tree, as exposed to assistive technology.
|
|
||||||
* `role` is the only field always present; the rest are populated when the
|
|
||||||
* underlying element defines them.
|
|
||||||
* @see https://pptr.dev/api/puppeteer.serializedaxnode
|
|
||||||
*/
|
|
||||||
interface BrowserRunSerializedAXNode {
|
|
||||||
/** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
|
|
||||||
role: string;
|
|
||||||
/** The `aria-autocomplete` value. */
|
|
||||||
autocomplete?: string;
|
|
||||||
/** Checked state of a checkbox, radio, or menu item. */
|
|
||||||
checked?: boolean | 'mixed';
|
|
||||||
/** Accessible description, typically from `aria-describedby` or `title`. */
|
|
||||||
description?: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
expanded?: boolean;
|
|
||||||
/** Whether the element currently holds keyboard focus. */
|
|
||||||
focused?: boolean;
|
|
||||||
/** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
|
|
||||||
haspopup?: string;
|
|
||||||
/** The `aria-invalid` value. */
|
|
||||||
invalid?: string;
|
|
||||||
/** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
|
|
||||||
keyshortcuts?: string;
|
|
||||||
/** Hierarchical level, e.g. the heading level of an `<h2>`. */
|
|
||||||
level?: number;
|
|
||||||
/** Whether the element is a modal dialog. */
|
|
||||||
modal?: boolean;
|
|
||||||
/** Whether a text input accepts multiple lines. */
|
|
||||||
multiline?: boolean;
|
|
||||||
/** Whether more than one option can be selected. */
|
|
||||||
multiselectable?: boolean;
|
|
||||||
/** Accessible name, e.g. a button's label or an image's alt text. */
|
|
||||||
name?: string;
|
|
||||||
orientation?: string;
|
|
||||||
/** Pressed state of a toggle button. */
|
|
||||||
pressed?: boolean | 'mixed';
|
|
||||||
readonly?: boolean;
|
|
||||||
required?: boolean;
|
|
||||||
/** Author-supplied role description, from `aria-roledescription`. */
|
|
||||||
roledescription?: string;
|
|
||||||
selected?: boolean;
|
|
||||||
/** Current value of an input or range element. */
|
|
||||||
value?: string | number;
|
|
||||||
valuemax?: number;
|
|
||||||
valuemin?: number;
|
|
||||||
/** Human-readable form of `value`, from `aria-valuetext`. */
|
|
||||||
valuetext?: string;
|
|
||||||
/** Child nodes. Absent for leaf nodes. */
|
|
||||||
children?: BrowserRunSerializedAXNode[];
|
|
||||||
}
|
|
||||||
/** Success response for `content` action. */
|
/** Success response for `content` action. */
|
||||||
type BrowserRunContentSuccessResponse = {
|
type BrowserRunContentSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
@@ -11302,7 +10926,6 @@ type BrowserRunLinksSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** Extracted links */
|
/** Extracted links */
|
||||||
result: string[];
|
result: string[];
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `scrape` action. */
|
/** Success response for `scrape` action. */
|
||||||
type BrowserRunScrapeSuccessResponse = {
|
type BrowserRunScrapeSuccessResponse = {
|
||||||
@@ -11333,33 +10956,15 @@ type BrowserRunScrapeSuccessResponse = {
|
|||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `snapshot` action. Each field is present only when the
|
/** Success response for `snapshot` action. */
|
||||||
* corresponding entry was requested in `formats`.
|
|
||||||
*/
|
|
||||||
type BrowserRunSnapshotSuccessResponse = {
|
type BrowserRunSnapshotSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
result: {
|
result: {
|
||||||
/** HTML content of the page. */
|
/** HTML content of the page. */
|
||||||
content?: string;
|
content: string;
|
||||||
/** Base64-encoded screenshot image. */
|
/** Base64-encoded screenshot image. */
|
||||||
screenshot?: string;
|
screenshot: string;
|
||||||
/** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
|
|
||||||
* page provides that metadata.
|
|
||||||
*/
|
|
||||||
markdown?: string;
|
|
||||||
/** Root of the page's accessibility tree. */
|
|
||||||
accessibilityTree?: BrowserRunSerializedAXNode;
|
|
||||||
};
|
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
|
||||||
/** Success response for `accessibilityTree` action. */
|
|
||||||
type BrowserRunAccessibilityTreeSuccessResponse = {
|
|
||||||
success: true;
|
|
||||||
result: {
|
|
||||||
/** Root of the accessibility tree, or `null` when `root` matched no element. */
|
|
||||||
accessibilityTree: BrowserRunSerializedAXNode | null;
|
|
||||||
};
|
};
|
||||||
meta: BrowserRunResponseMeta;
|
meta: BrowserRunResponseMeta;
|
||||||
};
|
};
|
||||||
@@ -11368,14 +10973,12 @@ type BrowserRunJsonSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** JSON data extracted from the page using an AI model */
|
/** JSON data extracted from the page using an AI model */
|
||||||
result: Record<string, unknown>;
|
result: Record<string, unknown>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `markdown` action. */
|
/** Success response for `markdown` action. */
|
||||||
type BrowserRunMarkdownSuccessResponse = {
|
type BrowserRunMarkdownSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
/** Extracted markdown content */
|
/** Extracted markdown content */
|
||||||
result: string;
|
result: string;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Error response for BrowserRun actions. */
|
/** Error response for BrowserRun actions. */
|
||||||
type BrowserRunErrorResponse = {
|
type BrowserRunErrorResponse = {
|
||||||
@@ -11485,10 +11088,9 @@ declare abstract class BrowserRun {
|
|||||||
*/
|
*/
|
||||||
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
||||||
/**
|
/**
|
||||||
* Get several representations of a web page in one request.
|
* Get both the HTML content and a base64-encoded screenshot of a web page.
|
||||||
* @param action - Must be `'snapshot'`.
|
* @param action - Must be `'snapshot'`.
|
||||||
* @param options - Snapshot options including the `formats` to return and
|
* @param options - Snapshot options including screenshot settings (encoding is always base64).
|
||||||
* screenshot settings (encoding is always base64).
|
|
||||||
* @returns A `Response` containing one of:
|
* @returns A `Response` containing one of:
|
||||||
*
|
*
|
||||||
* **Success (HTTP 200):**
|
* **Success (HTTP 200):**
|
||||||
@@ -11536,26 +11138,6 @@ declare abstract class BrowserRun {
|
|||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
||||||
*/
|
*/
|
||||||
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
||||||
/**
|
|
||||||
* Get the accessibility tree of a web page.
|
|
||||||
* @param action - Must be `'accessibilityTree'`.
|
|
||||||
* @param options - Options to scope the tree to a subtree and to control
|
|
||||||
* whether semantically uninteresting nodes are pruned.
|
|
||||||
* @returns A `Response` containing one of:
|
|
||||||
*
|
|
||||||
* **Success (HTTP 200):**
|
|
||||||
* - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
|
|
||||||
* - `result.accessibilityTree` is `null` when `root` matched no element
|
|
||||||
*
|
|
||||||
* **Error:**
|
|
||||||
* - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
|
|
||||||
* - HTTP 422 for a malformed `root` selector
|
|
||||||
* - HTTP 500 with code `2017` or `2018` when the tree could not be built
|
|
||||||
*
|
|
||||||
* **Headers:**
|
|
||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
|
||||||
*/
|
|
||||||
quickAction(action: 'accessibilityTree', options: BrowserRunAccessibilityTreeOptions): Promise<Response>;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* In addition to the properties you can set in the RequestInit dict
|
* In addition to the properties you can set in the RequestInit dict
|
||||||
@@ -12626,13 +12208,6 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|||||||
* @returns A promise that resolves when the email message is replied.
|
* @returns A promise that resolves when the email message is replied.
|
||||||
*/
|
*/
|
||||||
reply(message: EmailMessage): Promise<EmailSendResult>;
|
reply(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
/**
|
|
||||||
* Reply to the sender of this email message with a message built from the given
|
|
||||||
* fields. Threading headers (In-Reply-To/References) are set automatically.
|
|
||||||
* @param builder The reply message contents.
|
|
||||||
* @returns A promise that resolves when the email message is replied.
|
|
||||||
*/
|
|
||||||
reply(builder: EmailReplyMessageBuilder): Promise<EmailSendResult>;
|
|
||||||
}
|
}
|
||||||
/** A file attachment for an email message */
|
/** A file attachment for an email message */
|
||||||
type EmailAttachment = {
|
type EmailAttachment = {
|
||||||
@@ -12653,46 +12228,23 @@ interface EmailAddress {
|
|||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Recipient fields for `SendEmail.send()`. At least one of `to`, `cc`, or
|
|
||||||
* `bcc` must be provided.
|
|
||||||
*/
|
|
||||||
type EmailDestinations = {
|
|
||||||
to?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
cc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} & ({
|
|
||||||
to: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
cc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
bcc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* Fields shared by all composed emails (no recipients). Used directly by
|
|
||||||
* `ForwardableEmailMessage.reply()`, which always replies to the original
|
|
||||||
* sender, and extended by `EmailMessageBuilder` for `SendEmail.send()`.
|
|
||||||
*/
|
|
||||||
interface EmailReplyMessageBuilder {
|
|
||||||
from: string | EmailAddress;
|
|
||||||
subject: string;
|
|
||||||
replyTo?: string | EmailAddress;
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
text?: string;
|
|
||||||
html?: string;
|
|
||||||
attachments?: EmailAttachment[];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Fields for composing an email without constructing raw MIME, for
|
|
||||||
* `SendEmail.send()`. Requires at least one of `to`, `cc`, or `bcc`.
|
|
||||||
*/
|
|
||||||
type EmailMessageBuilder = EmailReplyMessageBuilder & EmailDestinations;
|
|
||||||
/**
|
/**
|
||||||
* A binding that allows a Worker to send email messages.
|
* A binding that allows a Worker to send email messages.
|
||||||
*/
|
*/
|
||||||
interface SendEmail {
|
interface SendEmail {
|
||||||
send(message: EmailMessage): Promise<EmailSendResult>;
|
send(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
send(builder: EmailMessageBuilder): Promise<EmailSendResult>;
|
send(builder: {
|
||||||
|
from: string | EmailAddress;
|
||||||
|
to: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
subject: string;
|
||||||
|
replyTo?: string | EmailAddress;
|
||||||
|
cc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
headers?: Record<string, string>;
|
||||||
|
text?: string;
|
||||||
|
html?: string;
|
||||||
|
attachments?: EmailAttachment[];
|
||||||
|
}): Promise<EmailSendResult>;
|
||||||
}
|
}
|
||||||
declare abstract class EmailEvent extends ExtendableEvent {
|
declare abstract class EmailEvent extends ExtendableEvent {
|
||||||
readonly message: ForwardableEmailMessage;
|
readonly message: ForwardableEmailMessage;
|
||||||
@@ -12846,15 +12398,6 @@ interface Hyperdrive {
|
|||||||
* for your database.
|
* for your database.
|
||||||
*/
|
*/
|
||||||
readonly host: string;
|
readonly host: string;
|
||||||
/*
|
|
||||||
* A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
|
|
||||||
* host field, is only valid within the context of the currently running
|
|
||||||
* Worker and, when passed into the `connect()` function from the
|
|
||||||
* "cloudflare:sockets" module, will connect to the Hyperdrive instance for
|
|
||||||
* your database. This is provided for database drivers that require the host
|
|
||||||
* to be an IP literal rather than a hostname.
|
|
||||||
*/
|
|
||||||
readonly ip: string;
|
|
||||||
/*
|
/*
|
||||||
* The port that must be paired the the host field when connecting.
|
* The port that must be paired the the host field when connecting.
|
||||||
*/
|
*/
|
||||||
@@ -12876,78 +12419,6 @@ interface Hyperdrive {
|
|||||||
*/
|
*/
|
||||||
readonly database: string;
|
readonly database: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* A handle to a dynamically-provisioned Hyperdrive connection, returned by
|
|
||||||
* `HyperdriveApi.get()`.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamic extends Disposable {
|
|
||||||
/**
|
|
||||||
* The database name to use when connecting through this Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly database: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated user to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly user: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated password to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly password: Promise<string>;
|
|
||||||
/**
|
|
||||||
* Open a TCP socket to the target database through this Hyperdrive.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
connect(): Promise<Socket>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Binding that provisions Hyperdrive connections at request time, rather than
|
|
||||||
* from static configuration.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicApi {
|
|
||||||
/**
|
|
||||||
* Provision a connection for the database described by `args`.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
|
|
||||||
/**
|
|
||||||
* Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
|
|
||||||
*/
|
|
||||||
getHyperdriveConnectionString(connectionString: string): Promise<string>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Parameters identifying the database that a dynamically-provisioned
|
|
||||||
* Hyperdrive connection should target.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicConfig {
|
|
||||||
/**
|
|
||||||
* Generated connection string to pass into the dynamic worker.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
dynamicHyperdriveConnectionString: string;
|
|
||||||
/**
|
|
||||||
* Connection string for the origin database Hyperdrive should connect to.
|
|
||||||
* Contains credentials, so treat it as a secret.
|
|
||||||
*
|
|
||||||
* The scheme selects the database engine. PostgreSQL origins are supported.
|
|
||||||
*/
|
|
||||||
connectionString: string;
|
|
||||||
/**
|
|
||||||
* Region in which to place the connection pool. See the Hyperdrive
|
|
||||||
* documentation for the set of supported regions.
|
|
||||||
*/
|
|
||||||
targetRegion: string;
|
|
||||||
/**
|
|
||||||
* Whether Hyperdrive should cache query results for this connection.
|
|
||||||
*/
|
|
||||||
cachingEnabled?: boolean;
|
|
||||||
/**
|
|
||||||
* Maximum number of connections the pool may open to the origin database.
|
|
||||||
* Defaults to 60.
|
|
||||||
*/
|
|
||||||
maxConnections?: number;
|
|
||||||
}
|
|
||||||
// Copyright (c) 2024 Cloudflare, Inc.
|
// Copyright (c) 2024 Cloudflare, Inc.
|
||||||
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
||||||
// https://opensource.org/licenses/Apache-2.0
|
// https://opensource.org/licenses/Apache-2.0
|
||||||
@@ -12959,27 +12430,6 @@ type ImageInfoResponse = {
|
|||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* Parameters for rasterizing text into an image.
|
|
||||||
*/
|
|
||||||
type TextRasterize = {
|
|
||||||
/** The text content to render */
|
|
||||||
content: string;
|
|
||||||
/** rasterization options for the text **/
|
|
||||||
options: TextOptions;
|
|
||||||
};
|
|
||||||
type TextOptions = {
|
|
||||||
/** Font configuration */
|
|
||||||
font: {
|
|
||||||
/** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
/** Font size in points (pt) */
|
|
||||||
size?: number;
|
|
||||||
/** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
|
|
||||||
color?: string;
|
|
||||||
};
|
|
||||||
type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
|
|
||||||
type ImageTransform = {
|
type ImageTransform = {
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
@@ -13069,9 +12519,6 @@ interface ImageUploadOptions {
|
|||||||
requireSignedURLs?: boolean;
|
requireSignedURLs?: boolean;
|
||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
/**
|
|
||||||
* If 'base64', the input data will be decoded from base64 before processing
|
|
||||||
*/
|
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
}
|
}
|
||||||
interface ImageUpdateOptions {
|
interface ImageUpdateOptions {
|
||||||
@@ -13079,40 +12526,11 @@ interface ImageUpdateOptions {
|
|||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
}
|
}
|
||||||
type ImageMetadataFilterOperators = {
|
|
||||||
eq?: string | number | boolean;
|
|
||||||
in?: string[] | number[];
|
|
||||||
gt?: number;
|
|
||||||
gte?: number;
|
|
||||||
lt?: number;
|
|
||||||
lte?: number;
|
|
||||||
};
|
|
||||||
type ImageMetadataFilterValue = string | number | boolean | ImageMetadataFilterOperators;
|
|
||||||
interface ImageListFilter {
|
|
||||||
metadata?: Record<string, ImageMetadataFilterValue>;
|
|
||||||
}
|
|
||||||
interface ImageListOptions {
|
interface ImageListOptions {
|
||||||
limit?: number;
|
limit?: number;
|
||||||
cursor?: string;
|
cursor?: string;
|
||||||
sortOrder?: 'asc' | 'desc';
|
sortOrder?: 'asc' | 'desc';
|
||||||
creator?: string;
|
creator?: string;
|
||||||
filter?: ImageListFilter;
|
|
||||||
}
|
|
||||||
interface ImageSignedUrlOptions {
|
|
||||||
variant: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
keyName?: string;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadOptions {
|
|
||||||
id?: string;
|
|
||||||
requireSignedURLs?: boolean;
|
|
||||||
metadata?: Record<string, unknown>;
|
|
||||||
creator?: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadResult {
|
|
||||||
id: string;
|
|
||||||
uploadURL: string;
|
|
||||||
}
|
}
|
||||||
interface ImageList {
|
interface ImageList {
|
||||||
images: ImageMetadata[];
|
images: ImageMetadata[];
|
||||||
@@ -13130,13 +12548,6 @@ interface ImageHandle {
|
|||||||
* @returns ReadableStream of image bytes, or null if not found
|
* @returns ReadableStream of image bytes, or null if not found
|
||||||
*/
|
*/
|
||||||
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
||||||
/**
|
|
||||||
* Generate a signed delivery URL for this hosted image.
|
|
||||||
* @param options Signing configuration
|
|
||||||
* @returns A signed image delivery URL
|
|
||||||
* @throws {@link ImagesError} if signing fails
|
|
||||||
*/
|
|
||||||
signedUrl(options: ImageSignedUrlOptions): Promise<string>;
|
|
||||||
/**
|
/**
|
||||||
* Update hosted image metadata
|
* Update hosted image metadata
|
||||||
* @param options Properties to update
|
* @param options Properties to update
|
||||||
@@ -13172,14 +12583,6 @@ interface HostedImagesBinding {
|
|||||||
* @throws {@link ImagesError} if list fails
|
* @throws {@link ImagesError} if list fails
|
||||||
*/
|
*/
|
||||||
list(options?: ImageListOptions): Promise<ImageList>;
|
list(options?: ImageListOptions): Promise<ImageList>;
|
||||||
/**
|
|
||||||
* Create a Direct Creator Upload link, letting an end user upload an
|
|
||||||
* image straight to Cloudflare without exposing an API token
|
|
||||||
* @param options Upload link configuration
|
|
||||||
* @returns The new image ID and the upload URL to hand to the end user
|
|
||||||
* @throws {@link ImagesError} if creation fails
|
|
||||||
*/
|
|
||||||
createDirectUpload(options?: ImageDirectUploadOptions): Promise<ImageDirectUploadResult>;
|
|
||||||
}
|
}
|
||||||
interface ImagesBinding {
|
interface ImagesBinding {
|
||||||
/**
|
/**
|
||||||
@@ -13194,13 +12597,6 @@ interface ImagesBinding {
|
|||||||
* @returns A transform handle
|
* @returns A transform handle
|
||||||
*/
|
*/
|
||||||
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
||||||
/**
|
|
||||||
* Begin applying a series of transformations to text
|
|
||||||
* @param content string to be rendered
|
|
||||||
* @param options font, optional color and size to use in rendering text
|
|
||||||
* @returns A transform handle
|
|
||||||
*/
|
|
||||||
text(content: string, options: TextOptions): ImageTransformer;
|
|
||||||
/**
|
/**
|
||||||
* Access hosted images CRUD operations
|
* Access hosted images CRUD operations
|
||||||
*/
|
*/
|
||||||
@@ -13230,15 +12626,11 @@ interface ImageTransformer {
|
|||||||
type ImageTransformationOutputOptions = {
|
type ImageTransformationOutputOptions = {
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
};
|
};
|
||||||
type ImageTransformationResponseOptions = {
|
|
||||||
headers?: HeadersInit;
|
|
||||||
};
|
|
||||||
interface ImageTransformationResult {
|
interface ImageTransformationResult {
|
||||||
/**
|
/**
|
||||||
* The image as a response, ready to store in cache or return to users
|
* The image as a response, ready to store in cache or return to users
|
||||||
* @param options Options that apply to the returned response, e.g. additional headers
|
|
||||||
*/
|
*/
|
||||||
response(options?: ImageTransformationResponseOptions): Response;
|
response(): Response;
|
||||||
/**
|
/**
|
||||||
* The content type of the returned image
|
* The content type of the returned image
|
||||||
*/
|
*/
|
||||||
@@ -13674,11 +13066,6 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowDynamicDelayContext = {
|
|
||||||
ctx: WorkflowStepContext<WorkflowDelayFunction>;
|
|
||||||
error: Error;
|
|
||||||
};
|
|
||||||
export type WorkflowDelayFunction = (input: WorkflowDynamicDelayContext) => WorkflowDelayDuration | Promise<WorkflowDelayDuration>;
|
|
||||||
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
||||||
@@ -13686,32 +13073,12 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowStepConfig = {
|
export type WorkflowStepConfig = {
|
||||||
retries?: {
|
retries?: {
|
||||||
limit: number;
|
limit: number;
|
||||||
delay: WorkflowDelayDuration | number | WorkflowDelayFunction;
|
delay: WorkflowDelayDuration | number;
|
||||||
backoff?: WorkflowBackoff;
|
backoff?: WorkflowBackoff;
|
||||||
};
|
};
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
timeout?: WorkflowTimeoutDuration | number;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
// Internal discriminators used only for `WorkflowStep.do` overload
|
|
||||||
// resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
|
|
||||||
// single kind so the callback context can be narrowed based on the shape of
|
|
||||||
// the config argument (rather than on an inferred type parameter, which is
|
|
||||||
// lost when the caller supplies an explicit return-type argument). Not
|
|
||||||
// exported: they must not widen the public type surface.
|
|
||||||
type WorkflowStepConfigWithStaticDelay = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
type WorkflowStepConfigWithDelayFunction = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayFunction;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
||||||
export type WorkflowCronSchedule = {
|
export type WorkflowCronSchedule = {
|
||||||
/** Cron expression that triggered this event. */
|
/** Cron expression that triggered this event. */
|
||||||
@@ -13732,51 +13099,28 @@ declare namespace CloudflareWorkersModule {
|
|||||||
type: string;
|
type: string;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
export type WorkflowStepContext<Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepContext = {
|
||||||
step: {
|
step: {
|
||||||
name: string;
|
name: string;
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
attempt: number;
|
attempt: number;
|
||||||
config: {
|
config: WorkflowStepConfig;
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
} & (Delay extends WorkflowDelayFunction ? {} : {
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
});
|
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
|
||||||
sensitive?: WorkflowStepSensitivity;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
// The rollback handler receives the step context, so it mirrors the same
|
export type WorkflowRollbackContext<T = unknown> = {
|
||||||
// delay discriminant as the step callback: when the step was configured with
|
ctx: WorkflowStepContext;
|
||||||
// a dynamic delay function the resolved `config.retries.delay` is omitted,
|
|
||||||
// otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
|
|
||||||
// overload that matched the step config.
|
|
||||||
export type WorkflowRollbackContext<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
||||||
ctx: WorkflowStepContext<Delay>;
|
|
||||||
error: Error;
|
error: Error;
|
||||||
output: T | undefined;
|
output: T | undefined;
|
||||||
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
||||||
stepName: string;
|
stepName: string;
|
||||||
};
|
};
|
||||||
export type WorkflowRollbackHandler<T = unknown, Delay = WorkflowDelayDuration | number> = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
|
export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
|
||||||
export type WorkflowStepRollbackOptions<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepRollbackOptions<T = unknown> = {
|
||||||
rollback: WorkflowRollbackHandler<T, Delay>;
|
rollback: WorkflowRollbackHandler<T>;
|
||||||
rollbackConfig?: WorkflowStepRollbackConfig;
|
rollbackConfig?: WorkflowStepRollbackConfig;
|
||||||
};
|
};
|
||||||
export abstract class WorkflowStep {
|
export abstract class WorkflowStep {
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
// The config overloads discriminate on the shape of `config.retries.delay`
|
|
||||||
// so the callback context reflects whether the resolved delay is present
|
|
||||||
// (static delay) or omitted (dynamic delay function). Each has a single
|
|
||||||
// type parameter, so an explicit return-type argument (`do<T>(...)`) still
|
|
||||||
// resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
|
|
||||||
// fallback MUST remain last, otherwise it shadows the discriminating
|
|
||||||
// overloads and narrowing is silently lost.
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithDelayFunction, callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithStaticDelay, callback: (ctx: WorkflowStepContext<WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayDuration | number>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
||||||
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
||||||
@@ -14552,12 +13896,11 @@ type MarkdownDocument = {
|
|||||||
name: string;
|
name: string;
|
||||||
blob: Blob;
|
blob: Blob;
|
||||||
};
|
};
|
||||||
type OutputFormat = 'markdown' | 'text';
|
|
||||||
type ConversionResponse = {
|
type ConversionResponse = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
mimeType: string;
|
mimeType: string;
|
||||||
format: OutputFormat;
|
format: 'markdown';
|
||||||
tokens: number;
|
tokens: number;
|
||||||
data: string;
|
data: string;
|
||||||
} | {
|
} | {
|
||||||
@@ -14574,11 +13917,7 @@ type EmbeddedImageConversionOptions = ImageConversionOptions & {
|
|||||||
convert?: boolean;
|
convert?: boolean;
|
||||||
maxConvertedImages?: number;
|
maxConvertedImages?: number;
|
||||||
};
|
};
|
||||||
type ConversionOutputOptions = {
|
|
||||||
format?: OutputFormat;
|
|
||||||
};
|
|
||||||
type ConversionOptions = {
|
type ConversionOptions = {
|
||||||
output?: ConversionOutputOptions;
|
|
||||||
html?: {
|
html?: {
|
||||||
images?: EmbeddedImageConversionOptions & {
|
images?: EmbeddedImageConversionOptions & {
|
||||||
convertOGImage?: boolean;
|
convertOGImage?: boolean;
|
||||||
@@ -14673,7 +14012,7 @@ declare namespace TailStream {
|
|||||||
interface ConnectEventInfo {
|
interface ConnectEventInfo {
|
||||||
readonly type: "connect";
|
readonly type: "connect";
|
||||||
}
|
}
|
||||||
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime" | "aborted";
|
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime";
|
||||||
interface ScriptVersion {
|
interface ScriptVersion {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly tag?: string;
|
readonly tag?: string;
|
||||||
@@ -14692,7 +14031,6 @@ declare namespace TailStream {
|
|||||||
readonly dispatchNamespace?: string;
|
readonly dispatchNamespace?: string;
|
||||||
readonly entrypoint?: string;
|
readonly entrypoint?: string;
|
||||||
readonly executionModel: string;
|
readonly executionModel: string;
|
||||||
readonly durableObjectId?: string;
|
|
||||||
readonly scriptName?: string;
|
readonly scriptName?: string;
|
||||||
readonly scriptTags?: string[];
|
readonly scriptTags?: string[];
|
||||||
readonly scriptVersion?: ScriptVersion;
|
readonly scriptVersion?: ScriptVersion;
|
||||||
@@ -14727,22 +14065,11 @@ declare namespace TailStream {
|
|||||||
readonly message: string;
|
readonly message: string;
|
||||||
readonly stack?: string;
|
readonly stack?: string;
|
||||||
}
|
}
|
||||||
interface TailStreamErrorInfo {
|
interface Log {
|
||||||
readonly name: string;
|
|
||||||
readonly message: string;
|
|
||||||
readonly stack?: string;
|
|
||||||
}
|
|
||||||
type Log = {
|
|
||||||
readonly type: "log";
|
readonly type: "log";
|
||||||
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
||||||
readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
|
|
||||||
} & ({
|
|
||||||
readonly message: object;
|
readonly message: object;
|
||||||
readonly truncated?: false;
|
}
|
||||||
} | {
|
|
||||||
readonly message: string;
|
|
||||||
readonly truncated: true;
|
|
||||||
});
|
|
||||||
interface DroppedEventsDiagnostic {
|
interface DroppedEventsDiagnostic {
|
||||||
readonly diagnosticsType: "droppedEvents";
|
readonly diagnosticsType: "droppedEvents";
|
||||||
readonly count: number;
|
readonly count: number;
|
||||||
@@ -15220,31 +14547,10 @@ declare abstract class Workflow<PARAMS = unknown> {
|
|||||||
* @returns A promise that resolves with a list of handles for the created instances.
|
* @returns A promise that resolves with a list of handles for the created instances.
|
||||||
*/
|
*/
|
||||||
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
||||||
/**
|
|
||||||
* Delete a batch of Workflow instances and their stored state.
|
|
||||||
* `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
|
|
||||||
* The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
|
|
||||||
* @param instanceIds IDs of the Workflow instances to delete
|
|
||||||
* @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
|
|
||||||
*/
|
|
||||||
public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
|
|
||||||
}
|
}
|
||||||
type WorkflowBatchDeleteResult = {
|
|
||||||
deleted: {
|
|
||||||
id: string;
|
|
||||||
}[];
|
|
||||||
errors: {
|
|
||||||
id: string;
|
|
||||||
code: number;
|
|
||||||
message: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
/** Geographic regions supported when creating a Workflow instance.
|
|
||||||
* Location hints are best-effort placement preferences. */
|
|
||||||
type WorkflowInstanceLocationHint = 'wnam' | 'enam' | 'sam' | 'weur' | 'eeur' | 'apac' | 'apac-ne' | 'apac-se' | 'oc' | 'afr' | 'me';
|
|
||||||
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
||||||
/**
|
/**
|
||||||
* An id for your Workflow instance. Must be unique within the Workflow.
|
* An id for your Workflow instance. Must be unique within the Workflow.
|
||||||
@@ -15262,9 +14568,6 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|||||||
successRetention?: WorkflowRetentionDuration;
|
successRetention?: WorkflowRetentionDuration;
|
||||||
errorRetention?: WorkflowRetentionDuration;
|
errorRetention?: WorkflowRetentionDuration;
|
||||||
};
|
};
|
||||||
/** A best-effort geographic placement preference for the Workflow instance.
|
|
||||||
* See `WorkflowInstanceLocationHint` for supported regions. */
|
|
||||||
locationHint?: WorkflowInstanceLocationHint;
|
|
||||||
}
|
}
|
||||||
type InstanceStatus = {
|
type InstanceStatus = {
|
||||||
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
||||||
@@ -15282,13 +14585,6 @@ interface WorkflowError {
|
|||||||
code?: number;
|
code?: number;
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
interface WorkflowInstanceTerminateOptions {
|
|
||||||
/**
|
|
||||||
* If true, run registered rollback handlers before terminating the instance.
|
|
||||||
* Only steps that registered rollback handlers are rolled back.
|
|
||||||
*/
|
|
||||||
rollback?: boolean;
|
|
||||||
}
|
|
||||||
interface WorkflowInstanceRestartOptions {
|
interface WorkflowInstanceRestartOptions {
|
||||||
/**
|
/**
|
||||||
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
||||||
@@ -15322,19 +14618,14 @@ declare abstract class WorkflowInstance {
|
|||||||
public resume(): Promise<void>;
|
public resume(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
||||||
* @param options Options for termination, including whether registered rollback handlers should run.
|
|
||||||
*/
|
*/
|
||||||
public terminate(options?: WorkflowInstanceTerminateOptions): Promise<void>;
|
public terminate(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Restart the instance. Optionally restart from a specific step, preserving
|
* Restart the instance. Optionally restart from a specific step, preserving
|
||||||
* cached results for all steps before it.
|
* cached results for all steps before it.
|
||||||
* @param options Options for the restart, including an optional step to restart from.
|
* @param options Options for the restart, including an optional step to restart from.
|
||||||
*/
|
*/
|
||||||
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
||||||
/**
|
|
||||||
* Delete the instance and its stored state.
|
|
||||||
*/
|
|
||||||
public delete(): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Returns the current status of the instance.
|
* Returns the current status of the instance.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,10 +5,8 @@
|
|||||||
"compatibility_date": "2026-06-16",
|
"compatibility_date": "2026-06-16",
|
||||||
"compatibility_flags": ["nodejs_compat"],
|
"compatibility_flags": ["nodejs_compat"],
|
||||||
// Shared `recflare` DB. Reads room scenes for matchmaking, writes a player's
|
// Shared `recflare` DB. Reads room scenes for matchmaking, writes a player's
|
||||||
// personal dorm room on first dorm entry (see getOrCreateDormRoom), holds
|
// personal dorm room on first dorm entry (see getOrCreateDormRoom), and holds
|
||||||
// player presence (the `presence` table — owned/migrated by the `rooms` worker),
|
// player presence (the `presence` table — owned/migrated by the `rooms` worker).
|
||||||
// and the per-player settings map (`player_settings`, owned by the `playersettings`
|
|
||||||
// worker) that GET|PUT /player/avoidjuniors reads one key of.
|
|
||||||
// This worker owns the `room_invite` table behind POST /invite (schema/migration
|
// This worker owns the `room_invite` table behind POST /invite (schema/migration
|
||||||
// here); its own migrations_table keeps that history separate from the other
|
// here); its own migrations_table keeps that history separate from the other
|
||||||
// workers' migrations on the shared database.
|
// workers' migrations on the shared database.
|
||||||
@@ -22,6 +20,15 @@
|
|||||||
"migrations_table": "d1_migrations_match"
|
"migrations_table": "d1_migrations_match"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
// Per-player settings KV, owned by the `playersettings` worker. Read-only here, for
|
||||||
|
// GET /player/avoidjuniors. The "local" id placeholder is replaced with the real id
|
||||||
|
// from RECFLARE_KV at deploy time.
|
||||||
|
"kv_namespaces": [
|
||||||
|
{
|
||||||
|
"binding": "RECFLARE_PLAYER_SETTINGS",
|
||||||
|
"id": "local"
|
||||||
|
}
|
||||||
|
],
|
||||||
// Presence sweep. Rows expire on their own TTL (15m) and reads already ignore
|
// Presence sweep. Rows expire on their own TTL (15m) and reads already ignore
|
||||||
// expired ones, so this is housekeeping: it purges them, deletes the room
|
// expired ones, so this is housekeeping: it purges them, deletes the room
|
||||||
// instances left with nobody in them, and recomputes the fullness of the
|
// instances left with nobody in them, and recomputes the fullness of the
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import type { NotificationsHub } from '../../notify/src/notifications-hub'
|
|||||||
* Union of every mounted worker's bindings.
|
* Union of every mounted worker's bindings.
|
||||||
*
|
*
|
||||||
* Because the split workers already share the same underlying resources — one
|
* Because the split workers already share the same underlying resources — one
|
||||||
* `recflare` D1, one Secrets Store, the shared R2 buckets and the Notifications Durable
|
* `recflare` D1, one Secrets Store, the shared R2 buckets, the single KV namespace and
|
||||||
* Object — this is a de-duplicated union, not a migration.
|
* the Notifications Durable Object — this is a de-duplicated union, not a migration.
|
||||||
* Each mounted app reads only the subset it needs; a superset `Env` is assignable to
|
* Each mounted app reads only the subset it needs; a superset `Env` is assignable to
|
||||||
* each app's narrower `Env`, so the sub-apps type-check unchanged.
|
* each app's narrower `Env`, so the sub-apps type-check unchanged.
|
||||||
*/
|
*/
|
||||||
@@ -20,12 +20,14 @@ export type Env = SharedHonoEnv & {
|
|||||||
// Meta (Oculus) app secret, from the same store. Read only by `auth`, to validate a
|
// Meta (Oculus) app secret, from the same store. Read only by `auth`, to validate a
|
||||||
// headset login's nonce with Meta (see apps/auth/src/meta-nonce.ts).
|
// headset login's nonce with Meta (see apps/auth/src/meta-nonce.ts).
|
||||||
META_APP_SECRET: SecretsStoreSecret
|
META_APP_SECRET: SecretsStoreSecret
|
||||||
// Shared `recflare` database (accounts, auth, api, clubs, match, playersettings, rooms, …).
|
// Shared `recflare` database (accounts, auth, api, clubs, match, rooms, …).
|
||||||
DB: D1Database
|
DB: D1Database
|
||||||
// Image storage bucket (api, img).
|
// Image storage bucket (api, img).
|
||||||
IMAGES: R2Bucket
|
IMAGES: R2Bucket
|
||||||
// Binary room-data CDN bucket (cdn, rooms, storage).
|
// Binary room-data CDN bucket (cdn, rooms, storage).
|
||||||
CDN_ASSETS: R2Bucket
|
CDN_ASSETS: R2Bucket
|
||||||
|
// Per-player settings (playersettings).
|
||||||
|
RECFLARE_PLAYER_SETTINGS: KVNamespace
|
||||||
// Real-time notifications hub. The class is defined in `notify` and re-exported by
|
// Real-time notifications hub. The class is defined in `notify` and re-exported by
|
||||||
// this worker's entry so the binding resolves in-process (no `script_name`).
|
// this worker's entry so the binding resolves in-process (no `script_name`).
|
||||||
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>
|
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>
|
||||||
|
|||||||
+241
-950
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// Runtime types generated with workerd@1.20260831.1 2026-06-16 nodejs_compat
|
// Runtime types generated with workerd@1.20260625.1 2026-06-16 nodejs_compat
|
||||||
// Begin runtime types
|
// Begin runtime types
|
||||||
/*! *****************************************************************************
|
/*! *****************************************************************************
|
||||||
Copyright (c) Cloudflare. All rights reserved.
|
Copyright (c) Cloudflare. All rights reserved.
|
||||||
@@ -19,26 +19,26 @@ and limitations under the License.
|
|||||||
// noinspection JSUnusedGlobalSymbols
|
// noinspection JSUnusedGlobalSymbols
|
||||||
declare var onmessage: never;
|
declare var onmessage: never;
|
||||||
/**
|
/**
|
||||||
* The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs.
|
* The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
||||||
*/
|
*/
|
||||||
declare class DOMException extends Error {
|
declare class DOMException extends Error {
|
||||||
constructor(message?: string, name?: string);
|
constructor(message?: string, name?: string);
|
||||||
/**
|
/**
|
||||||
* The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name.
|
* The **`message`** read-only property of the a message or description associated with the given error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
||||||
*/
|
*/
|
||||||
readonly message: string;
|
readonly message: string;
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name.
|
* The **`name`** read-only property of the one of the strings associated with an error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
||||||
*/
|
*/
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
/**
|
/**
|
||||||
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match.
|
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
||||||
@@ -96,61 +96,61 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
clear(): void;
|
clear(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.count()`** static method logs the number of times that this particular call to count() has been called.
|
* The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
||||||
*/
|
*/
|
||||||
count(label?: string): void;
|
count(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.countReset()`** static method resets counter used with console.count().
|
* The **`console.countReset()`** static method resets counter used with console/count_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
||||||
*/
|
*/
|
||||||
countReset(label?: string): void;
|
countReset(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.debug()`** static method outputs a message to the console at the "debug" log level. The message is only displayed to the user if the console is configured to display debug output. In most cases, the log level is configured within the console UI. This log level might correspond to the Debug or Verbose log level.
|
* The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
||||||
*/
|
*/
|
||||||
debug(...data: any[]): void;
|
debug(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. In browser consoles, the output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
|
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
||||||
*/
|
*/
|
||||||
dir(item?: any, options?: any): void;
|
dir(item?: any, options?: any): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.
|
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
||||||
*/
|
*/
|
||||||
dirxml(...data: any[]): void;
|
dirxml(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.error()`** static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information.
|
* The **`console.error()`** static method outputs a message to the console at the 'error' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
||||||
*/
|
*/
|
||||||
error(...data: any[]): void;
|
error(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.
|
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
||||||
*/
|
*/
|
||||||
group(...data: any[]): void;
|
group(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupCollapsed()`** static method creates a new inline group in the console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.
|
* The **`console.groupCollapsed()`** static method creates a new inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
||||||
*/
|
*/
|
||||||
groupCollapsed(...data: any[]): void;
|
groupCollapsed(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupEnd()`** static method exits the current inline group in the console. See Using groups in the console in the console documentation for details and examples.
|
* The **`console.groupEnd()`** static method exits the current inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
||||||
*/
|
*/
|
||||||
groupEnd(): void;
|
groupEnd(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.info()`** static method outputs a message to the console at the "info" log level. The message is only displayed to the user if the console is configured to display info output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as a small "i" icon next to it.
|
* The **`console.info()`** static method outputs a message to the console at the 'info' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
||||||
*/
|
*/
|
||||||
@@ -168,24 +168,23 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
table(tabularData?: any, properties?: string[]): void;
|
table(tabularData?: any, properties?: string[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.
|
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
||||||
*/
|
*/
|
||||||
time(label?: string): void;
|
time(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console.time().
|
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
||||||
*/
|
*/
|
||||||
timeEnd(label?: string): void;
|
timeEnd(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console.time().
|
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
||||||
*/
|
*/
|
||||||
timeLog(label?: string, ...data: any[]): void;
|
timeLog(label?: string, ...data: any[]): void;
|
||||||
/* The **`console.timeStamp()`** static method adds a single marker to the browser's Performance tool (Firefox bug 1387528, Chrome). This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. */
|
|
||||||
timeStamp(label?: string): void;
|
timeStamp(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.trace()`** static method outputs a stack trace to the console.
|
* The **`console.trace()`** static method outputs a stack trace to the console.
|
||||||
@@ -194,7 +193,7 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
trace(...data: any[]): void;
|
trace(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.warn()`** static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon.
|
* The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
||||||
*/
|
*/
|
||||||
@@ -360,7 +359,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|||||||
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -405,7 +404,6 @@ declare const crypto: Crypto;
|
|||||||
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
||||||
*/
|
*/
|
||||||
declare const caches: CacheStorage;
|
declare const caches: CacheStorage;
|
||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scheduler) */
|
|
||||||
declare const scheduler: Scheduler;
|
declare const scheduler: Scheduler;
|
||||||
/**
|
/**
|
||||||
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
||||||
@@ -427,7 +425,6 @@ interface ExecutionContext<Props = unknown> {
|
|||||||
cache?: CacheContext;
|
cache?: CacheContext;
|
||||||
readonly access?: CloudflareAccessContext;
|
readonly access?: CloudflareAccessContext;
|
||||||
tracing: Tracing;
|
tracing: Tracing;
|
||||||
abort(reason?: any): void;
|
|
||||||
}
|
}
|
||||||
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
||||||
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
||||||
@@ -516,7 +513,7 @@ declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded
|
|||||||
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
||||||
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
||||||
}
|
}
|
||||||
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high" | "us";
|
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
|
||||||
interface DurableObjectNamespaceNewUniqueIdOptions {
|
interface DurableObjectNamespaceNewUniqueIdOptions {
|
||||||
jurisdiction?: DurableObjectJurisdiction;
|
jurisdiction?: DurableObjectJurisdiction;
|
||||||
}
|
}
|
||||||
@@ -545,7 +542,7 @@ interface DurableObjectState<Props = unknown> {
|
|||||||
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
||||||
getHibernatableWebSocketEventTimeout(): number | null;
|
getHibernatableWebSocketEventTimeout(): number | null;
|
||||||
getTags(ws: WebSocket): string[];
|
getTags(ws: WebSocket): string[];
|
||||||
abort(reason?: string, options?: DurableObjectAbortOptions): void;
|
abort(reason?: string): void;
|
||||||
}
|
}
|
||||||
interface DurableObjectTransaction {
|
interface DurableObjectTransaction {
|
||||||
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
||||||
@@ -581,9 +578,6 @@ interface DurableObjectStorage {
|
|||||||
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
||||||
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
||||||
}
|
}
|
||||||
interface DurableObjectAbortOptions {
|
|
||||||
retryAlarm?: boolean;
|
|
||||||
}
|
|
||||||
interface DurableObjectListOptions {
|
interface DurableObjectListOptions {
|
||||||
start?: string;
|
start?: string;
|
||||||
startAfter?: string;
|
startAfter?: string;
|
||||||
@@ -634,26 +628,26 @@ interface AnalyticsEngineDataPoint {
|
|||||||
blobs?: ((ArrayBuffer | string) | null)[];
|
blobs?: ((ArrayBuffer | string) | null)[];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`Event`** interface represents an event which takes place on an EventTarget.
|
* The **`Event`** interface represents an event which takes place on an `EventTarget`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
||||||
*/
|
*/
|
||||||
declare class Event {
|
declare class Event {
|
||||||
constructor(type: string, init?: EventInit);
|
constructor(type: string, init?: EventInit);
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error.
|
* The **`type`** read-only property of the Event interface returns a string containing the event's type.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated.
|
* The **`eventPhase`** read-only property of the being evaluated.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
||||||
*/
|
*/
|
||||||
get eventPhase(): number;
|
get eventPhase(): number;
|
||||||
/**
|
/**
|
||||||
* The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
* The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
||||||
*/
|
*/
|
||||||
@@ -690,13 +684,13 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get currentTarget(): EventTarget | undefined;
|
get currentTarget(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event.
|
* The read-only **`target`** property of the dispatched.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
||||||
*/
|
*/
|
||||||
get target(): EventTarget | undefined;
|
get target(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead.
|
* The deprecated **`Event.srcElement`** is an alias for the Event.target property.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
||||||
@@ -709,45 +703,45 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get timeStamp(): number;
|
get timeStamp(): number;
|
||||||
/**
|
/**
|
||||||
* The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents.
|
* The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
||||||
*/
|
*/
|
||||||
get isTrusted(): boolean;
|
get isTrusted(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
get cancelBubble(): boolean;
|
get cancelBubble(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
set cancelBubble(value: boolean);
|
set cancelBubble(value: boolean);
|
||||||
/**
|
/**
|
||||||
* The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called.
|
* The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
||||||
*/
|
*/
|
||||||
stopImmediatePropagation(): void;
|
stopImmediatePropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken.
|
* The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
||||||
*/
|
*/
|
||||||
preventDefault(): void;
|
preventDefault(): void;
|
||||||
/**
|
/**
|
||||||
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().
|
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
||||||
*/
|
*/
|
||||||
stopPropagation(): void;
|
stopPropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.
|
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
||||||
*/
|
*/
|
||||||
@@ -768,7 +762,7 @@ interface EventListenerObject<EventType extends Event = Event> {
|
|||||||
}
|
}
|
||||||
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
||||||
/**
|
/**
|
||||||
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. In other words, any target of events implements the three methods associated with this interface.
|
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
||||||
*/
|
*/
|
||||||
@@ -781,13 +775,13 @@ declare class EventTarget<EventMap extends Record<string, Event> = Record<string
|
|||||||
*/
|
*/
|
||||||
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
|
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
||||||
*/
|
*/
|
||||||
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -819,7 +813,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. This is able to abort fetch requests, the consumption of any response bodies, or streams.
|
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
||||||
*/
|
*/
|
||||||
@@ -832,7 +826,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
declare abstract class AbortSignal extends EventTarget {
|
declare abstract class AbortSignal extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).
|
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
||||||
*/
|
*/
|
||||||
@@ -844,13 +838,13 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
*/
|
*/
|
||||||
static timeout(delay: number): AbortSignal;
|
static timeout(delay: number): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal.
|
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
||||||
*/
|
*/
|
||||||
static any(signals: AbortSignal[]): AbortSignal;
|
static any(signals: AbortSignal[]): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false).
|
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
||||||
*/
|
*/
|
||||||
@@ -866,17 +860,12 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
||||||
set onabort(value: any | null);
|
set onabort(value: any | null);
|
||||||
/**
|
/**
|
||||||
* The **`throwIfAborted()`** method throws the signal's abort reason if the signal has been aborted; otherwise it does nothing.
|
* The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
||||||
*/
|
*/
|
||||||
throwIfAborted(): void;
|
throwIfAborted(): void;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`Scheduler`** interface of the Prioritized Task Scheduling API provides methods for scheduling prioritized tasks.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Scheduler)
|
|
||||||
*/
|
|
||||||
interface Scheduler {
|
interface Scheduler {
|
||||||
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
||||||
}
|
}
|
||||||
@@ -884,20 +873,20 @@ interface SchedulerWaitOptions {
|
|||||||
signal?: AbortSignal;
|
signal?: AbortSignal;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent`** interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
|
* The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class ExtendableEvent extends Event {
|
declare abstract class ExtendableEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful. In service workers, waitUntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the service worker if it wants that work to complete.
|
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
||||||
*/
|
*/
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CustomEvent`** interface can be used to attach custom data to an event generated by an application.
|
* The **`CustomEvent`** interface represents events initialized by an application for any purpose.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
||||||
*/
|
*/
|
||||||
@@ -936,7 +925,7 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`slice()`** method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it's called.
|
* The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
||||||
*/
|
*/
|
||||||
@@ -954,13 +943,13 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
bytes(): Promise<Uint8Array>;
|
bytes(): Promise<Uint8Array>;
|
||||||
/**
|
/**
|
||||||
* The **`text()`** method of the Blob interface returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8.
|
* The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
||||||
*/
|
*/
|
||||||
text(): Promise<string>;
|
text(): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.
|
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
||||||
*/
|
*/
|
||||||
@@ -977,13 +966,13 @@ interface BlobOptions {
|
|||||||
declare class File extends Blob {
|
declare class File extends Blob {
|
||||||
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object. For security reasons, the path is excluded from this property.
|
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
||||||
*/
|
*/
|
||||||
get name(): string;
|
get name(): string;
|
||||||
/**
|
/**
|
||||||
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
||||||
*/
|
*/
|
||||||
@@ -1000,7 +989,7 @@ interface FileOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class CacheStorage {
|
declare abstract class CacheStorage {
|
||||||
/**
|
/**
|
||||||
* The **`open()`** method of the CacheStorage interface returns a Promise that resolves to the Cache object matching the cacheName.
|
* The **`open()`** method of the the Cache object matching the `cacheName`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
||||||
*/
|
*/
|
||||||
@@ -1033,14 +1022,14 @@ interface CacheQueryOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class Crypto {
|
declare abstract class Crypto {
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.subtle`** read-only property returns a SubtleCrypto which can then be used to perform low-level cryptographic operations.
|
* The **`Crypto.subtle`** read-only property returns a cryptographic operations.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
||||||
*/
|
*/
|
||||||
get subtle(): SubtleCrypto;
|
get subtle(): SubtleCrypto;
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).
|
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
||||||
*/
|
*/
|
||||||
@@ -1068,7 +1057,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data. It takes as arguments a key to decrypt with, some optional extra parameters, and the data to decrypt (also known as "ciphertext"). It returns a Promise which will be fulfilled with the decrypted data (also known as "plaintext").
|
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
||||||
*/
|
*/
|
||||||
@@ -1086,7 +1075,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
||||||
/**
|
/**
|
||||||
* The **`digest()`** method of the SubtleCrypto interface generates a digest of the given data, using the specified hash function. A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value.
|
* The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
||||||
*/
|
*/
|
||||||
@@ -1104,7 +1093,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
||||||
/**
|
/**
|
||||||
* The **`deriveBits()`** method of the SubtleCrypto interface can be used to derive an array of bits from a base key.
|
* The **`deriveBits()`** method of the key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
||||||
*/
|
*/
|
||||||
@@ -1122,13 +1111,13 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
||||||
/**
|
/**
|
||||||
* The **`wrapKey()`** method of the SubtleCrypto interface "wraps" a key. This means that it exports the key in an external, portable format, then encrypts the exported key. Wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
|
* The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
||||||
*/
|
*/
|
||||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`unwrapKey()`** method of the SubtleCrypto interface "unwraps" a key. This means that it takes as its input a key that has been exported and then encrypted (also called "wrapped"). It decrypts the key and then imports it, returning a CryptoKey object that can be used in the Web Crypto API.
|
* The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
||||||
*/
|
*/
|
||||||
@@ -1136,20 +1125,20 @@ declare abstract class SubtleCrypto {
|
|||||||
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey().
|
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
||||||
*/
|
*/
|
||||||
declare abstract class CryptoKey {
|
declare abstract class CryptoKey {
|
||||||
/**
|
/**
|
||||||
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object. It can have the following values:
|
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
||||||
*/
|
*/
|
||||||
readonly type: string;
|
readonly type: string;
|
||||||
/**
|
/**
|
||||||
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using SubtleCrypto.exportKey() or SubtleCrypto.wrapKey().
|
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
||||||
*/
|
*/
|
||||||
@@ -1266,15 +1255,12 @@ interface CryptoKeyArbitraryKeyAlgorithm {
|
|||||||
length?: number;
|
length?: number;
|
||||||
}
|
}
|
||||||
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
||||||
constructor(algorithm: string | SubtleCryptoHashAlgorithm, options?: DigestStreamOptions);
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
||||||
readonly digest: Promise<ArrayBuffer>;
|
readonly digest: Promise<ArrayBuffer>;
|
||||||
get bytesWritten(): number | bigint;
|
get bytesWritten(): number | bigint;
|
||||||
}
|
}
|
||||||
interface DigestStreamOptions {
|
|
||||||
toWellFormed?: boolean;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
|
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
||||||
*/
|
*/
|
||||||
@@ -1291,20 +1277,20 @@ declare class TextDecoder {
|
|||||||
get ignoreBOM(): boolean;
|
get ignoreBOM(): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder`** interface enables you to encode a JavaScript string using UTF-8.
|
* The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
||||||
*/
|
*/
|
||||||
declare class TextEncoder {
|
declare class TextEncoder {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Uint8Array containing the string encoded using UTF-8.
|
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
||||||
*/
|
*/
|
||||||
encode(input?: string): Uint8Array;
|
encode(input?: string): Uint8Array;
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns an object indicating the progress of the encoding. This is potentially more performant than the encode() method — especially when the target buffer is a view into a Wasm heap.
|
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
||||||
*/
|
*/
|
||||||
@@ -1361,9 +1347,6 @@ declare class ErrorEvent extends Event {
|
|||||||
get error(): any;
|
get error(): any;
|
||||||
}
|
}
|
||||||
interface ErrorEventErrorEventInit {
|
interface ErrorEventErrorEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
message?: string;
|
message?: string;
|
||||||
filename?: string;
|
filename?: string;
|
||||||
lineno?: number;
|
lineno?: number;
|
||||||
@@ -1376,139 +1359,135 @@ interface ErrorEventErrorEventInit {
|
|||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
||||||
*/
|
*/
|
||||||
declare class MessageEvent extends Event {
|
declare class MessageEvent extends Event {
|
||||||
constructor(type: string, initializer?: MessageEventInit);
|
constructor(type: string, initializer: MessageEventInit);
|
||||||
/**
|
/**
|
||||||
* The **`data`** read-only property of the MessageEvent interface represents the data sent by the message emitter.
|
* The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
||||||
*/
|
*/
|
||||||
readonly data: any;
|
readonly data: any;
|
||||||
/**
|
/**
|
||||||
* The **`origin`** read-only property of the MessageEvent interface is a string representing the origin of the message emitter.
|
* The **`origin`** read-only property of the origin of the message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
||||||
*/
|
*/
|
||||||
readonly origin: string | null;
|
readonly origin: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`lastEventId`** read-only property of the MessageEvent interface is a string representing a unique ID for the event.
|
* The **`lastEventId`** read-only property of the unique ID for the event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
||||||
*/
|
*/
|
||||||
readonly lastEventId: string;
|
readonly lastEventId: string;
|
||||||
/**
|
/**
|
||||||
* The **`source`** read-only property of the MessageEvent interface is a MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter.
|
* The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
||||||
*/
|
*/
|
||||||
readonly source: MessagePort | null;
|
readonly source: MessagePort | null;
|
||||||
/**
|
/**
|
||||||
* The **`ports`** read-only property of the MessageEvent interface is an array of MessagePort objects containing all MessagePort objects sent with the message, in order.
|
* The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
||||||
*/
|
*/
|
||||||
readonly ports: MessagePort[];
|
readonly ports: MessagePort[];
|
||||||
}
|
}
|
||||||
interface MessageEventInit {
|
interface MessageEventInit {
|
||||||
bubbles?: boolean;
|
data: ArrayBuffer | string;
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
data?: any;
|
|
||||||
origin?: string;
|
|
||||||
lastEventId?: string;
|
|
||||||
source?: MessagePort;
|
|
||||||
ports?: MessagePort[];
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. These events are particularly useful for telemetry and debugging purposes.
|
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class PromiseRejectionEvent extends Event {
|
declare abstract class PromiseRejectionEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript Promise which was rejected. You can examine the event's PromiseRejectionEvent.reason property to learn why the promise was rejected.
|
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
||||||
*/
|
*/
|
||||||
readonly promise: Promise<any>;
|
readonly promise: Promise<any>;
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). This in theory provides information about why the promise was rejected.
|
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject().
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
||||||
*/
|
*/
|
||||||
readonly reason: any;
|
readonly reason: any;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the fetch(), XMLHttpRequest.send() or navigator.sendBeacon() methods. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
|
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
||||||
*/
|
*/
|
||||||
declare class FormData {
|
declare class FormData {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string | Blob): void;
|
append(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: Blob, filename?: string): void;
|
append(name: string, value: Blob, filename?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a FormData object.
|
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a FormData object. If you expect multiple values and want all of them, use the getAll() method instead.
|
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): (File | string) | null;
|
get(name: string): (File | string) | null;
|
||||||
/**
|
/**
|
||||||
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a FormData object.
|
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
||||||
*/
|
*/
|
||||||
getAll(name: string): (File | string)[];
|
getAll(name: string): (File | string)[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the FormData interface returns whether a FormData object contains a certain key.
|
* The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string | Blob): void;
|
set(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: Blob, filename?: string): void;
|
set(name: string, value: Blob, filename?: string): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the list. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: File | string
|
value: File | string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the list. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the list. */
|
||||||
values(): IterableIterator<(File | string)>;
|
values(): IterableIterator<(File | string)>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
@@ -1587,19 +1566,19 @@ interface DocumentEnd {
|
|||||||
append(content: string, options?: ContentOptions): DocumentEnd;
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class FetchEvent extends ExtendableEvent {
|
declare abstract class FetchEvent extends ExtendableEvent {
|
||||||
/**
|
/**
|
||||||
* The **`request`** read-only property of the FetchEvent interface returns the Request that triggered the event handler.
|
* The **`request`** read-only property of the the event handler.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
||||||
*/
|
*/
|
||||||
readonly request: Request;
|
readonly request: Request;
|
||||||
/**
|
/**
|
||||||
* The **`respondWith()`** method of FetchEvent prevents the browser's default fetch handling, and allows you to provide a promise for a Response yourself.
|
* The **`respondWith()`** method of allows you to provide a promise for a Response yourself.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
||||||
*/
|
*/
|
||||||
@@ -1608,55 +1587,58 @@ declare abstract class FetchEvent extends ExtendableEvent {
|
|||||||
}
|
}
|
||||||
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
||||||
/**
|
/**
|
||||||
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
|
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
||||||
*/
|
*/
|
||||||
declare class Headers {
|
declare class Headers {
|
||||||
constructor(init?: HeadersInit);
|
constructor(init?: HeadersInit);
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.
|
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): string | null;
|
get(name: string): string | null;
|
||||||
getAll(name: string): string[];
|
getAll(name: string): string[];
|
||||||
/**
|
/**
|
||||||
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. This allows Headers objects to handle having multiple Set-Cookie headers, which wasn't possible prior to its implementation.
|
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
||||||
*/
|
*/
|
||||||
getSetCookie(): string[];
|
getSetCookie(): string[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the Headers interface returns a boolean stating whether a Headers object contains a certain header.
|
* The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the Headers interface deletes a header from the current Headers object.
|
* The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
||||||
|
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
@@ -1719,7 +1701,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
statusText: string;
|
statusText: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Response interface contains the Headers object associated with the response.
|
* The **`headers`** read-only property of the with the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1737,7 +1719,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
redirected: boolean;
|
redirected: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects.
|
* The **`url`** read-only property of the Response interface contains the URL of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
||||||
*/
|
*/
|
||||||
@@ -1745,7 +1727,7 @@ interface Response extends Body {
|
|||||||
webSocket: WebSocket | null;
|
webSocket: WebSocket | null;
|
||||||
cf: any | undefined;
|
cf: any | undefined;
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers.
|
* The **`type`** read-only property of the Response interface contains the type of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
||||||
*/
|
*/
|
||||||
@@ -1776,13 +1758,13 @@ declare var Request: {
|
|||||||
*/
|
*/
|
||||||
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
||||||
/**
|
/**
|
||||||
* The **`clone()`** method of the Request interface creates a copy of the current Request object.
|
* The **`clone()`** method of the Request interface creates a copy of the current `Request` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
||||||
*/
|
*/
|
||||||
clone(): Request<CfHostMetadata, Cf>;
|
clone(): Request<CfHostMetadata, Cf>;
|
||||||
/**
|
/**
|
||||||
* The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.)
|
* The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
||||||
*/
|
*/
|
||||||
@@ -1794,7 +1776,7 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Request interface contains the Headers object associated with the request.
|
* The **`headers`** read-only property of the with the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1820,13 +1802,13 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
integrity: string;
|
integrity: string;
|
||||||
/**
|
/**
|
||||||
* The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
* The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
||||||
*/
|
*/
|
||||||
keepalive: boolean;
|
keepalive: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache.
|
* The **`cache`** read-only property of the Request interface contains the cache mode of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
||||||
*/
|
*/
|
||||||
@@ -2215,7 +2197,7 @@ type ReadableStreamReadResult<R = any> = {
|
|||||||
value?: undefined;
|
value?: undefined;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2233,13 +2215,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
getReader(): ReadableStreamDefaultReader<R>;
|
getReader(): ReadableStreamDefaultReader<R>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
@@ -2251,13 +2233,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
||||||
/**
|
/**
|
||||||
* The **`pipeTo()`** method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
* The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
||||||
*/
|
*/
|
||||||
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`tee()`** method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances.
|
* The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
||||||
*/
|
*/
|
||||||
@@ -2269,7 +2251,7 @@ interface ReadableStream<R = any> {
|
|||||||
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2301,7 +2283,7 @@ declare class ReadableStreamDefaultReader<R = any> {
|
|||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBReader`** interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. It is used for efficient copying from underlying sources where the data is delivered as an "anonymous" sequence of bytes, such as files.
|
* The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
||||||
*/
|
*/
|
||||||
@@ -2310,13 +2292,13 @@ declare class ReadableStreamBYOBReader {
|
|||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. A request for data will be satisfied from the stream's internal queues if there is any data present. If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source.
|
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
||||||
*/
|
*/
|
||||||
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. After the lock is released, the reader is no longer active.
|
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
||||||
*/
|
*/
|
||||||
@@ -2335,7 +2317,7 @@ interface ReadableStreamGetReaderOptions {
|
|||||||
mode: "byob";
|
mode: "byob";
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a "pull request" for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
||||||
*/
|
*/
|
||||||
@@ -2361,13 +2343,13 @@ declare abstract class ReadableStreamBYOBRequest {
|
|||||||
get atLeast(): number | null;
|
get atLeast(): number | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams.
|
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableStreamDefaultController<R = any> {
|
declare abstract class ReadableStreamDefaultController<R = any> {
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the required to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2379,32 +2361,32 @@ declare abstract class ReadableStreamDefaultController<R = any> {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.
|
* The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
||||||
*/
|
*/
|
||||||
enqueue(chunk?: R): void;
|
enqueue(chunk?: R): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. It allows control of the state and internal queue of a ReadableStream with an underlying byte source, and enables efficient zero-copy transfer of data from the underlying source to a consumer when the stream's internal queue is empty.
|
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableByteStreamController {
|
declare abstract class ReadableByteStreamController {
|
||||||
/**
|
/**
|
||||||
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests.
|
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
||||||
*/
|
*/
|
||||||
get byobRequest(): ReadableStreamBYOBRequest | null;
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its "desired size".
|
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2416,7 +2398,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is transferred into the stream's internal queues).
|
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
||||||
*/
|
*/
|
||||||
@@ -2429,7 +2411,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultController`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
@@ -2441,7 +2423,7 @@ declare abstract class WritableStreamDefaultController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the WritableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2466,7 +2448,7 @@ declare abstract class TransformStreamDefaultController<O = any> {
|
|||||||
*/
|
*/
|
||||||
enqueue(chunk?: O): void;
|
enqueue(chunk?: O): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
|
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2488,14 +2470,14 @@ interface ReadableWritablePair<R = any, W = any> {
|
|||||||
writable: WritableStream<W>;
|
writable: WritableStream<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
|
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
||||||
*/
|
*/
|
||||||
declare class WritableStream<W = any> {
|
declare class WritableStream<W = any> {
|
||||||
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
||||||
/**
|
/**
|
||||||
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.
|
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
||||||
*/
|
*/
|
||||||
@@ -2507,83 +2489,83 @@ declare class WritableStream<W = any> {
|
|||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled.
|
* The **`close()`** method of the WritableStream interface closes the associated stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. While the stream is locked, no other writer can be acquired until this one is released.
|
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
||||||
*/
|
*/
|
||||||
getWriter(): WritableStreamDefaultWriter<W>;
|
getWriter(): WritableStreamDefaultWriter<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
||||||
*/
|
*/
|
||||||
declare class WritableStreamDefaultWriter<W = any> {
|
declare class WritableStreamDefaultWriter<W = any> {
|
||||||
constructor(stream: WritableStream);
|
constructor(stream: WritableStream);
|
||||||
/**
|
/**
|
||||||
* The **`closed`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that fulfills if the stream becomes closed, or rejects if the stream errors or the writer's lock is released.
|
* The **`closed`** read-only property of the the stream errors or the writer's lock is released.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
||||||
*/
|
*/
|
||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`ready`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
* The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
||||||
*/
|
*/
|
||||||
get ready(): Promise<void>;
|
get ready(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the WritableStreamDefaultWriter interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
||||||
*/
|
*/
|
||||||
get desiredSize(): number | null;
|
get desiredSize(): number | null;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the WritableStreamDefaultWriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
* The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStreamDefaultWriter interface closes the associated writable stream.
|
* The **`close()`** method of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`write()`** method of the WritableStreamDefaultWriter interface writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation.
|
* The **`write()`** method of the operation.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
||||||
*/
|
*/
|
||||||
write(chunk?: W): Promise<void>;
|
write(chunk?: W): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the WritableStreamDefaultWriter interface releases the writer's lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
|
* The **`releaseLock()`** method of the corresponding stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
||||||
*/
|
*/
|
||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain transform stream concept.
|
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
||||||
*/
|
*/
|
||||||
declare class TransformStream<I = any, O = any> {
|
declare class TransformStream<I = any, O = any> {
|
||||||
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
||||||
/**
|
/**
|
||||||
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream. This stream emits the transformed output data.
|
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
||||||
*/
|
*/
|
||||||
get readable(): ReadableStream<O>;
|
get readable(): ReadableStream<O>;
|
||||||
/**
|
/**
|
||||||
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream. This stream accepts input data that will be transformed and emitted to the readable stream.
|
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
||||||
*/
|
*/
|
||||||
@@ -2602,7 +2584,7 @@ interface ReadableStreamValuesOptions {
|
|||||||
preventCancel?: boolean;
|
preventCancel?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CompressionStream`** interface of the Compression Streams API compresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2610,7 +2592,7 @@ declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBuffe
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`DecompressionStream`** interface of the Compression Streams API decompresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2618,7 +2600,7 @@ declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBuf
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2627,7 +2609,7 @@ declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
|
|||||||
get encoding(): string;
|
get encoding(): string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings. It is the streaming equivalent of TextDecoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2776,12 +2758,6 @@ interface TraceLog {
|
|||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
readonly level: string;
|
readonly level: string;
|
||||||
readonly message: any;
|
readonly message: any;
|
||||||
readonly errorInfo?: (TraceLogErrorInfo | null)[];
|
|
||||||
}
|
|
||||||
interface TraceLogErrorInfo {
|
|
||||||
name: string;
|
|
||||||
message: string;
|
|
||||||
stack?: string;
|
|
||||||
}
|
}
|
||||||
interface TraceException {
|
interface TraceException {
|
||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
@@ -2802,7 +2778,7 @@ interface UnsafeTraceMetrics {
|
|||||||
fromTrace(item: TraceItem): TraceMetrics;
|
fromTrace(item: TraceItem): TraceMetrics;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`URL`** interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.
|
* The **`URL`** interface is used to parse, construct, normalize, and encode URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
||||||
*/
|
*/
|
||||||
@@ -2827,121 +2803,121 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
set href(value: string);
|
set href(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
set protocol(value: string);
|
set protocol(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
set username(value: string);
|
set username(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
set password(value: string);
|
set password(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
get host(): string;
|
get host(): string;
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
set host(value: string);
|
set host(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
set hostname(value: string);
|
set hostname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
set port(value: string);
|
set port(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
set pathname(value: string);
|
set pathname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
set search(value: string);
|
set search(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
set hash(value: string);
|
set hash(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
|
* The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
||||||
*/
|
*/
|
||||||
get searchParams(): URLSearchParams;
|
get searchParams(): URLSearchParams;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().
|
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -2961,13 +2937,13 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
static parse(url: string, base?: string): URL | null;
|
static parse(url: string, base?: string): URL | null;
|
||||||
/**
|
/**
|
||||||
* The **`createObjectURL()`** static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.
|
* The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
||||||
*/
|
*/
|
||||||
static createObjectURL(object: File | Blob): string;
|
static createObjectURL(object: File | Blob): string;
|
||||||
/**
|
/**
|
||||||
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().
|
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
||||||
*/
|
*/
|
||||||
@@ -3017,22 +2993,25 @@ declare class URLSearchParams {
|
|||||||
*/
|
*/
|
||||||
has(name: string, value?: string): boolean;
|
has(name: string, value?: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.
|
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved).
|
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
||||||
*/
|
*/
|
||||||
sort(): void;
|
sort(): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the search params. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the search params. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
||||||
/*function toString() { [native code] }*/
|
/*function toString() { [native code] }*/
|
||||||
@@ -3042,78 +3021,18 @@ declare class URLSearchParams {
|
|||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern. The pattern can contain capturing groups that extract parts of the matched URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
|
|
||||||
*/
|
|
||||||
declare class URLPattern {
|
declare class URLPattern {
|
||||||
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
||||||
/**
|
|
||||||
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
||||||
*/
|
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
|
||||||
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
||||||
*/
|
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
|
||||||
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
||||||
*/
|
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
|
||||||
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
||||||
*/
|
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
|
||||||
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
||||||
*/
|
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
|
||||||
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
||||||
*/
|
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
|
||||||
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
||||||
*/
|
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
|
||||||
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
|
|
||||||
*/
|
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
|
||||||
* The **`hasRegExpGroups`** read-only property of the URLPattern interface is a boolean indicating whether or not any of the URLPattern components contain regular expression capturing groups.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
|
|
||||||
*/
|
|
||||||
get hasRegExpGroups(): boolean;
|
get hasRegExpGroups(): boolean;
|
||||||
/**
|
|
||||||
* The **`test()`** method of the URLPattern interface takes a URL string or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
|
|
||||||
*/
|
|
||||||
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
||||||
/**
|
|
||||||
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or null if the URL does not match the pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
|
|
||||||
*/
|
|
||||||
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
||||||
}
|
}
|
||||||
interface URLPatternInit {
|
interface URLPatternInit {
|
||||||
@@ -3146,7 +3065,7 @@ interface URLPatternOptions {
|
|||||||
ignoreCase?: boolean;
|
ignoreCase?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* A `CloseEvent` is sent to clients using WebSockets when the connection is closed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
||||||
*/
|
*/
|
||||||
@@ -3165,16 +3084,13 @@ declare class CloseEvent extends Event {
|
|||||||
*/
|
*/
|
||||||
readonly reason: string;
|
readonly reason: string;
|
||||||
/**
|
/**
|
||||||
* The **`wasClean`** read-only property of the CloseEvent interface returns true if the connection closed cleanly.
|
* The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
||||||
*/
|
*/
|
||||||
readonly wasClean: boolean;
|
readonly wasClean: boolean;
|
||||||
}
|
}
|
||||||
interface CloseEventInit {
|
interface CloseEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
code?: number;
|
code?: number;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
wasClean?: boolean;
|
wasClean?: boolean;
|
||||||
@@ -3186,7 +3102,7 @@ type WebSocketEventMap = {
|
|||||||
error: ErrorEvent;
|
error: ErrorEvent;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
@@ -3203,20 +3119,20 @@ declare var WebSocket: {
|
|||||||
readonly CLOSED: number;
|
readonly CLOSED: number;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
||||||
accept(options?: WebSocketAcceptOptions): void;
|
accept(options?: WebSocketAcceptOptions): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. The browser will throw an exception if you call send() when the connection is in the CONNECTING state. If you call send() when the connection is in the CLOSING or CLOSED states, the browser will silently discard the data.
|
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
||||||
*/
|
*/
|
||||||
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.close()`** method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.
|
* The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
||||||
*/
|
*/
|
||||||
@@ -3236,13 +3152,13 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|||||||
*/
|
*/
|
||||||
url: string | null;
|
url: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object, or the empty string if no connection is established.
|
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
||||||
*/
|
*/
|
||||||
protocol: string | null;
|
protocol: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.
|
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
||||||
*/
|
*/
|
||||||
@@ -3329,25 +3245,25 @@ interface SocketInfo {
|
|||||||
declare class EventSource extends EventTarget {
|
declare class EventSource extends EventTarget {
|
||||||
constructor(url: string, init?: EventSourceEventSourceInit);
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the EventSource.readyState attribute to 2 (closed).
|
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the EventSource interface returns a string representing the URL of the source.
|
* The **`url`** read-only property of the URL of the source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
||||||
*/
|
*/
|
||||||
get url(): string;
|
get url(): string;
|
||||||
/**
|
/**
|
||||||
* The **`withCredentials`** read-only property of the EventSource interface returns a boolean value indicating whether the EventSource object was instantiated with CORS credentials set.
|
* The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
||||||
*/
|
*/
|
||||||
get withCredentials(): boolean;
|
get withCredentials(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`readyState`** read-only property of the EventSource interface returns a number representing the state of the connection.
|
* The **`readyState`** read-only property of the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
||||||
*/
|
*/
|
||||||
@@ -3382,26 +3298,18 @@ interface ContainerExecOptions {
|
|||||||
cwd?: string;
|
cwd?: string;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
user?: string;
|
user?: string;
|
||||||
signal?: AbortSignal;
|
|
||||||
pty?: boolean | ContainerExecPtyOptions;
|
|
||||||
stdin?: ReadableStream | "pipe";
|
stdin?: ReadableStream | "pipe";
|
||||||
stdout?: "pipe" | "ignore";
|
stdout?: "pipe" | "ignore";
|
||||||
stderr?: "pipe" | "ignore" | "combined";
|
stderr?: "pipe" | "ignore" | "combined";
|
||||||
}
|
}
|
||||||
interface ContainerExecPtyOptions {
|
|
||||||
cols?: number;
|
|
||||||
rows?: number;
|
|
||||||
}
|
|
||||||
interface ExecProcess {
|
interface ExecProcess {
|
||||||
readonly stdin: WritableStream | null;
|
readonly stdin: WritableStream | null;
|
||||||
readonly stdout: ReadableStream | null;
|
readonly stdout: ReadableStream | null;
|
||||||
readonly stderr: ReadableStream | null;
|
readonly stderr: ReadableStream | null;
|
||||||
readonly pid: number;
|
readonly pid: number;
|
||||||
readonly isPty: boolean;
|
|
||||||
readonly exitCode: Promise<number>;
|
readonly exitCode: Promise<number>;
|
||||||
output(): Promise<ExecOutput>;
|
output(): Promise<ExecOutput>;
|
||||||
kill(signal?: number): void;
|
kill(signal?: number): void;
|
||||||
resize(cols: number, rows: number): void;
|
|
||||||
}
|
}
|
||||||
interface Container {
|
interface Container {
|
||||||
get running(): boolean;
|
get running(): boolean;
|
||||||
@@ -3428,42 +3336,25 @@ interface ContainerDirectorySnapshotOptions {
|
|||||||
dir: string;
|
dir: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerDirectorySnapshotRestoreParams = {
|
interface ContainerDirectorySnapshotRestoreParams {
|
||||||
snapshot: ContainerDirectorySnapshot;
|
snapshot: ContainerDirectorySnapshot;
|
||||||
mountPoint?: string;
|
mountPoint?: string;
|
||||||
} | {
|
}
|
||||||
snapshot?: undefined;
|
|
||||||
mountPoint: string;
|
|
||||||
};
|
|
||||||
interface ContainerSnapshot {
|
interface ContainerSnapshot {
|
||||||
id: string;
|
id: string;
|
||||||
size: number;
|
size: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
interface ContainerSnapshotRestoreParams {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
interface ContainerSnapshotOptions {
|
interface ContainerSnapshotOptions {
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerStartupOptions = {
|
interface ContainerStartupOptions {
|
||||||
entrypoint?: string[];
|
entrypoint?: string[];
|
||||||
enableInternet: boolean;
|
enableInternet: boolean;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
instance?: "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | ContainerStartResources;
|
|
||||||
labels?: Record<string, string>;
|
labels?: Record<string, string>;
|
||||||
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
||||||
} & ({
|
containerSnapshot?: ContainerSnapshot;
|
||||||
image: string;
|
|
||||||
containerSnapshot?: never;
|
|
||||||
} | {
|
|
||||||
image?: never;
|
|
||||||
containerSnapshot?: ContainerSnapshotRestoreParams;
|
|
||||||
});
|
|
||||||
interface ContainerStartResources {
|
|
||||||
vcpu: number;
|
|
||||||
memoryMib: number;
|
|
||||||
diskMb: number;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
||||||
@@ -3472,19 +3363,19 @@ interface ContainerStartResources {
|
|||||||
*/
|
*/
|
||||||
declare abstract class MessagePort extends EventTarget {
|
declare abstract class MessagePort extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`postMessage()`** method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
|
* The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
||||||
*/
|
*/
|
||||||
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.
|
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage.
|
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
||||||
*/
|
*/
|
||||||
@@ -3500,13 +3391,13 @@ declare abstract class MessagePort extends EventTarget {
|
|||||||
declare class MessageChannel {
|
declare class MessageChannel {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`port1`** read-only property of the MessageChannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
|
* The **`port1`** read-only property of the the port attached to the context that originated the channel.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
||||||
*/
|
*/
|
||||||
readonly port1: MessagePort;
|
readonly port1: MessagePort;
|
||||||
/**
|
/**
|
||||||
* The **`port2`** read-only property of the MessageChannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
|
* The **`port2`** read-only property of the the port attached to the context at the other end of the channel, which the message is initially sent to.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
||||||
*/
|
*/
|
||||||
@@ -3566,7 +3457,7 @@ interface WorkerLoaderModule {
|
|||||||
data?: ArrayBuffer;
|
data?: ArrayBuffer;
|
||||||
json?: any;
|
json?: any;
|
||||||
py?: string;
|
py?: string;
|
||||||
wasm?: ArrayBuffer | ArrayBufferView | WebAssembly.Module;
|
wasm?: ArrayBuffer;
|
||||||
}
|
}
|
||||||
interface WorkerLoaderWorkerCode {
|
interface WorkerLoaderWorkerCode {
|
||||||
compatibilityDate: string;
|
compatibilityDate: string;
|
||||||
@@ -3574,7 +3465,7 @@ interface WorkerLoaderWorkerCode {
|
|||||||
allowExperimental?: boolean;
|
allowExperimental?: boolean;
|
||||||
limits?: workerdResourceLimits;
|
limits?: workerdResourceLimits;
|
||||||
mainModule: string;
|
mainModule: string;
|
||||||
modules: Record<string, string | WebAssembly.Module | WorkerLoaderModule>;
|
modules: Record<string, WorkerLoaderModule | string>;
|
||||||
env?: any;
|
env?: any;
|
||||||
globalOutbound?: (Fetcher | null);
|
globalOutbound?: (Fetcher | null);
|
||||||
tails?: Fetcher[];
|
tails?: Fetcher[];
|
||||||
@@ -3596,7 +3487,7 @@ declare abstract class Performance {
|
|||||||
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
||||||
now(): number;
|
now(): number;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the Performance interface is a serializer; it returns a JSON representation of the Performance object.
|
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -3605,13 +3496,11 @@ declare abstract class Performance {
|
|||||||
interface Tracing {
|
interface Tracing {
|
||||||
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startSpan(name: string): Span;
|
|
||||||
Span: typeof Span;
|
Span: typeof Span;
|
||||||
}
|
}
|
||||||
declare abstract class Span {
|
declare abstract class Span {
|
||||||
get isTraced(): boolean;
|
get isTraced(): boolean;
|
||||||
setAttribute(key: string, value: boolean | number | string): this;
|
setAttribute(key: string, value?: (boolean | number | string)): void;
|
||||||
setAttributes(attributes: Record<string, boolean | number | string | undefined>): this;
|
|
||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -4251,13 +4140,6 @@ type AiSearchListItemsParams = {
|
|||||||
source?: string;
|
source?: string;
|
||||||
/** JSON-encoded Vectorize filter for metadata filtering. */
|
/** JSON-encoded Vectorize filter for metadata filtering. */
|
||||||
metadata_filter?: string;
|
metadata_filter?: string;
|
||||||
/** Filter items by their unique ID. Returns at most one item. */
|
|
||||||
item_id?: string;
|
|
||||||
/**
|
|
||||||
* Filter items by their exact key (object key / filename). Keys are unique
|
|
||||||
* per source, so combine with `source` to disambiguate across data sources.
|
|
||||||
*/
|
|
||||||
key?: string;
|
|
||||||
};
|
};
|
||||||
type AiSearchListItemsResponse = {
|
type AiSearchListItemsResponse = {
|
||||||
result: AiSearchItemInfo[];
|
result: AiSearchItemInfo[];
|
||||||
@@ -10155,163 +10037,6 @@ declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|||||||
inputs: ChatCompletionsInput;
|
inputs: ChatCompletionsInput;
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
postProcessedOutputs: ChatCompletionsOutput;
|
||||||
}
|
}
|
||||||
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_2 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input {
|
|
||||||
/**
|
|
||||||
* Which Moondream skill to run.
|
|
||||||
*/
|
|
||||||
task?: "query" | "caption" | "point" | "detect";
|
|
||||||
/**
|
|
||||||
* Input image as a public HTTPS URL or base64 data URI. Optional for `query`; required for `caption`, `point`, and `detect`.
|
|
||||||
*/
|
|
||||||
image?: string;
|
|
||||||
/**
|
|
||||||
* Question for the `query` task.
|
|
||||||
*/
|
|
||||||
question?: string;
|
|
||||||
/**
|
|
||||||
* Caption length for the `caption` task.
|
|
||||||
*/
|
|
||||||
caption_length?: "short" | "normal" | "long";
|
|
||||||
/**
|
|
||||||
* Object phrase to locate for `point` and `detect` tasks (e.g. 'person wearing a red shirt').
|
|
||||||
*/
|
|
||||||
target?: string;
|
|
||||||
/**
|
|
||||||
* Enable reasoning trace for the `query` task.
|
|
||||||
*/
|
|
||||||
reasoning?: boolean;
|
|
||||||
/**
|
|
||||||
* Sampling temperature.
|
|
||||||
*/
|
|
||||||
temperature?: number;
|
|
||||||
/**
|
|
||||||
* Top-p (nucleus) sampling.
|
|
||||||
*/
|
|
||||||
top_p?: number;
|
|
||||||
/**
|
|
||||||
* Max tokens to generate for `query` and `caption`.
|
|
||||||
*/
|
|
||||||
max_tokens?: number;
|
|
||||||
/**
|
|
||||||
* Max objects to return for `point` and `detect`.
|
|
||||||
*/
|
|
||||||
max_objects?: number;
|
|
||||||
/**
|
|
||||||
* Return incremental tokens for `query` and `caption`. `point` and `detect` do not support streaming.
|
|
||||||
*/
|
|
||||||
stream?: boolean;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output {
|
|
||||||
/**
|
|
||||||
* Reason the generation finished.
|
|
||||||
*/
|
|
||||||
finish_reason: string;
|
|
||||||
metrics: {
|
|
||||||
/**
|
|
||||||
* Number of input tokens consumed.
|
|
||||||
*/
|
|
||||||
input_tokens: number;
|
|
||||||
/**
|
|
||||||
* Number of output tokens generated.
|
|
||||||
*/
|
|
||||||
output_tokens: number;
|
|
||||||
/**
|
|
||||||
* Prefill time in milliseconds.
|
|
||||||
*/
|
|
||||||
prefill_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Decode time in milliseconds.
|
|
||||||
*/
|
|
||||||
decode_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Time to first token in milliseconds.
|
|
||||||
*/
|
|
||||||
ttft_ms: number;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Answer text for the `query` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
answer?: string;
|
|
||||||
/**
|
|
||||||
* Caption text for the `caption` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
caption?: string;
|
|
||||||
/**
|
|
||||||
* Located points for the `point` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
points?: {
|
|
||||||
/**
|
|
||||||
* X coordinate.
|
|
||||||
*/
|
|
||||||
x: number;
|
|
||||||
/**
|
|
||||||
* Y coordinate.
|
|
||||||
*/
|
|
||||||
y: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Detected bounding boxes for the `detect` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
objects?: {
|
|
||||||
/**
|
|
||||||
* Minimum X coordinate.
|
|
||||||
*/
|
|
||||||
x_min: number;
|
|
||||||
/**
|
|
||||||
* Minimum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_min: number;
|
|
||||||
/**
|
|
||||||
* Maximum X coordinate.
|
|
||||||
*/
|
|
||||||
x_max: number;
|
|
||||||
/**
|
|
||||||
* Maximum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_max: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Reasoning trace for the `query` task when reasoning=true. Null otherwise.
|
|
||||||
*/
|
|
||||||
reasoning?: {
|
|
||||||
/**
|
|
||||||
* Reasoning text.
|
|
||||||
*/
|
|
||||||
text: string;
|
|
||||||
/**
|
|
||||||
* Grounding information.
|
|
||||||
*/
|
|
||||||
grounding?: {}[];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B {
|
|
||||||
inputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input;
|
|
||||||
postProcessedOutputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Qwen_Qwen3_8_27B {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3_Flash {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface AiModels {
|
interface AiModels {
|
||||||
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
||||||
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
||||||
@@ -10404,13 +10129,6 @@ interface AiModels {
|
|||||||
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
||||||
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
||||||
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
||||||
"@cf/moonshotai/kimi-k2.7-code": Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code;
|
|
||||||
"@cf/zai-org/glm-5.2": Base_Ai_Cf_Zai_Org_Glm_5_2;
|
|
||||||
"@cf/moondream/moondream3.1-9B-A2B": Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-flash-0731": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-pro-0813": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813;
|
|
||||||
"@cf/qwen/qwen3.8-27b": Base_Ai_Cf_Qwen_Qwen3_8_27B;
|
|
||||||
"@cf/zai-org/glm-5.3-flash": Base_Ai_Cf_Zai_Org_Glm_5_3_Flash;
|
|
||||||
}
|
}
|
||||||
type AiOptions = {
|
type AiOptions = {
|
||||||
/**
|
/**
|
||||||
@@ -11077,15 +10795,6 @@ interface BrowserRunBaseOptions {
|
|||||||
*/
|
*/
|
||||||
cacheTTL?: number;
|
cacheTTL?: number;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Backend selection, mixed into the options of the quick actions that support it.
|
|
||||||
* Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
|
|
||||||
* reject an alternate backend, so they must not accept the field.
|
|
||||||
*/
|
|
||||||
interface BrowserRunAlternateBackendOptions {
|
|
||||||
/** Render with an alternate browser backend instead of the default one. */
|
|
||||||
browser?: 'kitesurf';
|
|
||||||
}
|
|
||||||
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
||||||
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
||||||
/** URL to navigate to, e.g. `"https://example.com"`. */
|
/** URL to navigate to, e.g. `"https://example.com"`. */
|
||||||
@@ -11120,7 +10829,7 @@ type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
|
|||||||
scrollPage?: boolean;
|
scrollPage?: boolean;
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
||||||
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
||||||
pdfOptions?: {
|
pdfOptions?: {
|
||||||
@@ -11156,7 +10865,7 @@ type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
|||||||
/** @default 30000 */
|
/** @default 30000 */
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
};
|
};
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
||||||
/** CSS selectors to scrape. At least one element is required. */
|
/** CSS selectors to scrape. At least one element is required. */
|
||||||
elements: Array<{
|
elements: Array<{
|
||||||
@@ -11169,29 +10878,10 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
|
|||||||
/** When true, exclude links pointing to external domains. @default false */
|
/** When true, exclude links pointing to external domains. @default false */
|
||||||
excludeExternalLinks?: boolean;
|
excludeExternalLinks?: boolean;
|
||||||
};
|
};
|
||||||
type BrowserRunSnapshotFormat = 'content' | 'screenshot' | 'markdown' | 'accessibilityTree';
|
|
||||||
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
||||||
/** Which representations of the page to return. At least two distinct formats
|
|
||||||
* are required; request a single format from its dedicated action instead.
|
|
||||||
* @default ["content","screenshot"]
|
|
||||||
*/
|
|
||||||
formats?: BrowserRunSnapshotFormat[];
|
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
||||||
};
|
};
|
||||||
/** Options for the `accessibilityTree` quick action. */
|
|
||||||
type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
|
|
||||||
/** When true, prune nodes that carry no semantic meaning, such as generic
|
|
||||||
* containers. Defaults to true, or to false when `root` is set so that the
|
|
||||||
* requested subtree is returned as-is.
|
|
||||||
*/
|
|
||||||
interestingOnly?: boolean;
|
|
||||||
/** CSS selector limiting the tree to the matching element's subtree.
|
|
||||||
* A selector that matches nothing yields `accessibilityTree: null` with
|
|
||||||
* HTTP 200; a malformed selector is an error.
|
|
||||||
*/
|
|
||||||
root?: string;
|
|
||||||
} & BrowserRunAlternateBackendOptions;
|
|
||||||
interface BrowserRunJsonBaseOptions {
|
interface BrowserRunJsonBaseOptions {
|
||||||
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
||||||
custom_ai?: Array<{
|
custom_ai?: Array<{
|
||||||
@@ -11205,7 +10895,7 @@ interface BrowserRunJsonBaseOptions {
|
|||||||
* Options for the `json` quick action.
|
* Options for the `json` quick action.
|
||||||
* At least one of `prompt` or `response_format` must be provided.
|
* At least one of `prompt` or `response_format` must be provided.
|
||||||
*/
|
*/
|
||||||
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions & BrowserRunJsonBaseOptions & ({
|
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunJsonBaseOptions & ({
|
||||||
/** Natural-language prompt describing what data to extract. */
|
/** Natural-language prompt describing what data to extract. */
|
||||||
prompt: string;
|
prompt: string;
|
||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
@@ -11216,80 +10906,14 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBacken
|
|||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
response_format: AiTextGenerationResponseFormat;
|
response_format: AiTextGenerationResponseFormat;
|
||||||
});
|
});
|
||||||
type BrowserRunContentOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunContentOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunMarkdownOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunRedirectHop = {
|
|
||||||
/** URL that returned the redirect. */
|
|
||||||
url: string;
|
|
||||||
/** HTTP status of the redirect. */
|
|
||||||
status: number;
|
|
||||||
/** Redirect response headers, including `location`. */
|
|
||||||
headers: Record<string, string>;
|
|
||||||
};
|
|
||||||
type BrowserRunResponseMeta = {
|
type BrowserRunResponseMeta = {
|
||||||
/** HTTP status code of the rendered page */
|
/** HTTP status code of the rendered page */
|
||||||
status: number;
|
status: number;
|
||||||
/** Page title */
|
/** Page title */
|
||||||
title: string;
|
title: string;
|
||||||
/** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
/** URL that served the response, after any redirects the browser followed. */
|
|
||||||
finalUrl?: string;
|
|
||||||
/** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
|
|
||||||
redirectChain?: BrowserRunRedirectHop[];
|
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* A node in the page's accessibility tree, as exposed to assistive technology.
|
|
||||||
* `role` is the only field always present; the rest are populated when the
|
|
||||||
* underlying element defines them.
|
|
||||||
* @see https://pptr.dev/api/puppeteer.serializedaxnode
|
|
||||||
*/
|
|
||||||
interface BrowserRunSerializedAXNode {
|
|
||||||
/** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
|
|
||||||
role: string;
|
|
||||||
/** The `aria-autocomplete` value. */
|
|
||||||
autocomplete?: string;
|
|
||||||
/** Checked state of a checkbox, radio, or menu item. */
|
|
||||||
checked?: boolean | 'mixed';
|
|
||||||
/** Accessible description, typically from `aria-describedby` or `title`. */
|
|
||||||
description?: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
expanded?: boolean;
|
|
||||||
/** Whether the element currently holds keyboard focus. */
|
|
||||||
focused?: boolean;
|
|
||||||
/** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
|
|
||||||
haspopup?: string;
|
|
||||||
/** The `aria-invalid` value. */
|
|
||||||
invalid?: string;
|
|
||||||
/** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
|
|
||||||
keyshortcuts?: string;
|
|
||||||
/** Hierarchical level, e.g. the heading level of an `<h2>`. */
|
|
||||||
level?: number;
|
|
||||||
/** Whether the element is a modal dialog. */
|
|
||||||
modal?: boolean;
|
|
||||||
/** Whether a text input accepts multiple lines. */
|
|
||||||
multiline?: boolean;
|
|
||||||
/** Whether more than one option can be selected. */
|
|
||||||
multiselectable?: boolean;
|
|
||||||
/** Accessible name, e.g. a button's label or an image's alt text. */
|
|
||||||
name?: string;
|
|
||||||
orientation?: string;
|
|
||||||
/** Pressed state of a toggle button. */
|
|
||||||
pressed?: boolean | 'mixed';
|
|
||||||
readonly?: boolean;
|
|
||||||
required?: boolean;
|
|
||||||
/** Author-supplied role description, from `aria-roledescription`. */
|
|
||||||
roledescription?: string;
|
|
||||||
selected?: boolean;
|
|
||||||
/** Current value of an input or range element. */
|
|
||||||
value?: string | number;
|
|
||||||
valuemax?: number;
|
|
||||||
valuemin?: number;
|
|
||||||
/** Human-readable form of `value`, from `aria-valuetext`. */
|
|
||||||
valuetext?: string;
|
|
||||||
/** Child nodes. Absent for leaf nodes. */
|
|
||||||
children?: BrowserRunSerializedAXNode[];
|
|
||||||
}
|
|
||||||
/** Success response for `content` action. */
|
/** Success response for `content` action. */
|
||||||
type BrowserRunContentSuccessResponse = {
|
type BrowserRunContentSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
@@ -11302,7 +10926,6 @@ type BrowserRunLinksSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** Extracted links */
|
/** Extracted links */
|
||||||
result: string[];
|
result: string[];
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `scrape` action. */
|
/** Success response for `scrape` action. */
|
||||||
type BrowserRunScrapeSuccessResponse = {
|
type BrowserRunScrapeSuccessResponse = {
|
||||||
@@ -11333,33 +10956,15 @@ type BrowserRunScrapeSuccessResponse = {
|
|||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `snapshot` action. Each field is present only when the
|
/** Success response for `snapshot` action. */
|
||||||
* corresponding entry was requested in `formats`.
|
|
||||||
*/
|
|
||||||
type BrowserRunSnapshotSuccessResponse = {
|
type BrowserRunSnapshotSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
result: {
|
result: {
|
||||||
/** HTML content of the page. */
|
/** HTML content of the page. */
|
||||||
content?: string;
|
content: string;
|
||||||
/** Base64-encoded screenshot image. */
|
/** Base64-encoded screenshot image. */
|
||||||
screenshot?: string;
|
screenshot: string;
|
||||||
/** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
|
|
||||||
* page provides that metadata.
|
|
||||||
*/
|
|
||||||
markdown?: string;
|
|
||||||
/** Root of the page's accessibility tree. */
|
|
||||||
accessibilityTree?: BrowserRunSerializedAXNode;
|
|
||||||
};
|
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
|
||||||
/** Success response for `accessibilityTree` action. */
|
|
||||||
type BrowserRunAccessibilityTreeSuccessResponse = {
|
|
||||||
success: true;
|
|
||||||
result: {
|
|
||||||
/** Root of the accessibility tree, or `null` when `root` matched no element. */
|
|
||||||
accessibilityTree: BrowserRunSerializedAXNode | null;
|
|
||||||
};
|
};
|
||||||
meta: BrowserRunResponseMeta;
|
meta: BrowserRunResponseMeta;
|
||||||
};
|
};
|
||||||
@@ -11368,14 +10973,12 @@ type BrowserRunJsonSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** JSON data extracted from the page using an AI model */
|
/** JSON data extracted from the page using an AI model */
|
||||||
result: Record<string, unknown>;
|
result: Record<string, unknown>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `markdown` action. */
|
/** Success response for `markdown` action. */
|
||||||
type BrowserRunMarkdownSuccessResponse = {
|
type BrowserRunMarkdownSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
/** Extracted markdown content */
|
/** Extracted markdown content */
|
||||||
result: string;
|
result: string;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Error response for BrowserRun actions. */
|
/** Error response for BrowserRun actions. */
|
||||||
type BrowserRunErrorResponse = {
|
type BrowserRunErrorResponse = {
|
||||||
@@ -11485,10 +11088,9 @@ declare abstract class BrowserRun {
|
|||||||
*/
|
*/
|
||||||
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
||||||
/**
|
/**
|
||||||
* Get several representations of a web page in one request.
|
* Get both the HTML content and a base64-encoded screenshot of a web page.
|
||||||
* @param action - Must be `'snapshot'`.
|
* @param action - Must be `'snapshot'`.
|
||||||
* @param options - Snapshot options including the `formats` to return and
|
* @param options - Snapshot options including screenshot settings (encoding is always base64).
|
||||||
* screenshot settings (encoding is always base64).
|
|
||||||
* @returns A `Response` containing one of:
|
* @returns A `Response` containing one of:
|
||||||
*
|
*
|
||||||
* **Success (HTTP 200):**
|
* **Success (HTTP 200):**
|
||||||
@@ -11536,26 +11138,6 @@ declare abstract class BrowserRun {
|
|||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
||||||
*/
|
*/
|
||||||
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
||||||
/**
|
|
||||||
* Get the accessibility tree of a web page.
|
|
||||||
* @param action - Must be `'accessibilityTree'`.
|
|
||||||
* @param options - Options to scope the tree to a subtree and to control
|
|
||||||
* whether semantically uninteresting nodes are pruned.
|
|
||||||
* @returns A `Response` containing one of:
|
|
||||||
*
|
|
||||||
* **Success (HTTP 200):**
|
|
||||||
* - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
|
|
||||||
* - `result.accessibilityTree` is `null` when `root` matched no element
|
|
||||||
*
|
|
||||||
* **Error:**
|
|
||||||
* - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
|
|
||||||
* - HTTP 422 for a malformed `root` selector
|
|
||||||
* - HTTP 500 with code `2017` or `2018` when the tree could not be built
|
|
||||||
*
|
|
||||||
* **Headers:**
|
|
||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
|
||||||
*/
|
|
||||||
quickAction(action: 'accessibilityTree', options: BrowserRunAccessibilityTreeOptions): Promise<Response>;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* In addition to the properties you can set in the RequestInit dict
|
* In addition to the properties you can set in the RequestInit dict
|
||||||
@@ -12626,13 +12208,6 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|||||||
* @returns A promise that resolves when the email message is replied.
|
* @returns A promise that resolves when the email message is replied.
|
||||||
*/
|
*/
|
||||||
reply(message: EmailMessage): Promise<EmailSendResult>;
|
reply(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
/**
|
|
||||||
* Reply to the sender of this email message with a message built from the given
|
|
||||||
* fields. Threading headers (In-Reply-To/References) are set automatically.
|
|
||||||
* @param builder The reply message contents.
|
|
||||||
* @returns A promise that resolves when the email message is replied.
|
|
||||||
*/
|
|
||||||
reply(builder: EmailReplyMessageBuilder): Promise<EmailSendResult>;
|
|
||||||
}
|
}
|
||||||
/** A file attachment for an email message */
|
/** A file attachment for an email message */
|
||||||
type EmailAttachment = {
|
type EmailAttachment = {
|
||||||
@@ -12653,46 +12228,23 @@ interface EmailAddress {
|
|||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Recipient fields for `SendEmail.send()`. At least one of `to`, `cc`, or
|
|
||||||
* `bcc` must be provided.
|
|
||||||
*/
|
|
||||||
type EmailDestinations = {
|
|
||||||
to?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
cc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} & ({
|
|
||||||
to: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
cc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
bcc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* Fields shared by all composed emails (no recipients). Used directly by
|
|
||||||
* `ForwardableEmailMessage.reply()`, which always replies to the original
|
|
||||||
* sender, and extended by `EmailMessageBuilder` for `SendEmail.send()`.
|
|
||||||
*/
|
|
||||||
interface EmailReplyMessageBuilder {
|
|
||||||
from: string | EmailAddress;
|
|
||||||
subject: string;
|
|
||||||
replyTo?: string | EmailAddress;
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
text?: string;
|
|
||||||
html?: string;
|
|
||||||
attachments?: EmailAttachment[];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Fields for composing an email without constructing raw MIME, for
|
|
||||||
* `SendEmail.send()`. Requires at least one of `to`, `cc`, or `bcc`.
|
|
||||||
*/
|
|
||||||
type EmailMessageBuilder = EmailReplyMessageBuilder & EmailDestinations;
|
|
||||||
/**
|
/**
|
||||||
* A binding that allows a Worker to send email messages.
|
* A binding that allows a Worker to send email messages.
|
||||||
*/
|
*/
|
||||||
interface SendEmail {
|
interface SendEmail {
|
||||||
send(message: EmailMessage): Promise<EmailSendResult>;
|
send(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
send(builder: EmailMessageBuilder): Promise<EmailSendResult>;
|
send(builder: {
|
||||||
|
from: string | EmailAddress;
|
||||||
|
to: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
subject: string;
|
||||||
|
replyTo?: string | EmailAddress;
|
||||||
|
cc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
headers?: Record<string, string>;
|
||||||
|
text?: string;
|
||||||
|
html?: string;
|
||||||
|
attachments?: EmailAttachment[];
|
||||||
|
}): Promise<EmailSendResult>;
|
||||||
}
|
}
|
||||||
declare abstract class EmailEvent extends ExtendableEvent {
|
declare abstract class EmailEvent extends ExtendableEvent {
|
||||||
readonly message: ForwardableEmailMessage;
|
readonly message: ForwardableEmailMessage;
|
||||||
@@ -12846,15 +12398,6 @@ interface Hyperdrive {
|
|||||||
* for your database.
|
* for your database.
|
||||||
*/
|
*/
|
||||||
readonly host: string;
|
readonly host: string;
|
||||||
/*
|
|
||||||
* A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
|
|
||||||
* host field, is only valid within the context of the currently running
|
|
||||||
* Worker and, when passed into the `connect()` function from the
|
|
||||||
* "cloudflare:sockets" module, will connect to the Hyperdrive instance for
|
|
||||||
* your database. This is provided for database drivers that require the host
|
|
||||||
* to be an IP literal rather than a hostname.
|
|
||||||
*/
|
|
||||||
readonly ip: string;
|
|
||||||
/*
|
/*
|
||||||
* The port that must be paired the the host field when connecting.
|
* The port that must be paired the the host field when connecting.
|
||||||
*/
|
*/
|
||||||
@@ -12876,78 +12419,6 @@ interface Hyperdrive {
|
|||||||
*/
|
*/
|
||||||
readonly database: string;
|
readonly database: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* A handle to a dynamically-provisioned Hyperdrive connection, returned by
|
|
||||||
* `HyperdriveApi.get()`.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamic extends Disposable {
|
|
||||||
/**
|
|
||||||
* The database name to use when connecting through this Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly database: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated user to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly user: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated password to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly password: Promise<string>;
|
|
||||||
/**
|
|
||||||
* Open a TCP socket to the target database through this Hyperdrive.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
connect(): Promise<Socket>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Binding that provisions Hyperdrive connections at request time, rather than
|
|
||||||
* from static configuration.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicApi {
|
|
||||||
/**
|
|
||||||
* Provision a connection for the database described by `args`.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
|
|
||||||
/**
|
|
||||||
* Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
|
|
||||||
*/
|
|
||||||
getHyperdriveConnectionString(connectionString: string): Promise<string>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Parameters identifying the database that a dynamically-provisioned
|
|
||||||
* Hyperdrive connection should target.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicConfig {
|
|
||||||
/**
|
|
||||||
* Generated connection string to pass into the dynamic worker.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
dynamicHyperdriveConnectionString: string;
|
|
||||||
/**
|
|
||||||
* Connection string for the origin database Hyperdrive should connect to.
|
|
||||||
* Contains credentials, so treat it as a secret.
|
|
||||||
*
|
|
||||||
* The scheme selects the database engine. PostgreSQL origins are supported.
|
|
||||||
*/
|
|
||||||
connectionString: string;
|
|
||||||
/**
|
|
||||||
* Region in which to place the connection pool. See the Hyperdrive
|
|
||||||
* documentation for the set of supported regions.
|
|
||||||
*/
|
|
||||||
targetRegion: string;
|
|
||||||
/**
|
|
||||||
* Whether Hyperdrive should cache query results for this connection.
|
|
||||||
*/
|
|
||||||
cachingEnabled?: boolean;
|
|
||||||
/**
|
|
||||||
* Maximum number of connections the pool may open to the origin database.
|
|
||||||
* Defaults to 60.
|
|
||||||
*/
|
|
||||||
maxConnections?: number;
|
|
||||||
}
|
|
||||||
// Copyright (c) 2024 Cloudflare, Inc.
|
// Copyright (c) 2024 Cloudflare, Inc.
|
||||||
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
||||||
// https://opensource.org/licenses/Apache-2.0
|
// https://opensource.org/licenses/Apache-2.0
|
||||||
@@ -12959,27 +12430,6 @@ type ImageInfoResponse = {
|
|||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* Parameters for rasterizing text into an image.
|
|
||||||
*/
|
|
||||||
type TextRasterize = {
|
|
||||||
/** The text content to render */
|
|
||||||
content: string;
|
|
||||||
/** rasterization options for the text **/
|
|
||||||
options: TextOptions;
|
|
||||||
};
|
|
||||||
type TextOptions = {
|
|
||||||
/** Font configuration */
|
|
||||||
font: {
|
|
||||||
/** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
/** Font size in points (pt) */
|
|
||||||
size?: number;
|
|
||||||
/** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
|
|
||||||
color?: string;
|
|
||||||
};
|
|
||||||
type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
|
|
||||||
type ImageTransform = {
|
type ImageTransform = {
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
@@ -13069,9 +12519,6 @@ interface ImageUploadOptions {
|
|||||||
requireSignedURLs?: boolean;
|
requireSignedURLs?: boolean;
|
||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
/**
|
|
||||||
* If 'base64', the input data will be decoded from base64 before processing
|
|
||||||
*/
|
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
}
|
}
|
||||||
interface ImageUpdateOptions {
|
interface ImageUpdateOptions {
|
||||||
@@ -13079,40 +12526,11 @@ interface ImageUpdateOptions {
|
|||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
}
|
}
|
||||||
type ImageMetadataFilterOperators = {
|
|
||||||
eq?: string | number | boolean;
|
|
||||||
in?: string[] | number[];
|
|
||||||
gt?: number;
|
|
||||||
gte?: number;
|
|
||||||
lt?: number;
|
|
||||||
lte?: number;
|
|
||||||
};
|
|
||||||
type ImageMetadataFilterValue = string | number | boolean | ImageMetadataFilterOperators;
|
|
||||||
interface ImageListFilter {
|
|
||||||
metadata?: Record<string, ImageMetadataFilterValue>;
|
|
||||||
}
|
|
||||||
interface ImageListOptions {
|
interface ImageListOptions {
|
||||||
limit?: number;
|
limit?: number;
|
||||||
cursor?: string;
|
cursor?: string;
|
||||||
sortOrder?: 'asc' | 'desc';
|
sortOrder?: 'asc' | 'desc';
|
||||||
creator?: string;
|
creator?: string;
|
||||||
filter?: ImageListFilter;
|
|
||||||
}
|
|
||||||
interface ImageSignedUrlOptions {
|
|
||||||
variant: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
keyName?: string;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadOptions {
|
|
||||||
id?: string;
|
|
||||||
requireSignedURLs?: boolean;
|
|
||||||
metadata?: Record<string, unknown>;
|
|
||||||
creator?: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadResult {
|
|
||||||
id: string;
|
|
||||||
uploadURL: string;
|
|
||||||
}
|
}
|
||||||
interface ImageList {
|
interface ImageList {
|
||||||
images: ImageMetadata[];
|
images: ImageMetadata[];
|
||||||
@@ -13130,13 +12548,6 @@ interface ImageHandle {
|
|||||||
* @returns ReadableStream of image bytes, or null if not found
|
* @returns ReadableStream of image bytes, or null if not found
|
||||||
*/
|
*/
|
||||||
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
||||||
/**
|
|
||||||
* Generate a signed delivery URL for this hosted image.
|
|
||||||
* @param options Signing configuration
|
|
||||||
* @returns A signed image delivery URL
|
|
||||||
* @throws {@link ImagesError} if signing fails
|
|
||||||
*/
|
|
||||||
signedUrl(options: ImageSignedUrlOptions): Promise<string>;
|
|
||||||
/**
|
/**
|
||||||
* Update hosted image metadata
|
* Update hosted image metadata
|
||||||
* @param options Properties to update
|
* @param options Properties to update
|
||||||
@@ -13172,14 +12583,6 @@ interface HostedImagesBinding {
|
|||||||
* @throws {@link ImagesError} if list fails
|
* @throws {@link ImagesError} if list fails
|
||||||
*/
|
*/
|
||||||
list(options?: ImageListOptions): Promise<ImageList>;
|
list(options?: ImageListOptions): Promise<ImageList>;
|
||||||
/**
|
|
||||||
* Create a Direct Creator Upload link, letting an end user upload an
|
|
||||||
* image straight to Cloudflare without exposing an API token
|
|
||||||
* @param options Upload link configuration
|
|
||||||
* @returns The new image ID and the upload URL to hand to the end user
|
|
||||||
* @throws {@link ImagesError} if creation fails
|
|
||||||
*/
|
|
||||||
createDirectUpload(options?: ImageDirectUploadOptions): Promise<ImageDirectUploadResult>;
|
|
||||||
}
|
}
|
||||||
interface ImagesBinding {
|
interface ImagesBinding {
|
||||||
/**
|
/**
|
||||||
@@ -13194,13 +12597,6 @@ interface ImagesBinding {
|
|||||||
* @returns A transform handle
|
* @returns A transform handle
|
||||||
*/
|
*/
|
||||||
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
||||||
/**
|
|
||||||
* Begin applying a series of transformations to text
|
|
||||||
* @param content string to be rendered
|
|
||||||
* @param options font, optional color and size to use in rendering text
|
|
||||||
* @returns A transform handle
|
|
||||||
*/
|
|
||||||
text(content: string, options: TextOptions): ImageTransformer;
|
|
||||||
/**
|
/**
|
||||||
* Access hosted images CRUD operations
|
* Access hosted images CRUD operations
|
||||||
*/
|
*/
|
||||||
@@ -13230,15 +12626,11 @@ interface ImageTransformer {
|
|||||||
type ImageTransformationOutputOptions = {
|
type ImageTransformationOutputOptions = {
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
};
|
};
|
||||||
type ImageTransformationResponseOptions = {
|
|
||||||
headers?: HeadersInit;
|
|
||||||
};
|
|
||||||
interface ImageTransformationResult {
|
interface ImageTransformationResult {
|
||||||
/**
|
/**
|
||||||
* The image as a response, ready to store in cache or return to users
|
* The image as a response, ready to store in cache or return to users
|
||||||
* @param options Options that apply to the returned response, e.g. additional headers
|
|
||||||
*/
|
*/
|
||||||
response(options?: ImageTransformationResponseOptions): Response;
|
response(): Response;
|
||||||
/**
|
/**
|
||||||
* The content type of the returned image
|
* The content type of the returned image
|
||||||
*/
|
*/
|
||||||
@@ -13674,11 +13066,6 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowDynamicDelayContext = {
|
|
||||||
ctx: WorkflowStepContext<WorkflowDelayFunction>;
|
|
||||||
error: Error;
|
|
||||||
};
|
|
||||||
export type WorkflowDelayFunction = (input: WorkflowDynamicDelayContext) => WorkflowDelayDuration | Promise<WorkflowDelayDuration>;
|
|
||||||
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
||||||
@@ -13686,32 +13073,12 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowStepConfig = {
|
export type WorkflowStepConfig = {
|
||||||
retries?: {
|
retries?: {
|
||||||
limit: number;
|
limit: number;
|
||||||
delay: WorkflowDelayDuration | number | WorkflowDelayFunction;
|
delay: WorkflowDelayDuration | number;
|
||||||
backoff?: WorkflowBackoff;
|
backoff?: WorkflowBackoff;
|
||||||
};
|
};
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
timeout?: WorkflowTimeoutDuration | number;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
// Internal discriminators used only for `WorkflowStep.do` overload
|
|
||||||
// resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
|
|
||||||
// single kind so the callback context can be narrowed based on the shape of
|
|
||||||
// the config argument (rather than on an inferred type parameter, which is
|
|
||||||
// lost when the caller supplies an explicit return-type argument). Not
|
|
||||||
// exported: they must not widen the public type surface.
|
|
||||||
type WorkflowStepConfigWithStaticDelay = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
type WorkflowStepConfigWithDelayFunction = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayFunction;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
||||||
export type WorkflowCronSchedule = {
|
export type WorkflowCronSchedule = {
|
||||||
/** Cron expression that triggered this event. */
|
/** Cron expression that triggered this event. */
|
||||||
@@ -13732,51 +13099,28 @@ declare namespace CloudflareWorkersModule {
|
|||||||
type: string;
|
type: string;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
export type WorkflowStepContext<Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepContext = {
|
||||||
step: {
|
step: {
|
||||||
name: string;
|
name: string;
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
attempt: number;
|
attempt: number;
|
||||||
config: {
|
config: WorkflowStepConfig;
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
} & (Delay extends WorkflowDelayFunction ? {} : {
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
});
|
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
|
||||||
sensitive?: WorkflowStepSensitivity;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
// The rollback handler receives the step context, so it mirrors the same
|
export type WorkflowRollbackContext<T = unknown> = {
|
||||||
// delay discriminant as the step callback: when the step was configured with
|
ctx: WorkflowStepContext;
|
||||||
// a dynamic delay function the resolved `config.retries.delay` is omitted,
|
|
||||||
// otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
|
|
||||||
// overload that matched the step config.
|
|
||||||
export type WorkflowRollbackContext<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
||||||
ctx: WorkflowStepContext<Delay>;
|
|
||||||
error: Error;
|
error: Error;
|
||||||
output: T | undefined;
|
output: T | undefined;
|
||||||
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
||||||
stepName: string;
|
stepName: string;
|
||||||
};
|
};
|
||||||
export type WorkflowRollbackHandler<T = unknown, Delay = WorkflowDelayDuration | number> = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
|
export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
|
||||||
export type WorkflowStepRollbackOptions<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepRollbackOptions<T = unknown> = {
|
||||||
rollback: WorkflowRollbackHandler<T, Delay>;
|
rollback: WorkflowRollbackHandler<T>;
|
||||||
rollbackConfig?: WorkflowStepRollbackConfig;
|
rollbackConfig?: WorkflowStepRollbackConfig;
|
||||||
};
|
};
|
||||||
export abstract class WorkflowStep {
|
export abstract class WorkflowStep {
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
// The config overloads discriminate on the shape of `config.retries.delay`
|
|
||||||
// so the callback context reflects whether the resolved delay is present
|
|
||||||
// (static delay) or omitted (dynamic delay function). Each has a single
|
|
||||||
// type parameter, so an explicit return-type argument (`do<T>(...)`) still
|
|
||||||
// resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
|
|
||||||
// fallback MUST remain last, otherwise it shadows the discriminating
|
|
||||||
// overloads and narrowing is silently lost.
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithDelayFunction, callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithStaticDelay, callback: (ctx: WorkflowStepContext<WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayDuration | number>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
||||||
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
||||||
@@ -14552,12 +13896,11 @@ type MarkdownDocument = {
|
|||||||
name: string;
|
name: string;
|
||||||
blob: Blob;
|
blob: Blob;
|
||||||
};
|
};
|
||||||
type OutputFormat = 'markdown' | 'text';
|
|
||||||
type ConversionResponse = {
|
type ConversionResponse = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
mimeType: string;
|
mimeType: string;
|
||||||
format: OutputFormat;
|
format: 'markdown';
|
||||||
tokens: number;
|
tokens: number;
|
||||||
data: string;
|
data: string;
|
||||||
} | {
|
} | {
|
||||||
@@ -14574,11 +13917,7 @@ type EmbeddedImageConversionOptions = ImageConversionOptions & {
|
|||||||
convert?: boolean;
|
convert?: boolean;
|
||||||
maxConvertedImages?: number;
|
maxConvertedImages?: number;
|
||||||
};
|
};
|
||||||
type ConversionOutputOptions = {
|
|
||||||
format?: OutputFormat;
|
|
||||||
};
|
|
||||||
type ConversionOptions = {
|
type ConversionOptions = {
|
||||||
output?: ConversionOutputOptions;
|
|
||||||
html?: {
|
html?: {
|
||||||
images?: EmbeddedImageConversionOptions & {
|
images?: EmbeddedImageConversionOptions & {
|
||||||
convertOGImage?: boolean;
|
convertOGImage?: boolean;
|
||||||
@@ -14673,7 +14012,7 @@ declare namespace TailStream {
|
|||||||
interface ConnectEventInfo {
|
interface ConnectEventInfo {
|
||||||
readonly type: "connect";
|
readonly type: "connect";
|
||||||
}
|
}
|
||||||
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime" | "aborted";
|
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime";
|
||||||
interface ScriptVersion {
|
interface ScriptVersion {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly tag?: string;
|
readonly tag?: string;
|
||||||
@@ -14692,7 +14031,6 @@ declare namespace TailStream {
|
|||||||
readonly dispatchNamespace?: string;
|
readonly dispatchNamespace?: string;
|
||||||
readonly entrypoint?: string;
|
readonly entrypoint?: string;
|
||||||
readonly executionModel: string;
|
readonly executionModel: string;
|
||||||
readonly durableObjectId?: string;
|
|
||||||
readonly scriptName?: string;
|
readonly scriptName?: string;
|
||||||
readonly scriptTags?: string[];
|
readonly scriptTags?: string[];
|
||||||
readonly scriptVersion?: ScriptVersion;
|
readonly scriptVersion?: ScriptVersion;
|
||||||
@@ -14727,22 +14065,11 @@ declare namespace TailStream {
|
|||||||
readonly message: string;
|
readonly message: string;
|
||||||
readonly stack?: string;
|
readonly stack?: string;
|
||||||
}
|
}
|
||||||
interface TailStreamErrorInfo {
|
interface Log {
|
||||||
readonly name: string;
|
|
||||||
readonly message: string;
|
|
||||||
readonly stack?: string;
|
|
||||||
}
|
|
||||||
type Log = {
|
|
||||||
readonly type: "log";
|
readonly type: "log";
|
||||||
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
||||||
readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
|
|
||||||
} & ({
|
|
||||||
readonly message: object;
|
readonly message: object;
|
||||||
readonly truncated?: false;
|
}
|
||||||
} | {
|
|
||||||
readonly message: string;
|
|
||||||
readonly truncated: true;
|
|
||||||
});
|
|
||||||
interface DroppedEventsDiagnostic {
|
interface DroppedEventsDiagnostic {
|
||||||
readonly diagnosticsType: "droppedEvents";
|
readonly diagnosticsType: "droppedEvents";
|
||||||
readonly count: number;
|
readonly count: number;
|
||||||
@@ -15220,31 +14547,10 @@ declare abstract class Workflow<PARAMS = unknown> {
|
|||||||
* @returns A promise that resolves with a list of handles for the created instances.
|
* @returns A promise that resolves with a list of handles for the created instances.
|
||||||
*/
|
*/
|
||||||
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
||||||
/**
|
|
||||||
* Delete a batch of Workflow instances and their stored state.
|
|
||||||
* `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
|
|
||||||
* The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
|
|
||||||
* @param instanceIds IDs of the Workflow instances to delete
|
|
||||||
* @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
|
|
||||||
*/
|
|
||||||
public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
|
|
||||||
}
|
}
|
||||||
type WorkflowBatchDeleteResult = {
|
|
||||||
deleted: {
|
|
||||||
id: string;
|
|
||||||
}[];
|
|
||||||
errors: {
|
|
||||||
id: string;
|
|
||||||
code: number;
|
|
||||||
message: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
/** Geographic regions supported when creating a Workflow instance.
|
|
||||||
* Location hints are best-effort placement preferences. */
|
|
||||||
type WorkflowInstanceLocationHint = 'wnam' | 'enam' | 'sam' | 'weur' | 'eeur' | 'apac' | 'apac-ne' | 'apac-se' | 'oc' | 'afr' | 'me';
|
|
||||||
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
||||||
/**
|
/**
|
||||||
* An id for your Workflow instance. Must be unique within the Workflow.
|
* An id for your Workflow instance. Must be unique within the Workflow.
|
||||||
@@ -15262,9 +14568,6 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|||||||
successRetention?: WorkflowRetentionDuration;
|
successRetention?: WorkflowRetentionDuration;
|
||||||
errorRetention?: WorkflowRetentionDuration;
|
errorRetention?: WorkflowRetentionDuration;
|
||||||
};
|
};
|
||||||
/** A best-effort geographic placement preference for the Workflow instance.
|
|
||||||
* See `WorkflowInstanceLocationHint` for supported regions. */
|
|
||||||
locationHint?: WorkflowInstanceLocationHint;
|
|
||||||
}
|
}
|
||||||
type InstanceStatus = {
|
type InstanceStatus = {
|
||||||
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
||||||
@@ -15282,13 +14585,6 @@ interface WorkflowError {
|
|||||||
code?: number;
|
code?: number;
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
interface WorkflowInstanceTerminateOptions {
|
|
||||||
/**
|
|
||||||
* If true, run registered rollback handlers before terminating the instance.
|
|
||||||
* Only steps that registered rollback handlers are rolled back.
|
|
||||||
*/
|
|
||||||
rollback?: boolean;
|
|
||||||
}
|
|
||||||
interface WorkflowInstanceRestartOptions {
|
interface WorkflowInstanceRestartOptions {
|
||||||
/**
|
/**
|
||||||
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
||||||
@@ -15322,19 +14618,14 @@ declare abstract class WorkflowInstance {
|
|||||||
public resume(): Promise<void>;
|
public resume(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
||||||
* @param options Options for termination, including whether registered rollback handlers should run.
|
|
||||||
*/
|
*/
|
||||||
public terminate(options?: WorkflowInstanceTerminateOptions): Promise<void>;
|
public terminate(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Restart the instance. Optionally restart from a specific step, preserving
|
* Restart the instance. Optionally restart from a specific step, preserving
|
||||||
* cached results for all steps before it.
|
* cached results for all steps before it.
|
||||||
* @param options Options for the restart, including an optional step to restart from.
|
* @param options Options for the restart, including an optional step to restart from.
|
||||||
*/
|
*/
|
||||||
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
||||||
/**
|
|
||||||
* Delete the instance and its stored state.
|
|
||||||
*/
|
|
||||||
public delete(): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Returns the current status of the instance.
|
* Returns the current status of the instance.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -32,6 +32,13 @@
|
|||||||
"bucket_name": "recflare-cdn"
|
"bucket_name": "recflare-cdn"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
// Per-player settings KV (playersettings). "local" id replaced at deploy.
|
||||||
|
"kv_namespaces": [
|
||||||
|
{
|
||||||
|
"binding": "RECFLARE_PLAYER_SETTINGS",
|
||||||
|
"id": "local"
|
||||||
|
}
|
||||||
|
],
|
||||||
// Notifications hub. The class ships IN this worker (re-exported from notify), so it
|
// Notifications hub. The class ships IN this worker (re-exported from notify), so it
|
||||||
// is bound locally (no script_name) and migrated here.
|
// is bound locally (no script_name) and migrated here.
|
||||||
"durable_objects": {
|
"durable_objects": {
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ Player-settings worker served on the `playersettings` subdomain.
|
|||||||
|
|
||||||
- `GET /` — service status `{ "service": "playersettings", "status": "ok" }`.
|
- `GET /` — service status `{ "service": "playersettings", "status": "ok" }`.
|
||||||
- `GET /playersettings` — `[Authorize]`. The player's settings as
|
- `GET /playersettings` — `[Authorize]`. The player's settings as
|
||||||
`{ PlayerId, Key, Value }`, read from the player's stored map. On a player's
|
`{ PlayerId, Key, Value }`, read from the per-player KV map. On a player's
|
||||||
first read it seeds (and persists) the default settings.
|
first read it seeds (and persists) the default settings.
|
||||||
- `PUT /playersettings` — `[Authorize]`. Accepts a form-urlencoded
|
- `PUT /playersettings` — `[Authorize]`. Accepts a form-urlencoded
|
||||||
`key=…&value=…` (or a JSON `{key,value}` / array) and **upserts** it into the
|
`key=…&value=…` (or a JSON `{key,value}` / array) and **upserts** it into the
|
||||||
player's settings, keyed by the `sub` claim of the Bearer JWT. Returns `200`.
|
player's settings, keyed by the `sub` claim of the Bearer JWT. Returns `200`.
|
||||||
Persisted in the `player_settings` D1 table (one JSON row per player).
|
Persisted in Workers KV (`RECFLARE_PLAYER_SETTINGS`, key `player:<id>`).
|
||||||
- `DELETE /playersettings` — `[Authorize]`. Removes a setting from the player's
|
- `DELETE /playersettings` — `[Authorize]`. Removes a setting from the player's
|
||||||
map. The client sends a bare form-urlencoded `key=PlayerShoppingBagId` (no
|
map. The client sends a bare form-urlencoded `key=PlayerShoppingBagId` (no
|
||||||
`value`); a JSON body and a `?key=` query param are also read. Deleting a key
|
`value`); a JSON body and a `?key=` query param are also read. Deleting a key
|
||||||
@@ -22,24 +22,19 @@ Player-settings worker served on the `playersettings` subdomain.
|
|||||||
> Emptying the map with DELETE puts the player back to a first read: the next
|
> Emptying the map with DELETE puts the player back to a first read: the next
|
||||||
> `GET` re-seeds the defaults.
|
> `GET` re-seeds the defaults.
|
||||||
|
|
||||||
## Storage
|
> Keys under `Growth.YIR.` (the client's Year-In-Review telemetry — distance
|
||||||
|
> drawn, time with friends, …) and `MakerPenSessionCount` are **dropped** on
|
||||||
|
> `PUT`, not stored. The client posts them with a new value every time, so they
|
||||||
|
> were over half of all writes and nothing reads them. Real maker pen preferences
|
||||||
|
> (`MakerPen_SnappingMode`, …) are kept. See `IGNORED_SETTING_KEYS` /
|
||||||
|
> `IGNORED_SETTING_PREFIXES` in `default-settings.ts`.
|
||||||
|
|
||||||
Settings live in the `player_settings` table on the shared `recflare` D1: one row per
|
## KV namespace
|
||||||
player, `account_id` plus `data`, the whole map as a JSON object of strings
|
|
||||||
(`{"Recroom.OOBE":"77","TUTORIAL_COMPLETE_MASK":"11"}`). This worker owns the table
|
|
||||||
(`migrations/0001_player_settings.sql`, applied under its own `d1_migrations_playersettings`
|
|
||||||
ledger); the `api`, `match` and `chat` workers each keep a key of their own in the same map
|
|
||||||
through `@repo/domain`'s `player-settings-db`, which is why every writer merges rather than
|
|
||||||
replaces. A write that changes nothing is skipped.
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
just migrate -F playersettings # create the table (add -- --local for the dev db)
|
wrangler kv namespace create RECFLARE_PLAYER_SETTINGS # then put the id in .env under RECFLARE_KV (see .env.example)
|
||||||
```
|
```
|
||||||
|
|
||||||
They used to live in a Workers KV namespace (`RECFLARE_PLAYER_SETTINGS`, key `player:<id>`).
|
|
||||||
A deployment from then copies it across once with `just settings-import-kv --remote` —
|
|
||||||
see CLI.md — after which the namespace can be deleted.
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
### Run in dev mode
|
### Run in dev mode
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
-- Per-player settings: the key/value bag the game client reads on load and writes back
|
|
||||||
-- as the player toggles options. Generated from packages/domain/src/player-settings-db.ts
|
|
||||||
-- (PLAYER_SETTINGS_SCHEMA_DDL) — keep in sync.
|
|
||||||
--
|
|
||||||
-- One row per player. `data` is the whole map as a JSON object of strings
|
|
||||||
-- (`{"Recroom.OOBE":"77","TUTORIAL_COMPLETE_MASK":"11"}`) — the same value the
|
|
||||||
-- RECFLARE_PLAYER_SETTINGS KV namespace used to hold under `player:<id>`, which is what
|
|
||||||
-- `runx admin settings-import-kv` copies across. Every writer (this worker, api, match,
|
|
||||||
-- chat) merges into the object rather than replacing it.
|
|
||||||
CREATE TABLE IF NOT EXISTS player_settings (
|
|
||||||
account_id INTEGER PRIMARY KEY,
|
|
||||||
data TEXT NOT NULL
|
|
||||||
);
|
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
"deploy": "run-wrangler-deploy",
|
"deploy": "run-wrangler-deploy",
|
||||||
"dev": "run-wrangler-dev",
|
"dev": "run-wrangler-dev",
|
||||||
"fix:workers-types": "run-wrangler-types",
|
"fix:workers-types": "run-wrangler-types",
|
||||||
"migrate": "run-wrangler-migrate",
|
|
||||||
"test": "run-vitest"
|
"test": "run-vitest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -6,12 +6,8 @@ export type Env = SharedHonoEnv & {
|
|||||||
// with `await env.JWT_SECRET.get()`; all workers bind the same store so tokens
|
// with `await env.JWT_SECRET.get()`; all workers bind the same store so tokens
|
||||||
// signed by `auth` verify here.
|
// signed by `auth` verify here.
|
||||||
JWT_SECRET: SecretsStoreSecret
|
JWT_SECRET: SecretsStoreSecret
|
||||||
/**
|
/** Per-player settings store. Key `player:<id>` → JSON map of `{ key: value }`. */
|
||||||
* Shared `recflare` D1. This worker owns the `player_settings` table — one row per
|
RECFLARE_PLAYER_SETTINGS: KVNamespace
|
||||||
* player holding their whole settings map as a JSON `{ key: value }` object (see
|
|
||||||
* `@repo/domain`'s player-settings-db).
|
|
||||||
*/
|
|
||||||
DB: D1Database
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Variables can be extended */
|
/** Variables can be extended */
|
||||||
|
|||||||
@@ -1,11 +1,28 @@
|
|||||||
/**
|
/**
|
||||||
* Default player settings seeded on a player's first read, ported verbatim from
|
* Default player settings seeded on a player's first read, ported verbatim from
|
||||||
* the reference's `PlayerSettingsController.GetPlayerSettings`. Ordered; written to the player’s row the
|
* the reference's `PlayerSettingsController.GetPlayerSettings`. Ordered; written to KV the
|
||||||
* first time a player has no stored settings. Mirrored as `SEEDED_DEFAULTS` in
|
* first time a player has no stored settings.
|
||||||
* packages/tools/src/cmd/admin.cmd.ts (the KV import treats these values as the seed) — keep in sync.
|
|
||||||
*/
|
*/
|
||||||
export const DEFAULT_SETTINGS: Array<{ Key: string; Value: string }> = [
|
export const DEFAULT_SETTINGS: Array<{ Key: string; Value: string }> = [
|
||||||
{ Key: 'Recroom.OOBE', Value: '77' },
|
{ Key: 'Recroom.OOBE', Value: '77' },
|
||||||
{ Key: 'TUTORIAL_COMPLETE_MASK', Value: '11' },
|
{ Key: 'TUTORIAL_COMPLETE_MASK', Value: '11' },
|
||||||
{ Key: 'FIRST_TIME_IN_FLAGS', Value: '0' },
|
{ Key: 'FIRST_TIME_IN_FLAGS', Value: '0' },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Settings the server DROPS on write, by exact key and by prefix. The client posts its
|
||||||
|
* Year-In-Review telemetry (`Growth.YIR.UGC.TubeDistance`, `Growth.YIR.DistanceTraveled`, …)
|
||||||
|
* and the `MakerPenSessionCount` counter through this endpoint as the player plays, and the
|
||||||
|
* values change every time, so they can never be deduplicated — measured at ~500 CCU they
|
||||||
|
* were over half of all settings writes. Nothing server-side reads them and the client works
|
||||||
|
* without them (a new player has none), so a PUT naming one is answered 200 and nothing is
|
||||||
|
* stored. Real maker pen preferences (`MakerPen_SnappingMode` and the other `MakerPen_*`
|
||||||
|
* keys) are kept: the client reads those back.
|
||||||
|
*/
|
||||||
|
export const IGNORED_SETTING_KEYS: ReadonlySet<string> = new Set(['MakerPenSessionCount'])
|
||||||
|
export const IGNORED_SETTING_PREFIXES: readonly string[] = ['Growth.YIR.']
|
||||||
|
|
||||||
|
/** Whether a posted setting is one the server drops rather than stores. */
|
||||||
|
export function isIgnoredSetting(key: string): boolean {
|
||||||
|
return IGNORED_SETTING_KEYS.has(key) || IGNORED_SETTING_PREFIXES.some((p) => key.startsWith(p))
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,17 +2,11 @@ import { Hono } from 'hono'
|
|||||||
import { describeRoute, openAPIRouteHandler } from 'hono-openapi'
|
import { describeRoute, openAPIRouteHandler } from 'hono-openapi'
|
||||||
import { useWorkersLogger } from 'workers-tagged-logger'
|
import { useWorkersLogger } from 'workers-tagged-logger'
|
||||||
|
|
||||||
import {
|
import { mergePlayerSettings } from '@repo/domain'
|
||||||
mergePlayerSettings,
|
|
||||||
PlayerSettingsTooLargeError,
|
|
||||||
putPlayerSettingsIfChanged,
|
|
||||||
readPlayerSettings,
|
|
||||||
writePlayerSettings,
|
|
||||||
} from '@repo/domain'
|
|
||||||
import { withCleanSpec, withNotFound, withOnError } from '@repo/hono-helpers'
|
import { withCleanSpec, withNotFound, withOnError } from '@repo/hono-helpers'
|
||||||
import { validateAndGetAccountId } from '@repo/jwt'
|
import { validateAndGetAccountId } from '@repo/jwt'
|
||||||
|
|
||||||
import { DEFAULT_SETTINGS } from './default-settings'
|
import { DEFAULT_SETTINGS, isIgnoredSetting } from './default-settings'
|
||||||
import {
|
import {
|
||||||
AUTHED,
|
AUTHED,
|
||||||
formOrJson,
|
formOrJson,
|
||||||
@@ -31,11 +25,9 @@ import type { App } from './context'
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Player Settings Worker. Serves the small key/value settings bag the game client reads
|
* Player Settings Worker. Serves the small key/value settings bag the game client reads
|
||||||
* on load and writes back as the player toggles options. Backed by one row per player in
|
* on load and writes back as the player toggles options. Backed by a per-player KV map
|
||||||
* the `player_settings` table on the shared D1 — the whole map as a JSON object, read and
|
* (`player:{id}`); a player with nothing stored is seeded with the reference defaults on
|
||||||
* written through `@repo/domain`'s player-settings-db, which `api`, `match` and `chat` also
|
* their first read.
|
||||||
* merge their own keys into. A player with nothing stored is seeded with the reference
|
|
||||||
* defaults on their first read.
|
|
||||||
*
|
*
|
||||||
* Every `/playersettings` route is auth-gated on the Bearer JWT issued by the `auth` worker.
|
* Every `/playersettings` route is auth-gated on the Bearer JWT issued by the `auth` worker.
|
||||||
*/
|
*/
|
||||||
@@ -155,7 +147,7 @@ const app = new Hono<App>()
|
|||||||
)
|
)
|
||||||
|
|
||||||
// The authenticated player's settings as `{ PlayerId, Key, Value }`. Reads
|
// The authenticated player's settings as `{ PlayerId, Key, Value }`. Reads
|
||||||
// the player's row; seeds (and persists) the defaults on first read.
|
// the per-player KV map; seeds (and persists) the defaults on first read.
|
||||||
.get(
|
.get(
|
||||||
'/playersettings',
|
'/playersettings',
|
||||||
describeRoute({
|
describeRoute({
|
||||||
@@ -163,7 +155,7 @@ const app = new Hono<App>()
|
|||||||
summary: 'The player’s settings',
|
summary: 'The player’s settings',
|
||||||
description: [
|
description: [
|
||||||
'The authenticated player’s settings as `{ PlayerId, Key, Value }` entries, read from',
|
'The authenticated player’s settings as `{ PlayerId, Key, Value }` entries, read from',
|
||||||
'their stored map. A player with nothing stored is seeded with the reference defaults',
|
'their KV map. A player with nothing stored is seeded with the reference defaults',
|
||||||
'(Recroom.OOBE, TUTORIAL_COMPLETE_MASK, FIRST_TIME_IN_FLAGS), which are persisted on',
|
'(Recroom.OOBE, TUTORIAL_COMPLETE_MASK, FIRST_TIME_IN_FLAGS), which are persisted on',
|
||||||
'that first read.',
|
'that first read.',
|
||||||
].join(' '),
|
].join(' '),
|
||||||
@@ -177,60 +169,55 @@ const app = new Hono<App>()
|
|||||||
const id = await authedId(c)
|
const id = await authedId(c)
|
||||||
if (id === null) return unauthorized(c)
|
if (id === null) return unauthorized(c)
|
||||||
|
|
||||||
let stored = await readPlayerSettings(c.env.DB, id)
|
const kvKey = `player:${id}`
|
||||||
|
let stored = await c.env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(kvKey, 'json')
|
||||||
if (!stored || Object.keys(stored).length === 0) {
|
if (!stored || Object.keys(stored).length === 0) {
|
||||||
stored = Object.fromEntries(DEFAULT_SETTINGS.map((s) => [s.Key, s.Value]))
|
stored = Object.fromEntries(DEFAULT_SETTINGS.map((s) => [s.Key, s.Value]))
|
||||||
await writePlayerSettings(c.env.DB, id, stored)
|
await c.env.RECFLARE_PLAYER_SETTINGS.put(kvKey, JSON.stringify(stored))
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.json(Object.entries(stored).map(([Key, Value]) => ({ PlayerId: id, Key, Value })))
|
return c.json(Object.entries(stored).map(([Key, Value]) => ({ PlayerId: id, Key, Value })))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Upsert player settings into the player's row, keyed by the authenticated player id.
|
// Upsert player settings into KV, keyed by the authenticated player id.
|
||||||
// A full replace would overwrite the player's entire set; we merge so individual key PUTs
|
// A full replace would overwrite the player's entire set; we merge so individual key PUTs
|
||||||
// (e.g. `key=PlayerSessionCount&value=1`) don't wipe the rest. The client re-posts values
|
// (e.g. `key=PlayerSessionCount&value=1`) don't wipe the rest. The client re-posts values
|
||||||
// it already has at every login and menu change, so a PUT that changes nothing is a
|
// it already has at every login and menu change, so a PUT that changes nothing is a
|
||||||
// read only — the row is written only when a value changed.
|
// read only — KV writes are what cost money here.
|
||||||
.put(
|
.put(
|
||||||
'/playersettings',
|
'/playersettings',
|
||||||
describeRoute({
|
describeRoute({
|
||||||
tags: ['Player Settings'],
|
tags: ['Player Settings'],
|
||||||
summary: 'Write the player’s settings',
|
summary: 'Write the player’s settings',
|
||||||
description: [
|
description: [
|
||||||
'Upserts the posted setting(s) into the caller’s settings map. The write MERGES: a single',
|
'Upserts the posted setting(s) into the caller’s KV map. The write MERGES: a single',
|
||||||
'key PUT (`key=PlayerSessionCount&value=1`, which is what the client sends) leaves the',
|
'key PUT (`key=PlayerSessionCount&value=1`, which is what the client sends) leaves the',
|
||||||
'player’s other settings alone. A JSON body is also accepted, as one object or an',
|
'player’s other settings alone. A JSON body is also accepted, as one object or an',
|
||||||
'array, in either `key`/`value` or `Key`/`Value` casing; entries with an empty key are',
|
'array, in either `key`/`value` or `Key`/`Value` casing; entries with an empty key are',
|
||||||
'dropped. An unparseable or empty body is a no-op 200, not a 400, and so is a PUT whose',
|
'dropped. An unparseable or empty body is a no-op 200, not a 400, and so is a PUT whose',
|
||||||
'values are already stored — nothing is written. A PUT that would make the stored map',
|
'values are already stored — nothing is written to KV. Keys under `Growth.YIR.` (the',
|
||||||
'larger than 64 KiB of JSON is refused with a 413 and changes nothing. Empty body on',
|
'client’s Year-In-Review telemetry) and `MakerPenSessionCount`, which change on every',
|
||||||
'success.',
|
'post and nothing reads, are dropped rather than stored. Empty body on success.',
|
||||||
].join(' '),
|
].join(' '),
|
||||||
security: AUTHED,
|
security: AUTHED,
|
||||||
requestBody: formOrJson(SettingFormWrite, SettingJsonWrite, 'The setting(s) to write'),
|
requestBody: formOrJson(SettingFormWrite, SettingJsonWrite, 'The setting(s) to write'),
|
||||||
responses: {
|
responses: {
|
||||||
200: { description: 'Applied, or nothing parseable to apply (empty body)' },
|
200: { description: 'Applied, or nothing parseable to apply (empty body)' },
|
||||||
401: UNAUTHORIZED_RESPONSE,
|
401: UNAUTHORIZED_RESPONSE,
|
||||||
413: { description: 'The stored map would exceed 64 KiB; nothing was written' },
|
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
async (c) => {
|
async (c) => {
|
||||||
const id = await authedId(c)
|
const id = await authedId(c)
|
||||||
if (id === null) return unauthorized(c)
|
if (id === null) return unauthorized(c)
|
||||||
|
|
||||||
const incoming = await parseSettings(c)
|
const incoming = (await parseSettings(c)).filter((s) => !isIgnoredSetting(s.key))
|
||||||
if (incoming.length === 0) return c.body(null, 200)
|
if (incoming.length === 0) return c.body(null, 200)
|
||||||
|
|
||||||
const patch: Record<string, string> = {}
|
const patch: Record<string, string> = {}
|
||||||
for (const { key, value } of incoming) patch[key] = value
|
for (const { key, value } of incoming) patch[key] = value
|
||||||
|
|
||||||
try {
|
await mergePlayerSettings(c.env.RECFLARE_PLAYER_SETTINGS, id, patch)
|
||||||
await mergePlayerSettings(c.env.DB, id, patch)
|
|
||||||
} catch (err) {
|
|
||||||
if (err instanceof PlayerSettingsTooLargeError) return c.body(null, 413)
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
return c.body(null, 200)
|
return c.body(null, 200)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -244,7 +231,7 @@ const app = new Hono<App>()
|
|||||||
tags: ['Player Settings'],
|
tags: ['Player Settings'],
|
||||||
summary: 'Delete a player setting',
|
summary: 'Delete a player setting',
|
||||||
description: [
|
description: [
|
||||||
'Removes the named setting(s) from the caller’s settings map. The client sends a bare',
|
'Removes the named setting(s) from the caller’s KV map. The client sends a bare',
|
||||||
'form-urlencoded `key=PlayerShoppingBagId` (no `value`); a JSON body — a string, a',
|
'form-urlencoded `key=PlayerShoppingBagId` (no `value`); a JSON body — a string, a',
|
||||||
'`{ key }` object, or an array of either — and a `?key=` query param are also read.',
|
'`{ key }` object, or an array of either — and a `?key=` query param are also read.',
|
||||||
'Deleting a key that isn’t stored, or sending nothing to delete, is a no-op 200, not a',
|
'Deleting a key that isn’t stored, or sending nothing to delete, is a no-op 200, not a',
|
||||||
@@ -267,13 +254,22 @@ const app = new Hono<App>()
|
|||||||
const keys = await parseDeleteKeys(c)
|
const keys = await parseDeleteKeys(c)
|
||||||
if (keys.length === 0) return c.body(null, 200)
|
if (keys.length === 0) return c.body(null, 200)
|
||||||
|
|
||||||
const existing = await readPlayerSettings(c.env.DB, id)
|
const kvKey = `player:${id}`
|
||||||
|
const existing = await c.env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
|
kvKey,
|
||||||
|
'json'
|
||||||
|
)
|
||||||
if (!existing) return c.body(null, 200)
|
if (!existing) return c.body(null, 200)
|
||||||
|
|
||||||
const remaining = { ...existing }
|
const remaining = { ...existing }
|
||||||
for (const key of keys) delete remaining[key]
|
let removed = false
|
||||||
// Nothing stored was named: no write.
|
for (const key of keys) {
|
||||||
await putPlayerSettingsIfChanged(c.env.DB, id, existing, remaining)
|
if (key in remaining) {
|
||||||
|
delete remaining[key]
|
||||||
|
removed = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (removed) await c.env.RECFLARE_PLAYER_SETTINGS.put(kvKey, JSON.stringify(remaining))
|
||||||
|
|
||||||
return c.body(null, 200)
|
return c.body(null, 200)
|
||||||
}
|
}
|
||||||
@@ -293,8 +289,8 @@ app.get(
|
|||||||
description: [
|
description: [
|
||||||
'The player key/value settings bag for recflare, a private-server reimplementation of',
|
'The player key/value settings bag for recflare, a private-server reimplementation of',
|
||||||
'the Rec Room backend. The client reads these on load and writes them back as the',
|
'the Rec Room backend. The client reads these on load and writes them back as the',
|
||||||
'player toggles options; they are stored as one JSON row per player on the shared',
|
'player toggles options; they are stored in a per-player KV map, seeded with the',
|
||||||
'D1, seeded with the reference defaults on a player’s first read.',
|
'reference defaults on a player’s first read.',
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
},
|
},
|
||||||
servers: [{ url: 'https://playersettings.recflare.net', description: 'Production' }],
|
servers: [{ url: 'https://playersettings.recflare.net', description: 'Production' }],
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import { beforeAll, describe, expect, it } from 'vitest'
|
|||||||
|
|
||||||
import '../../playersettings.app'
|
import '../../playersettings.app'
|
||||||
|
|
||||||
import { PLAYER_SETTINGS_SCHEMA_DDL, readPlayerSettings } from '@repo/domain'
|
|
||||||
|
|
||||||
import type { Env } from '../../context'
|
import type { Env } from '../../context'
|
||||||
|
|
||||||
declare module 'cloudflare:test' {
|
declare module 'cloudflare:test' {
|
||||||
@@ -16,33 +14,8 @@ const ORIGIN = 'https://example.com'
|
|||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// Seed the shared JWT signing key into the local Secrets Store so .get() resolves.
|
// Seed the shared JWT signing key into the local Secrets Store so .get() resolves.
|
||||||
await adminSecretsStore(env.JWT_SECRET).create('test-signing-key')
|
await adminSecretsStore(env.JWT_SECRET).create('test-signing-key')
|
||||||
// The player_settings table this worker owns (mirror of migrations/0001).
|
|
||||||
for (const stmt of PLAYER_SETTINGS_SCHEMA_DDL) await env.DB.prepare(stmt).run()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
/** The player's stored map, as the worker reads it. */
|
|
||||||
const stored = (playerId: number) => readPlayerSettings(env.DB, playerId)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The row's `data` exactly as stored. The "nothing was written" tests seed it with whitespace
|
|
||||||
* the worker's own JSON.stringify never produces: if that survives a request, no write happened.
|
|
||||||
*/
|
|
||||||
async function rawData(playerId: number): Promise<string | null> {
|
|
||||||
const row = await env.DB.prepare('SELECT data FROM player_settings WHERE account_id = ?1')
|
|
||||||
.bind(playerId)
|
|
||||||
.first<{ data: string }>()
|
|
||||||
return row?.data ?? null
|
|
||||||
}
|
|
||||||
|
|
||||||
async function seedRaw(playerId: number, data: string): Promise<void> {
|
|
||||||
await env.DB.prepare(
|
|
||||||
`INSERT INTO player_settings (account_id, data) VALUES (?1, ?2)
|
|
||||||
ON CONFLICT (account_id) DO UPDATE SET data = excluded.data`
|
|
||||||
)
|
|
||||||
.bind(playerId, data)
|
|
||||||
.run()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mint a token the way the `auth` worker does, signing with the shared test key seeded into the JWT_SECRET store.
|
// Mint a token the way the `auth` worker does, signing with the shared test key seeded into the JWT_SECRET store.
|
||||||
const TEST_SECRET = 'test-signing-key'
|
const TEST_SECRET = 'test-signing-key'
|
||||||
|
|
||||||
@@ -112,9 +85,12 @@ describe('playersettings endpoints', () => {
|
|||||||
expect(settings.find((s) => s.Key === 'Recroom.OOBE')?.Value).toBe('77')
|
expect(settings.find((s) => s.Key === 'Recroom.OOBE')?.Value).toBe('77')
|
||||||
expect(settings.find((s) => s.Key === 'TUTORIAL_COMPLETE_MASK')?.Value).toBe('11')
|
expect(settings.find((s) => s.Key === 'TUTORIAL_COMPLETE_MASK')?.Value).toBe('11')
|
||||||
|
|
||||||
// Defaults were persisted.
|
// Defaults were persisted to KV.
|
||||||
const map = await stored(100)
|
const stored = await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
expect(map?.['Recroom.OOBE']).toBe('77')
|
'player:100',
|
||||||
|
'json'
|
||||||
|
)
|
||||||
|
expect(stored?.['Recroom.OOBE']).toBe('77')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('GET /playersettings reflects a value written by PUT', async () => {
|
it('GET /playersettings reflects a value written by PUT', async () => {
|
||||||
@@ -133,15 +109,18 @@ describe('playersettings endpoints', () => {
|
|||||||
expect(res.status).toBe(401)
|
expect(res.status).toBe(401)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('PUT /playersettings persists the form key/value', async () => {
|
it('PUT /playersettings persists the form key/value into KV', async () => {
|
||||||
const res = await SELF.fetch(
|
const res = await SELF.fetch(
|
||||||
`${ORIGIN}/playersettings`,
|
`${ORIGIN}/playersettings`,
|
||||||
putForm({ key: 'PlayerSessionCount', value: '1' }, await bearer('7'))
|
putForm({ key: 'PlayerSessionCount', value: '1' }, await bearer('7'))
|
||||||
)
|
)
|
||||||
expect(res.status).toBe(200)
|
expect(res.status).toBe(200)
|
||||||
|
|
||||||
const map = await stored(7)
|
const stored = await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
expect(map).toEqual({ PlayerSessionCount: '1' })
|
'player:7',
|
||||||
|
'json'
|
||||||
|
)
|
||||||
|
expect(stored).toEqual({ PlayerSessionCount: '1' })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('PUT /playersettings merges instead of replacing', async () => {
|
it('PUT /playersettings merges instead of replacing', async () => {
|
||||||
@@ -154,55 +133,71 @@ describe('playersettings endpoints', () => {
|
|||||||
putForm({ key: 'B', value: '2' }, await bearer('8'))
|
putForm({ key: 'B', value: '2' }, await bearer('8'))
|
||||||
)
|
)
|
||||||
|
|
||||||
const map = await stored(8)
|
const stored = await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
expect(map).toEqual({ A: '1', B: '2' })
|
'player:8',
|
||||||
|
'json'
|
||||||
|
)
|
||||||
|
expect(stored).toEqual({ A: '1', B: '2' })
|
||||||
})
|
})
|
||||||
|
|
||||||
// The client re-posts settings it already has at every login, and a write costs more
|
// KV writes are the cost here, and the client re-posts settings it already has at every
|
||||||
// than a read. The raw value is seeded with whitespace the worker's own JSON.stringify
|
// login. The raw value is seeded with whitespace the worker's own JSON.stringify would
|
||||||
// would never produce: if it survives the PUT, nothing was written.
|
// never produce: if it survives the PUT, nothing was written.
|
||||||
it('PUT /playersettings does not write when the value is already stored', async () => {
|
it('PUT /playersettings does not write KV when the value is already stored', async () => {
|
||||||
const padded = '{ "PlayerSessionCount": "5", "Recroom.OOBE": "77" }'
|
const padded = '{ "PlayerSessionCount": "5", "Recroom.OOBE": "77" }'
|
||||||
await seedRaw(10, padded)
|
await env.RECFLARE_PLAYER_SETTINGS.put('player:10', padded)
|
||||||
|
|
||||||
const same = await SELF.fetch(
|
const same = await SELF.fetch(
|
||||||
`${ORIGIN}/playersettings`,
|
`${ORIGIN}/playersettings`,
|
||||||
putForm({ key: 'PlayerSessionCount', value: '5' }, await bearer('10'))
|
putForm({ key: 'PlayerSessionCount', value: '5' }, await bearer('10'))
|
||||||
)
|
)
|
||||||
expect(same.status).toBe(200)
|
expect(same.status).toBe(200)
|
||||||
expect(await rawData(10)).toBe(padded)
|
expect(await env.RECFLARE_PLAYER_SETTINGS.get('player:10', 'text')).toBe(padded)
|
||||||
|
|
||||||
// A real change is still written — and compacted, which is how we know.
|
// A real change is still written — and compacted, which is how we know.
|
||||||
await SELF.fetch(
|
await SELF.fetch(
|
||||||
`${ORIGIN}/playersettings`,
|
`${ORIGIN}/playersettings`,
|
||||||
putForm({ key: 'PlayerSessionCount', value: '6' }, await bearer('10'))
|
putForm({ key: 'PlayerSessionCount', value: '6' }, await bearer('10'))
|
||||||
)
|
)
|
||||||
expect(await rawData(10)).toBe(
|
expect(await env.RECFLARE_PLAYER_SETTINGS.get('player:10', 'text')).toBe(
|
||||||
JSON.stringify({ PlayerSessionCount: '6', 'Recroom.OOBE': '77' })
|
JSON.stringify({ PlayerSessionCount: '6', 'Recroom.OOBE': '77' })
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
// The map lives on the D1 every worker shares, so a player can't grow it without bound.
|
it('PUT /playersettings drops Growth.YIR and MakerPenSessionCount without writing', async () => {
|
||||||
it('PUT /playersettings refuses a write that would push the map past the cap', async () => {
|
const stored = '{ "PlayerSessionCount": "5" }'
|
||||||
await seedRaw(11, JSON.stringify({ A: '1' }))
|
await env.RECFLARE_PLAYER_SETTINGS.put('player:11', stored)
|
||||||
const big = Array.from({ length: 70 }, (_, i) => ({ key: `K${i}`, value: 'x'.repeat(1024) }))
|
|
||||||
|
|
||||||
const res = await SELF.fetch(`${ORIGIN}/playersettings`, {
|
const form = await SELF.fetch(
|
||||||
method: 'PUT',
|
`${ORIGIN}/playersettings`,
|
||||||
headers: { ...(await bearer('11')), 'content-type': 'application/json' },
|
putForm({ key: 'Growth.YIR.UGC.TubeDistance', value: '1234.5' }, await bearer('11'))
|
||||||
body: JSON.stringify(big),
|
)
|
||||||
})
|
expect(form.status).toBe(200)
|
||||||
expect(res.status).toBe(413)
|
expect(await env.RECFLARE_PLAYER_SETTINGS.get('player:11', 'text')).toBe(stored)
|
||||||
expect(await stored(11)).toEqual({ A: '1' })
|
|
||||||
|
|
||||||
// Under the cap, the same kind of write still lands.
|
// A JSON batch keeps the real settings (a maker pen PREFERENCE included) and drops
|
||||||
const ok = await SELF.fetch(`${ORIGIN}/playersettings`, {
|
// only the telemetry and the session counter.
|
||||||
|
const json = await SELF.fetch(`${ORIGIN}/playersettings`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: { ...(await bearer('11')), 'content-type': 'application/json' },
|
headers: { 'content-type': 'application/json', ...(await bearer('11')) },
|
||||||
body: JSON.stringify(big.slice(0, 10)),
|
body: JSON.stringify([
|
||||||
|
{ key: 'Growth.YIR.DistanceTraveled', value: '99' },
|
||||||
|
{ key: 'MakerPenSessionCount', value: '3' },
|
||||||
|
{ key: 'MakerPen_SnappingMode', value: '2' },
|
||||||
|
]),
|
||||||
})
|
})
|
||||||
expect(ok.status).toBe(200)
|
expect(json.status).toBe(200)
|
||||||
expect(Object.keys((await stored(11)) ?? {})).toHaveLength(11)
|
expect(await env.RECFLARE_PLAYER_SETTINGS.get('player:11', 'json')).toEqual({
|
||||||
|
PlayerSessionCount: '5',
|
||||||
|
MakerPen_SnappingMode: '2',
|
||||||
|
})
|
||||||
|
|
||||||
|
// A player with nothing stored stays unseeded: no key is created for telemetry alone.
|
||||||
|
await SELF.fetch(
|
||||||
|
`${ORIGIN}/playersettings`,
|
||||||
|
putForm({ key: 'Growth.YIR.TimeSpentWithFriends', value: '7' }, await bearer('12'))
|
||||||
|
)
|
||||||
|
expect(await env.RECFLARE_PLAYER_SETTINGS.get('player:12', 'text')).toBeNull()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('PUT /playersettings 200s with no parseable settings', async () => {
|
it('PUT /playersettings 200s with no parseable settings', async () => {
|
||||||
@@ -234,8 +229,11 @@ describe('playersettings endpoints', () => {
|
|||||||
)
|
)
|
||||||
expect(res.status).toBe(200)
|
expect(res.status).toBe(200)
|
||||||
|
|
||||||
const map = await stored(20)
|
const stored = await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
expect(map).toEqual({ PlayerSessionCount: '3' })
|
'player:20',
|
||||||
|
'json'
|
||||||
|
)
|
||||||
|
expect(stored).toEqual({ PlayerSessionCount: '3' })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('DELETE /playersettings reads a body with no content-type', async () => {
|
it('DELETE /playersettings reads a body with no content-type', async () => {
|
||||||
@@ -251,8 +249,11 @@ describe('playersettings endpoints', () => {
|
|||||||
})
|
})
|
||||||
expect(res.status).toBe(200)
|
expect(res.status).toBe(200)
|
||||||
|
|
||||||
const map = await stored(21)
|
const stored = await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
expect(map).toEqual({})
|
'player:21',
|
||||||
|
'json'
|
||||||
|
)
|
||||||
|
expect(stored).toEqual({})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('DELETE /playersettings 200s for an unknown key and an empty body', async () => {
|
it('DELETE /playersettings 200s for an unknown key and an empty body', async () => {
|
||||||
@@ -271,8 +272,11 @@ describe('playersettings endpoints', () => {
|
|||||||
expect(empty.status).toBe(200)
|
expect(empty.status).toBe(200)
|
||||||
|
|
||||||
// Neither call touched the stored map.
|
// Neither call touched the stored map.
|
||||||
const map = await stored(22)
|
const stored = await env.RECFLARE_PLAYER_SETTINGS.get<Record<string, string>>(
|
||||||
expect(map).toEqual({ A: '1' })
|
'player:22',
|
||||||
|
'json'
|
||||||
|
)
|
||||||
|
expect(stored).toEqual({ A: '1' })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('GET /openapi.json documents every route', async () => {
|
it('GET /openapi.json documents every route', async () => {
|
||||||
|
|||||||
+242
-953
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// Runtime types generated with workerd@1.20260831.1 2026-06-16 nodejs_compat
|
// Runtime types generated with workerd@1.20260625.1 2025-09-20 nodejs_compat
|
||||||
// Begin runtime types
|
// Begin runtime types
|
||||||
/*! *****************************************************************************
|
/*! *****************************************************************************
|
||||||
Copyright (c) Cloudflare. All rights reserved.
|
Copyright (c) Cloudflare. All rights reserved.
|
||||||
@@ -19,26 +19,26 @@ and limitations under the License.
|
|||||||
// noinspection JSUnusedGlobalSymbols
|
// noinspection JSUnusedGlobalSymbols
|
||||||
declare var onmessage: never;
|
declare var onmessage: never;
|
||||||
/**
|
/**
|
||||||
* The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs.
|
* The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
||||||
*/
|
*/
|
||||||
declare class DOMException extends Error {
|
declare class DOMException extends Error {
|
||||||
constructor(message?: string, name?: string);
|
constructor(message?: string, name?: string);
|
||||||
/**
|
/**
|
||||||
* The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name.
|
* The **`message`** read-only property of the a message or description associated with the given error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
||||||
*/
|
*/
|
||||||
readonly message: string;
|
readonly message: string;
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name.
|
* The **`name`** read-only property of the one of the strings associated with an error name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
||||||
*/
|
*/
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
/**
|
/**
|
||||||
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match.
|
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
||||||
@@ -96,61 +96,61 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
clear(): void;
|
clear(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.count()`** static method logs the number of times that this particular call to count() has been called.
|
* The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
||||||
*/
|
*/
|
||||||
count(label?: string): void;
|
count(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.countReset()`** static method resets counter used with console.count().
|
* The **`console.countReset()`** static method resets counter used with console/count_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
||||||
*/
|
*/
|
||||||
countReset(label?: string): void;
|
countReset(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.debug()`** static method outputs a message to the console at the "debug" log level. The message is only displayed to the user if the console is configured to display debug output. In most cases, the log level is configured within the console UI. This log level might correspond to the Debug or Verbose log level.
|
* The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
||||||
*/
|
*/
|
||||||
debug(...data: any[]): void;
|
debug(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. In browser consoles, the output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
|
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
||||||
*/
|
*/
|
||||||
dir(item?: any, options?: any): void;
|
dir(item?: any, options?: any): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.
|
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
||||||
*/
|
*/
|
||||||
dirxml(...data: any[]): void;
|
dirxml(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.error()`** static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information.
|
* The **`console.error()`** static method outputs a message to the console at the 'error' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
||||||
*/
|
*/
|
||||||
error(...data: any[]): void;
|
error(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.
|
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
||||||
*/
|
*/
|
||||||
group(...data: any[]): void;
|
group(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupCollapsed()`** static method creates a new inline group in the console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.
|
* The **`console.groupCollapsed()`** static method creates a new inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
||||||
*/
|
*/
|
||||||
groupCollapsed(...data: any[]): void;
|
groupCollapsed(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.groupEnd()`** static method exits the current inline group in the console. See Using groups in the console in the console documentation for details and examples.
|
* The **`console.groupEnd()`** static method exits the current inline group in the console.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
||||||
*/
|
*/
|
||||||
groupEnd(): void;
|
groupEnd(): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.info()`** static method outputs a message to the console at the "info" log level. The message is only displayed to the user if the console is configured to display info output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as a small "i" icon next to it.
|
* The **`console.info()`** static method outputs a message to the console at the 'info' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
||||||
*/
|
*/
|
||||||
@@ -168,24 +168,23 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
table(tabularData?: any, properties?: string[]): void;
|
table(tabularData?: any, properties?: string[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.
|
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
||||||
*/
|
*/
|
||||||
time(label?: string): void;
|
time(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console.time().
|
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
||||||
*/
|
*/
|
||||||
timeEnd(label?: string): void;
|
timeEnd(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console.time().
|
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
||||||
*/
|
*/
|
||||||
timeLog(label?: string, ...data: any[]): void;
|
timeLog(label?: string, ...data: any[]): void;
|
||||||
/* The **`console.timeStamp()`** static method adds a single marker to the browser's Performance tool (Firefox bug 1387528, Chrome). This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. */
|
|
||||||
timeStamp(label?: string): void;
|
timeStamp(label?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.trace()`** static method outputs a stack trace to the console.
|
* The **`console.trace()`** static method outputs a stack trace to the console.
|
||||||
@@ -194,7 +193,7 @@ interface Console {
|
|||||||
*/
|
*/
|
||||||
trace(...data: any[]): void;
|
trace(...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
* The **`console.warn()`** static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon.
|
* The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
||||||
*/
|
*/
|
||||||
@@ -360,7 +359,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|||||||
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -405,7 +404,6 @@ declare const crypto: Crypto;
|
|||||||
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
||||||
*/
|
*/
|
||||||
declare const caches: CacheStorage;
|
declare const caches: CacheStorage;
|
||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scheduler) */
|
|
||||||
declare const scheduler: Scheduler;
|
declare const scheduler: Scheduler;
|
||||||
/**
|
/**
|
||||||
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
||||||
@@ -422,12 +420,10 @@ interface TestController {
|
|||||||
interface ExecutionContext<Props = unknown> {
|
interface ExecutionContext<Props = unknown> {
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
passThroughOnException(): void;
|
passThroughOnException(): void;
|
||||||
readonly exports: Cloudflare.Exports;
|
|
||||||
readonly props: Props;
|
readonly props: Props;
|
||||||
cache?: CacheContext;
|
cache?: CacheContext;
|
||||||
readonly access?: CloudflareAccessContext;
|
readonly access?: CloudflareAccessContext;
|
||||||
tracing: Tracing;
|
tracing: Tracing;
|
||||||
abort(reason?: any): void;
|
|
||||||
}
|
}
|
||||||
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
|
||||||
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
|
||||||
@@ -516,7 +512,7 @@ declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded
|
|||||||
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
|
||||||
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
|
||||||
}
|
}
|
||||||
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high" | "us";
|
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
|
||||||
interface DurableObjectNamespaceNewUniqueIdOptions {
|
interface DurableObjectNamespaceNewUniqueIdOptions {
|
||||||
jurisdiction?: DurableObjectJurisdiction;
|
jurisdiction?: DurableObjectJurisdiction;
|
||||||
}
|
}
|
||||||
@@ -530,7 +526,6 @@ interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = u
|
|||||||
}
|
}
|
||||||
interface DurableObjectState<Props = unknown> {
|
interface DurableObjectState<Props = unknown> {
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
readonly exports: Cloudflare.Exports;
|
|
||||||
readonly props: Props;
|
readonly props: Props;
|
||||||
readonly id: DurableObjectId;
|
readonly id: DurableObjectId;
|
||||||
readonly storage: DurableObjectStorage;
|
readonly storage: DurableObjectStorage;
|
||||||
@@ -545,7 +540,7 @@ interface DurableObjectState<Props = unknown> {
|
|||||||
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
||||||
getHibernatableWebSocketEventTimeout(): number | null;
|
getHibernatableWebSocketEventTimeout(): number | null;
|
||||||
getTags(ws: WebSocket): string[];
|
getTags(ws: WebSocket): string[];
|
||||||
abort(reason?: string, options?: DurableObjectAbortOptions): void;
|
abort(reason?: string): void;
|
||||||
}
|
}
|
||||||
interface DurableObjectTransaction {
|
interface DurableObjectTransaction {
|
||||||
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
|
||||||
@@ -581,9 +576,6 @@ interface DurableObjectStorage {
|
|||||||
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
||||||
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
||||||
}
|
}
|
||||||
interface DurableObjectAbortOptions {
|
|
||||||
retryAlarm?: boolean;
|
|
||||||
}
|
|
||||||
interface DurableObjectListOptions {
|
interface DurableObjectListOptions {
|
||||||
start?: string;
|
start?: string;
|
||||||
startAfter?: string;
|
startAfter?: string;
|
||||||
@@ -634,26 +626,26 @@ interface AnalyticsEngineDataPoint {
|
|||||||
blobs?: ((ArrayBuffer | string) | null)[];
|
blobs?: ((ArrayBuffer | string) | null)[];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`Event`** interface represents an event which takes place on an EventTarget.
|
* The **`Event`** interface represents an event which takes place on an `EventTarget`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
||||||
*/
|
*/
|
||||||
declare class Event {
|
declare class Event {
|
||||||
constructor(type: string, init?: EventInit);
|
constructor(type: string, init?: EventInit);
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error.
|
* The **`type`** read-only property of the Event interface returns a string containing the event's type.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated.
|
* The **`eventPhase`** read-only property of the being evaluated.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
||||||
*/
|
*/
|
||||||
get eventPhase(): number;
|
get eventPhase(): number;
|
||||||
/**
|
/**
|
||||||
* The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
* The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
||||||
*/
|
*/
|
||||||
@@ -690,13 +682,13 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get currentTarget(): EventTarget | undefined;
|
get currentTarget(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event.
|
* The read-only **`target`** property of the dispatched.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
|
||||||
*/
|
*/
|
||||||
get target(): EventTarget | undefined;
|
get target(): EventTarget | undefined;
|
||||||
/**
|
/**
|
||||||
* The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead.
|
* The deprecated **`Event.srcElement`** is an alias for the Event.target property.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
||||||
@@ -709,45 +701,45 @@ declare class Event {
|
|||||||
*/
|
*/
|
||||||
get timeStamp(): number;
|
get timeStamp(): number;
|
||||||
/**
|
/**
|
||||||
* The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents.
|
* The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
||||||
*/
|
*/
|
||||||
get isTrusted(): boolean;
|
get isTrusted(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
get cancelBubble(): boolean;
|
get cancelBubble(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
|
* The **`cancelBubble`** property of the Event interface is deprecated.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
||||||
*/
|
*/
|
||||||
set cancelBubble(value: boolean);
|
set cancelBubble(value: boolean);
|
||||||
/**
|
/**
|
||||||
* The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called.
|
* The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
||||||
*/
|
*/
|
||||||
stopImmediatePropagation(): void;
|
stopImmediatePropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken.
|
* The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
||||||
*/
|
*/
|
||||||
preventDefault(): void;
|
preventDefault(): void;
|
||||||
/**
|
/**
|
||||||
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().
|
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
||||||
*/
|
*/
|
||||||
stopPropagation(): void;
|
stopPropagation(): void;
|
||||||
/**
|
/**
|
||||||
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.
|
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
||||||
*/
|
*/
|
||||||
@@ -768,7 +760,7 @@ interface EventListenerObject<EventType extends Event = Event> {
|
|||||||
}
|
}
|
||||||
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
|
||||||
/**
|
/**
|
||||||
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. In other words, any target of events implements the three methods associated with this interface.
|
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
||||||
*/
|
*/
|
||||||
@@ -781,13 +773,13 @@ declare class EventTarget<EventMap extends Record<string, Event> = Record<string
|
|||||||
*/
|
*/
|
||||||
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
|
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
||||||
*/
|
*/
|
||||||
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
|
||||||
/**
|
/**
|
||||||
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
|
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
||||||
*/
|
*/
|
||||||
@@ -819,7 +811,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. This is able to abort fetch requests, the consumption of any response bodies, or streams.
|
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
||||||
*/
|
*/
|
||||||
@@ -832,7 +824,7 @@ declare class AbortController {
|
|||||||
*/
|
*/
|
||||||
declare abstract class AbortSignal extends EventTarget {
|
declare abstract class AbortSignal extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).
|
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
||||||
*/
|
*/
|
||||||
@@ -844,13 +836,13 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
*/
|
*/
|
||||||
static timeout(delay: number): AbortSignal;
|
static timeout(delay: number): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal.
|
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
||||||
*/
|
*/
|
||||||
static any(signals: AbortSignal[]): AbortSignal;
|
static any(signals: AbortSignal[]): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false).
|
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
||||||
*/
|
*/
|
||||||
@@ -866,17 +858,12 @@ declare abstract class AbortSignal extends EventTarget {
|
|||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
||||||
set onabort(value: any | null);
|
set onabort(value: any | null);
|
||||||
/**
|
/**
|
||||||
* The **`throwIfAborted()`** method throws the signal's abort reason if the signal has been aborted; otherwise it does nothing.
|
* The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
||||||
*/
|
*/
|
||||||
throwIfAborted(): void;
|
throwIfAborted(): void;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`Scheduler`** interface of the Prioritized Task Scheduling API provides methods for scheduling prioritized tasks.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Scheduler)
|
|
||||||
*/
|
|
||||||
interface Scheduler {
|
interface Scheduler {
|
||||||
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
||||||
}
|
}
|
||||||
@@ -884,20 +871,20 @@ interface SchedulerWaitOptions {
|
|||||||
signal?: AbortSignal;
|
signal?: AbortSignal;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent`** interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
|
* The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class ExtendableEvent extends Event {
|
declare abstract class ExtendableEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful. In service workers, waitUntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the service worker if it wants that work to complete.
|
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
|
||||||
*/
|
*/
|
||||||
waitUntil(promise: Promise<any>): void;
|
waitUntil(promise: Promise<any>): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CustomEvent`** interface can be used to attach custom data to an event generated by an application.
|
* The **`CustomEvent`** interface represents events initialized by an application for any purpose.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
|
||||||
*/
|
*/
|
||||||
@@ -936,7 +923,7 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
get type(): string;
|
get type(): string;
|
||||||
/**
|
/**
|
||||||
* The **`slice()`** method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it's called.
|
* The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
||||||
*/
|
*/
|
||||||
@@ -954,13 +941,13 @@ declare class Blob {
|
|||||||
*/
|
*/
|
||||||
bytes(): Promise<Uint8Array>;
|
bytes(): Promise<Uint8Array>;
|
||||||
/**
|
/**
|
||||||
* The **`text()`** method of the Blob interface returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8.
|
* The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
||||||
*/
|
*/
|
||||||
text(): Promise<string>;
|
text(): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.
|
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
||||||
*/
|
*/
|
||||||
@@ -977,13 +964,13 @@ interface BlobOptions {
|
|||||||
declare class File extends Blob {
|
declare class File extends Blob {
|
||||||
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
|
||||||
/**
|
/**
|
||||||
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object. For security reasons, the path is excluded from this property.
|
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
|
||||||
*/
|
*/
|
||||||
get name(): string;
|
get name(): string;
|
||||||
/**
|
/**
|
||||||
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
|
||||||
*/
|
*/
|
||||||
@@ -1000,7 +987,7 @@ interface FileOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class CacheStorage {
|
declare abstract class CacheStorage {
|
||||||
/**
|
/**
|
||||||
* The **`open()`** method of the CacheStorage interface returns a Promise that resolves to the Cache object matching the cacheName.
|
* The **`open()`** method of the the Cache object matching the `cacheName`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
||||||
*/
|
*/
|
||||||
@@ -1033,14 +1020,14 @@ interface CacheQueryOptions {
|
|||||||
*/
|
*/
|
||||||
declare abstract class Crypto {
|
declare abstract class Crypto {
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.subtle`** read-only property returns a SubtleCrypto which can then be used to perform low-level cryptographic operations.
|
* The **`Crypto.subtle`** read-only property returns a cryptographic operations.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
||||||
*/
|
*/
|
||||||
get subtle(): SubtleCrypto;
|
get subtle(): SubtleCrypto;
|
||||||
/**
|
/**
|
||||||
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).
|
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
||||||
*/
|
*/
|
||||||
@@ -1068,7 +1055,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data. It takes as arguments a key to decrypt with, some optional extra parameters, and the data to decrypt (also known as "ciphertext"). It returns a Promise which will be fulfilled with the decrypted data (also known as "plaintext").
|
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
|
||||||
*/
|
*/
|
||||||
@@ -1086,7 +1073,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
|
||||||
/**
|
/**
|
||||||
* The **`digest()`** method of the SubtleCrypto interface generates a digest of the given data, using the specified hash function. A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value.
|
* The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
|
||||||
*/
|
*/
|
||||||
@@ -1104,7 +1091,7 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
|
||||||
/**
|
/**
|
||||||
* The **`deriveBits()`** method of the SubtleCrypto interface can be used to derive an array of bits from a base key.
|
* The **`deriveBits()`** method of the key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
|
||||||
*/
|
*/
|
||||||
@@ -1122,13 +1109,13 @@ declare abstract class SubtleCrypto {
|
|||||||
*/
|
*/
|
||||||
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
||||||
/**
|
/**
|
||||||
* The **`wrapKey()`** method of the SubtleCrypto interface "wraps" a key. This means that it exports the key in an external, portable format, then encrypts the exported key. Wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
|
* The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
|
||||||
*/
|
*/
|
||||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
|
||||||
/**
|
/**
|
||||||
* The **`unwrapKey()`** method of the SubtleCrypto interface "unwraps" a key. This means that it takes as its input a key that has been exported and then encrypted (also called "wrapped"). It decrypts the key and then imports it, returning a CryptoKey object that can be used in the Web Crypto API.
|
* The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
|
||||||
*/
|
*/
|
||||||
@@ -1136,20 +1123,20 @@ declare abstract class SubtleCrypto {
|
|||||||
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey().
|
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey.
|
||||||
* Available only in secure contexts.
|
* Available only in secure contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
||||||
*/
|
*/
|
||||||
declare abstract class CryptoKey {
|
declare abstract class CryptoKey {
|
||||||
/**
|
/**
|
||||||
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object. It can have the following values:
|
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
|
||||||
*/
|
*/
|
||||||
readonly type: string;
|
readonly type: string;
|
||||||
/**
|
/**
|
||||||
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using SubtleCrypto.exportKey() or SubtleCrypto.wrapKey().
|
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
|
||||||
*/
|
*/
|
||||||
@@ -1266,15 +1253,12 @@ interface CryptoKeyArbitraryKeyAlgorithm {
|
|||||||
length?: number;
|
length?: number;
|
||||||
}
|
}
|
||||||
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
|
||||||
constructor(algorithm: string | SubtleCryptoHashAlgorithm, options?: DigestStreamOptions);
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
||||||
readonly digest: Promise<ArrayBuffer>;
|
readonly digest: Promise<ArrayBuffer>;
|
||||||
get bytesWritten(): number | bigint;
|
get bytesWritten(): number | bigint;
|
||||||
}
|
}
|
||||||
interface DigestStreamOptions {
|
|
||||||
toWellFormed?: boolean;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
|
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
||||||
*/
|
*/
|
||||||
@@ -1291,20 +1275,20 @@ declare class TextDecoder {
|
|||||||
get ignoreBOM(): boolean;
|
get ignoreBOM(): boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder`** interface enables you to encode a JavaScript string using UTF-8.
|
* The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
||||||
*/
|
*/
|
||||||
declare class TextEncoder {
|
declare class TextEncoder {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Uint8Array containing the string encoded using UTF-8.
|
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
||||||
*/
|
*/
|
||||||
encode(input?: string): Uint8Array;
|
encode(input?: string): Uint8Array;
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns an object indicating the progress of the encoding. This is potentially more performant than the encode() method — especially when the target buffer is a view into a Wasm heap.
|
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
||||||
*/
|
*/
|
||||||
@@ -1361,9 +1345,6 @@ declare class ErrorEvent extends Event {
|
|||||||
get error(): any;
|
get error(): any;
|
||||||
}
|
}
|
||||||
interface ErrorEventErrorEventInit {
|
interface ErrorEventErrorEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
message?: string;
|
message?: string;
|
||||||
filename?: string;
|
filename?: string;
|
||||||
lineno?: number;
|
lineno?: number;
|
||||||
@@ -1376,139 +1357,135 @@ interface ErrorEventErrorEventInit {
|
|||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
||||||
*/
|
*/
|
||||||
declare class MessageEvent extends Event {
|
declare class MessageEvent extends Event {
|
||||||
constructor(type: string, initializer?: MessageEventInit);
|
constructor(type: string, initializer: MessageEventInit);
|
||||||
/**
|
/**
|
||||||
* The **`data`** read-only property of the MessageEvent interface represents the data sent by the message emitter.
|
* The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
||||||
*/
|
*/
|
||||||
readonly data: any;
|
readonly data: any;
|
||||||
/**
|
/**
|
||||||
* The **`origin`** read-only property of the MessageEvent interface is a string representing the origin of the message emitter.
|
* The **`origin`** read-only property of the origin of the message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
|
||||||
*/
|
*/
|
||||||
readonly origin: string | null;
|
readonly origin: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`lastEventId`** read-only property of the MessageEvent interface is a string representing a unique ID for the event.
|
* The **`lastEventId`** read-only property of the unique ID for the event.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
|
||||||
*/
|
*/
|
||||||
readonly lastEventId: string;
|
readonly lastEventId: string;
|
||||||
/**
|
/**
|
||||||
* The **`source`** read-only property of the MessageEvent interface is a MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter.
|
* The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
||||||
*/
|
*/
|
||||||
readonly source: MessagePort | null;
|
readonly source: MessagePort | null;
|
||||||
/**
|
/**
|
||||||
* The **`ports`** read-only property of the MessageEvent interface is an array of MessagePort objects containing all MessagePort objects sent with the message, in order.
|
* The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
|
||||||
*/
|
*/
|
||||||
readonly ports: MessagePort[];
|
readonly ports: MessagePort[];
|
||||||
}
|
}
|
||||||
interface MessageEventInit {
|
interface MessageEventInit {
|
||||||
bubbles?: boolean;
|
data: ArrayBuffer | string;
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
data?: any;
|
|
||||||
origin?: string;
|
|
||||||
lastEventId?: string;
|
|
||||||
source?: MessagePort;
|
|
||||||
ports?: MessagePort[];
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. These events are particularly useful for telemetry and debugging purposes.
|
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class PromiseRejectionEvent extends Event {
|
declare abstract class PromiseRejectionEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript Promise which was rejected. You can examine the event's PromiseRejectionEvent.reason property to learn why the promise was rejected.
|
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
|
||||||
*/
|
*/
|
||||||
readonly promise: Promise<any>;
|
readonly promise: Promise<any>;
|
||||||
/**
|
/**
|
||||||
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). This in theory provides information about why the promise was rejected.
|
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject().
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
|
||||||
*/
|
*/
|
||||||
readonly reason: any;
|
readonly reason: any;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the fetch(), XMLHttpRequest.send() or navigator.sendBeacon() methods. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
|
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
||||||
*/
|
*/
|
||||||
declare class FormData {
|
declare class FormData {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string | Blob): void;
|
append(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
|
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: Blob, filename?: string): void;
|
append(name: string, value: Blob, filename?: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a FormData object.
|
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a FormData object. If you expect multiple values and want all of them, use the getAll() method instead.
|
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): (File | string) | null;
|
get(name: string): (File | string) | null;
|
||||||
/**
|
/**
|
||||||
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a FormData object.
|
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
||||||
*/
|
*/
|
||||||
getAll(name: string): (File | string)[];
|
getAll(name: string): (File | string)[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the FormData interface returns whether a FormData object contains a certain key.
|
* The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string | Blob): void;
|
set(name: string, value: string | Blob): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
|
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: Blob, filename?: string): void;
|
set(name: string, value: Blob, filename?: string): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the list. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: File | string
|
value: File | string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the list. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the list. */
|
||||||
values(): IterableIterator<(File | string)>;
|
values(): IterableIterator<(File | string)>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
@@ -1587,19 +1564,19 @@ interface DocumentEnd {
|
|||||||
append(content: string, options?: ContentOptions): DocumentEnd;
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
||||||
*/
|
*/
|
||||||
declare abstract class FetchEvent extends ExtendableEvent {
|
declare abstract class FetchEvent extends ExtendableEvent {
|
||||||
/**
|
/**
|
||||||
* The **`request`** read-only property of the FetchEvent interface returns the Request that triggered the event handler.
|
* The **`request`** read-only property of the the event handler.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
|
||||||
*/
|
*/
|
||||||
readonly request: Request;
|
readonly request: Request;
|
||||||
/**
|
/**
|
||||||
* The **`respondWith()`** method of FetchEvent prevents the browser's default fetch handling, and allows you to provide a promise for a Response yourself.
|
* The **`respondWith()`** method of allows you to provide a promise for a Response yourself.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
|
||||||
*/
|
*/
|
||||||
@@ -1608,62 +1585,65 @@ declare abstract class FetchEvent extends ExtendableEvent {
|
|||||||
}
|
}
|
||||||
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
|
||||||
/**
|
/**
|
||||||
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
|
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
||||||
*/
|
*/
|
||||||
declare class Headers {
|
declare class Headers {
|
||||||
constructor(init?: HeadersInit);
|
constructor(init?: HeadersInit);
|
||||||
/**
|
/**
|
||||||
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.
|
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
|
||||||
*/
|
*/
|
||||||
get(name: string): string | null;
|
get(name: string): string | null;
|
||||||
getAll(name: string): string[];
|
getAll(name: string): string[];
|
||||||
/**
|
/**
|
||||||
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. This allows Headers objects to handle having multiple Set-Cookie headers, which wasn't possible prior to its implementation.
|
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
|
||||||
*/
|
*/
|
||||||
getSetCookie(): string[];
|
getSetCookie(): string[];
|
||||||
/**
|
/**
|
||||||
* The **`has()`** method of the Headers interface returns a boolean stating whether a Headers object contains a certain header.
|
* The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
|
||||||
*/
|
*/
|
||||||
has(name: string): boolean;
|
has(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.
|
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
||||||
*/
|
*/
|
||||||
append(name: string, value: string): void;
|
append(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`delete()`** method of the Headers interface deletes a header from the current Headers object.
|
* The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
|
||||||
*/
|
*/
|
||||||
delete(name: string): void;
|
delete(name: string): void;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
|
||||||
|
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
[Symbol.iterator](): IterableIterator<[
|
[Symbol.iterator](): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
}
|
}
|
||||||
type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData | Iterable<ArrayBuffer | ArrayBufferView> | AsyncIterable<ArrayBuffer | ArrayBufferView>;
|
type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData;
|
||||||
declare abstract class Body {
|
declare abstract class Body {
|
||||||
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
||||||
get body(): ReadableStream | null;
|
get body(): ReadableStream | null;
|
||||||
@@ -1719,7 +1699,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
statusText: string;
|
statusText: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Response interface contains the Headers object associated with the response.
|
* The **`headers`** read-only property of the with the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1737,7 +1717,7 @@ interface Response extends Body {
|
|||||||
*/
|
*/
|
||||||
redirected: boolean;
|
redirected: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects.
|
* The **`url`** read-only property of the Response interface contains the URL of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
|
||||||
*/
|
*/
|
||||||
@@ -1745,7 +1725,7 @@ interface Response extends Body {
|
|||||||
webSocket: WebSocket | null;
|
webSocket: WebSocket | null;
|
||||||
cf: any | undefined;
|
cf: any | undefined;
|
||||||
/**
|
/**
|
||||||
* The **`type`** read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers.
|
* The **`type`** read-only property of the Response interface contains the type of the response.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
|
||||||
*/
|
*/
|
||||||
@@ -1776,13 +1756,13 @@ declare var Request: {
|
|||||||
*/
|
*/
|
||||||
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
|
||||||
/**
|
/**
|
||||||
* The **`clone()`** method of the Request interface creates a copy of the current Request object.
|
* The **`clone()`** method of the Request interface creates a copy of the current `Request` object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
|
||||||
*/
|
*/
|
||||||
clone(): Request<CfHostMetadata, Cf>;
|
clone(): Request<CfHostMetadata, Cf>;
|
||||||
/**
|
/**
|
||||||
* The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.)
|
* The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
||||||
*/
|
*/
|
||||||
@@ -1794,7 +1774,7 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
/**
|
/**
|
||||||
* The **`headers`** read-only property of the Request interface contains the Headers object associated with the request.
|
* The **`headers`** read-only property of the with the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
||||||
*/
|
*/
|
||||||
@@ -1820,13 +1800,13 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
|
|||||||
*/
|
*/
|
||||||
integrity: string;
|
integrity: string;
|
||||||
/**
|
/**
|
||||||
* The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
* The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
||||||
*/
|
*/
|
||||||
keepalive: boolean;
|
keepalive: boolean;
|
||||||
/**
|
/**
|
||||||
* The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache.
|
* The **`cache`** read-only property of the Request interface contains the cache mode of the request.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
||||||
*/
|
*/
|
||||||
@@ -2215,7 +2195,7 @@ type ReadableStreamReadResult<R = any> = {
|
|||||||
value?: undefined;
|
value?: undefined;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2233,13 +2213,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
getReader(): ReadableStreamDefaultReader<R>;
|
getReader(): ReadableStreamDefaultReader<R>;
|
||||||
/**
|
/**
|
||||||
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
|
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
||||||
*/
|
*/
|
||||||
@@ -2251,13 +2231,13 @@ interface ReadableStream<R = any> {
|
|||||||
*/
|
*/
|
||||||
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
||||||
/**
|
/**
|
||||||
* The **`pipeTo()`** method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
* The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
||||||
*/
|
*/
|
||||||
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`tee()`** method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances.
|
* The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
||||||
*/
|
*/
|
||||||
@@ -2269,7 +2249,7 @@ interface ReadableStream<R = any> {
|
|||||||
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStream`** interface of the Streams API 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.
|
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
||||||
*/
|
*/
|
||||||
@@ -2301,7 +2281,7 @@ declare class ReadableStreamDefaultReader<R = any> {
|
|||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBReader`** interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. It is used for efficient copying from underlying sources where the data is delivered as an "anonymous" sequence of bytes, such as files.
|
* The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
|
||||||
*/
|
*/
|
||||||
@@ -2310,13 +2290,13 @@ declare class ReadableStreamBYOBReader {
|
|||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
cancel(reason?: any): Promise<void>;
|
cancel(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. A request for data will be satisfied from the stream's internal queues if there is any data present. If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source.
|
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
|
||||||
*/
|
*/
|
||||||
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. After the lock is released, the reader is no longer active.
|
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
|
||||||
*/
|
*/
|
||||||
@@ -2335,7 +2315,7 @@ interface ReadableStreamGetReaderOptions {
|
|||||||
mode: "byob";
|
mode: "byob";
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a "pull request" for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
|
||||||
*/
|
*/
|
||||||
@@ -2361,13 +2341,13 @@ declare abstract class ReadableStreamBYOBRequest {
|
|||||||
get atLeast(): number | null;
|
get atLeast(): number | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams.
|
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableStreamDefaultController<R = any> {
|
declare abstract class ReadableStreamDefaultController<R = any> {
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the required to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2379,32 +2359,32 @@ declare abstract class ReadableStreamDefaultController<R = any> {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.
|
* The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
|
||||||
*/
|
*/
|
||||||
enqueue(chunk?: R): void;
|
enqueue(chunk?: R): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. It allows control of the state and internal queue of a ReadableStream with an underlying byte source, and enables efficient zero-copy transfer of data from the underlying source to a consumer when the stream's internal queue is empty.
|
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
|
||||||
*/
|
*/
|
||||||
declare abstract class ReadableByteStreamController {
|
declare abstract class ReadableByteStreamController {
|
||||||
/**
|
/**
|
||||||
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests.
|
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
|
||||||
*/
|
*/
|
||||||
get byobRequest(): ReadableStreamBYOBRequest | null;
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its "desired size".
|
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
|
||||||
*/
|
*/
|
||||||
@@ -2416,7 +2396,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is transferred into the stream's internal queues).
|
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues).
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
|
||||||
*/
|
*/
|
||||||
@@ -2429,7 +2409,7 @@ declare abstract class ReadableByteStreamController {
|
|||||||
error(reason: any): void;
|
error(reason: any): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultController`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
||||||
*/
|
*/
|
||||||
@@ -2441,7 +2421,7 @@ declare abstract class WritableStreamDefaultController {
|
|||||||
*/
|
*/
|
||||||
get signal(): AbortSignal;
|
get signal(): AbortSignal;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the WritableStreamDefaultController interface causes any future interactions with the associated stream to error.
|
* The **`error()`** method of the with the associated stream to error.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2466,7 +2446,7 @@ declare abstract class TransformStreamDefaultController<O = any> {
|
|||||||
*/
|
*/
|
||||||
enqueue(chunk?: O): void;
|
enqueue(chunk?: O): void;
|
||||||
/**
|
/**
|
||||||
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
|
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
|
||||||
*/
|
*/
|
||||||
@@ -2488,14 +2468,14 @@ interface ReadableWritablePair<R = any, W = any> {
|
|||||||
writable: WritableStream<W>;
|
writable: WritableStream<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
|
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
||||||
*/
|
*/
|
||||||
declare class WritableStream<W = any> {
|
declare class WritableStream<W = any> {
|
||||||
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
|
||||||
/**
|
/**
|
||||||
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.
|
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
|
||||||
*/
|
*/
|
||||||
@@ -2507,83 +2487,83 @@ declare class WritableStream<W = any> {
|
|||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled.
|
* The **`close()`** method of the WritableStream interface closes the associated stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. While the stream is locked, no other writer can be acquired until this one is released.
|
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
||||||
*/
|
*/
|
||||||
getWriter(): WritableStreamDefaultWriter<W>;
|
getWriter(): WritableStreamDefaultWriter<W>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
* The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
||||||
*/
|
*/
|
||||||
declare class WritableStreamDefaultWriter<W = any> {
|
declare class WritableStreamDefaultWriter<W = any> {
|
||||||
constructor(stream: WritableStream);
|
constructor(stream: WritableStream);
|
||||||
/**
|
/**
|
||||||
* The **`closed`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that fulfills if the stream becomes closed, or rejects if the stream errors or the writer's lock is released.
|
* The **`closed`** read-only property of the the stream errors or the writer's lock is released.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
|
||||||
*/
|
*/
|
||||||
get closed(): Promise<void>;
|
get closed(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`ready`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
* The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
|
||||||
*/
|
*/
|
||||||
get ready(): Promise<void>;
|
get ready(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`desiredSize`** read-only property of the WritableStreamDefaultWriter interface returns the desired size required to fill the stream's internal queue.
|
* The **`desiredSize`** read-only property of the to fill the stream's internal queue.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
|
||||||
*/
|
*/
|
||||||
get desiredSize(): number | null;
|
get desiredSize(): number | null;
|
||||||
/**
|
/**
|
||||||
* The **`abort()`** method of the WritableStreamDefaultWriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
* The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
|
||||||
*/
|
*/
|
||||||
abort(reason?: any): Promise<void>;
|
abort(reason?: any): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the WritableStreamDefaultWriter interface closes the associated writable stream.
|
* The **`close()`** method of the stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`write()`** method of the WritableStreamDefaultWriter interface writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation.
|
* The **`write()`** method of the operation.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
|
||||||
*/
|
*/
|
||||||
write(chunk?: W): Promise<void>;
|
write(chunk?: W): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* The **`releaseLock()`** method of the WritableStreamDefaultWriter interface releases the writer's lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
|
* The **`releaseLock()`** method of the corresponding stream.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
|
||||||
*/
|
*/
|
||||||
releaseLock(): void;
|
releaseLock(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain transform stream concept.
|
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
|
||||||
*/
|
*/
|
||||||
declare class TransformStream<I = any, O = any> {
|
declare class TransformStream<I = any, O = any> {
|
||||||
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
|
||||||
/**
|
/**
|
||||||
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream. This stream emits the transformed output data.
|
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
|
||||||
*/
|
*/
|
||||||
get readable(): ReadableStream<O>;
|
get readable(): ReadableStream<O>;
|
||||||
/**
|
/**
|
||||||
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream. This stream accepts input data that will be transformed and emitted to the readable stream.
|
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
|
||||||
*/
|
*/
|
||||||
@@ -2602,7 +2582,7 @@ interface ReadableStreamValuesOptions {
|
|||||||
preventCancel?: boolean;
|
preventCancel?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`CompressionStream`** interface of the Compression Streams API compresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2610,7 +2590,7 @@ declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBuffe
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`DecompressionStream`** interface of the Compression Streams API decompresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
|
||||||
*/
|
*/
|
||||||
@@ -2618,7 +2598,7 @@ declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBuf
|
|||||||
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2627,7 +2607,7 @@ declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
|
|||||||
get encoding(): string;
|
get encoding(): string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings. It is the streaming equivalent of TextDecoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
|
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
|
||||||
*/
|
*/
|
||||||
@@ -2776,12 +2756,6 @@ interface TraceLog {
|
|||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
readonly level: string;
|
readonly level: string;
|
||||||
readonly message: any;
|
readonly message: any;
|
||||||
readonly errorInfo?: (TraceLogErrorInfo | null)[];
|
|
||||||
}
|
|
||||||
interface TraceLogErrorInfo {
|
|
||||||
name: string;
|
|
||||||
message: string;
|
|
||||||
stack?: string;
|
|
||||||
}
|
}
|
||||||
interface TraceException {
|
interface TraceException {
|
||||||
readonly timestamp: number;
|
readonly timestamp: number;
|
||||||
@@ -2802,7 +2776,7 @@ interface UnsafeTraceMetrics {
|
|||||||
fromTrace(item: TraceItem): TraceMetrics;
|
fromTrace(item: TraceItem): TraceMetrics;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`URL`** interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.
|
* The **`URL`** interface is used to parse, construct, normalize, and encode URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
||||||
*/
|
*/
|
||||||
@@ -2827,121 +2801,121 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
set href(value: string);
|
set href(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
/**
|
||||||
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
||||||
*/
|
*/
|
||||||
set protocol(value: string);
|
set protocol(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
/**
|
||||||
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
* The **`username`** property of the URL interface is a string containing the username component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
||||||
*/
|
*/
|
||||||
set username(value: string);
|
set username(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
/**
|
||||||
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
* The **`password`** property of the URL interface is a string containing the password component of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
||||||
*/
|
*/
|
||||||
set password(value: string);
|
set password(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
get host(): string;
|
get host(): string;
|
||||||
/**
|
/**
|
||||||
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
||||||
*/
|
*/
|
||||||
set host(value: string);
|
set host(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
||||||
*/
|
*/
|
||||||
set hostname(value: string);
|
set hostname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
/**
|
||||||
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
* The **`port`** property of the URL interface is a string containing the port number of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
||||||
*/
|
*/
|
||||||
set port(value: string);
|
set port(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
/**
|
||||||
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
||||||
*/
|
*/
|
||||||
set pathname(value: string);
|
set pathname(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
/**
|
||||||
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
||||||
*/
|
*/
|
||||||
set search(value: string);
|
set search(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
/**
|
||||||
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
||||||
*/
|
*/
|
||||||
set hash(value: string);
|
set hash(value: string);
|
||||||
/**
|
/**
|
||||||
* The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
|
* The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
||||||
*/
|
*/
|
||||||
get searchParams(): URLSearchParams;
|
get searchParams(): URLSearchParams;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().
|
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -2961,13 +2935,13 @@ declare class URL {
|
|||||||
*/
|
*/
|
||||||
static parse(url: string, base?: string): URL | null;
|
static parse(url: string, base?: string): URL | null;
|
||||||
/**
|
/**
|
||||||
* The **`createObjectURL()`** static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.
|
* The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
||||||
*/
|
*/
|
||||||
static createObjectURL(object: File | Blob): string;
|
static createObjectURL(object: File | Blob): string;
|
||||||
/**
|
/**
|
||||||
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().
|
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
||||||
*/
|
*/
|
||||||
@@ -3017,22 +2991,25 @@ declare class URLSearchParams {
|
|||||||
*/
|
*/
|
||||||
has(name: string, value?: string): boolean;
|
has(name: string, value?: string): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.
|
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
||||||
*/
|
*/
|
||||||
set(name: string, value: string): void;
|
set(name: string, value: string): void;
|
||||||
/**
|
/**
|
||||||
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved).
|
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
||||||
*/
|
*/
|
||||||
sort(): void;
|
sort(): void;
|
||||||
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
||||||
entries(): IterableIterator<[
|
entries(): IterableIterator<[
|
||||||
key: string,
|
key: string,
|
||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
|
/* Returns a list of keys in the search params. */
|
||||||
keys(): IterableIterator<string>;
|
keys(): IterableIterator<string>;
|
||||||
|
/* Returns a list of values in the search params. */
|
||||||
values(): IterableIterator<string>;
|
values(): IterableIterator<string>;
|
||||||
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
|
||||||
/*function toString() { [native code] }*/
|
/*function toString() { [native code] }*/
|
||||||
@@ -3042,78 +3019,18 @@ declare class URLSearchParams {
|
|||||||
value: string
|
value: string
|
||||||
]>;
|
]>;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern. The pattern can contain capturing groups that extract parts of the matched URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
|
|
||||||
*/
|
|
||||||
declare class URLPattern {
|
declare class URLPattern {
|
||||||
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
|
||||||
/**
|
|
||||||
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
||||||
*/
|
|
||||||
get protocol(): string;
|
get protocol(): string;
|
||||||
/**
|
|
||||||
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
||||||
*/
|
|
||||||
get username(): string;
|
get username(): string;
|
||||||
/**
|
|
||||||
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
||||||
*/
|
|
||||||
get password(): string;
|
get password(): string;
|
||||||
/**
|
|
||||||
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
||||||
*/
|
|
||||||
get hostname(): string;
|
get hostname(): string;
|
||||||
/**
|
|
||||||
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
||||||
*/
|
|
||||||
get port(): string;
|
get port(): string;
|
||||||
/**
|
|
||||||
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
||||||
*/
|
|
||||||
get pathname(): string;
|
get pathname(): string;
|
||||||
/**
|
|
||||||
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
||||||
*/
|
|
||||||
get search(): string;
|
get search(): string;
|
||||||
/**
|
|
||||||
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
|
|
||||||
*/
|
|
||||||
get hash(): string;
|
get hash(): string;
|
||||||
/**
|
|
||||||
* The **`hasRegExpGroups`** read-only property of the URLPattern interface is a boolean indicating whether or not any of the URLPattern components contain regular expression capturing groups.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
|
|
||||||
*/
|
|
||||||
get hasRegExpGroups(): boolean;
|
get hasRegExpGroups(): boolean;
|
||||||
/**
|
|
||||||
* The **`test()`** method of the URLPattern interface takes a URL string or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
|
|
||||||
*/
|
|
||||||
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
test(input?: (string | URLPatternInit), baseURL?: string): boolean;
|
||||||
/**
|
|
||||||
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or null if the URL does not match the pattern.
|
|
||||||
*
|
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
|
|
||||||
*/
|
|
||||||
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
|
||||||
}
|
}
|
||||||
interface URLPatternInit {
|
interface URLPatternInit {
|
||||||
@@ -3146,7 +3063,7 @@ interface URLPatternOptions {
|
|||||||
ignoreCase?: boolean;
|
ignoreCase?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 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.
|
* A `CloseEvent` is sent to clients using WebSockets when the connection is closed.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
||||||
*/
|
*/
|
||||||
@@ -3165,16 +3082,13 @@ declare class CloseEvent extends Event {
|
|||||||
*/
|
*/
|
||||||
readonly reason: string;
|
readonly reason: string;
|
||||||
/**
|
/**
|
||||||
* The **`wasClean`** read-only property of the CloseEvent interface returns true if the connection closed cleanly.
|
* The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
||||||
*/
|
*/
|
||||||
readonly wasClean: boolean;
|
readonly wasClean: boolean;
|
||||||
}
|
}
|
||||||
interface CloseEventInit {
|
interface CloseEventInit {
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
code?: number;
|
code?: number;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
wasClean?: boolean;
|
wasClean?: boolean;
|
||||||
@@ -3186,7 +3100,7 @@ type WebSocketEventMap = {
|
|||||||
error: ErrorEvent;
|
error: ErrorEvent;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
@@ -3203,20 +3117,20 @@ declare var WebSocket: {
|
|||||||
readonly CLOSED: number;
|
readonly CLOSED: number;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
||||||
*/
|
*/
|
||||||
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
||||||
accept(options?: WebSocketAcceptOptions): void;
|
accept(options?: WebSocketAcceptOptions): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. The browser will throw an exception if you call send() when the connection is in the CONNECTING state. If you call send() when the connection is in the CLOSING or CLOSED states, the browser will silently discard the data.
|
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
||||||
*/
|
*/
|
||||||
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.close()`** method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.
|
* The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
||||||
*/
|
*/
|
||||||
@@ -3236,13 +3150,13 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|||||||
*/
|
*/
|
||||||
url: string | null;
|
url: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object, or the empty string if no connection is established.
|
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
||||||
*/
|
*/
|
||||||
protocol: string | null;
|
protocol: string | null;
|
||||||
/**
|
/**
|
||||||
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.
|
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
||||||
*/
|
*/
|
||||||
@@ -3329,25 +3243,25 @@ interface SocketInfo {
|
|||||||
declare class EventSource extends EventTarget {
|
declare class EventSource extends EventTarget {
|
||||||
constructor(url: string, init?: EventSourceEventSourceInit);
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the EventSource.readyState attribute to 2 (closed).
|
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`url`** read-only property of the EventSource interface returns a string representing the URL of the source.
|
* The **`url`** read-only property of the URL of the source.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
||||||
*/
|
*/
|
||||||
get url(): string;
|
get url(): string;
|
||||||
/**
|
/**
|
||||||
* The **`withCredentials`** read-only property of the EventSource interface returns a boolean value indicating whether the EventSource object was instantiated with CORS credentials set.
|
* The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
||||||
*/
|
*/
|
||||||
get withCredentials(): boolean;
|
get withCredentials(): boolean;
|
||||||
/**
|
/**
|
||||||
* The **`readyState`** read-only property of the EventSource interface returns a number representing the state of the connection.
|
* The **`readyState`** read-only property of the connection.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
||||||
*/
|
*/
|
||||||
@@ -3382,26 +3296,18 @@ interface ContainerExecOptions {
|
|||||||
cwd?: string;
|
cwd?: string;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
user?: string;
|
user?: string;
|
||||||
signal?: AbortSignal;
|
|
||||||
pty?: boolean | ContainerExecPtyOptions;
|
|
||||||
stdin?: ReadableStream | "pipe";
|
stdin?: ReadableStream | "pipe";
|
||||||
stdout?: "pipe" | "ignore";
|
stdout?: "pipe" | "ignore";
|
||||||
stderr?: "pipe" | "ignore" | "combined";
|
stderr?: "pipe" | "ignore" | "combined";
|
||||||
}
|
}
|
||||||
interface ContainerExecPtyOptions {
|
|
||||||
cols?: number;
|
|
||||||
rows?: number;
|
|
||||||
}
|
|
||||||
interface ExecProcess {
|
interface ExecProcess {
|
||||||
readonly stdin: WritableStream | null;
|
readonly stdin: WritableStream | null;
|
||||||
readonly stdout: ReadableStream | null;
|
readonly stdout: ReadableStream | null;
|
||||||
readonly stderr: ReadableStream | null;
|
readonly stderr: ReadableStream | null;
|
||||||
readonly pid: number;
|
readonly pid: number;
|
||||||
readonly isPty: boolean;
|
|
||||||
readonly exitCode: Promise<number>;
|
readonly exitCode: Promise<number>;
|
||||||
output(): Promise<ExecOutput>;
|
output(): Promise<ExecOutput>;
|
||||||
kill(signal?: number): void;
|
kill(signal?: number): void;
|
||||||
resize(cols: number, rows: number): void;
|
|
||||||
}
|
}
|
||||||
interface Container {
|
interface Container {
|
||||||
get running(): boolean;
|
get running(): boolean;
|
||||||
@@ -3428,42 +3334,25 @@ interface ContainerDirectorySnapshotOptions {
|
|||||||
dir: string;
|
dir: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerDirectorySnapshotRestoreParams = {
|
interface ContainerDirectorySnapshotRestoreParams {
|
||||||
snapshot: ContainerDirectorySnapshot;
|
snapshot: ContainerDirectorySnapshot;
|
||||||
mountPoint?: string;
|
mountPoint?: string;
|
||||||
} | {
|
}
|
||||||
snapshot?: undefined;
|
|
||||||
mountPoint: string;
|
|
||||||
};
|
|
||||||
interface ContainerSnapshot {
|
interface ContainerSnapshot {
|
||||||
id: string;
|
id: string;
|
||||||
size: number;
|
size: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
interface ContainerSnapshotRestoreParams {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
interface ContainerSnapshotOptions {
|
interface ContainerSnapshotOptions {
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
}
|
||||||
type ContainerStartupOptions = {
|
interface ContainerStartupOptions {
|
||||||
entrypoint?: string[];
|
entrypoint?: string[];
|
||||||
enableInternet: boolean;
|
enableInternet: boolean;
|
||||||
env?: Record<string, string>;
|
env?: Record<string, string>;
|
||||||
instance?: "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | ContainerStartResources;
|
|
||||||
labels?: Record<string, string>;
|
labels?: Record<string, string>;
|
||||||
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
||||||
} & ({
|
containerSnapshot?: ContainerSnapshot;
|
||||||
image: string;
|
|
||||||
containerSnapshot?: never;
|
|
||||||
} | {
|
|
||||||
image?: never;
|
|
||||||
containerSnapshot?: ContainerSnapshotRestoreParams;
|
|
||||||
});
|
|
||||||
interface ContainerStartResources {
|
|
||||||
vcpu: number;
|
|
||||||
memoryMib: number;
|
|
||||||
diskMb: number;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
* The **`MessagePort`** interface of the Channel Messaging API 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.
|
||||||
@@ -3472,19 +3361,19 @@ interface ContainerStartResources {
|
|||||||
*/
|
*/
|
||||||
declare abstract class MessagePort extends EventTarget {
|
declare abstract class MessagePort extends EventTarget {
|
||||||
/**
|
/**
|
||||||
* The **`postMessage()`** method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
|
* The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
||||||
*/
|
*/
|
||||||
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
|
||||||
/**
|
/**
|
||||||
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.
|
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
||||||
*/
|
*/
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage.
|
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
||||||
*/
|
*/
|
||||||
@@ -3500,13 +3389,13 @@ declare abstract class MessagePort extends EventTarget {
|
|||||||
declare class MessageChannel {
|
declare class MessageChannel {
|
||||||
constructor();
|
constructor();
|
||||||
/**
|
/**
|
||||||
* The **`port1`** read-only property of the MessageChannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
|
* The **`port1`** read-only property of the the port attached to the context that originated the channel.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
||||||
*/
|
*/
|
||||||
readonly port1: MessagePort;
|
readonly port1: MessagePort;
|
||||||
/**
|
/**
|
||||||
* The **`port2`** read-only property of the MessageChannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
|
* The **`port2`** read-only property of the the port attached to the context at the other end of the channel, which the message is initially sent to.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
||||||
*/
|
*/
|
||||||
@@ -3566,7 +3455,7 @@ interface WorkerLoaderModule {
|
|||||||
data?: ArrayBuffer;
|
data?: ArrayBuffer;
|
||||||
json?: any;
|
json?: any;
|
||||||
py?: string;
|
py?: string;
|
||||||
wasm?: ArrayBuffer | ArrayBufferView | WebAssembly.Module;
|
wasm?: ArrayBuffer;
|
||||||
}
|
}
|
||||||
interface WorkerLoaderWorkerCode {
|
interface WorkerLoaderWorkerCode {
|
||||||
compatibilityDate: string;
|
compatibilityDate: string;
|
||||||
@@ -3574,7 +3463,7 @@ interface WorkerLoaderWorkerCode {
|
|||||||
allowExperimental?: boolean;
|
allowExperimental?: boolean;
|
||||||
limits?: workerdResourceLimits;
|
limits?: workerdResourceLimits;
|
||||||
mainModule: string;
|
mainModule: string;
|
||||||
modules: Record<string, string | WebAssembly.Module | WorkerLoaderModule>;
|
modules: Record<string, WorkerLoaderModule | string>;
|
||||||
env?: any;
|
env?: any;
|
||||||
globalOutbound?: (Fetcher | null);
|
globalOutbound?: (Fetcher | null);
|
||||||
tails?: Fetcher[];
|
tails?: Fetcher[];
|
||||||
@@ -3596,7 +3485,7 @@ declare abstract class Performance {
|
|||||||
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
||||||
now(): number;
|
now(): number;
|
||||||
/**
|
/**
|
||||||
* The **`toJSON()`** method of the Performance interface is a serializer; it returns a JSON representation of the Performance object.
|
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
||||||
*
|
*
|
||||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
||||||
*/
|
*/
|
||||||
@@ -3605,13 +3494,11 @@ declare abstract class Performance {
|
|||||||
interface Tracing {
|
interface Tracing {
|
||||||
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
|
||||||
startSpan(name: string): Span;
|
|
||||||
Span: typeof Span;
|
Span: typeof Span;
|
||||||
}
|
}
|
||||||
declare abstract class Span {
|
declare abstract class Span {
|
||||||
get isTraced(): boolean;
|
get isTraced(): boolean;
|
||||||
setAttribute(key: string, value: boolean | number | string): this;
|
setAttribute(key: string, value?: (boolean | number | string)): void;
|
||||||
setAttributes(attributes: Record<string, boolean | number | string | undefined>): this;
|
|
||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -4251,13 +4138,6 @@ type AiSearchListItemsParams = {
|
|||||||
source?: string;
|
source?: string;
|
||||||
/** JSON-encoded Vectorize filter for metadata filtering. */
|
/** JSON-encoded Vectorize filter for metadata filtering. */
|
||||||
metadata_filter?: string;
|
metadata_filter?: string;
|
||||||
/** Filter items by their unique ID. Returns at most one item. */
|
|
||||||
item_id?: string;
|
|
||||||
/**
|
|
||||||
* Filter items by their exact key (object key / filename). Keys are unique
|
|
||||||
* per source, so combine with `source` to disambiguate across data sources.
|
|
||||||
*/
|
|
||||||
key?: string;
|
|
||||||
};
|
};
|
||||||
type AiSearchListItemsResponse = {
|
type AiSearchListItemsResponse = {
|
||||||
result: AiSearchItemInfo[];
|
result: AiSearchItemInfo[];
|
||||||
@@ -10155,163 +10035,6 @@ declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|||||||
inputs: ChatCompletionsInput;
|
inputs: ChatCompletionsInput;
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
postProcessedOutputs: ChatCompletionsOutput;
|
||||||
}
|
}
|
||||||
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_2 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input {
|
|
||||||
/**
|
|
||||||
* Which Moondream skill to run.
|
|
||||||
*/
|
|
||||||
task?: "query" | "caption" | "point" | "detect";
|
|
||||||
/**
|
|
||||||
* Input image as a public HTTPS URL or base64 data URI. Optional for `query`; required for `caption`, `point`, and `detect`.
|
|
||||||
*/
|
|
||||||
image?: string;
|
|
||||||
/**
|
|
||||||
* Question for the `query` task.
|
|
||||||
*/
|
|
||||||
question?: string;
|
|
||||||
/**
|
|
||||||
* Caption length for the `caption` task.
|
|
||||||
*/
|
|
||||||
caption_length?: "short" | "normal" | "long";
|
|
||||||
/**
|
|
||||||
* Object phrase to locate for `point` and `detect` tasks (e.g. 'person wearing a red shirt').
|
|
||||||
*/
|
|
||||||
target?: string;
|
|
||||||
/**
|
|
||||||
* Enable reasoning trace for the `query` task.
|
|
||||||
*/
|
|
||||||
reasoning?: boolean;
|
|
||||||
/**
|
|
||||||
* Sampling temperature.
|
|
||||||
*/
|
|
||||||
temperature?: number;
|
|
||||||
/**
|
|
||||||
* Top-p (nucleus) sampling.
|
|
||||||
*/
|
|
||||||
top_p?: number;
|
|
||||||
/**
|
|
||||||
* Max tokens to generate for `query` and `caption`.
|
|
||||||
*/
|
|
||||||
max_tokens?: number;
|
|
||||||
/**
|
|
||||||
* Max objects to return for `point` and `detect`.
|
|
||||||
*/
|
|
||||||
max_objects?: number;
|
|
||||||
/**
|
|
||||||
* Return incremental tokens for `query` and `caption`. `point` and `detect` do not support streaming.
|
|
||||||
*/
|
|
||||||
stream?: boolean;
|
|
||||||
}
|
|
||||||
interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output {
|
|
||||||
/**
|
|
||||||
* Reason the generation finished.
|
|
||||||
*/
|
|
||||||
finish_reason: string;
|
|
||||||
metrics: {
|
|
||||||
/**
|
|
||||||
* Number of input tokens consumed.
|
|
||||||
*/
|
|
||||||
input_tokens: number;
|
|
||||||
/**
|
|
||||||
* Number of output tokens generated.
|
|
||||||
*/
|
|
||||||
output_tokens: number;
|
|
||||||
/**
|
|
||||||
* Prefill time in milliseconds.
|
|
||||||
*/
|
|
||||||
prefill_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Decode time in milliseconds.
|
|
||||||
*/
|
|
||||||
decode_time_ms: number;
|
|
||||||
/**
|
|
||||||
* Time to first token in milliseconds.
|
|
||||||
*/
|
|
||||||
ttft_ms: number;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Answer text for the `query` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
answer?: string;
|
|
||||||
/**
|
|
||||||
* Caption text for the `caption` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
caption?: string;
|
|
||||||
/**
|
|
||||||
* Located points for the `point` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
points?: {
|
|
||||||
/**
|
|
||||||
* X coordinate.
|
|
||||||
*/
|
|
||||||
x: number;
|
|
||||||
/**
|
|
||||||
* Y coordinate.
|
|
||||||
*/
|
|
||||||
y: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Detected bounding boxes for the `detect` task. Null for other tasks.
|
|
||||||
*/
|
|
||||||
objects?: {
|
|
||||||
/**
|
|
||||||
* Minimum X coordinate.
|
|
||||||
*/
|
|
||||||
x_min: number;
|
|
||||||
/**
|
|
||||||
* Minimum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_min: number;
|
|
||||||
/**
|
|
||||||
* Maximum X coordinate.
|
|
||||||
*/
|
|
||||||
x_max: number;
|
|
||||||
/**
|
|
||||||
* Maximum Y coordinate.
|
|
||||||
*/
|
|
||||||
y_max: number;
|
|
||||||
}[];
|
|
||||||
/**
|
|
||||||
* Reasoning trace for the `query` task when reasoning=true. Null otherwise.
|
|
||||||
*/
|
|
||||||
reasoning?: {
|
|
||||||
/**
|
|
||||||
* Reasoning text.
|
|
||||||
*/
|
|
||||||
text: string;
|
|
||||||
/**
|
|
||||||
* Grounding information.
|
|
||||||
*/
|
|
||||||
grounding?: {}[];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B {
|
|
||||||
inputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input;
|
|
||||||
postProcessedOutputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813 {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Qwen_Qwen3_8_27B {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3_Flash {
|
|
||||||
inputs: ChatCompletionsInput;
|
|
||||||
postProcessedOutputs: ChatCompletionsOutput;
|
|
||||||
}
|
|
||||||
interface AiModels {
|
interface AiModels {
|
||||||
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
||||||
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
||||||
@@ -10404,13 +10127,6 @@ interface AiModels {
|
|||||||
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
||||||
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
||||||
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
||||||
"@cf/moonshotai/kimi-k2.7-code": Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code;
|
|
||||||
"@cf/zai-org/glm-5.2": Base_Ai_Cf_Zai_Org_Glm_5_2;
|
|
||||||
"@cf/moondream/moondream3.1-9B-A2B": Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-flash-0731": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731;
|
|
||||||
"@cf/deepseek-ai/deepseek-v4-pro-0813": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813;
|
|
||||||
"@cf/qwen/qwen3.8-27b": Base_Ai_Cf_Qwen_Qwen3_8_27B;
|
|
||||||
"@cf/zai-org/glm-5.3-flash": Base_Ai_Cf_Zai_Org_Glm_5_3_Flash;
|
|
||||||
}
|
}
|
||||||
type AiOptions = {
|
type AiOptions = {
|
||||||
/**
|
/**
|
||||||
@@ -11077,15 +10793,6 @@ interface BrowserRunBaseOptions {
|
|||||||
*/
|
*/
|
||||||
cacheTTL?: number;
|
cacheTTL?: number;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Backend selection, mixed into the options of the quick actions that support it.
|
|
||||||
* Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
|
|
||||||
* reject an alternate backend, so they must not accept the field.
|
|
||||||
*/
|
|
||||||
interface BrowserRunAlternateBackendOptions {
|
|
||||||
/** Render with an alternate browser backend instead of the default one. */
|
|
||||||
browser?: 'kitesurf';
|
|
||||||
}
|
|
||||||
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
/** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
|
||||||
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
|
||||||
/** URL to navigate to, e.g. `"https://example.com"`. */
|
/** URL to navigate to, e.g. `"https://example.com"`. */
|
||||||
@@ -11120,7 +10827,7 @@ type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
|
|||||||
scrollPage?: boolean;
|
scrollPage?: boolean;
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
||||||
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
/** @see https://pptr.dev/api/puppeteer.pdfoptions */
|
||||||
pdfOptions?: {
|
pdfOptions?: {
|
||||||
@@ -11156,7 +10863,7 @@ type BrowserRunPDFOptions = BrowserRunCommonOptions & {
|
|||||||
/** @default 30000 */
|
/** @default 30000 */
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
};
|
};
|
||||||
} & BrowserRunAlternateBackendOptions;
|
};
|
||||||
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
|
||||||
/** CSS selectors to scrape. At least one element is required. */
|
/** CSS selectors to scrape. At least one element is required. */
|
||||||
elements: Array<{
|
elements: Array<{
|
||||||
@@ -11169,29 +10876,10 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
|
|||||||
/** When true, exclude links pointing to external domains. @default false */
|
/** When true, exclude links pointing to external domains. @default false */
|
||||||
excludeExternalLinks?: boolean;
|
excludeExternalLinks?: boolean;
|
||||||
};
|
};
|
||||||
type BrowserRunSnapshotFormat = 'content' | 'screenshot' | 'markdown' | 'accessibilityTree';
|
|
||||||
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
|
||||||
/** Which representations of the page to return. At least two distinct formats
|
|
||||||
* are required; request a single format from its dedicated action instead.
|
|
||||||
* @default ["content","screenshot"]
|
|
||||||
*/
|
|
||||||
formats?: BrowserRunSnapshotFormat[];
|
|
||||||
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
/** @see https://pptr.dev/api/puppeteer.screenshotoptions */
|
||||||
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
|
||||||
};
|
};
|
||||||
/** Options for the `accessibilityTree` quick action. */
|
|
||||||
type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
|
|
||||||
/** When true, prune nodes that carry no semantic meaning, such as generic
|
|
||||||
* containers. Defaults to true, or to false when `root` is set so that the
|
|
||||||
* requested subtree is returned as-is.
|
|
||||||
*/
|
|
||||||
interestingOnly?: boolean;
|
|
||||||
/** CSS selector limiting the tree to the matching element's subtree.
|
|
||||||
* A selector that matches nothing yields `accessibilityTree: null` with
|
|
||||||
* HTTP 200; a malformed selector is an error.
|
|
||||||
*/
|
|
||||||
root?: string;
|
|
||||||
} & BrowserRunAlternateBackendOptions;
|
|
||||||
interface BrowserRunJsonBaseOptions {
|
interface BrowserRunJsonBaseOptions {
|
||||||
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
/** Custom AI models to try in order. Max 3. Falls back to next on error. */
|
||||||
custom_ai?: Array<{
|
custom_ai?: Array<{
|
||||||
@@ -11205,7 +10893,7 @@ interface BrowserRunJsonBaseOptions {
|
|||||||
* Options for the `json` quick action.
|
* Options for the `json` quick action.
|
||||||
* At least one of `prompt` or `response_format` must be provided.
|
* At least one of `prompt` or `response_format` must be provided.
|
||||||
*/
|
*/
|
||||||
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions & BrowserRunJsonBaseOptions & ({
|
type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunJsonBaseOptions & ({
|
||||||
/** Natural-language prompt describing what data to extract. */
|
/** Natural-language prompt describing what data to extract. */
|
||||||
prompt: string;
|
prompt: string;
|
||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
@@ -11216,80 +10904,14 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBacken
|
|||||||
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
/** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
|
||||||
response_format: AiTextGenerationResponseFormat;
|
response_format: AiTextGenerationResponseFormat;
|
||||||
});
|
});
|
||||||
type BrowserRunContentOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunContentOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunMarkdownOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
|
type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
|
||||||
type BrowserRunRedirectHop = {
|
|
||||||
/** URL that returned the redirect. */
|
|
||||||
url: string;
|
|
||||||
/** HTTP status of the redirect. */
|
|
||||||
status: number;
|
|
||||||
/** Redirect response headers, including `location`. */
|
|
||||||
headers: Record<string, string>;
|
|
||||||
};
|
|
||||||
type BrowserRunResponseMeta = {
|
type BrowserRunResponseMeta = {
|
||||||
/** HTTP status code of the rendered page */
|
/** HTTP status code of the rendered page */
|
||||||
status: number;
|
status: number;
|
||||||
/** Page title */
|
/** Page title */
|
||||||
title: string;
|
title: string;
|
||||||
/** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
/** URL that served the response, after any redirects the browser followed. */
|
|
||||||
finalUrl?: string;
|
|
||||||
/** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
|
|
||||||
redirectChain?: BrowserRunRedirectHop[];
|
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* A node in the page's accessibility tree, as exposed to assistive technology.
|
|
||||||
* `role` is the only field always present; the rest are populated when the
|
|
||||||
* underlying element defines them.
|
|
||||||
* @see https://pptr.dev/api/puppeteer.serializedaxnode
|
|
||||||
*/
|
|
||||||
interface BrowserRunSerializedAXNode {
|
|
||||||
/** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
|
|
||||||
role: string;
|
|
||||||
/** The `aria-autocomplete` value. */
|
|
||||||
autocomplete?: string;
|
|
||||||
/** Checked state of a checkbox, radio, or menu item. */
|
|
||||||
checked?: boolean | 'mixed';
|
|
||||||
/** Accessible description, typically from `aria-describedby` or `title`. */
|
|
||||||
description?: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
expanded?: boolean;
|
|
||||||
/** Whether the element currently holds keyboard focus. */
|
|
||||||
focused?: boolean;
|
|
||||||
/** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
|
|
||||||
haspopup?: string;
|
|
||||||
/** The `aria-invalid` value. */
|
|
||||||
invalid?: string;
|
|
||||||
/** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
|
|
||||||
keyshortcuts?: string;
|
|
||||||
/** Hierarchical level, e.g. the heading level of an `<h2>`. */
|
|
||||||
level?: number;
|
|
||||||
/** Whether the element is a modal dialog. */
|
|
||||||
modal?: boolean;
|
|
||||||
/** Whether a text input accepts multiple lines. */
|
|
||||||
multiline?: boolean;
|
|
||||||
/** Whether more than one option can be selected. */
|
|
||||||
multiselectable?: boolean;
|
|
||||||
/** Accessible name, e.g. a button's label or an image's alt text. */
|
|
||||||
name?: string;
|
|
||||||
orientation?: string;
|
|
||||||
/** Pressed state of a toggle button. */
|
|
||||||
pressed?: boolean | 'mixed';
|
|
||||||
readonly?: boolean;
|
|
||||||
required?: boolean;
|
|
||||||
/** Author-supplied role description, from `aria-roledescription`. */
|
|
||||||
roledescription?: string;
|
|
||||||
selected?: boolean;
|
|
||||||
/** Current value of an input or range element. */
|
|
||||||
value?: string | number;
|
|
||||||
valuemax?: number;
|
|
||||||
valuemin?: number;
|
|
||||||
/** Human-readable form of `value`, from `aria-valuetext`. */
|
|
||||||
valuetext?: string;
|
|
||||||
/** Child nodes. Absent for leaf nodes. */
|
|
||||||
children?: BrowserRunSerializedAXNode[];
|
|
||||||
}
|
|
||||||
/** Success response for `content` action. */
|
/** Success response for `content` action. */
|
||||||
type BrowserRunContentSuccessResponse = {
|
type BrowserRunContentSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
@@ -11302,7 +10924,6 @@ type BrowserRunLinksSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** Extracted links */
|
/** Extracted links */
|
||||||
result: string[];
|
result: string[];
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `scrape` action. */
|
/** Success response for `scrape` action. */
|
||||||
type BrowserRunScrapeSuccessResponse = {
|
type BrowserRunScrapeSuccessResponse = {
|
||||||
@@ -11333,33 +10954,15 @@ type BrowserRunScrapeSuccessResponse = {
|
|||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
}>;
|
}>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `snapshot` action. Each field is present only when the
|
/** Success response for `snapshot` action. */
|
||||||
* corresponding entry was requested in `formats`.
|
|
||||||
*/
|
|
||||||
type BrowserRunSnapshotSuccessResponse = {
|
type BrowserRunSnapshotSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
result: {
|
result: {
|
||||||
/** HTML content of the page. */
|
/** HTML content of the page. */
|
||||||
content?: string;
|
content: string;
|
||||||
/** Base64-encoded screenshot image. */
|
/** Base64-encoded screenshot image. */
|
||||||
screenshot?: string;
|
screenshot: string;
|
||||||
/** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
|
|
||||||
* page provides that metadata.
|
|
||||||
*/
|
|
||||||
markdown?: string;
|
|
||||||
/** Root of the page's accessibility tree. */
|
|
||||||
accessibilityTree?: BrowserRunSerializedAXNode;
|
|
||||||
};
|
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
|
||||||
/** Success response for `accessibilityTree` action. */
|
|
||||||
type BrowserRunAccessibilityTreeSuccessResponse = {
|
|
||||||
success: true;
|
|
||||||
result: {
|
|
||||||
/** Root of the accessibility tree, or `null` when `root` matched no element. */
|
|
||||||
accessibilityTree: BrowserRunSerializedAXNode | null;
|
|
||||||
};
|
};
|
||||||
meta: BrowserRunResponseMeta;
|
meta: BrowserRunResponseMeta;
|
||||||
};
|
};
|
||||||
@@ -11368,14 +10971,12 @@ type BrowserRunJsonSuccessResponse = {
|
|||||||
success: true;
|
success: true;
|
||||||
/** JSON data extracted from the page using an AI model */
|
/** JSON data extracted from the page using an AI model */
|
||||||
result: Record<string, unknown>;
|
result: Record<string, unknown>;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Success response for `markdown` action. */
|
/** Success response for `markdown` action. */
|
||||||
type BrowserRunMarkdownSuccessResponse = {
|
type BrowserRunMarkdownSuccessResponse = {
|
||||||
success: true;
|
success: true;
|
||||||
/** Extracted markdown content */
|
/** Extracted markdown content */
|
||||||
result: string;
|
result: string;
|
||||||
meta: BrowserRunResponseMeta;
|
|
||||||
};
|
};
|
||||||
/** Error response for BrowserRun actions. */
|
/** Error response for BrowserRun actions. */
|
||||||
type BrowserRunErrorResponse = {
|
type BrowserRunErrorResponse = {
|
||||||
@@ -11485,10 +11086,9 @@ declare abstract class BrowserRun {
|
|||||||
*/
|
*/
|
||||||
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
|
||||||
/**
|
/**
|
||||||
* Get several representations of a web page in one request.
|
* Get both the HTML content and a base64-encoded screenshot of a web page.
|
||||||
* @param action - Must be `'snapshot'`.
|
* @param action - Must be `'snapshot'`.
|
||||||
* @param options - Snapshot options including the `formats` to return and
|
* @param options - Snapshot options including screenshot settings (encoding is always base64).
|
||||||
* screenshot settings (encoding is always base64).
|
|
||||||
* @returns A `Response` containing one of:
|
* @returns A `Response` containing one of:
|
||||||
*
|
*
|
||||||
* **Success (HTTP 200):**
|
* **Success (HTTP 200):**
|
||||||
@@ -11536,26 +11136,6 @@ declare abstract class BrowserRun {
|
|||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
||||||
*/
|
*/
|
||||||
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
|
||||||
/**
|
|
||||||
* Get the accessibility tree of a web page.
|
|
||||||
* @param action - Must be `'accessibilityTree'`.
|
|
||||||
* @param options - Options to scope the tree to a subtree and to control
|
|
||||||
* whether semantically uninteresting nodes are pruned.
|
|
||||||
* @returns A `Response` containing one of:
|
|
||||||
*
|
|
||||||
* **Success (HTTP 200):**
|
|
||||||
* - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
|
|
||||||
* - `result.accessibilityTree` is `null` when `root` matched no element
|
|
||||||
*
|
|
||||||
* **Error:**
|
|
||||||
* - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
|
|
||||||
* - HTTP 422 for a malformed `root` selector
|
|
||||||
* - HTTP 500 with code `2017` or `2018` when the tree could not be built
|
|
||||||
*
|
|
||||||
* **Headers:**
|
|
||||||
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
|
|
||||||
*/
|
|
||||||
quickAction(action: 'accessibilityTree', options: BrowserRunAccessibilityTreeOptions): Promise<Response>;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* In addition to the properties you can set in the RequestInit dict
|
* In addition to the properties you can set in the RequestInit dict
|
||||||
@@ -12626,13 +12206,6 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|||||||
* @returns A promise that resolves when the email message is replied.
|
* @returns A promise that resolves when the email message is replied.
|
||||||
*/
|
*/
|
||||||
reply(message: EmailMessage): Promise<EmailSendResult>;
|
reply(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
/**
|
|
||||||
* Reply to the sender of this email message with a message built from the given
|
|
||||||
* fields. Threading headers (In-Reply-To/References) are set automatically.
|
|
||||||
* @param builder The reply message contents.
|
|
||||||
* @returns A promise that resolves when the email message is replied.
|
|
||||||
*/
|
|
||||||
reply(builder: EmailReplyMessageBuilder): Promise<EmailSendResult>;
|
|
||||||
}
|
}
|
||||||
/** A file attachment for an email message */
|
/** A file attachment for an email message */
|
||||||
type EmailAttachment = {
|
type EmailAttachment = {
|
||||||
@@ -12653,46 +12226,23 @@ interface EmailAddress {
|
|||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Recipient fields for `SendEmail.send()`. At least one of `to`, `cc`, or
|
|
||||||
* `bcc` must be provided.
|
|
||||||
*/
|
|
||||||
type EmailDestinations = {
|
|
||||||
to?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
cc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} & ({
|
|
||||||
to: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
cc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
} | {
|
|
||||||
bcc: string | EmailAddress | (string | EmailAddress)[];
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* Fields shared by all composed emails (no recipients). Used directly by
|
|
||||||
* `ForwardableEmailMessage.reply()`, which always replies to the original
|
|
||||||
* sender, and extended by `EmailMessageBuilder` for `SendEmail.send()`.
|
|
||||||
*/
|
|
||||||
interface EmailReplyMessageBuilder {
|
|
||||||
from: string | EmailAddress;
|
|
||||||
subject: string;
|
|
||||||
replyTo?: string | EmailAddress;
|
|
||||||
headers?: Record<string, string>;
|
|
||||||
text?: string;
|
|
||||||
html?: string;
|
|
||||||
attachments?: EmailAttachment[];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Fields for composing an email without constructing raw MIME, for
|
|
||||||
* `SendEmail.send()`. Requires at least one of `to`, `cc`, or `bcc`.
|
|
||||||
*/
|
|
||||||
type EmailMessageBuilder = EmailReplyMessageBuilder & EmailDestinations;
|
|
||||||
/**
|
/**
|
||||||
* A binding that allows a Worker to send email messages.
|
* A binding that allows a Worker to send email messages.
|
||||||
*/
|
*/
|
||||||
interface SendEmail {
|
interface SendEmail {
|
||||||
send(message: EmailMessage): Promise<EmailSendResult>;
|
send(message: EmailMessage): Promise<EmailSendResult>;
|
||||||
send(builder: EmailMessageBuilder): Promise<EmailSendResult>;
|
send(builder: {
|
||||||
|
from: string | EmailAddress;
|
||||||
|
to: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
subject: string;
|
||||||
|
replyTo?: string | EmailAddress;
|
||||||
|
cc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
bcc?: string | EmailAddress | (string | EmailAddress)[];
|
||||||
|
headers?: Record<string, string>;
|
||||||
|
text?: string;
|
||||||
|
html?: string;
|
||||||
|
attachments?: EmailAttachment[];
|
||||||
|
}): Promise<EmailSendResult>;
|
||||||
}
|
}
|
||||||
declare abstract class EmailEvent extends ExtendableEvent {
|
declare abstract class EmailEvent extends ExtendableEvent {
|
||||||
readonly message: ForwardableEmailMessage;
|
readonly message: ForwardableEmailMessage;
|
||||||
@@ -12846,15 +12396,6 @@ interface Hyperdrive {
|
|||||||
* for your database.
|
* for your database.
|
||||||
*/
|
*/
|
||||||
readonly host: string;
|
readonly host: string;
|
||||||
/*
|
|
||||||
* A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
|
|
||||||
* host field, is only valid within the context of the currently running
|
|
||||||
* Worker and, when passed into the `connect()` function from the
|
|
||||||
* "cloudflare:sockets" module, will connect to the Hyperdrive instance for
|
|
||||||
* your database. This is provided for database drivers that require the host
|
|
||||||
* to be an IP literal rather than a hostname.
|
|
||||||
*/
|
|
||||||
readonly ip: string;
|
|
||||||
/*
|
/*
|
||||||
* The port that must be paired the the host field when connecting.
|
* The port that must be paired the the host field when connecting.
|
||||||
*/
|
*/
|
||||||
@@ -12876,78 +12417,6 @@ interface Hyperdrive {
|
|||||||
*/
|
*/
|
||||||
readonly database: string;
|
readonly database: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* A handle to a dynamically-provisioned Hyperdrive connection, returned by
|
|
||||||
* `HyperdriveApi.get()`.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamic extends Disposable {
|
|
||||||
/**
|
|
||||||
* The database name to use when connecting through this Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly database: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated user to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly user: Promise<string>;
|
|
||||||
/*
|
|
||||||
* The randomly generated password to use when authenticating to your
|
|
||||||
* database via Hyperdrive.
|
|
||||||
*/
|
|
||||||
readonly password: Promise<string>;
|
|
||||||
/**
|
|
||||||
* Open a TCP socket to the target database through this Hyperdrive.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
connect(): Promise<Socket>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Binding that provisions Hyperdrive connections at request time, rather than
|
|
||||||
* from static configuration.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicApi {
|
|
||||||
/**
|
|
||||||
* Provision a connection for the database described by `args`.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
|
|
||||||
/**
|
|
||||||
* Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
|
|
||||||
*/
|
|
||||||
getHyperdriveConnectionString(connectionString: string): Promise<string>;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Parameters identifying the database that a dynamically-provisioned
|
|
||||||
* Hyperdrive connection should target.
|
|
||||||
*/
|
|
||||||
interface HyperdriveDynamicConfig {
|
|
||||||
/**
|
|
||||||
* Generated connection string to pass into the dynamic worker.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
dynamicHyperdriveConnectionString: string;
|
|
||||||
/**
|
|
||||||
* Connection string for the origin database Hyperdrive should connect to.
|
|
||||||
* Contains credentials, so treat it as a secret.
|
|
||||||
*
|
|
||||||
* The scheme selects the database engine. PostgreSQL origins are supported.
|
|
||||||
*/
|
|
||||||
connectionString: string;
|
|
||||||
/**
|
|
||||||
* Region in which to place the connection pool. See the Hyperdrive
|
|
||||||
* documentation for the set of supported regions.
|
|
||||||
*/
|
|
||||||
targetRegion: string;
|
|
||||||
/**
|
|
||||||
* Whether Hyperdrive should cache query results for this connection.
|
|
||||||
*/
|
|
||||||
cachingEnabled?: boolean;
|
|
||||||
/**
|
|
||||||
* Maximum number of connections the pool may open to the origin database.
|
|
||||||
* Defaults to 60.
|
|
||||||
*/
|
|
||||||
maxConnections?: number;
|
|
||||||
}
|
|
||||||
// Copyright (c) 2024 Cloudflare, Inc.
|
// Copyright (c) 2024 Cloudflare, Inc.
|
||||||
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
||||||
// https://opensource.org/licenses/Apache-2.0
|
// https://opensource.org/licenses/Apache-2.0
|
||||||
@@ -12959,27 +12428,6 @@ type ImageInfoResponse = {
|
|||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* Parameters for rasterizing text into an image.
|
|
||||||
*/
|
|
||||||
type TextRasterize = {
|
|
||||||
/** The text content to render */
|
|
||||||
content: string;
|
|
||||||
/** rasterization options for the text **/
|
|
||||||
options: TextOptions;
|
|
||||||
};
|
|
||||||
type TextOptions = {
|
|
||||||
/** Font configuration */
|
|
||||||
font: {
|
|
||||||
/** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
/** Font size in points (pt) */
|
|
||||||
size?: number;
|
|
||||||
/** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
|
|
||||||
color?: string;
|
|
||||||
};
|
|
||||||
type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
|
|
||||||
type ImageTransform = {
|
type ImageTransform = {
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
@@ -13069,9 +12517,6 @@ interface ImageUploadOptions {
|
|||||||
requireSignedURLs?: boolean;
|
requireSignedURLs?: boolean;
|
||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
/**
|
|
||||||
* If 'base64', the input data will be decoded from base64 before processing
|
|
||||||
*/
|
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
}
|
}
|
||||||
interface ImageUpdateOptions {
|
interface ImageUpdateOptions {
|
||||||
@@ -13079,40 +12524,11 @@ interface ImageUpdateOptions {
|
|||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
}
|
}
|
||||||
type ImageMetadataFilterOperators = {
|
|
||||||
eq?: string | number | boolean;
|
|
||||||
in?: string[] | number[];
|
|
||||||
gt?: number;
|
|
||||||
gte?: number;
|
|
||||||
lt?: number;
|
|
||||||
lte?: number;
|
|
||||||
};
|
|
||||||
type ImageMetadataFilterValue = string | number | boolean | ImageMetadataFilterOperators;
|
|
||||||
interface ImageListFilter {
|
|
||||||
metadata?: Record<string, ImageMetadataFilterValue>;
|
|
||||||
}
|
|
||||||
interface ImageListOptions {
|
interface ImageListOptions {
|
||||||
limit?: number;
|
limit?: number;
|
||||||
cursor?: string;
|
cursor?: string;
|
||||||
sortOrder?: 'asc' | 'desc';
|
sortOrder?: 'asc' | 'desc';
|
||||||
creator?: string;
|
creator?: string;
|
||||||
filter?: ImageListFilter;
|
|
||||||
}
|
|
||||||
interface ImageSignedUrlOptions {
|
|
||||||
variant: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
keyName?: string;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadOptions {
|
|
||||||
id?: string;
|
|
||||||
requireSignedURLs?: boolean;
|
|
||||||
metadata?: Record<string, unknown>;
|
|
||||||
creator?: string;
|
|
||||||
expiresIn?: number;
|
|
||||||
}
|
|
||||||
interface ImageDirectUploadResult {
|
|
||||||
id: string;
|
|
||||||
uploadURL: string;
|
|
||||||
}
|
}
|
||||||
interface ImageList {
|
interface ImageList {
|
||||||
images: ImageMetadata[];
|
images: ImageMetadata[];
|
||||||
@@ -13130,13 +12546,6 @@ interface ImageHandle {
|
|||||||
* @returns ReadableStream of image bytes, or null if not found
|
* @returns ReadableStream of image bytes, or null if not found
|
||||||
*/
|
*/
|
||||||
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
bytes(): Promise<ReadableStream<Uint8Array> | null>;
|
||||||
/**
|
|
||||||
* Generate a signed delivery URL for this hosted image.
|
|
||||||
* @param options Signing configuration
|
|
||||||
* @returns A signed image delivery URL
|
|
||||||
* @throws {@link ImagesError} if signing fails
|
|
||||||
*/
|
|
||||||
signedUrl(options: ImageSignedUrlOptions): Promise<string>;
|
|
||||||
/**
|
/**
|
||||||
* Update hosted image metadata
|
* Update hosted image metadata
|
||||||
* @param options Properties to update
|
* @param options Properties to update
|
||||||
@@ -13172,14 +12581,6 @@ interface HostedImagesBinding {
|
|||||||
* @throws {@link ImagesError} if list fails
|
* @throws {@link ImagesError} if list fails
|
||||||
*/
|
*/
|
||||||
list(options?: ImageListOptions): Promise<ImageList>;
|
list(options?: ImageListOptions): Promise<ImageList>;
|
||||||
/**
|
|
||||||
* Create a Direct Creator Upload link, letting an end user upload an
|
|
||||||
* image straight to Cloudflare without exposing an API token
|
|
||||||
* @param options Upload link configuration
|
|
||||||
* @returns The new image ID and the upload URL to hand to the end user
|
|
||||||
* @throws {@link ImagesError} if creation fails
|
|
||||||
*/
|
|
||||||
createDirectUpload(options?: ImageDirectUploadOptions): Promise<ImageDirectUploadResult>;
|
|
||||||
}
|
}
|
||||||
interface ImagesBinding {
|
interface ImagesBinding {
|
||||||
/**
|
/**
|
||||||
@@ -13194,13 +12595,6 @@ interface ImagesBinding {
|
|||||||
* @returns A transform handle
|
* @returns A transform handle
|
||||||
*/
|
*/
|
||||||
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
|
||||||
/**
|
|
||||||
* Begin applying a series of transformations to text
|
|
||||||
* @param content string to be rendered
|
|
||||||
* @param options font, optional color and size to use in rendering text
|
|
||||||
* @returns A transform handle
|
|
||||||
*/
|
|
||||||
text(content: string, options: TextOptions): ImageTransformer;
|
|
||||||
/**
|
/**
|
||||||
* Access hosted images CRUD operations
|
* Access hosted images CRUD operations
|
||||||
*/
|
*/
|
||||||
@@ -13230,15 +12624,11 @@ interface ImageTransformer {
|
|||||||
type ImageTransformationOutputOptions = {
|
type ImageTransformationOutputOptions = {
|
||||||
encoding?: 'base64';
|
encoding?: 'base64';
|
||||||
};
|
};
|
||||||
type ImageTransformationResponseOptions = {
|
|
||||||
headers?: HeadersInit;
|
|
||||||
};
|
|
||||||
interface ImageTransformationResult {
|
interface ImageTransformationResult {
|
||||||
/**
|
/**
|
||||||
* The image as a response, ready to store in cache or return to users
|
* The image as a response, ready to store in cache or return to users
|
||||||
* @param options Options that apply to the returned response, e.g. additional headers
|
|
||||||
*/
|
*/
|
||||||
response(options?: ImageTransformationResponseOptions): Response;
|
response(): Response;
|
||||||
/**
|
/**
|
||||||
* The content type of the returned image
|
* The content type of the returned image
|
||||||
*/
|
*/
|
||||||
@@ -13674,11 +13064,6 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowDynamicDelayContext = {
|
|
||||||
ctx: WorkflowStepContext<WorkflowDelayFunction>;
|
|
||||||
error: Error;
|
|
||||||
};
|
|
||||||
export type WorkflowDelayFunction = (input: WorkflowDynamicDelayContext) => WorkflowDelayDuration | Promise<WorkflowDelayDuration>;
|
|
||||||
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';
|
||||||
@@ -13686,32 +13071,12 @@ declare namespace CloudflareWorkersModule {
|
|||||||
export type WorkflowStepConfig = {
|
export type WorkflowStepConfig = {
|
||||||
retries?: {
|
retries?: {
|
||||||
limit: number;
|
limit: number;
|
||||||
delay: WorkflowDelayDuration | number | WorkflowDelayFunction;
|
delay: WorkflowDelayDuration | number;
|
||||||
backoff?: WorkflowBackoff;
|
backoff?: WorkflowBackoff;
|
||||||
};
|
};
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
timeout?: WorkflowTimeoutDuration | number;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
// Internal discriminators used only for `WorkflowStep.do` overload
|
|
||||||
// resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
|
|
||||||
// single kind so the callback context can be narrowed based on the shape of
|
|
||||||
// the config argument (rather than on an inferred type parameter, which is
|
|
||||||
// lost when the caller supplies an explicit return-type argument). Not
|
|
||||||
// exported: they must not widen the public type surface.
|
|
||||||
type WorkflowStepConfigWithStaticDelay = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
type WorkflowStepConfigWithDelayFunction = Omit<WorkflowStepConfig, 'retries'> & {
|
|
||||||
retries: {
|
|
||||||
limit: number;
|
|
||||||
delay: WorkflowDelayFunction;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
|
||||||
export type WorkflowCronSchedule = {
|
export type WorkflowCronSchedule = {
|
||||||
/** Cron expression that triggered this event. */
|
/** Cron expression that triggered this event. */
|
||||||
@@ -13732,51 +13097,28 @@ declare namespace CloudflareWorkersModule {
|
|||||||
type: string;
|
type: string;
|
||||||
sensitive?: WorkflowStepSensitivity;
|
sensitive?: WorkflowStepSensitivity;
|
||||||
};
|
};
|
||||||
export type WorkflowStepContext<Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepContext = {
|
||||||
step: {
|
step: {
|
||||||
name: string;
|
name: string;
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
attempt: number;
|
attempt: number;
|
||||||
config: {
|
config: WorkflowStepConfig;
|
||||||
retries?: {
|
|
||||||
limit: number;
|
|
||||||
backoff?: WorkflowBackoff;
|
|
||||||
} & (Delay extends WorkflowDelayFunction ? {} : {
|
|
||||||
delay: WorkflowDelayDuration | number;
|
|
||||||
});
|
|
||||||
timeout?: WorkflowTimeoutDuration | number;
|
|
||||||
sensitive?: WorkflowStepSensitivity;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
// The rollback handler receives the step context, so it mirrors the same
|
export type WorkflowRollbackContext<T = unknown> = {
|
||||||
// delay discriminant as the step callback: when the step was configured with
|
ctx: WorkflowStepContext;
|
||||||
// a dynamic delay function the resolved `config.retries.delay` is omitted,
|
|
||||||
// otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
|
|
||||||
// overload that matched the step config.
|
|
||||||
export type WorkflowRollbackContext<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
|
||||||
ctx: WorkflowStepContext<Delay>;
|
|
||||||
error: Error;
|
error: Error;
|
||||||
output: T | undefined;
|
output: T | undefined;
|
||||||
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
||||||
stepName: string;
|
stepName: string;
|
||||||
};
|
};
|
||||||
export type WorkflowRollbackHandler<T = unknown, Delay = WorkflowDelayDuration | number> = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
|
export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
|
||||||
export type WorkflowStepRollbackOptions<T = unknown, Delay = WorkflowDelayDuration | number> = {
|
export type WorkflowStepRollbackOptions<T = unknown> = {
|
||||||
rollback: WorkflowRollbackHandler<T, Delay>;
|
rollback: WorkflowRollbackHandler<T>;
|
||||||
rollbackConfig?: WorkflowStepRollbackConfig;
|
rollbackConfig?: WorkflowStepRollbackConfig;
|
||||||
};
|
};
|
||||||
export abstract class WorkflowStep {
|
export abstract class WorkflowStep {
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
// The config overloads discriminate on the shape of `config.retries.delay`
|
|
||||||
// so the callback context reflects whether the resolved delay is present
|
|
||||||
// (static delay) or omitted (dynamic delay function). Each has a single
|
|
||||||
// type parameter, so an explicit return-type argument (`do<T>(...)`) still
|
|
||||||
// resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
|
|
||||||
// fallback MUST remain last, otherwise it shadows the discriminating
|
|
||||||
// overloads and narrowing is silently lost.
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithDelayFunction, callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithStaticDelay, callback: (ctx: WorkflowStepContext<WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayDuration | number>): Promise<T>;
|
|
||||||
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
|
||||||
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
||||||
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
||||||
@@ -14552,12 +13894,11 @@ type MarkdownDocument = {
|
|||||||
name: string;
|
name: string;
|
||||||
blob: Blob;
|
blob: Blob;
|
||||||
};
|
};
|
||||||
type OutputFormat = 'markdown' | 'text';
|
|
||||||
type ConversionResponse = {
|
type ConversionResponse = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
mimeType: string;
|
mimeType: string;
|
||||||
format: OutputFormat;
|
format: 'markdown';
|
||||||
tokens: number;
|
tokens: number;
|
||||||
data: string;
|
data: string;
|
||||||
} | {
|
} | {
|
||||||
@@ -14574,11 +13915,7 @@ type EmbeddedImageConversionOptions = ImageConversionOptions & {
|
|||||||
convert?: boolean;
|
convert?: boolean;
|
||||||
maxConvertedImages?: number;
|
maxConvertedImages?: number;
|
||||||
};
|
};
|
||||||
type ConversionOutputOptions = {
|
|
||||||
format?: OutputFormat;
|
|
||||||
};
|
|
||||||
type ConversionOptions = {
|
type ConversionOptions = {
|
||||||
output?: ConversionOutputOptions;
|
|
||||||
html?: {
|
html?: {
|
||||||
images?: EmbeddedImageConversionOptions & {
|
images?: EmbeddedImageConversionOptions & {
|
||||||
convertOGImage?: boolean;
|
convertOGImage?: boolean;
|
||||||
@@ -14673,7 +14010,7 @@ declare namespace TailStream {
|
|||||||
interface ConnectEventInfo {
|
interface ConnectEventInfo {
|
||||||
readonly type: "connect";
|
readonly type: "connect";
|
||||||
}
|
}
|
||||||
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime" | "aborted";
|
type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime";
|
||||||
interface ScriptVersion {
|
interface ScriptVersion {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly tag?: string;
|
readonly tag?: string;
|
||||||
@@ -14692,7 +14029,6 @@ declare namespace TailStream {
|
|||||||
readonly dispatchNamespace?: string;
|
readonly dispatchNamespace?: string;
|
||||||
readonly entrypoint?: string;
|
readonly entrypoint?: string;
|
||||||
readonly executionModel: string;
|
readonly executionModel: string;
|
||||||
readonly durableObjectId?: string;
|
|
||||||
readonly scriptName?: string;
|
readonly scriptName?: string;
|
||||||
readonly scriptTags?: string[];
|
readonly scriptTags?: string[];
|
||||||
readonly scriptVersion?: ScriptVersion;
|
readonly scriptVersion?: ScriptVersion;
|
||||||
@@ -14727,22 +14063,11 @@ declare namespace TailStream {
|
|||||||
readonly message: string;
|
readonly message: string;
|
||||||
readonly stack?: string;
|
readonly stack?: string;
|
||||||
}
|
}
|
||||||
interface TailStreamErrorInfo {
|
interface Log {
|
||||||
readonly name: string;
|
|
||||||
readonly message: string;
|
|
||||||
readonly stack?: string;
|
|
||||||
}
|
|
||||||
type Log = {
|
|
||||||
readonly type: "log";
|
readonly type: "log";
|
||||||
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
||||||
readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
|
|
||||||
} & ({
|
|
||||||
readonly message: object;
|
readonly message: object;
|
||||||
readonly truncated?: false;
|
}
|
||||||
} | {
|
|
||||||
readonly message: string;
|
|
||||||
readonly truncated: true;
|
|
||||||
});
|
|
||||||
interface DroppedEventsDiagnostic {
|
interface DroppedEventsDiagnostic {
|
||||||
readonly diagnosticsType: "droppedEvents";
|
readonly diagnosticsType: "droppedEvents";
|
||||||
readonly count: number;
|
readonly count: number;
|
||||||
@@ -15220,31 +14545,10 @@ declare abstract class Workflow<PARAMS = unknown> {
|
|||||||
* @returns A promise that resolves with a list of handles for the created instances.
|
* @returns A promise that resolves with a list of handles for the created instances.
|
||||||
*/
|
*/
|
||||||
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
|
||||||
/**
|
|
||||||
* Delete a batch of Workflow instances and their stored state.
|
|
||||||
* `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
|
|
||||||
* The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
|
|
||||||
* @param instanceIds IDs of the Workflow instances to delete
|
|
||||||
* @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
|
|
||||||
*/
|
|
||||||
public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
|
|
||||||
}
|
}
|
||||||
type WorkflowBatchDeleteResult = {
|
|
||||||
deleted: {
|
|
||||||
id: string;
|
|
||||||
}[];
|
|
||||||
errors: {
|
|
||||||
id: string;
|
|
||||||
code: number;
|
|
||||||
message: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
||||||
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
|
||||||
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
type WorkflowRetentionDuration = WorkflowSleepDuration;
|
||||||
/** Geographic regions supported when creating a Workflow instance.
|
|
||||||
* Location hints are best-effort placement preferences. */
|
|
||||||
type WorkflowInstanceLocationHint = 'wnam' | 'enam' | 'sam' | 'weur' | 'eeur' | 'apac' | 'apac-ne' | 'apac-se' | 'oc' | 'afr' | 'me';
|
|
||||||
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
||||||
/**
|
/**
|
||||||
* An id for your Workflow instance. Must be unique within the Workflow.
|
* An id for your Workflow instance. Must be unique within the Workflow.
|
||||||
@@ -15262,9 +14566,6 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|||||||
successRetention?: WorkflowRetentionDuration;
|
successRetention?: WorkflowRetentionDuration;
|
||||||
errorRetention?: WorkflowRetentionDuration;
|
errorRetention?: WorkflowRetentionDuration;
|
||||||
};
|
};
|
||||||
/** A best-effort geographic placement preference for the Workflow instance.
|
|
||||||
* See `WorkflowInstanceLocationHint` for supported regions. */
|
|
||||||
locationHint?: WorkflowInstanceLocationHint;
|
|
||||||
}
|
}
|
||||||
type InstanceStatus = {
|
type InstanceStatus = {
|
||||||
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
status: 'queued' // means that instance is waiting to be started (see concurrency limits)
|
||||||
@@ -15282,13 +14583,6 @@ interface WorkflowError {
|
|||||||
code?: number;
|
code?: number;
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
interface WorkflowInstanceTerminateOptions {
|
|
||||||
/**
|
|
||||||
* If true, run registered rollback handlers before terminating the instance.
|
|
||||||
* Only steps that registered rollback handlers are rolled back.
|
|
||||||
*/
|
|
||||||
rollback?: boolean;
|
|
||||||
}
|
|
||||||
interface WorkflowInstanceRestartOptions {
|
interface WorkflowInstanceRestartOptions {
|
||||||
/**
|
/**
|
||||||
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
* Restart from a specific step. If omitted, the instance restarts from the beginning.
|
||||||
@@ -15322,19 +14616,14 @@ declare abstract class WorkflowInstance {
|
|||||||
public resume(): Promise<void>;
|
public resume(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
||||||
* @param options Options for termination, including whether registered rollback handlers should run.
|
|
||||||
*/
|
*/
|
||||||
public terminate(options?: WorkflowInstanceTerminateOptions): Promise<void>;
|
public terminate(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Restart the instance. Optionally restart from a specific step, preserving
|
* Restart the instance. Optionally restart from a specific step, preserving
|
||||||
* cached results for all steps before it.
|
* cached results for all steps before it.
|
||||||
* @param options Options for the restart, including an optional step to restart from.
|
* @param options Options for the restart, including an optional step to restart from.
|
||||||
*/
|
*/
|
||||||
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
|
||||||
/**
|
|
||||||
* Delete the instance and its stored state.
|
|
||||||
*/
|
|
||||||
public delete(): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Returns the current status of the instance.
|
* Returns the current status of the instance.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -4,18 +4,11 @@
|
|||||||
"main": "src/playersettings.app.ts",
|
"main": "src/playersettings.app.ts",
|
||||||
"compatibility_date": "2026-06-16",
|
"compatibility_date": "2026-06-16",
|
||||||
"compatibility_flags": ["nodejs_compat"],
|
"compatibility_flags": ["nodejs_compat"],
|
||||||
// Shared `recflare` DB (created manually with `wrangler d1 create recflare`; the
|
// Per-player settings persistence.
|
||||||
// "local" placeholder is spliced out at deploy time). This worker owns the
|
"kv_namespaces": [
|
||||||
// `player_settings` table (schema/migration here) — one JSON row per player, which
|
|
||||||
// `api`, `match` and `chat` also read and merge into. Its own migrations_table keeps
|
|
||||||
// history separate from the other workers' migrations on the shared database.
|
|
||||||
"d1_databases": [
|
|
||||||
{
|
{
|
||||||
"binding": "DB",
|
"binding": "RECFLARE_PLAYER_SETTINGS",
|
||||||
"database_name": "recflare",
|
"id": "local"
|
||||||
"database_id": "local",
|
|
||||||
"migrations_dir": "migrations",
|
|
||||||
"migrations_table": "d1_migrations_playersettings"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// Shared Secrets Store holding the HS256 JWT signing key. Every worker binds the
|
// Shared Secrets Store holding the HS256 JWT signing key. Every worker binds the
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export * from './clubs-db'
|
|||||||
export * from './d1-binds'
|
export * from './d1-binds'
|
||||||
export * from './images-db'
|
export * from './images-db'
|
||||||
export * from './password'
|
export * from './password'
|
||||||
export * from './player-settings-db'
|
export * from './player-settings-kv'
|
||||||
export * from './rooms-db'
|
export * from './rooms-db'
|
||||||
export * from './room-instance-db'
|
export * from './room-instance-db'
|
||||||
export * from './room-comments-db'
|
export * from './room-comments-db'
|
||||||
|
|||||||
@@ -1,144 +0,0 @@
|
|||||||
/**
|
|
||||||
* The player settings map — the `player_settings` table on the shared `recflare` D1.
|
|
||||||
*
|
|
||||||
* One row per player, holding every setting they have as a flat `{ [Key]: Value }` JSON
|
|
||||||
* record of strings in `data` — OOBE state, tutorial mask, chat privacy, the lot. The
|
|
||||||
* `playersettings` worker owns the table (migration: apps/playersettings/migrations/
|
|
||||||
* 0001_player_settings.sql) but `api`, `match` and `chat` each keep a setting of their own in
|
|
||||||
* the same map, so every writer merges into the record rather than replacing it, and all of
|
|
||||||
* them go through here.
|
|
||||||
*
|
|
||||||
* This replaced a Workers KV namespace (`RECFLARE_PLAYER_SETTINGS`, key `player:<id>`): the
|
|
||||||
* row's `data` is byte-for-byte what the KV value was, which is what lets `runx admin
|
|
||||||
* settings-import-kv` copy the old namespace across. The client is noisy — it re-posts
|
|
||||||
* settings it already has at every login and menu change — and every write site has to read
|
|
||||||
* the map first to merge into it, so comparing the result against what was read is free:
|
|
||||||
* {@link putPlayerSettingsIfChanged} skips the write when the merged map is the one already
|
|
||||||
* stored. (D1 reads are strongly consistent, so unlike KV a write here is visible to the next
|
|
||||||
* read from any PoP.)
|
|
||||||
*/
|
|
||||||
|
|
||||||
export type PlayerSettings = Record<string, string>
|
|
||||||
|
|
||||||
/** Schema DDL (mirror of apps/playersettings/migrations/0001_player_settings.sql). */
|
|
||||||
export const PLAYER_SETTINGS_SCHEMA_DDL: string[] = [
|
|
||||||
`CREATE TABLE IF NOT EXISTS player_settings (
|
|
||||||
account_id INTEGER PRIMARY KEY,
|
|
||||||
data TEXT NOT NULL
|
|
||||||
)`,
|
|
||||||
]
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The player's stored settings, or null when they have none. A D1 failure THROWS rather than
|
|
||||||
* reading as "none": a writer that mistook an outage for an empty map would then store its
|
|
||||||
* one key over everything the player had. Read-only callers that would rather degrade wrap
|
|
||||||
* this in their own `.catch`.
|
|
||||||
*/
|
|
||||||
export async function readPlayerSettings(
|
|
||||||
db: D1Database,
|
|
||||||
accountId: number
|
|
||||||
): Promise<PlayerSettings | null> {
|
|
||||||
const row = await db
|
|
||||||
.prepare('SELECT data FROM player_settings WHERE account_id = ?1')
|
|
||||||
.bind(accountId)
|
|
||||||
.first<{ data: string }>()
|
|
||||||
return row === null ? null : (JSON.parse(row.data) as PlayerSettings)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The most a player's stored map may hold, in bytes of its JSON. The map is player-written
|
|
||||||
* and lives on the D1 every worker shares, so an uncapped one lets any account grow its row
|
|
||||||
* toward D1's ~2 MB row limit and, across enough accounts, fill the database. Real maps are
|
|
||||||
* tiny: the 15,134 imported from KV averaged ~2 KB (46 keys), and the largest was ~12 KB
|
|
||||||
* (182 keys) — this leaves about five times that.
|
|
||||||
*/
|
|
||||||
export const MAX_PLAYER_SETTINGS_BYTES = 64 * 1024
|
|
||||||
|
|
||||||
/** A write that would grow a player's map past {@link MAX_PLAYER_SETTINGS_BYTES}. */
|
|
||||||
export class PlayerSettingsTooLargeError extends Error {
|
|
||||||
constructor(
|
|
||||||
readonly accountId: number,
|
|
||||||
readonly bytes: number
|
|
||||||
) {
|
|
||||||
super(
|
|
||||||
`player ${accountId}'s settings would be ${bytes} bytes (limit ${MAX_PLAYER_SETTINGS_BYTES})`
|
|
||||||
)
|
|
||||||
this.name = 'PlayerSettingsTooLargeError'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function settingsBytes(settings: PlayerSettings): number {
|
|
||||||
return new TextEncoder().encode(JSON.stringify(settings)).byteLength
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store `settings` as the player's whole map, replacing whatever row they had. Throws
|
|
||||||
* {@link PlayerSettingsTooLargeError} when the map is over {@link MAX_PLAYER_SETTINGS_BYTES}.
|
|
||||||
*/
|
|
||||||
export async function writePlayerSettings(
|
|
||||||
db: D1Database,
|
|
||||||
accountId: number,
|
|
||||||
settings: PlayerSettings
|
|
||||||
): Promise<void> {
|
|
||||||
const bytes = settingsBytes(settings)
|
|
||||||
if (bytes > MAX_PLAYER_SETTINGS_BYTES) throw new PlayerSettingsTooLargeError(accountId, bytes)
|
|
||||||
await db
|
|
||||||
.prepare(
|
|
||||||
`INSERT INTO player_settings (account_id, data) VALUES (?1, ?2)
|
|
||||||
ON CONFLICT (account_id) DO UPDATE SET data = excluded.data`
|
|
||||||
)
|
|
||||||
.bind(accountId, JSON.stringify(settings))
|
|
||||||
.run()
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Drop the player's row entirely — their next read is a first read again. */
|
|
||||||
export async function deletePlayerSettings(db: D1Database, accountId: number): Promise<void> {
|
|
||||||
await db.prepare('DELETE FROM player_settings WHERE account_id = ?1').bind(accountId).run()
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Whether two settings maps hold the same keys with the same values. Order is irrelevant. */
|
|
||||||
export function samePlayerSettings(a: PlayerSettings | null, b: PlayerSettings | null): boolean {
|
|
||||||
const left = a ?? {}
|
|
||||||
const right = b ?? {}
|
|
||||||
const keys = Object.keys(left)
|
|
||||||
if (keys.length !== Object.keys(right).length) return false
|
|
||||||
return keys.every((key) => key in right && left[key] === right[key])
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store `next` as the player's settings unless it is what `existing` already says, in which
|
|
||||||
* case nothing is written. Returns whether a write happened. Throws
|
|
||||||
* {@link PlayerSettingsTooLargeError} when `next` is over {@link MAX_PLAYER_SETTINGS_BYTES}.
|
|
||||||
*
|
|
||||||
* `existing` is the map the caller read to build `next` from; passing the map it read (not a
|
|
||||||
* fresh read) is the point — the comparison costs no database operation.
|
|
||||||
*/
|
|
||||||
export async function putPlayerSettingsIfChanged(
|
|
||||||
db: D1Database,
|
|
||||||
accountId: number,
|
|
||||||
existing: PlayerSettings | null,
|
|
||||||
next: PlayerSettings
|
|
||||||
): Promise<boolean> {
|
|
||||||
if (existing !== null && samePlayerSettings(existing, next)) return false
|
|
||||||
await writePlayerSettings(db, accountId, next)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Merge `patch` into the player's settings, writing only if a value actually changed. The
|
|
||||||
* result carries the merged map (what the player now has) and whether the row was written.
|
|
||||||
*
|
|
||||||
* Read-modify-write here isn't atomic; racing writers means one player toggling two of their
|
|
||||||
* own options in the same instant, which every caller has accepted since before this helper
|
|
||||||
* existed.
|
|
||||||
*/
|
|
||||||
export async function mergePlayerSettings(
|
|
||||||
db: D1Database,
|
|
||||||
accountId: number,
|
|
||||||
patch: PlayerSettings
|
|
||||||
): Promise<{ settings: PlayerSettings; written: boolean }> {
|
|
||||||
const existing = await readPlayerSettings(db, accountId)
|
|
||||||
const settings: PlayerSettings = { ...existing, ...patch }
|
|
||||||
const written = await putPlayerSettingsIfChanged(db, accountId, existing, settings)
|
|
||||||
return { settings, written }
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
/**
|
||||||
|
* The player settings map in the `RECFLARE_PLAYER_SETTINGS` KV namespace.
|
||||||
|
*
|
||||||
|
* One key per player, `player:<accountId>`, holding every setting they have as a flat
|
||||||
|
* `{ [Key]: Value }` record of strings — OOBE state, tutorial mask, chat privacy, the lot.
|
||||||
|
* The `playersettings` worker owns the namespace but `api`, `match` and `chat` each keep a
|
||||||
|
* setting of their own in the same map, so every writer merges into the record rather than
|
||||||
|
* replacing it, and all of them go through here.
|
||||||
|
*
|
||||||
|
* KV writes cost roughly ten times a read and are capped at one per second per key, and the
|
||||||
|
* client is noisy: it re-posts settings it already has at every login and menu change. Every
|
||||||
|
* write site has to read the map first to merge into it, so comparing the result against what
|
||||||
|
* was read is free — {@link putPlayerSettingsIfChanged} skips the `put` when the merged map
|
||||||
|
* is the one already stored.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export type PlayerSettings = Record<string, string>
|
||||||
|
|
||||||
|
/** The KV key holding a player's settings. */
|
||||||
|
export function playerSettingsKey(accountId: number): string {
|
||||||
|
return `player:${accountId}`
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The player's stored settings, or null when they have none. A KV failure THROWS rather than
|
||||||
|
* reading as "none": a writer that mistook an outage for an empty map would then store its
|
||||||
|
* one key over everything the player had. Read-only callers that would rather degrade wrap
|
||||||
|
* this in their own `.catch`.
|
||||||
|
*/
|
||||||
|
export async function readPlayerSettings(
|
||||||
|
kv: KVNamespace,
|
||||||
|
accountId: number
|
||||||
|
): Promise<PlayerSettings | null> {
|
||||||
|
return kv.get<PlayerSettings>(playerSettingsKey(accountId), 'json')
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Whether two settings maps hold the same keys with the same values. Order is irrelevant. */
|
||||||
|
export function samePlayerSettings(a: PlayerSettings | null, b: PlayerSettings | null): boolean {
|
||||||
|
const left = a ?? {}
|
||||||
|
const right = b ?? {}
|
||||||
|
const keys = Object.keys(left)
|
||||||
|
if (keys.length !== Object.keys(right).length) return false
|
||||||
|
return keys.every((key) => key in right && left[key] === right[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store `next` as the player's settings unless it is what `existing` already says, in which
|
||||||
|
* case nothing is written. Returns whether a write happened.
|
||||||
|
*
|
||||||
|
* `existing` is the map the caller read to build `next` from; passing the map it read (not a
|
||||||
|
* fresh read) is the point — the comparison costs no KV operation.
|
||||||
|
*/
|
||||||
|
export async function putPlayerSettingsIfChanged(
|
||||||
|
kv: KVNamespace,
|
||||||
|
accountId: number,
|
||||||
|
existing: PlayerSettings | null,
|
||||||
|
next: PlayerSettings
|
||||||
|
): Promise<boolean> {
|
||||||
|
if (existing !== null && samePlayerSettings(existing, next)) return false
|
||||||
|
await kv.put(playerSettingsKey(accountId), JSON.stringify(next))
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Merge `patch` into the player's settings, writing only if a value actually changed. The
|
||||||
|
* result carries the merged map (what the player now has) and whether KV was written.
|
||||||
|
*
|
||||||
|
* Read-modify-write on KV isn't atomic; racing writers here means one player toggling two
|
||||||
|
* of their own options in the same instant, which every caller has accepted since before
|
||||||
|
* this helper existed.
|
||||||
|
*/
|
||||||
|
export async function mergePlayerSettings(
|
||||||
|
kv: KVNamespace,
|
||||||
|
accountId: number,
|
||||||
|
patch: PlayerSettings
|
||||||
|
): Promise<{ settings: PlayerSettings; written: boolean }> {
|
||||||
|
const existing = await readPlayerSettings(kv, accountId)
|
||||||
|
const settings: PlayerSettings = { ...existing, ...patch }
|
||||||
|
const written = await putPlayerSettingsIfChanged(kv, accountId, existing, settings)
|
||||||
|
return { settings, written }
|
||||||
|
}
|
||||||
@@ -32,7 +32,6 @@ import type { D1ExecResult } from '../d1'
|
|||||||
* runx admin grant-plus --username alice [--revoke] [--remote]
|
* runx admin grant-plus --username alice [--revoke] [--remote]
|
||||||
* runx admin reload-plus <amount> [--dry-run] [--remote]
|
* runx admin reload-plus <amount> [--dry-run] [--remote]
|
||||||
* runx admin cai-load [--file <export.json>] [--dry-run] [--remote]
|
* runx admin cai-load [--file <export.json>] [--dry-run] [--remote]
|
||||||
* runx admin settings-import-kv [--namespace-id <id>] [--overwrite] [--dry-run] [--remote]
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -405,233 +404,6 @@ const caiLoad = new Command('cai-load')
|
|||||||
console.log(chalk.green(`✓ custom avatar items loaded into ${target(remote)}`))
|
console.log(chalk.green(`✓ custom avatar items loaded into ${target(remote)}`))
|
||||||
})
|
})
|
||||||
|
|
||||||
/** The KV binding the player settings used to live under — the key `RECFLARE_KV` files its id by. */
|
|
||||||
const SETTINGS_KV_BINDING = 'RECFLARE_PLAYER_SETTINGS'
|
|
||||||
/** Every settings key in that namespace was `player:<accountId>`. */
|
|
||||||
const SETTINGS_KV_PREFIX = 'player:'
|
|
||||||
/** The KV bulk-get API takes at most this many keys per request. */
|
|
||||||
const KV_BULK_GET_LIMIT = 100
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run `wrangler kv …` from the `playersettings` directory — the namespace was that worker's
|
|
||||||
* binding, so with `--local` the dev-store state wrangler kept for it is under its .wrangler/.
|
|
||||||
*/
|
|
||||||
async function runKv(args: string[], remote: boolean): Promise<string> {
|
|
||||||
cd(path.join(getRepoRoot(), 'apps', 'playersettings'))
|
|
||||||
const out = await $`pnpm exec wrangler kv ${args} ${remote ? '--remote' : '--local'}`.quiet()
|
|
||||||
return out.stdout
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The JSON wrangler prints after its banner (which can carry ANSI `[` sequences of its own). */
|
|
||||||
function parseWranglerJson<T>(stdout: string): T {
|
|
||||||
const m = /^[[{]/m.exec(stdout)
|
|
||||||
if (!m) throw new Error(`unexpected wrangler output:\n${stdout}`)
|
|
||||||
return JSON.parse(stdout.slice(m.index)) as T
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The old namespace's id, from the `RECFLARE_KV` entry the deploys used to splice it from. */
|
|
||||||
async function settingsNamespaceIdFromEnv(): Promise<string> {
|
|
||||||
const raw = await readRootEnv('RECFLARE_KV')
|
|
||||||
const id = raw ? (JSON.parse(raw) as Record<string, string>)[SETTINGS_KV_BINDING] : undefined
|
|
||||||
if (id) return id
|
|
||||||
throw new Error(
|
|
||||||
`no ${SETTINGS_KV_BINDING} id in RECFLARE_KV — pass --namespace-id, or add the old namespace's id to .env`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy the old `RECFLARE_PLAYER_SETTINGS` KV namespace into the `player_settings` table (owned
|
|
||||||
* by the `playersettings` worker). A KV value was the player's whole map as a JSON object of
|
|
||||||
* strings, which is exactly what the row's `data` holds, so each key becomes one row.
|
|
||||||
*
|
|
||||||
* Rows that already exist are MERGED: KV fills in what D1 lacks, and D1 wins any key it has
|
|
||||||
* moved off the seeded default. A key D1 still holds AT its default (`SEEDED_DEFAULTS`) does
|
|
||||||
* not count as the player's — `GET /playersettings` seeds those for any player with no row, so
|
|
||||||
* a player who signed in after the cut-over but before the import has a fresh row of
|
|
||||||
* defaults, and their KV progress (OOBE, tutorial mask) has to beat it. That makes the import
|
|
||||||
* safe to run after the cut-over and to re-run. `--overwrite` makes KV win outright instead.
|
|
||||||
* Nothing is deleted on either side.
|
|
||||||
*
|
|
||||||
* What it cannot recover is a KV write made after the import read the namespace, to a key the
|
|
||||||
* imported row already holds off-default: D1 keeps the imported value. So run it once before
|
|
||||||
* `just deploy` (the bulk) and once after (to catch anyone who changed something in between).
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* What `GET /playersettings` seeds for a player with no row — mirror of `DEFAULT_SETTINGS` in
|
|
||||||
* apps/playersettings/src/default-settings.ts. A D1 value equal to one of these may be the
|
|
||||||
* seed rather than the player's, so the import lets KV replace it.
|
|
||||||
*/
|
|
||||||
const SEEDED_DEFAULTS: Record<string, string> = {
|
|
||||||
'Recroom.OOBE': '77',
|
|
||||||
TUTORIAL_COMPLETE_MASK: '11',
|
|
||||||
FIRST_TIME_IN_FLAGS: '0',
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A KV value as a settings map, or null when it isn't one. Numbers and booleans are kept as
|
|
||||||
* their string form (what a PUT would have stored); a null, object or array value drops just
|
|
||||||
* that key rather than the player's whole map.
|
|
||||||
*/
|
|
||||||
function kvSettingsMap(value: string | null | undefined): Record<string, string> | null {
|
|
||||||
let parsed: unknown
|
|
||||||
try {
|
|
||||||
parsed = value == null ? null : JSON.parse(value)
|
|
||||||
} catch {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) return null
|
|
||||||
const map: Record<string, string> = {}
|
|
||||||
for (const [k, v] of Object.entries(parsed)) {
|
|
||||||
if (typeof v === 'string') map[k] = v
|
|
||||||
else if (typeof v === 'number' || typeof v === 'boolean') map[k] = String(v)
|
|
||||||
}
|
|
||||||
return map
|
|
||||||
}
|
|
||||||
|
|
||||||
const settingsImportKv = new Command('settings-import-kv')
|
|
||||||
.description('Copy the old RECFLARE_PLAYER_SETTINGS KV namespace into player_settings (merges)')
|
|
||||||
.option(
|
|
||||||
'--namespace-id <id>',
|
|
||||||
`The KV namespace to read (default: ${SETTINGS_KV_BINDING} in RECFLARE_KV from .env; "local" with --local)`
|
|
||||||
)
|
|
||||||
.option(
|
|
||||||
'--overwrite',
|
|
||||||
'Let the KV value replace a row that already exists (the default merges, keeping what D1 has)',
|
|
||||||
false
|
|
||||||
)
|
|
||||||
.option('--dry-run', 'Read the namespace, report what would be written, change nothing', false)
|
|
||||||
.option('--local', 'Target the local dev database and KV store (the default).', false)
|
|
||||||
.option('--remote', 'Target the deployed database and namespace instead.', false)
|
|
||||||
.action(async (opts) => {
|
|
||||||
const remote = resolveRemote(opts)
|
|
||||||
const namespaceId = opts.namespaceId ?? (remote ? await settingsNamespaceIdFromEnv() : 'local')
|
|
||||||
console.log(
|
|
||||||
`Reading KV namespace ${namespaceId} (${remote ? 'remote' : 'local'}) into ${target(remote)}`
|
|
||||||
)
|
|
||||||
|
|
||||||
const keys = parseWranglerJson<Array<{ name: string }>>(
|
|
||||||
await runKv(
|
|
||||||
['key', 'list', '--namespace-id', namespaceId, '--prefix', SETTINGS_KV_PREFIX],
|
|
||||||
remote
|
|
||||||
)
|
|
||||||
).map((k) => k.name)
|
|
||||||
console.log(`${keys.length} ${SETTINGS_KV_PREFIX}* key(s) in the namespace`)
|
|
||||||
|
|
||||||
const rows: Array<{ accountId: number; data: string }> = []
|
|
||||||
const skipped: string[] = []
|
|
||||||
let empty = 0
|
|
||||||
for (let i = 0; i < keys.length; i += KV_BULK_GET_LIMIT) {
|
|
||||||
const chunk = keys.slice(i, i + KV_BULK_GET_LIMIT)
|
|
||||||
const file = path.join(os.tmpdir(), `recflare-kv-keys-${Date.now()}-${i}.json`)
|
|
||||||
await fs.writeFile(file, JSON.stringify(chunk))
|
|
||||||
// `bulk get` answers `{ key: value }`, or `{ key: { value, metadata } }` with
|
|
||||||
// `--with-metadata`; read either.
|
|
||||||
let got: Record<string, string | { value: string | null } | null>
|
|
||||||
try {
|
|
||||||
got = parseWranglerJson(
|
|
||||||
await runKv(['bulk', 'get', file, '--namespace-id', namespaceId], remote)
|
|
||||||
)
|
|
||||||
} finally {
|
|
||||||
await fs.remove(file)
|
|
||||||
}
|
|
||||||
for (const key of chunk) {
|
|
||||||
const accountId = Number(key.slice(SETTINGS_KV_PREFIX.length))
|
|
||||||
const raw = got[key]
|
|
||||||
const map = kvSettingsMap(typeof raw === 'string' ? raw : raw?.value)
|
|
||||||
if (!Number.isSafeInteger(accountId) || accountId <= 0 || map === null) {
|
|
||||||
skipped.push(key)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
// An empty map is what a player with no row reads as; nothing to import.
|
|
||||||
if (Object.keys(map).length === 0) {
|
|
||||||
empty++
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
rows.push({ accountId, data: JSON.stringify(map) })
|
|
||||||
}
|
|
||||||
console.log(` fetched ${Math.min(i + chunk.length, keys.length)}/${keys.length}`)
|
|
||||||
}
|
|
||||||
for (const key of skipped) console.log(chalk.yellow(` skipping ${key}: not a settings map`))
|
|
||||||
|
|
||||||
// Merge: start from D1, lay KV over it, then lay back every D1 key that isn't sitting at
|
|
||||||
// its seeded default. (`json_group_object` of no rows is `{}`, which patches nothing.)
|
|
||||||
const d1OwnKeys = `(SELECT json_group_object(s.key, s.value) FROM json_each(player_settings.data) AS s WHERE NOT EXISTS (SELECT 1 FROM json_each('${sqlStr(JSON.stringify(SEEDED_DEFAULTS))}') AS d WHERE d.key = s.key AND d.value = s.value))`
|
|
||||||
const onConflict = opts.overwrite
|
|
||||||
? 'excluded.data'
|
|
||||||
: `json_patch(json_patch(player_settings.data, excluded.data), ${d1OwnKeys})`
|
|
||||||
const statements = rows.map(
|
|
||||||
(r) =>
|
|
||||||
`INSERT INTO player_settings (account_id, data) VALUES (${r.accountId}, '${sqlStr(r.data)}') ON CONFLICT (account_id) DO UPDATE SET data = ${onConflict};`
|
|
||||||
)
|
|
||||||
console.log(
|
|
||||||
`${rows.length} player(s) to import, ${empty} empty, ${skipped.length} skipped` +
|
|
||||||
(opts.overwrite
|
|
||||||
? ' (KV overwrites existing rows)'
|
|
||||||
: ' (existing rows merge; D1 wins unless still at a seeded default)')
|
|
||||||
)
|
|
||||||
if (opts.dryRun) {
|
|
||||||
console.log(
|
|
||||||
chalk.cyan(`--dry-run: built ${statements.length} statements; nothing was written.`)
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (rows.length === 0) {
|
|
||||||
console.log(chalk.green('✓ nothing to import'))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const count = async (): Promise<number> =>
|
|
||||||
Number(
|
|
||||||
(await execSql('SELECT COUNT(*) AS n FROM player_settings', remote, 'playersettings'))
|
|
||||||
.results[0]?.n ?? 0
|
|
||||||
)
|
|
||||||
const before = await count()
|
|
||||||
|
|
||||||
const sqlFile = path.join(os.tmpdir(), `recflare-settings-${Date.now()}.sql`)
|
|
||||||
await fs.writeFile(sqlFile, statements.join('\n'))
|
|
||||||
try {
|
|
||||||
await execSqlFile(sqlFile, remote, 'playersettings')
|
|
||||||
} catch (err) {
|
|
||||||
// A large remote `--file` goes through D1's import API, and wrangler can fail its
|
|
||||||
// final status poll with this after the import has already completed (it did, for
|
|
||||||
// all 15,137 rows, the first time this ran). Fall through to the check below, which
|
|
||||||
// decides whether the rows actually landed.
|
|
||||||
if (!(err instanceof Error && err.message.includes('Not currently importing anything'))) {
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
console.log(chalk.yellow(' wrangler lost track of the import; checking what landed'))
|
|
||||||
} finally {
|
|
||||||
await fs.remove(sqlFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prove it landed: a merge never deletes, so the table holds at least every imported id.
|
|
||||||
const after = await count()
|
|
||||||
// Chunked: one IN list of every id outgrows D1's statement limit (and argv) at ~15k players.
|
|
||||||
const ids = rows.map((r) => r.accountId)
|
|
||||||
let found = 0
|
|
||||||
for (let i = 0; i < ids.length; i += 1000) {
|
|
||||||
found += Number(
|
|
||||||
(
|
|
||||||
await execSql(
|
|
||||||
`SELECT COUNT(*) AS n FROM player_settings WHERE account_id IN (${ids.slice(i, i + 1000).join(', ')})`,
|
|
||||||
remote,
|
|
||||||
'playersettings'
|
|
||||||
)
|
|
||||||
).results[0]?.n ?? 0
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (found !== ids.length) {
|
|
||||||
throw new Error(
|
|
||||||
`import did not land: ${ids.length - found} of ${ids.length} rows are missing. Re-run it.`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
const added = after - before
|
|
||||||
console.log(
|
|
||||||
`${added} new row(s), ${rows.length - added} merged into existing rows (${after} rows now)`
|
|
||||||
)
|
|
||||||
console.log(chalk.green(`✓ player settings imported into ${target(remote)}`))
|
|
||||||
})
|
|
||||||
|
|
||||||
const lookup = new Command('lookup')
|
const lookup = new Command('lookup')
|
||||||
.description('Print an account by id or username')
|
.description('Print an account by id or username')
|
||||||
.option('--account <id>', 'Account id to look up')
|
.option('--account <id>', 'Account id to look up')
|
||||||
@@ -695,7 +467,6 @@ export const adminCmd = new Command('admin')
|
|||||||
.addCommand(grantStudio)
|
.addCommand(grantStudio)
|
||||||
.addCommand(reloadPlus)
|
.addCommand(reloadPlus)
|
||||||
.addCommand(caiLoad)
|
.addCommand(caiLoad)
|
||||||
.addCommand(settingsImportKv)
|
|
||||||
.addCommand(lookup)
|
.addCommand(lookup)
|
||||||
.addHelpText(
|
.addHelpText(
|
||||||
'after',
|
'after',
|
||||||
|
|||||||
Reference in New Issue
Block a user