X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=%40types%2Fevents.d.ts;h=b5338939859c39642f667a2854d3da5ddf9b98df;hb=2d222913a09a96b2a78b0c2072ddff98973a35a5;hp=b2da7b09329db6af2bdfde17ed08bb48c4eda45c;hpb=9536123094d1ab7212e1980662d952a1d590ab8a;p=poolifier.git diff --git a/@types/events.d.ts b/@types/events.d.ts index b2da7b09..b5338939 100644 --- a/@types/events.d.ts +++ b/@types/events.d.ts @@ -14,7 +14,7 @@ declare module 'events' { EventEmitterOptions { /** * The type of async event. - * @default new.target.name + * @default new.target.name if instantiated as a child class. */ name?: string } @@ -26,17 +26,21 @@ declare module 'events' { * * The EventEmitterAsyncResource class has the same methods and takes the * same options as EventEmitter and AsyncResource themselves. + * @throws if `options.name` is not provided when instantiated directly. + * @since v17.4.0, v16.14.0 */ export class EventEmitterAsyncResource extends EventEmitter { + /** + * @param options Only optional in child class. + */ constructor (options?: EventEmitterAsyncResourceOptions) /** * Call all `destroy` hooks. This should only ever be called once. An error will * be thrown if it is called more than once. This **must** be manually called. If * the resource is left to be collected by the GC then the `destroy` hooks will * never be called. - * @return A reference to `asyncResource`. */ - emitDestroy (): AsyncResource + emitDestroy (): void /** The unique asyncId assigned to the resource. */ readonly asyncId: number /** The same triggerAsyncId that is passed to the AsyncResource constructor. */