UNPKG

2.41 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/depd`
3
4# Summary
5This package contains type definitions for depd (https://github.com/dougwilson/nodejs-depd).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/depd.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/depd/index.d.ts)
10````ts
11// Type definitions for depd 1.1
12// Project: https://github.com/dougwilson/nodejs-depd
13// Definitions by: Zhiyuan Wang <https://github.com/danny8002>
14// BendingBender <https://github.com/BendingBender>
15// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
16// TypeScript Version: 2.2
17
18/// <reference types="node" />
19
20export = depd;
21
22declare function depd(namespace: string): depd.Deprecate;
23
24declare namespace depd {
25 interface Deprecate {
26 (message: string): void;
27 // tslint:disable-next-line ban-types
28 function<T extends Function>(fn: T, message?: string): T;
29 property<T extends object>(obj: T, prop: keyof T, message: string): void;
30 }
31
32 interface DeprecationError extends Error {
33 readonly name: "DeprecationError";
34 namespace: string;
35 stack: string;
36 }
37}
38
39declare global {
40 namespace NodeJS {
41 interface Process {
42 addListener(event: "deprecation", listener: (deprecationError: depd.DeprecationError) => void): this;
43 emit(event: "deprecation", code: depd.DeprecationError): boolean;
44 on(event: "deprecation", listener: (deprecationError: depd.DeprecationError) => void): this;
45 once(event: "deprecation", listener: (deprecationError: depd.DeprecationError) => void): this;
46 prependListener(event: "deprecation", listener: (deprecationError: depd.DeprecationError) => void): this;
47 prependOnceListener(
48 event: "deprecation",
49 listener: (deprecationError: depd.DeprecationError) => void,
50 ): this;
51 listeners(event: "deprecation"): depd.DeprecationError[];
52 }
53 }
54}
55
56````
57
58### Additional Details
59 * Last updated: Fri, 22 Sep 2023 20:29:40 GMT
60 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
61 * Global values: none
62
63# Credits
64These definitions were written by [Zhiyuan Wang](https://github.com/danny8002), and [BendingBender](https://github.com/BendingBender).
65
\No newline at end of file