1 |
|
2 |
|
3 | export = depd;
|
4 |
|
5 | declare function depd(namespace: string): depd.Deprecate;
|
6 |
|
7 | declare namespace depd {
|
8 | interface Deprecate {
|
9 | (message: string): void;
|
10 |
|
11 | function<T extends Function>(fn: T, message?: string): T;
|
12 | property<T extends object>(obj: T, prop: keyof T, message: string): void;
|
13 | }
|
14 |
|
15 | interface DeprecationError extends Error {
|
16 | readonly name: "DeprecationError";
|
17 | namespace: string;
|
18 | stack: string;
|
19 | }
|
20 | }
|
21 |
|
22 | declare global {
|
23 | namespace NodeJS {
|
24 | interface Process {
|
25 | addListener(event: "deprecation", listener: (deprecationError: depd.DeprecationError) => void): this;
|
26 | emit(event: "deprecation", code: depd.DeprecationError): boolean;
|
27 | on(event: "deprecation", listener: (deprecationError: depd.DeprecationError) => void): this;
|
28 | once(event: "deprecation", listener: (deprecationError: depd.DeprecationError) => void): this;
|
29 | prependListener(event: "deprecation", listener: (deprecationError: depd.DeprecationError) => void): this;
|
30 | prependOnceListener(
|
31 | event: "deprecation",
|
32 | listener: (deprecationError: depd.DeprecationError) => void,
|
33 | ): this;
|
34 | listeners(event: "deprecation"): depd.DeprecationError[];
|
35 | }
|
36 | }
|
37 | }
|