### Hierarchy

- Emitter
  - ProviderSocket

### Implements

- IEmitter
- IPageProvider

## Index

### Constructors

- constructor

### Properties

- _data
- _error
- _folderId
- _pageId
- _redirectCounter
- _redirectLimit
- _socket
- _stopped
- _wsUrl
- listeners
- onListeners

### Accessors

- SOCKET_EVENT_PAGE_CONTENT
- SOCKET_EVENT_PAGE_DATA
- SOCKET_EVENT_PAGE_ERROR
- SOCKET_EVENT_PAGE_PUSH
- SOCKET_EVENT_PAGE_SETTINGS
- SOCKET_EVENT_PAGE_USER_JOINED
- SOCKET_EVENT_PAGE_USER_LEFT

### Methods

- connect
- destroy
- emit
- getData
- init
- off
- on
- onAuthRefresh
- onConnect
- onDisconnect
- onOAuthError
- onPageContent
- onPageError
- onPageSettings
- onReconnectError
- onReconnectingError
- onRedirect
- register
- removeEvent
- removeEvents
- start
- stop
- supportsWebSockets
- unRegister

## Constructors

### constructor

- new ProviderSocket(_pageId?: undefined | number, _folderId?: undefined | number): ProviderSocket

- Overrides Emitter.constructor

  - Defined in Page/Provider.ts:249

  #### Parameters

  - ##### Optional _pageId: undefined | number

  - ##### Optional _folderId: undefined | number

  #### Returns ProviderSocket

## Properties

### Private _data

_data: any

- Defined in Page/Provider.ts:248

### Private _error

_error: boolean = false

- Defined in Page/Provider.ts:249

### Private Optional _folderId

_folderId: undefined | number

- Defined in Page/Provider.ts:251

### Private Optional _pageId

_pageId: undefined | number

- Defined in Page/Provider.ts:251

### Private _redirectCounter

_redirectCounter: number = 0

- Defined in Page/Provider.ts:246

### Private _redirectLimit

_redirectLimit: number = 10

- Defined in Page/Provider.ts:247

### Private _socket

_socket: Socket

- Defined in Page/Provider.ts:244

### Private _stopped

_stopped: boolean = false

- Defined in Page/Provider.ts:243

### Private _wsUrl

_wsUrl: string

- Defined in Page/Provider.ts:245

### listeners

listeners: IListeners = []

Inherited from Emitter.listeners

- Defined in Emitter.ts:16

### onListeners

onListeners: any

Inherited from Emitter.onListeners

- Defined in Emitter.ts:17

## Accessors

### Static SOCKET_EVENT_PAGE_CONTENT

- get SOCKET_EVENT_PAGE_CONTENT(): string

- - Defined in Page/Provider.ts:219

  #### Returns string

### Static SOCKET_EVENT_PAGE_DATA

- get SOCKET_EVENT_PAGE_DATA(): string

- - Defined in Page/Provider.ts:231

  #### Returns string

### Static SOCKET_EVENT_PAGE_ERROR

- get SOCKET_EVENT_PAGE_ERROR(): string

- - Defined in Page/Provider.ts:215

  #### Returns string

### Static SOCKET_EVENT_PAGE_PUSH

- get SOCKET_EVENT_PAGE_PUSH(): string

- - Defined in Page/Provider.ts:223

  #### Returns string

### Static SOCKET_EVENT_PAGE_SETTINGS

- get SOCKET_EVENT_PAGE_SETTINGS(): string

- - Defined in Page/Provider.ts:227

  #### Returns string

### Static SOCKET_EVENT_PAGE_USER_JOINED

- get SOCKET_EVENT_PAGE_USER_JOINED(): string

- - Defined in Page/Provider.ts:235

  #### Returns string

### Static SOCKET_EVENT_PAGE_USER_LEFT

- get SOCKET_EVENT_PAGE_USER_LEFT(): string

- - Defined in Page/Provider.ts:239

  #### Returns string

## Methods

### Private connect

- connect(): Socket

- - Defined in Page/Provider.ts:335

  Connect socket to a server. If client doesnt support websockets, it tries to fall back to long polling

  #### Returns Socket

### destroy

- destroy(hard?: boolean): void

- - Defined in Page/Provider.ts:292

  Remove listeners for all socket events, disconnects socket and destroys object

  #### Parameters

  - ##### Default value hard: boolean = true

  #### Returns void

### emit

- emit(name: string, args?: any): void

- Inherited from Emitter.emit

  - Defined in Emitter.ts:51

  #### Parameters

  - ##### name: string

  - ##### Optional args: any

  #### Returns void

### getData

- getData(): any

- - Defined in Page/Provider.ts:303

  #### Returns any

### Private init

- init(): void

- - Defined in Page/Provider.ts:310

  Initialize socket connection with all listeners

  #### Returns void

### off

- off(name: string, callback: any): void

- Inherited from Emitter.off

  - Defined in Emitter.ts:30

  #### Parameters

  - ##### name: string

  - ##### callback: any

  #### Returns void

### on

- on(name: string, callback: any): void

- Inherited from Emitter.on

  - Defined in Emitter.ts:23

  #### Parameters

  - ##### name: string

  - ##### callback: any

  #### Returns void

### Private onAuthRefresh

- onAuthRefresh(): void

- - Defined in Page/Provider.ts:456

  onAuthRefresh event action

  #### Returns void

### Private onConnect

- onConnect(): void

- - Defined in Page/Provider.ts:354

  onConnect event action

  #### Returns void

### Private onDisconnect

- onDisconnect(): void

- - Defined in Page/Provider.ts:381

  onDisconnect event action

  #### Returns void

### Private onOAuthError

- onOAuthError(data: any): void

- - Defined in Page/Provider.ts:447

  onOAuthError event action

  #### Parameters

  - ##### data: any

  #### Returns void

### Private onPageContent

- onPageContent(data: IPageServiceContent): void

- - Defined in Page/Provider.ts:414

  onPageContent eent action

  #### Parameters

  - ##### data: IPageServiceContent

  #### Returns void

### Private onPageError

- onPageError(data: any): void

- - Defined in Page/Provider.ts:433

  onPageError event action

  #### Parameters

  - ##### data: any

  #### Returns void

### Private onPageSettings

- onPageSettings(data: IPageServiceMeta): void

- - Defined in Page/Provider.ts:425

  onPageSettings event action

  #### Parameters

  - ##### data: IPageServiceMeta

  #### Returns void

### Private onReconnectError

- onReconnectError(): void

- - Defined in Page/Provider.ts:368

  onReconnectError event action Try and brake the previous redirect. Go back to root

  #### Returns void

### Private onReconnectingError

- onReconnectingError(attempt: number): void

- - Defined in Page/Provider.ts:358

  #### Parameters

  - ##### attempt: number

  #### Returns void

### Private onRedirect

- onRedirect(msg: string): void

- - Defined in Page/Provider.ts:389

  onRedirect event action

  #### Parameters

  - ##### msg: string

  #### Returns void

### register

- register(callback: any): void

- Inherited from Emitter.register

  - Defined in Emitter.ts:40

  #### Parameters

  - ##### callback: any

  #### Returns void

### removeEvent

- removeEvent(): void

- Implementation of IPageProvider.removeEvent

  Inherited from Emitter.removeEvent

  - Defined in Emitter.ts:65

  #### Returns void

### removeEvents

- removeEvents(): void

- Implementation of IPageProvider.removeEvents

  Inherited from Emitter.removeEvents

  - Defined in Emitter.ts:69

  #### Returns void

### start

- start(): void

- - Defined in Page/Provider.ts:262

  Start listening for content updates. If socket not connected yet, it will initialize the socket connection

  #### Returns void

### stop

- stop(): void

- - Defined in Page/Provider.ts:281

  Stop receiving page content updates (still keeps receiving settings/meta updates and other events) This will NOT disconnect the socket, merely it will just stop listening for updates - throws them away

  #### Returns void

### Private supportsWebSockets

- supportsWebSockets(): boolean

- - Defined in Page/Provider.ts:465

  Determines if client supports websockets

  #### Returns boolean

### unRegister

- unRegister(callback: any): void

- Inherited from Emitter.unRegister

  - Defined in Emitter.ts:44

  #### Parameters

  - ##### callback: any

  #### Returns void

Generated using TypeDoc