# ActorFront

[**@openpolyfill/firefox-rdp**](/docs/api/reference)

***

[@openpolyfill/firefox-rdp](/docs/api/reference/globals) / ActorFront

# Class: ActorFront

Defined in: [src/client.ts:44](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L44)

A generic actor client: use call() or the methods proxy to invoke actor methods.

## Extended by

- [`RootFront`](/docs/api/reference/classes/RootFront)
- [`TabDescriptorFront`](/docs/api/reference/classes/TabDescriptorFront)
- [`WatcherFront`](/docs/api/reference/classes/WatcherFront)
- [`TargetFront`](/docs/api/reference/classes/TargetFront)
- [`WebConsoleFront`](/docs/api/reference/classes/WebConsoleFront)
- [`LongStringFront`](/docs/api/reference/classes/LongStringFront)
- [`ObjectFront`](/docs/api/reference/classes/ObjectFront)

## Constructors

### Constructor

> **new ActorFront**(`client`, `actorId`): `ActorFront`

Defined in: [src/client.ts:58](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L58)

#### Parameters

##### client

[`FirefoxRDP`](/docs/api/reference/classes/FirefoxRDP)

##### actorId

`string`

#### Returns

`ActorFront`

## Properties

### actorId

> `readonly` **actorId**: `string`

Defined in: [src/client.ts:60](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L60)

***

### api

> `readonly` **api**: `Record`\<`string`, (...`args`) => `Promise`\<`unknown`\>\>

Defined in: [src/client.ts:52](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L52)

Firefox-spec positional method calls; arguments are marshalled by Arg/Option templates.

***

### client

> `readonly` **client**: [`FirefoxRDP`](/docs/api/reference/classes/FirefoxRDP)

Defined in: [src/client.ts:59](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L59)

***

### form

> **form**: [`Params`](/docs/api/reference/type-aliases/Params) \| `undefined`

Defined in: [src/client.ts:49](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L49)

Most recent actor form, when supplied by the remote actor.

***

### methods

> `readonly` **methods**: `Record`\<`string`, (`params?`) => `Promise`\<[`RDPResponse`](/docs/api/reference/type-aliases/RDPResponse)\>\>

Defined in: [src/client.ts:50](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L50)

***

### spec?

> `protected` `optional` **spec?**: [`ActorSpec`](/docs/api/reference/interfaces/ActorSpec)

Defined in: [src/client.ts:53](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L53)

## Accessors

### specTypeName

#### Get Signature

> **get** **specTypeName**(): `string` \| `undefined`

Defined in: [src/client.ts:54](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L54)

##### Returns

`string` \| `undefined`

## Methods

### adoptFrom()

> **adoptFrom**(`other`): `this`

Defined in: [src/client.ts:190](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L190)

Preserve listeners when a generic actor is upgraded to a specialized front.

#### Parameters

##### other

`ActorFront`

#### Returns

`this`

***

### call()

> **call**(`method`, `params?`): `Promise`\<[`RDPResponse`](/docs/api/reference/type-aliases/RDPResponse)\>

Defined in: [src/client.ts:109](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L109)

#### Parameters

##### method

`string`

##### params?

[`Params`](/docs/api/reference/type-aliases/Params) = `{String.fromCharCode(123)}{String.fromCharCode(125)}`

#### Returns

`Promise`\<[`RDPResponse`](/docs/api/reference/type-aliases/RDPResponse)\>

***

### dispatch()

> **dispatch**(`packet`): `void`

Defined in: [src/client.ts:208](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L208)

#### Parameters

##### packet

[`RDPResponse`](/docs/api/reference/type-aliases/RDPResponse)

#### Returns

`void`

***

### invoke()

> **invoke**(`method`, ...`args`): `Promise`\<`unknown`\>

Defined in: [src/client.ts:92](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L92)

Call the named Firefox actor method with its original positional JS signature.

#### Parameters

##### method

`string`

##### args

...`unknown`[]

#### Returns

`Promise`\<`unknown`\>

***

### isEvent()

> **isEvent**(`packet`): `boolean`

Defined in: [src/client.ts:202](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L202)

#### Parameters

##### packet

[`RDPResponse`](/docs/api/reference/type-aliases/RDPResponse)

#### Returns

`boolean`

***

### listen()

> **listen**(`type`, `listener`): `this`

Defined in: [src/client.ts:114](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L114)

Subscribe with Firefox's native positional Front event signature.

#### Parameters

##### type

`string`

##### listener

(...`args`) => `void`

#### Returns

`this`

***

### off()

> **off**(`type`, `listener`): `this`

Defined in: [src/client.ts:176](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L176)

#### Parameters

##### type

`string`

##### listener

[`PacketListener`](/docs/api/reference/type-aliases/PacketListener)

#### Returns

`this`

***

### on()

> **on**(`type`, `listener`): `this`

Defined in: [src/client.ts:168](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L168)

#### Parameters

##### type

`string`

##### listener

[`PacketListener`](/docs/api/reference/type-aliases/PacketListener)

#### Returns

`this`

***

### once()

> **once**(`type`, `listener`): `this`

Defined in: [src/client.ts:181](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L181)

#### Parameters

##### type

`string`

##### listener

[`PacketListener`](/docs/api/reference/type-aliases/PacketListener)

#### Returns

`this`

***

### registerEvents()

> **registerEvents**(...`types`): `this`

Defined in: [src/client.ts:163](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L163)

Mark event packet types explicitly, even if no listener is currently attached.

#### Parameters

##### types

...`string`[]

#### Returns

`this`

***

### unlisten()

> **unlisten**(`type`, `listener`): `this`

Defined in: [src/client.ts:122](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L122)

#### Parameters

##### type

`string`

##### listener

(...`args`) => `void`

#### Returns

`this`

***

### useSpec()

> **useSpec**(`spec`): `this`

Defined in: [src/client.ts:85](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L85)

Attach an actor spec to enable schema-based calls and automatic event routing.

#### Parameters

##### spec

[`ActorSpec`](/docs/api/reference/interfaces/ActorSpec)

#### Returns

`this`

***

### waitFor()

> **waitFor**(`type`, `options?`): `Promise`\<[`RDPResponse`](/docs/api/reference/type-aliases/RDPResponse)\>

Defined in: [src/client.ts:128](https://github.com/OpenPolyfill/FirefoxRDP/blob/50728dfa35fc2a06b6d8a70fbaf9c0ef0a5bd3a4/src/client.ts#L128)

Await one event, optionally with cancellation and timeout.

#### Parameters

##### type

`string`

##### options?

###### signal?

`AbortSignal`

###### timeoutMs?

`number`

#### Returns

`Promise`\<[`RDPResponse`](/docs/api/reference/type-aliases/RDPResponse)\>
