Skip to content

Commit

Permalink
feat!(browser): refactor options, now required key, url or host
Browse files Browse the repository at this point in the history
… and `port` field
  • Loading branch information
starknt committed Jul 11, 2024
1 parent 4103cb3 commit 68e3d97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/browser.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { CLOSE_EVENT, ERROR_EVENT, LiveClient, MESSAGE_EVENT, NOOP, OPEN_EVENT, WEBSOCKET_SSL_URL, WEBSOCKET_URL } from './base/base'
import type { BaseLiveClientOptions, HostServerList, IWebSocket, Merge, RequiredByKeys, WSOptions } from './base/types'
import type { BaseLiveClientOptions, IWebSocket, Merge, RequiredByKeys, WSOptions } from './base/types'
import { DEFAULT_WS_OPTIONS } from './base/types'
import { parser } from './base/buffer'
import { inflates } from './browserlib/inflate'
import type { EventKey } from './base/eventemitter'
import { parseRoomId, randomElement } from './base/utils'
import { parseRoomId } from './base/utils'

export interface WSEvents {
// [OPEN_EVENT]: void
Expand All @@ -26,7 +26,7 @@ interface BrowserWSHostOptions extends RequiredByKeys<WSOptions, 'key' | 'host'
port: number
}

type BrowserWSOptions = BrowserWSUrlOptions | BrowserWSHostOptions
export type BrowserWSOptions = BrowserWSUrlOptions | BrowserWSHostOptions

export class KeepLiveWS<E extends Record<EventKey, any> = object> extends LiveClient<Merge<WSEvents, E>> {
ws!: WebSocket
Expand Down

0 comments on commit 68e3d97

Please sign in to comment.