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

Commit

Permalink
Updated types for 2022-05-03 (#228)
Browse files Browse the repository at this point in the history
Co-authored-by: autodecl-bot[bot] <91285878+autodecl-bot[bot]@users.noreply.github.com>
  • Loading branch information
autodecl-bot[bot] authored May 4, 2022
1 parent ca1c65b commit edaac15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/2022-04-29.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-types": minor
---

Updated auto-generated types @ 2022-04-29
13 changes: 8 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ interface DurableObjectStorage {
): Promise<T>;
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
setAlarm(
scheduledTime: Date,
scheduledTime: number | Date,
options?: DurableObjectSetAlarmOptions
): Promise<void>;
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
Expand Down Expand Up @@ -483,7 +483,7 @@ interface DurableObjectTransaction {
rollback(): void;
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
setAlarm(
scheduledTime: Date,
scheduledTime: number | Date,
options?: DurableObjectSetAlarmOptions
): Promise<void>;
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
Expand Down Expand Up @@ -616,11 +616,15 @@ declare type ExportedHandlerScheduledHandler<Env = unknown> = (
ctx: ExecutionContext
) => void | Promise<void>;

declare class ExtendableEvent extends Event {
constructor(type: string, init?: EventInit);
waitUntil(promise: Promise<any>): void;
}

declare abstract class FetchEvent extends Event {
readonly request: Request;
respondWith(promise: Response | Promise<Response>): void;
passThroughOnException(): void;
waitUntil(promise: Promise<any>): void;
}

declare abstract class Fetcher {
Expand Down Expand Up @@ -1481,11 +1485,10 @@ interface ScheduledController {
noRetry(): void;
}

declare abstract class ScheduledEvent extends Event {
declare abstract class ScheduledEvent extends ExtendableEvent {
readonly scheduledTime: number;
readonly cron: string;
noRetry(): void;
waitUntil(promise: Promise<any>): void;
}

interface Scheduler {
Expand Down

0 comments on commit edaac15

Please sign in to comment.