Skip to main content

Class: NiivueEvent<K>

Defined in: events.ts:124

Type-safe event class for Niivue events. Extends CustomEvent with typed detail property.

Extends

Type Parameters

Type Parameter
K extends keyof NiivueEventMap

Constructors

Constructor

new NiivueEvent<K>(type: K, detail: NiivueEventMap[K]): NiivueEvent<K>;

Defined in: events.ts:125

Parameters

ParameterType
typeK
detailNiivueEventMap[K]

Returns

NiivueEvent<K>

Overrides

CustomEvent<NiivueEventMap[K]>.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
AT_TARGETreadonly2-CustomEvent.AT_TARGET../../../node_modules/typescript/lib/lib.dom.d.ts:8192
bubblesreadonlybooleanReturns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. MDN ReferenceCustomEvent.bubbles../../../node_modules/typescript/lib/lib.dom.d.ts:8087
BUBBLING_PHASEreadonly3-CustomEvent.BUBBLING_PHASE../../../node_modules/typescript/lib/lib.dom.d.ts:8193
cancelablereadonlybooleanReturns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. MDN ReferenceCustomEvent.cancelable../../../node_modules/typescript/lib/lib.dom.d.ts:8099
cancelBubblepublicbooleanDeprecated MDN ReferenceCustomEvent.cancelBubble../../../node_modules/typescript/lib/lib.dom.d.ts:8093
CAPTURING_PHASEreadonly1-CustomEvent.CAPTURING_PHASE../../../node_modules/typescript/lib/lib.dom.d.ts:8191
composedreadonlybooleanReturns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. MDN ReferenceCustomEvent.composed../../../node_modules/typescript/lib/lib.dom.d.ts:8105
currentTargetreadonlyEventTargetReturns the object whose event listener's callback is currently being invoked. MDN ReferenceCustomEvent.currentTarget../../../node_modules/typescript/lib/lib.dom.d.ts:8111
defaultPreventedreadonlybooleanReturns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. MDN ReferenceCustomEvent.defaultPrevented../../../node_modules/typescript/lib/lib.dom.d.ts:8117
detailreadonlyNiivueEventMap[K]Returns any custom data event was created with. Typically used for synthetic events. MDN ReferenceCustomEvent.detail../../../node_modules/typescript/lib/lib.dom.d.ts:6045
eventPhasereadonlynumberReturns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. MDN ReferenceCustomEvent.eventPhase../../../node_modules/typescript/lib/lib.dom.d.ts:8123
isTrustedreadonlybooleanReturns true if event was dispatched by the user agent, and false otherwise. MDN ReferenceCustomEvent.isTrusted../../../node_modules/typescript/lib/lib.dom.d.ts:8129
NONEreadonly0-CustomEvent.NONE../../../node_modules/typescript/lib/lib.dom.d.ts:8190
returnValuepublicbooleanDeprecated MDN ReferenceCustomEvent.returnValue../../../node_modules/typescript/lib/lib.dom.d.ts:8135
srcElementreadonlyEventTargetDeprecated MDN ReferenceCustomEvent.srcElement../../../node_modules/typescript/lib/lib.dom.d.ts:8141
targetreadonlyEventTargetReturns the object to which event is dispatched (its target). MDN ReferenceCustomEvent.target../../../node_modules/typescript/lib/lib.dom.d.ts:8147
timeStampreadonlynumberReturns the event's timestamp as the number of milliseconds measured relative to the time origin. MDN ReferenceCustomEvent.timeStamp../../../node_modules/typescript/lib/lib.dom.d.ts:8153
typereadonlystringReturns the type of event, e.g. "click", "hashchange", or "submit". MDN ReferenceCustomEvent.type../../../node_modules/typescript/lib/lib.dom.d.ts:8159

Methods

composedPath()

composedPath(): EventTarget[];

Defined in: ../../../node_modules/typescript/lib/lib.dom.d.ts:8165

Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.

MDN Reference

Returns

EventTarget[]

Inherited from

CustomEvent.composedPath;

initCustomEvent()

initCustomEvent(
type: string,
bubbles?: boolean,
cancelable?: boolean,
detail?: NiivueEventMap[K]): void;

Defined in: ../../../node_modules/typescript/lib/lib.dom.d.ts:6051

Parameters

ParameterType
typestring
bubbles?boolean
cancelable?boolean
detail?NiivueEventMap[K]

Returns

void

Deprecated

MDN Reference

Inherited from

CustomEvent.initCustomEvent;

initEvent()

initEvent(
type: string,
bubbles?: boolean,
cancelable?: boolean): void;

Defined in: ../../../node_modules/typescript/lib/lib.dom.d.ts:8171

Parameters

ParameterType
typestring
bubbles?boolean
cancelable?boolean

Returns

void

Deprecated

MDN Reference

Inherited from

CustomEvent.initEvent;

preventDefault()

preventDefault(): void;

Defined in: ../../../node_modules/typescript/lib/lib.dom.d.ts:8177

If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.

MDN Reference

Returns

void

Inherited from

CustomEvent.preventDefault;

stopImmediatePropagation()

stopImmediatePropagation(): void;

Defined in: ../../../node_modules/typescript/lib/lib.dom.d.ts:8183

Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.

MDN Reference

Returns

void

Inherited from

CustomEvent.stopImmediatePropagation;

stopPropagation()

stopPropagation(): void;

Defined in: ../../../node_modules/typescript/lib/lib.dom.d.ts:8189

When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.

MDN Reference

Returns

void

Inherited from

CustomEvent.stopPropagation;