MCPcopy Create free account
hub / github.com/csound/csound / decorateAPI

Method decorateAPI

wasm/browser/src/events.js:113–212  ·  view source on GitHub ↗
(exportApi)

Source from the content-addressed store, hash-verified

111 }
112
113 decorateAPI(exportApi) {
114 /**
115 * Returns an array listing the events for which the emitter has registered listeners.
116 * The values in the array are strings.
117 * @function
118 * @name eventNames
119 * @memberof CsoundObj
120 * @return {Array<string>}
121 */
122 exportApi.eventNames = this.eventEmitter.eventNames.bind(this.eventEmitter);
123 /**
124 * Returns the number of listeners listening to the event named eventName.
125 * @function
126 * @name listenerCount
127 * @memberof CsoundObj
128 * @return {number}
129 */
130 exportApi.listenerCount = this.eventEmitter.listenerCount.bind(this.eventEmitter);
131 /**
132 * Returns a copy of the array of listeners for the event named eventName.
133 * @function
134 * @name listeners
135 * @memberof CsoundObj
136 * @param {PublicEvents} eventName
137 * @return {Array.<function()>}
138 */
139 exportApi.listeners = this.eventEmitter.listeners.bind(this.eventEmitter);
140 /**
141 * Alias for removeListener()
142 * @function
143 * @name off
144 * @memberof CsoundObj
145 * @param {PublicEvents} eventName
146 * @param {function()} listener
147 * @return {EventEmitter}
148 */
149 exportApi.off = this.eventEmitter.off.bind(this.eventEmitter);
150 /**
151 * Adds the listener function to the end of the listeners array for the event named eventName.
152 * No checks are made to see if the listener has already been added.
153 * Multiple calls passing the same combination of eventName and listener
154 * will result in the listener being added, and called, multiple times.
155 * @function
156 * @name on
157 * @memberof CsoundObj
158 * @param {PublicEvents} eventName
159 * @param {function()} listener
160 * @return {EventEmitter}
161 */
162 exportApi.on = this.eventEmitter.on.bind(this.eventEmitter);
163 /**
164 * Alias for "on"
165 * @function
166 * @name addListener
167 * @memberof CsoundObj
168 * @param {PublicEvents} eventName
169 * @param {function()} listener
170 * @return {EventEmitter}

Callers 4

initializeMethod · 0.80
initializeMethod · 0.80
initializeMethod · 0.80
initializeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected