Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Commit

Permalink
fix(types): Fix definitions of meta events.
Browse files Browse the repository at this point in the history
fix #77
  • Loading branch information
MomoCow committed Jul 23, 2019
1 parent 9267989 commit ca1a731
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cq-websocket.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ type RequestEvents = 'request.friend'
// node
| 'request.group'

type MetaEvents = 'meta_event.lifecycle'
| 'meta_event.heartbeat'

type SocketEvents = 'socket.connecting'
| 'socket.connect'
| 'socket.failed'
Expand Down Expand Up @@ -139,7 +142,10 @@ export class CQWebSocket {
isReady (): boolean

on (event_type: MessageEvents | 'message', listener: MessageEventListener): CQWebSocket
on (event_type: NoticeEvents | RequestEvents | 'notice' | 'request', listener: ContextEventListener): CQWebSocket
on (
event_type: NoticeEvents | RequestEvents | MetaEvents | 'notice' | 'request' | 'meta_event',
listener: ContextEventListener
): CQWebSocket
on (event_type: Exclude<SocketEvents, SocketExcludeType>, listener: SocketEventListener): CQWebSocket
on (event_type: 'socket.connect', listener: (type: WebSocketType, socket: any, attempts: number) => void): CQWebSocket
on (event_type: 'socket.closing', listener: (type: WebSocketType) => void): CQWebSocket
Expand All @@ -152,7 +158,10 @@ export class CQWebSocket {
on (event_type: 'ready', listener: () => void): CQWebSocket

once (event_type: MessageEvents | 'message', listener: MessageEventListener): CQWebSocket
once (event_type: NoticeEvents | RequestEvents | 'notice' | 'request', listener: ContextEventListener): CQWebSocket
once (
event_type: NoticeEvents | RequestEvents | MetaEvents | 'notice' | 'request' | 'meta_event',
listener: ContextEventListener
): CQWebSocket
once (event_type: Exclude<SocketEvents, SocketExcludeType>, listener: SocketEventListener): CQWebSocket
once (event_type: 'socket.connect', listener: (type: WebSocketType, socket: any, attempts: number) => void): CQWebSocket
once (event_type: 'socket.closing', listener: (type: WebSocketType) => void): CQWebSocket
Expand Down

0 comments on commit ca1a731

Please sign in to comment.