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