source: trip-planner-front/node_modules/eventemitter-asyncresource/dist/src/index.d.ts@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/// <reference types="node" />
2import { EventEmitter } from 'events';
3import { AsyncResource } from 'async_hooks';
4declare const kEventEmitter: unique symbol;
5declare const kAsyncResource: unique symbol;
6declare type EventEmitterOptions = typeof EventEmitter extends {
7 new (options?: infer T): EventEmitter;
8} ? T : never;
9declare type AsyncResourceOptions = typeof AsyncResource extends {
10 new (name: string, options?: infer T): AsyncResource;
11} ? T : never;
12declare type Options = EventEmitterOptions & AsyncResourceOptions & {
13 name?: string;
14};
15declare class EventEmitterReferencingAsyncResource extends AsyncResource {
16 [kEventEmitter]: EventEmitter;
17 constructor(ee: EventEmitter, type: string, options?: AsyncResourceOptions);
18 get eventEmitter(): EventEmitter;
19}
20declare class EventEmitterAsyncResource extends EventEmitter {
21 [kAsyncResource]: EventEmitterReferencingAsyncResource;
22 constructor(options?: Options | string);
23 emit(event: string | symbol, ...args: any[]): boolean;
24 emitDestroy(): void;
25 asyncId(): number;
26 triggerAsyncId(): number;
27 get asyncResource(): EventEmitterReferencingAsyncResource;
28 static get EventEmitterAsyncResource(): typeof EventEmitterAsyncResource;
29}
30export = EventEmitterAsyncResource;
Note: See TracBrowser for help on using the repository browser.