EventEmitter
Module @netwiv/api/plugins/shell · Kind Class
import { EventEmitter } from '@netwiv/api/plugins/shell';Constructor
Section titled “Constructor”new EventEmitter<E extends Record<string, any>>()Instance members
Section titled “Instance members”addListener
Section titled “addListener”addListener<N>(eventName: N, listener: (arg: E[N]): void) => EventEmitter<E>Alias for emitter.on(eventName, listener).
listenerCount
Section titled “listenerCount”listenerCount<N extends keyof E>(eventName: N): numberReturns the number of listeners listening to the event named eventName.
off<N>(eventName: N, listener: (arg: E[N]): void) => EventEmitter<E>Removes the all specified listener from the listener array for the event eventName
Returns a reference to the EventEmitter, so that calls can be chained.
on<N>(eventName: N, listener: (arg: E[N]): void) => EventEmitter<E>Adds the listener function to the end of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple
times.
Returns a reference to the EventEmitter, so that calls can be chained.
once<N>(eventName: N, listener: (arg: E[N]): void) => EventEmitter<E>Adds a one-timelistener function for the event named eventName. The
next time eventName is triggered, this listener is removed and then invoked.
Returns a reference to the EventEmitter, so that calls can be chained.
prependListener
Section titled “prependListener”prependListener<N>(eventName: N, listener: (arg: E[N]): void) => EventEmitter<E>Adds the listener function to the beginning of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple
times.
Returns a reference to the EventEmitter, so that calls can be chained.
prependOnceListener
Section titled “prependOnceListener”prependOnceListener<N>(eventName: N, listener: (arg: E[N]): void) => EventEmitter<E>Adds a one-timelistener function for the event named eventName to the_beginning_ of the listeners array. The next time eventName is triggered, this
listener is removed, and then invoked.
Returns a reference to the EventEmitter, so that calls can be chained.
removeAllListeners
Section titled “removeAllListeners”removeAllListeners<N>(event?: N | undefined): EventEmitter<E>Removes all listeners, or those of the specified eventName.
Returns a reference to the EventEmitter, so that calls can be chained.
removeListener
Section titled “removeListener”removeListener<N>(eventName: N, listener: (arg: E[N]): void) => EventEmitter<E>Alias for emitter.off(eventName, listener).
Upstream since 2.0.0
Descriptions come from the pinned @tauri-apps/plugin-shell@2.3.6 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.