|
1 | 1 | import { Stats } from 'fs';
|
2 | 2 |
|
3 | 3 | declare function directoryTree(
|
4 |
| - path: string, |
5 |
| - options?: directoryTree.DirectoryTreeOptions, |
6 |
| - onEachFile?: directoryTree.DirectoryTreeCallback, |
7 |
| - onEachDirectory?: directoryTree.DirectoryTreeCallback |
| 4 | + path: string, |
| 5 | + options ? : directoryTree.DirectoryTreeOptions, |
| 6 | + onEachFile ? : directoryTree.DirectoryTreeCallback, |
| 7 | + onEachDirectory ? : directoryTree.DirectoryTreeCallback, |
8 | 8 | ): directoryTree.DirectoryTree;
|
9 | 9 |
|
10 | 10 | export as namespace directoryTree;
|
11 | 11 |
|
12 | 12 | declare namespace directoryTree {
|
13 |
| - export interface DirectoryTree { |
14 |
| - path: string; |
15 |
| - name: string; |
16 |
| - size: number; |
17 |
| - type: 'directory' | 'file'; |
18 |
| - children?: DirectoryTree[]; |
19 |
| - extension?: string; |
20 |
| - isSymbolicLink?: boolean; |
21 |
| - custom: { [key: string]: any }; |
22 |
| - } |
23 |
| - export interface DirectoryTreeOptions { |
24 |
| - normalizePath?: boolean; |
25 |
| - exclude?: RegExp | RegExp[]; |
26 |
| - attributes?: (keyof Stats | 'type' | 'extension')[]; |
27 |
| - extensions?: RegExp; |
28 |
| - followSymlink?: boolean; |
29 |
| - } |
30 |
| - export type DirectoryTreeCallback = ( |
31 |
| - item: DirectoryTree, |
32 |
| - path: string, |
33 |
| - stats: Stats |
34 |
| - ) => void; |
| 13 | + export interface DirectoryTree { |
| 14 | + path: string; |
| 15 | + name: string; |
| 16 | + size: number; |
| 17 | + type: "directory" | "file"; |
| 18 | + children ? : DirectoryTree[]; |
| 19 | + extension?: string; |
| 20 | + isSymbolicLink?: boolean; |
| 21 | + custom: { [key: string]: any }; |
| 22 | + } |
| 23 | + export interface DirectoryTreeOptions { |
| 24 | + normalizePath ? : boolean; |
| 25 | + exclude ? : RegExp | RegExp[]; |
| 26 | + attributes ? : (keyof Stats | "type" | "extension")[]; |
| 27 | + extensions ? : RegExp; |
| 28 | + followSymlink ? : boolean; |
| 29 | + } |
| 30 | + export type DirectoryTreeCallback = (item: DirectoryTree, path: string, stats: Stats) => void; |
35 | 31 | }
|
36 | 32 |
|
37 | 33 | export = directoryTree;
|
0 commit comments