### Hierarchy

- EventEmitter
  - Connection

## Index

### Interfaces

- Events

### Constructors

- constructor

### Properties

- device
- isOpen
- defaultMaxListeners

### Methods

- addListener
- close
- emit
- eventNames
- getMaxListeners
- listenerCount
- listeners
- off
- on
- once
- open
- prependListener
- prependOnceListener
- rawListeners
- removeAllListeners
- removeListener
- send
- sendBlank
- setMaxListeners
- waitForSequence
- listenerCount

## Constructors

### constructor

- new Connection(device: AppleTV, socket?: Socket): Connection

- Overrides EventEmitter.__constructor

  - Defined in src/lib/connection.ts:26

  #### Parameters

  - ##### device: AppleTV

  - ##### Optional socket: Socket

  #### Returns Connection

## Properties

### device

device: AppleTV

- Defined in src/lib/connection.ts:28

### isOpen

isOpen: boolean

- Defined in src/lib/connection.ts:22

### Static defaultMaxListeners

defaultMaxListeners: number

Inherited from Connection.defaultMaxListeners

- Defined in node_modules/@types/node/events.d.ts:45

## Methods

### addListener

- addListener(event: string | symbol, listener: (...args: any[]) => void): this

- Inherited from Connection.addListener

  - Defined in node_modules/@types/node/globals.d.ts:541

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: (...args: any[]) => void

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### close

- close(): void

- - Defined in src/lib/connection.ts:74

  #### Returns void

### emit

- emit(event: string | symbol, ...args: any[]): boolean

- Inherited from Connection.emit

  - Defined in node_modules/@types/node/globals.d.ts:551

  #### Parameters

  - ##### event: string | symbol

  - ##### Rest ...args: any[]

  #### Returns boolean

### eventNames

- eventNames(): Array<string | symbol>

- Inherited from Connection.eventNames

  - Defined in node_modules/@types/node/globals.d.ts:556

  #### Returns Array<string | symbol>

### getMaxListeners

- getMaxListeners(): number

- Inherited from Connection.getMaxListeners

  - Defined in node_modules/@types/node/globals.d.ts:548

  #### Returns number

### listenerCount

- listenerCount(type: string | symbol): number

- Inherited from Connection.listenerCount

  - Defined in node_modules/@types/node/globals.d.ts:552

  #### Parameters

  - ##### type: string | symbol

  #### Returns number

### listeners

- listeners(event: string | symbol): Function[]

- Inherited from Connection.listeners

  - Defined in node_modules/@types/node/globals.d.ts:549

  #### Parameters

  - ##### event: string | symbol

  #### Returns Function[]

### off

- off(event: string | symbol, listener: (...args: any[]) => void): this

- Inherited from Connection.off

  - Defined in node_modules/@types/node/globals.d.ts:545

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: (...args: any[]) => void

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### on

- on(event: string | symbol, listener: (...args: any[]) => void): this

- Inherited from Connection.on

  - Defined in node_modules/@types/node/globals.d.ts:542

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: (...args: any[]) => void

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### once

- once(event: string | symbol, listener: (...args: any[]) => void): this

- Inherited from Connection.once

  - Defined in node_modules/@types/node/globals.d.ts:543

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: (...args: any[]) => void

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### open

- open(): Promise<void>

- - Defined in src/lib/connection.ts:61

  #### Returns Promise<void>

### prependListener

- prependListener(event: string | symbol, listener: (...args: any[]) => void): this

- Inherited from Connection.prependListener

  - Defined in node_modules/@types/node/globals.d.ts:554

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: (...args: any[]) => void

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### prependOnceListener

- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this

- Inherited from Connection.prependOnceListener

  - Defined in node_modules/@types/node/globals.d.ts:555

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: (...args: any[]) => void

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### rawListeners

- rawListeners(event: string | symbol): Function[]

- Inherited from Connection.rawListeners

  - Defined in node_modules/@types/node/globals.d.ts:550

  #### Parameters

  - ##### event: string | symbol

  #### Returns Function[]

### removeAllListeners

- removeAllListeners(event?: string | symbol): this

- Inherited from Connection.removeAllListeners

  - Defined in node_modules/@types/node/globals.d.ts:546

  #### Parameters

  - ##### Optional event: string | symbol

  #### Returns this

### removeListener

- removeListener(event: string | symbol, listener: (...args: any[]) => void): this

- Inherited from Connection.removeListener

  - Defined in node_modules/@types/node/globals.d.ts:544

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: (...args: any[]) => void

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### send

- send(message: ProtoMessage<{}>, waitForResponse: boolean, priority: number, credentials?: Credentials): Promise<Message>

- - Defined in src/lib/connection.ts:95

  #### Parameters

  - ##### message: ProtoMessage<{}>

  - ##### waitForResponse: boolean

  - ##### priority: number

  - ##### Optional credentials: Credentials

  #### Returns Promise<Message>

### sendBlank

- sendBlank(typeName: string, waitForResponse: boolean, credentials?: Credentials): Promise<Message>

- - Defined in src/lib/connection.ts:78

  #### Parameters

  - ##### typeName: string

  - ##### waitForResponse: boolean

  - ##### Optional credentials: Credentials

  #### Returns Promise<Message>

### setMaxListeners

- setMaxListeners(n: number): this

- Inherited from Connection.setMaxListeners

  - Defined in node_modules/@types/node/globals.d.ts:547

  #### Parameters

  - ##### n: number

  #### Returns this

### waitForSequence

- waitForSequence(sequence: number, timeout?: number): Promise<Message>

- - Defined in src/lib/connection.ts:172

  #### Parameters

  - ##### sequence: number

  - ##### Default value timeout: number = 3

  #### Returns Promise<Message>

### Static listenerCount

- listenerCount(emitter: EventEmitter, event: string | symbol): number

- Inherited from Connection.listenerCount

  - Defined in node_modules/@types/node/events.d.ts:44
  deprecated

    since v4.0.0

  #### Parameters

  - ##### emitter: EventEmitter

  - ##### event: string | symbol

  #### Returns number

Generated using TypeDoc