Installation
npm install --save @types/read-package-tree
Summary
This package contains type definitions for read-package-tree (https://github.com/npm/read-package-tree).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/read-package-tree.
index.d.ts
declare function rpt(root: string, cb: (er: Error | null, data: rpt.Node) => void): void;
declare function rpt(
root: string,
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
filterWith: (node: rpt.Node, kidName: string) => void | undefined | boolean,
cb: (er: Error | null, data: rpt.Node) => void,
): void;
declare namespace rpt {
class Node {
id: number;
name: string;
package: any;
children: Node[];
parent: Node | null;
path: string;
realpath: string;
error: Error | null;
isLink: boolean;
constructor(
pkg: any,
logical: string,
physical: string,
er: Error | null,
cache: { [physical: string]: Node },
fromLink?: boolean,
);
}
class Link extends Node {
isLink: true;
target: Node;
constructor(
pkg: any,
logical: string,
physical: string,
realpath: string,
er: Error | null,
cache: { [physical: string]: Node },
);
}
}
export = rpt;
Additional Details
- Last updated: Wed, 22 Nov 2023 00:24:48 GMT
- Dependencies: none
Credits
These definitions were written by Melvin Groenhoff.