|
1 | 1 | declare module "node:process" { |
2 | 2 | import { Control, MessageOptions, SendHandle } from "node:child_process"; |
3 | | - import { InternalEventEmitter } from "node:events"; |
4 | 3 | import { PathLike } from "node:fs"; |
5 | 4 | import * as tty from "node:tty"; |
6 | 5 | import { Worker } from "node:worker_threads"; |
@@ -687,7 +686,7 @@ declare module "node:process" { |
687 | 686 | readonly visibility: string; |
688 | 687 | }; |
689 | 688 | } |
690 | | - interface Process extends InternalEventEmitter<ProcessEventMap> { |
| 689 | + interface Process extends EventEmitter { |
691 | 690 | /** |
692 | 691 | * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is |
693 | 692 | * a `Writable` stream. |
@@ -2100,6 +2099,57 @@ declare module "node:process" { |
2100 | 2099 | * **Default:** `process.env`. |
2101 | 2100 | */ |
2102 | 2101 | execve?(file: string, args?: readonly string[], env?: ProcessEnv): never; |
| 2102 | + // #region InternalEventEmitter |
| 2103 | + addListener<E extends keyof ProcessEventMap>( |
| 2104 | + eventName: E, |
| 2105 | + listener: (...args: ProcessEventMap[E]) => void, |
| 2106 | + ): this; |
| 2107 | + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; |
| 2108 | + emit<E extends keyof ProcessEventMap>(eventName: E, ...args: ProcessEventMap[E]): boolean; |
| 2109 | + emit(eventName: string | symbol, ...args: any[]): boolean; |
| 2110 | + listenerCount<E extends keyof ProcessEventMap>( |
| 2111 | + eventName: E, |
| 2112 | + listener?: (...args: ProcessEventMap[E]) => void, |
| 2113 | + ): number; |
| 2114 | + listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number; |
| 2115 | + listeners<E extends keyof ProcessEventMap>(eventName: E): ((...args: ProcessEventMap[E]) => void)[]; |
| 2116 | + listeners(eventName: string | symbol): ((...args: any[]) => void)[]; |
| 2117 | + off<E extends keyof ProcessEventMap>( |
| 2118 | + eventName: E, |
| 2119 | + listener: (...args: ProcessEventMap[E]) => void, |
| 2120 | + ): this; |
| 2121 | + off(eventName: string | symbol, listener: (...args: any[]) => void): this; |
| 2122 | + on<E extends keyof ProcessEventMap>( |
| 2123 | + eventName: E, |
| 2124 | + listener: (...args: ProcessEventMap[E]) => void, |
| 2125 | + ): this; |
| 2126 | + on(eventName: string | symbol, listener: (...args: any[]) => void): this; |
| 2127 | + once<E extends keyof ProcessEventMap>( |
| 2128 | + eventName: E, |
| 2129 | + listener: (...args: ProcessEventMap[E]) => void, |
| 2130 | + ): this; |
| 2131 | + once(eventName: string | symbol, listener: (...args: any[]) => void): this; |
| 2132 | + prependListener<E extends keyof ProcessEventMap>( |
| 2133 | + eventName: E, |
| 2134 | + listener: (...args: ProcessEventMap[E]) => void, |
| 2135 | + ): this; |
| 2136 | + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; |
| 2137 | + prependOnceListener<E extends keyof ProcessEventMap>( |
| 2138 | + eventName: E, |
| 2139 | + listener: (...args: ProcessEventMap[E]) => void, |
| 2140 | + ): this; |
| 2141 | + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; |
| 2142 | + rawListeners<E extends keyof ProcessEventMap>(eventName: E): ((...args: ProcessEventMap[E]) => void)[]; |
| 2143 | + rawListeners(eventName: string | symbol): ((...args: any[]) => void)[]; |
| 2144 | + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics |
| 2145 | + removeAllListeners<E extends keyof ProcessEventMap>(eventName?: E): this; |
| 2146 | + removeAllListeners(eventName?: string | symbol): this; |
| 2147 | + removeListener<E extends keyof ProcessEventMap>( |
| 2148 | + eventName: E, |
| 2149 | + listener: (...args: ProcessEventMap[E]) => void, |
| 2150 | + ): this; |
| 2151 | + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; |
| 2152 | + // #endregion |
2103 | 2153 | } |
2104 | 2154 | } |
2105 | 2155 | } |
|
0 commit comments