@snap/camera-kit
Version:
Camera Kit Web
62 lines (32 loc) • 1.09 kB
Markdown
[**CameraKit Web SDK v1.13.0**](../README.md)
***
[CameraKit Web SDK](../globals.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.
## Extends
- `CustomEvent`\<`T`\>
## Type Parameters
• **N** *extends* `string` = `string`
• **T** = `any`
## Constructors
### new TypedCustomEvent()
> **new TypedCustomEvent**\<`N`, `T`\>(`type`, `detail`, `eventInitDict`): [`TypedCustomEvent`](TypedCustomEvent.md)\<`N`, `T`\>
#### Parameters
##### type
`N`
##### detail
`T`
##### eventInitDict
`Omit`\<`CustomEventInit`\<`T`\>, `"detail"`\> = `{}`
#### Returns
[`TypedCustomEvent`](TypedCustomEvent.md)\<`N`, `T`\>
#### Overrides
`CustomEvent<T>.constructor`
## Properties
### type
> `readonly` **type**: `N`
Returns the type of event, e.g. "click", "hashchange", or "submit".
#### Overrides
`CustomEvent.type`