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

Commit edaac15

Browse files
author
autodecl-bot[bot]
authored
Updated types for 2022-05-03 (#228)
Co-authored-by: autodecl-bot[bot] <91285878+autodecl-bot[bot]@users.noreply.github.com>
1 parent ca1c65b commit edaac15

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.changeset/2022-04-29.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/workers-types": minor
3+
---
4+
5+
Updated auto-generated types @ 2022-04-29

index.d.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ interface DurableObjectStorage {
430430
): Promise<T>;
431431
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
432432
setAlarm(
433-
scheduledTime: Date,
433+
scheduledTime: number | Date,
434434
options?: DurableObjectSetAlarmOptions
435435
): Promise<void>;
436436
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
@@ -483,7 +483,7 @@ interface DurableObjectTransaction {
483483
rollback(): void;
484484
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
485485
setAlarm(
486-
scheduledTime: Date,
486+
scheduledTime: number | Date,
487487
options?: DurableObjectSetAlarmOptions
488488
): Promise<void>;
489489
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
@@ -616,11 +616,15 @@ declare type ExportedHandlerScheduledHandler<Env = unknown> = (
616616
ctx: ExecutionContext
617617
) => void | Promise<void>;
618618

619+
declare class ExtendableEvent extends Event {
620+
constructor(type: string, init?: EventInit);
621+
waitUntil(promise: Promise<any>): void;
622+
}
623+
619624
declare abstract class FetchEvent extends Event {
620625
readonly request: Request;
621626
respondWith(promise: Response | Promise<Response>): void;
622627
passThroughOnException(): void;
623-
waitUntil(promise: Promise<any>): void;
624628
}
625629

626630
declare abstract class Fetcher {
@@ -1481,11 +1485,10 @@ interface ScheduledController {
14811485
noRetry(): void;
14821486
}
14831487

1484-
declare abstract class ScheduledEvent extends Event {
1488+
declare abstract class ScheduledEvent extends ExtendableEvent {
14851489
readonly scheduledTime: number;
14861490
readonly cron: string;
14871491
noRetry(): void;
1488-
waitUntil(promise: Promise<any>): void;
14891492
}
14901493

14911494
interface Scheduler {

0 commit comments

Comments
 (0)