diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-10-08 20:43:26 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-08 11:43:26 +0200 |
commit | 9d71b0ef5b6aa7cfa69be7041c3e8ba7c849e89d (patch) | |
tree | 09e384fe74acd0e3e23aa00e2a6269cacc58661a /cli/dts/lib.deno.shared_globals.d.ts | |
parent | 986ad08bce7781e17f98d17d223033a2eb0785af (diff) |
fix: update worker types to better align to lib.dom.d.ts (#7843)
Diffstat (limited to 'cli/dts/lib.deno.shared_globals.d.ts')
-rw-r--r-- | cli/dts/lib.deno.shared_globals.d.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cli/dts/lib.deno.shared_globals.d.ts b/cli/dts/lib.deno.shared_globals.d.ts index 6b6a1bf85..03b85f50d 100644 --- a/cli/dts/lib.deno.shared_globals.d.ts +++ b/cli/dts/lib.deno.shared_globals.d.ts @@ -606,15 +606,20 @@ declare class URL { toJSON(): string; } -interface MessageEventInit extends EventInit { - data?: any; +interface MessageEventInit<T = any> extends EventInit { + data?: T; origin?: string; lastEventId?: string; } -declare class MessageEvent extends Event { - readonly data: any; - readonly origin: string; +declare class MessageEvent<T = any> extends Event { + /** + * Returns the data of the message. + */ + readonly data: T; + /** + * Returns the last event ID string, for server-sent events. + */ readonly lastEventId: string; constructor(type: string, eventInitDict?: MessageEventInit); } |