@snap/camera-kit
Version:
Camera Kit Web
70 lines (41 loc) • 1.36 kB
Markdown
[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\<T\>.constructor
## Properties
### type
• `Readonly` **type**: `N`
#### Overrides
CustomEvent.type