UNPKG

@snap/camera-kit

Version:
70 lines (41 loc) 1.36 kB
[CameraKit Web SDK - v0.22.0](../README.md) / [Exports](../modules.md) / TypedCustomEvent # Class: TypedCustomEvent\<N, T\> This wrapper around CustomEvent provides more descriptive type information. By using this class, the `type` property of the CustomEvent will be typed as a string literal – this allows [TypedEventTarget] to provide more useful type checking of events. ## Type parameters | Name | Type | | :------ | :------ | | `N` | extends `string` = `string` | | `T` | `any` | ## Hierarchy - `CustomEvent`\<`T`\> ↳ **`TypedCustomEvent`** ## Table of contents ### Constructors - [constructor](TypedCustomEvent.md#constructor) ### Properties - [type](TypedCustomEvent.md#type) ## Constructors ### constructor**new TypedCustomEvent**\<`N`, `T`\>(`type`, `detail`, `eventInitDict?`): [`TypedCustomEvent`](TypedCustomEvent.md)\<`N`, `T`\> #### Type parameters | Name | Type | | :------ | :------ | | `N` | extends `string` = `string` | | `T` | `any` | #### Parameters | Name | Type | | :------ | :------ | | `type` | `N` | | `detail` | `T` | | `eventInitDict` | `Omit`\<`CustomEventInit`\<`T`\>, ``"detail"``\> | #### Returns [`TypedCustomEvent`](TypedCustomEvent.md)\<`N`, `T`\> #### Overrides CustomEvent\&lt;T\&gt;.constructor ## Properties ### type`Readonly` **type**: `N` #### Overrides CustomEvent.type