You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
715 B
25 lines
715 B
|
3 years ago
|
declare module "domain" {
|
||
|
|
import { EventEmitter } from "events";
|
||
|
|
|
||
|
|
global {
|
||
|
|
namespace NodeJS {
|
||
|
|
interface Domain extends EventEmitter {
|
||
|
|
run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
|
||
|
|
add(emitter: EventEmitter | Timer): void;
|
||
|
|
remove(emitter: EventEmitter | Timer): void;
|
||
|
|
bind<T extends Function>(cb: T): T;
|
||
|
|
intercept<T extends Function>(cb: T): T;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
interface Domain extends NodeJS.Domain {}
|
||
|
|
class Domain extends EventEmitter {
|
||
|
|
members: Array<EventEmitter | NodeJS.Timer>;
|
||
|
|
enter(): void;
|
||
|
|
exit(): void;
|
||
|
|
}
|
||
|
|
|
||
|
|
function create(): Domain;
|
||
|
|
}
|