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-27 #226

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Updated types for 2022-04-27 #226

merged 1 commit into from
Apr 28, 2022

Conversation

ghost
Copy link

@ghost ghost commented Apr 27, 2022

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

@changeset-bot
Copy link

changeset-bot bot commented Apr 27, 2022

🦋 Changeset detected

Latest commit: a18ca78

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

setAlarm(
arg2: Date,
options?: DurableObjectStorageOperationsSetAlarmOptions
scheduledTime: Date,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this right? getAlarm returns a number, but setAlarm takes a Date? Should setAlarm take number | Date?

Copy link

Choose a reason for hiding this comment

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

setAlarm does take number | Date, I guess we need to update the type generation script to understand this

Copy link
Contributor

Choose a reason for hiding this comment

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

setAlarm(kj::Date scheduledTime

Are you sure about that Matt? The type generation script is pretty stable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we don't return a Date from getAlarm?

Copy link
Contributor

Choose a reason for hiding this comment

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

setAlarm(kj::Date scheduledTime

Are you sure about that Matt? The type generation script is pretty stable.

It's possible CFJS automatically casts numbers to kj::Dates?

Choose a reason for hiding this comment

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

I think that Brendan's observation is valid. This API is asymmetric which is odd.

@xortive could you see what's causing this and see if we can fix it? thank you

setAlarm(
arg2: Date,
options?: DurableObjectStorageOperationsSetAlarmOptions
scheduledTime: Date,
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, should this be number | Date?

@vlovich
Copy link
Contributor

vlovich commented Apr 28, 2022

Going to merge this because conversation is about API which isn't a great forum because this project represents the current state of the runtime and the types generated are actually correct.

@vlovich vlovich merged commit c2c7c2e into master Apr 28, 2022
@vlovich vlovich deleted the update-types branch April 28, 2022 16:20
@github-actions github-actions bot mentioned this pull request Apr 28, 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

4 participants