Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Updated types for 2022-01-19 #186

Merged
merged 2 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/2022-01-19.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-types": minor
---

Updated auto-generated types @ 2022-01-19
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ declare class FormData {
has(name: string): boolean;
set(name: string, value: string): void;
set(name: string, value: Blob, filename?: string): void;
entries(): IterableIterator<[key: string, value: File | string][]>;
entries(): IterableIterator<[key: string, value: File | string]>;
keys(): IterableIterator<string>;
values(): IterableIterator<File | string>;
forEach<This = unknown>(
Expand All @@ -616,7 +616,7 @@ declare class FormData {
) => void,
thisArg?: This
): void;
[Symbol.iterator](): IterableIterator<[key: string, value: File | string][]>;
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
}

declare class HTMLRewriter {
Expand Down Expand Up @@ -820,7 +820,7 @@ interface KVNamespace<K extends string = string> {
* @param value value to store. The type is inferred. The maximum size of a value is 25MB.
* @returns Returns a `Promise` that you should `await` on in order to verify a successful update.
* @example
* await NAMESPACE.put(key, value)
* await NAMESPACE.put(key, value);
*/
put(
key: K,
Expand Down
94 changes: 41 additions & 53 deletions src/workers.json
Original file line number Diff line number Diff line change
Expand Up @@ -4261,32 +4261,27 @@
"name": "IterableIterator",
"args": [
{
"name": "[]",
"args": [
"name": "()",
"params": [
{
"name": "()",
"params": [
{
"name": "key",
"type": {
"name": "key",
"type": {
"name": "string"
}
},
{
"name": "value",
"type": {
"name": "|",
"args": [
{
"name": "File"
},
{
"name": "string"
}
},
{
"name": "value",
"type": {
"name": "|",
"args": [
{
"name": "File"
},
{
"name": "string"
}
]
}
}
]
]
}
}
]
}
Expand Down Expand Up @@ -4405,32 +4400,27 @@
"name": "IterableIterator",
"args": [
{
"name": "[]",
"args": [
"name": "()",
"params": [
{
"name": "()",
"params": [
{
"name": "key",
"type": {
"name": "key",
"type": {
"name": "string"
}
},
{
"name": "value",
"type": {
"name": "|",
"args": [
{
"name": "File"
},
{
"name": "string"
}
},
{
"name": "value",
"type": {
"name": "|",
"args": [
{
"name": "File"
},
{
"name": "string"
}
]
}
}
]
]
}
}
]
}
Expand Down Expand Up @@ -5951,9 +5941,7 @@
],
"returns": "Returns a `Promise` that you should `await` on in order to verify a successful update.",
"examples": {
"typescript": [
"await NAMESPACE.put(key, value)"
]
"typescript": ["await NAMESPACE.put(key, value);"]
}
}
},
Expand Down Expand Up @@ -7830,13 +7818,13 @@
"name": "|",
"args": [
{
"name": "'lossy'"
"name": "\"lossy\""
},
{
"name": "'lossless'"
"name": "\"lossless\""
},
{
"name": "'off'"
"name": "\"off\""
}
],
"optional": true
Expand Down Expand Up @@ -11988,4 +11976,4 @@
},
"kind": "function"
}
}
}
4 changes: 2 additions & 2 deletions tests/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const formData = new FormData();

const data: { [key: string]: string | File } = {};
for (const [key, value] of formData.entries()) {
// data[key] = value; // TODO: this should be uncommented
data[key] = value; // TODO: this should be uncommented
}

for (const [key, value] of formData) {
// data[key] = value; // TODO: this should be uncommented
data[key] = value; // TODO: this should be uncommented
}

export {};