Skip to content

Commit c61d907

Browse files
committed
Make EventEmitter docstring comments consistent
1 parent b57ea83 commit c61d907

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/utilities/EventEmitter.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ export default class EventEmitter<T> {
115115

116116
/**
117117
* {@label WITH_EVENTS}
118-
* Add an event listener
119-
* @param eventOrEvents the name of the event to listen to or the listener to be called.
120-
* @param listener (optional) the listener to be called.
118+
* Add an event listener.
119+
* @param eventOrEvents An event name, or an array of event names.
120+
* @param listener An event listener.
121121
*
122122
* @typeParam K A type which allows one or more names of the properties of {@link T}.
123123
*/
124124
on<K extends keyof T>(eventOrEvents?: K | K[], listener?: EventListener<T, K>): void;
125125
/**
126-
* Behaves the same as { @link on:WITH_EVENTS | the overload which accepts one or more event names }, but listens to _all_ events.
127-
* @param listener (optional) the listener to be called.
126+
* Add an event listener for all event types.
127+
* @param listener An event listener.
128128
*/
129129
on(listener?: EventListener<T, keyof T>): void;
130130
/**
@@ -159,16 +159,16 @@ export default class EventEmitter<T> {
159159

160160
/**
161161
* {@label WITH_EVENTS}
162-
* Remove one or more event listeners
163-
* @param eventOrEvents the name of the event whose listener is to be removed.
164-
* @param listener (optional) the listener to remove. If not supplied, all listeners are removed.
162+
* Remove one or more event listeners.
163+
* @param eventOrEvents An event name, or an array of event names.
164+
* @param listener An event listener. If not supplied, all listeners are removed.
165165
*
166166
* @typeParam K A type which allows one or more names of the properties of {@link T}. TypeScript will infer this type based on the {@link eventOrEvents} argument.
167167
*/
168168
off<K extends keyof T>(eventOrEvents?: K | K[], listener?: EventListener<T, K>): void;
169169
/**
170-
* Behaves the same as { @link off:WITH_EVENTS | the overload which accepts one or more event names }, but removes the listener from _all_ events.
171-
* @param listener (optional) the listener to remove. If not supplied, all listeners are removed.
170+
* Remove one or more event listeners for all event types.
171+
* @param listener An event listener. If not supplied, all listeners are removed.
172172
*/
173173
off(listener?: EventListener<T, keyof T>): void;
174174
/**
@@ -227,9 +227,9 @@ export default class EventEmitter<T> {
227227
}
228228

229229
/**
230-
* Get the array of listeners for a given event; excludes once events
231-
* @param event (optional) the name of the event, or none for 'any'
232-
* @return array of events, or null if none
230+
* Get the array of listeners for a given event. Excludes `once` events.
231+
* @param event An event name.
232+
* @return An array of events, or `null` if there are none.
233233
*
234234
* @typeParam K A type which allows a name of the properties of {@link T}. TypeScript will infer this type based on the {@link event} argument.
235235
*/
@@ -251,8 +251,8 @@ export default class EventEmitter<T> {
251251
* @internal
252252
*
253253
* Emit an event
254-
* @param event the event name
255-
* @param arg the arguments to pass to the listener
254+
* @param event An event name.
255+
* @param arg The arguments to pass to the listener.
256256
*/
257257
emit<K extends keyof T>(event: K, arg: T[K]) {
258258
const eventThis = { event };
@@ -285,16 +285,16 @@ export default class EventEmitter<T> {
285285

286286
/**
287287
* {@label WITH_EVENTS}
288-
* Listen for a single occurrence of an event
289-
* @param event the name of the event to listen to
290-
* @param listener (optional) the listener to be called
288+
* Listen for a single occurrence of an event.
289+
* @param event An event name.
290+
* @param listener An event listener.
291291
*
292292
* @typeParam K A type which allows a name of one of the properties of {@link T}. TypeScript will infer this type based on the {@link event} argument.
293293
*/
294294
once<K extends keyof T>(event: K, listener?: EventListener<T, K>): void | Promise<any>;
295295
/**
296-
* Behaves the same as { @link once:WITH_EVENTS | the overload which accepts one or more event names }, but listens for _all_ events.
297-
* @param listener (optional) the listener to be called
296+
* Listen for a single occurrence of an event of any event type.
297+
* @param listener An event listener.
298298
*/
299299
once(listener?: EventListener<T, keyof T>): void | Promise<any>;
300300
/**

0 commit comments

Comments
 (0)