[@bigcommerce/checkout-sdk](../README.md) / IframeEventListener

# Class: IframeEventListener\<TEventMap, TContext\>

## Type parameters

| Name | Type |
| :------ | :------ |
| `TEventMap` | extends [`IframeEventMap`](../README.md#iframeeventmap)\<keyof `TEventMap`\> |
| `TContext` | `undefined` |

## Table of contents

### Constructors

- [constructor](IframeEventListener.md#constructor)

### Methods

- [addListener](IframeEventListener.md#addlistener)
- [listen](IframeEventListener.md#listen)
- [removeListener](IframeEventListener.md#removelistener)
- [stopListen](IframeEventListener.md#stoplisten)
- [trigger](IframeEventListener.md#trigger)

## Constructors

### constructor

• **new IframeEventListener**\<`TEventMap`, `TContext`\>(`sourceOrigin`): [`IframeEventListener`](IframeEventListener.md)\<`TEventMap`, `TContext`\>

#### Type parameters

| Name | Type |
| :------ | :------ |
| `TEventMap` | extends [`IframeEventMap`](../README.md#iframeeventmap)\<keyof `TEventMap`\> |
| `TContext` | `undefined` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `sourceOrigin` | `string` |

#### Returns

[`IframeEventListener`](IframeEventListener.md)\<`TEventMap`, `TContext`\>

## Methods

### addListener

▸ **addListener**\<`TType`\>(`type`, `listener`): `void`

#### Type parameters

| Name | Type |
| :------ | :------ |
| `TType` | extends `string` \| `number` \| `symbol` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `type` | `TType` |
| `listener` | (`event`: `TEventMap`[`TType`], `context?`: `TContext`) => `void` |

#### Returns

`void`

___

### listen

▸ **listen**(): `void`

#### Returns

`void`

___

### removeListener

▸ **removeListener**\<`TType`\>(`type`, `listener`): `void`

#### Type parameters

| Name | Type |
| :------ | :------ |
| `TType` | extends `string` \| `number` \| `symbol` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `type` | `TType` |
| `listener` | (`event`: `TEventMap`[`TType`], `context?`: `TContext`) => `void` |

#### Returns

`void`

___

### stopListen

▸ **stopListen**(): `void`

#### Returns

`void`

___

### trigger

▸ **trigger**\<`TType`\>(`event`, `context?`): `void`

#### Type parameters

| Name | Type |
| :------ | :------ |
| `TType` | extends `string` \| `number` \| `symbol` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `event` | `TEventMap`[`TType`] |
| `context?` | `TContext` |

#### Returns

`void`
