diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2023-11-27 19:33:01 -0500 |
|---|---|---|
| committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2023-11-27 19:33:01 -0500 |
| commit | 14d12f6ba20b837a04c638b935773f3120e194ff (patch) | |
| tree | dcd6b61d51ff39c97b60812b2bf3c8cd564347f8 /types/ext | |
| parent | d5b1217df3fe7480fc5f58fe194f5bbf73281094 (diff) | |
Update timer types and such
Diffstat (limited to 'types/ext')
| -rw-r--r-- | types/ext/core.d.ts | 2 | ||||
| -rw-r--r-- | types/ext/cross-frame-api.d.ts | 2 | ||||
| -rw-r--r-- | types/ext/offscreen.d.ts | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/types/ext/core.d.ts b/types/ext/core.d.ts index ce3a09f0..b83e6a74 100644 --- a/types/ext/core.d.ts +++ b/types/ext/core.d.ts @@ -100,3 +100,5 @@ export type MessageHandlerDetails = { export type MessageHandlerMap = Map<string, MessageHandlerDetails>; export type MessageHandlerArray = [key: string, handlerDetails: MessageHandlerDetails][]; + +export type Timeout = number | NodeJS.Timeout; diff --git a/types/ext/cross-frame-api.d.ts b/types/ext/cross-frame-api.d.ts index 5cedbec9..88ce59a7 100644 --- a/types/ext/cross-frame-api.d.ts +++ b/types/ext/cross-frame-api.d.ts @@ -50,5 +50,5 @@ export type Invocation = { responseTimeout: number; action: string; ack: boolean; - timer: number | null; + timer: Core.Timeout | null; }; diff --git a/types/ext/offscreen.d.ts b/types/ext/offscreen.d.ts index 7dd64d1e..ddf7eadc 100644 --- a/types/ext/offscreen.d.ts +++ b/types/ext/offscreen.d.ts @@ -112,4 +112,4 @@ export type MessageHandler< details: MessageDetailsMap[TMessage], ) => (TIsAsync extends true ? Promise<MessageReturn<TMessage>> : MessageReturn<TMessage>); -export type MessageHandlerMap = Map<MessageType, Core.MessageHandlerDetails>; +export type MessageHandlerMap<T = MessageType> = Map<T, Core.MessageHandlerDetails>; |