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

Updated types for 2022-04-13 #210

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Updated types for 2022-04-13 #210

merged 1 commit into from
Apr 14, 2022

Conversation

ghost
Copy link

@ghost ghost commented Mar 26, 2022

This PR includes the auto-generated types generated on 2022-04-13.

@changeset-bot
Copy link

changeset-bot bot commented Mar 26, 2022

🦋 Changeset detected

Latest commit: 7d6a53d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/workers-types Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vlovich
Copy link
Contributor

vlovich commented Mar 28, 2022

WebSocket's are still missing from this release but otherwise should be OK to merge later this week. CC @harrishancock

@ObsidianMinor ObsidianMinor changed the title Updated types for 2022-03-26 Updated types for 2022-04-13 Apr 13, 2022
Copy link
Contributor

@mrbbot mrbbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Blob is missing from R2Bucket.put and a few other small things, but other than that... 🙂

declare class ByteLengthQueuingStrategy {
constructor(init: QueuingStrategyInit);
readonly highWaterMark: number;
size(arg1?: any): number | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: arg1 could have a nicer name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @ObsidianMinor - can be updated for the next release.

declare class CountQueuingStrategy {
constructor(init: QueuingStrategyInit);
readonly highWaterMark: number;
size(arg1?: any): number | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: again, arg1 could have a nicer name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @ObsidianMinor - can be updated for the next release

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is for @jasnell

@@ -187,6 +193,10 @@ interface Comment {
remove(): Comment;
}

declare class CompressionStream extends TransformStream {
constructor(format: string);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could be more specific, what formats are supported?

Suggested change
constructor(format: string);
constructor(format: "gzip" | "deflate");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @jasnell. Would be for next release not this one.

@@ -306,6 +322,10 @@ declare class DOMException extends Error {
static readonly DATA_CLONE_ERR: number;
}

declare class DecompressionStream extends TransformStream {
constructor(format: string);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: again, what formats are supported?

Suggested change
constructor(format: string);
constructor(format: "gzip" | "deflate");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @jasnell - not blocking this release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make a note to update this in the overrides for next release.

@@ -399,24 +428,26 @@ interface DurableObjectStorage {
transaction<T>(
closure: (txn: DurableObjectTransaction) => Promise<T>
): Promise<T>;
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<Date | null>;
setAlarm(arg2: Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: arg2 could have a nicer name (kinda confused why this is arg2 not arg1 😅)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @ObsidianMinor - not blocking

@@ -446,6 +477,8 @@ interface DurableObjectTransaction {
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
rollback(): void;
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<Date | null>;
setAlarm(arg2: Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: again arg2 could have a nicer name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @ObsidianMinor - not blocking

get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
put(
key: string,
value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing Blob

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup - will fix it for next release. You can actually pass in a blob, it's just the type signature is wrong.

index.d.ts Show resolved Hide resolved
index.d.ts Show resolved Hide resolved
@@ -1495,7 +1665,10 @@ declare class TextDecoder {
label?: "utf-8" | "utf8" | "unicode-1-1-utf-8",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of 2022/2/25, TextDecoder supports the full range of encodings. Presumably TextEncoder does too?

Suggested change
label?: "utf-8" | "utf8" | "unicode-1-1-utf-8",
label?: string,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but... TextEncoder only supports UTF-8. It does not have a label argument.

Copy link
Contributor

@vlovich vlovich Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think TextDecoder needs to have the override removed for the label maybe since we support all of the standard labels?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does

@vlovich vlovich merged commit f498fd9 into master Apr 14, 2022
@vlovich vlovich deleted the update-types branch April 14, 2022 18:08
@vlovich
Copy link
Contributor

vlovich commented Apr 14, 2022

Nothing blocking identified. Merging.

Copy link
Contributor

@vlovich vlovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot mentioned this pull request Apr 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants