Skip to content

Commit 47cb54b

Browse files
authored
Merge pull request #121 from rigwild/master
Fix TypeScript declaration
2 parents 988b45f + a802c99 commit 47cb54b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

index.d.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { Stats } from "fs";
22

3-
interface IObj {
4-
[key: string]: any;
5-
}
6-
73
declare function directoryTree<
8-
TCustomFile extends IObj = IObj,
9-
TCustomDir extends IObj = IObj,
10-
TCustomResult extends IObj = TCustomFile & TCustomDir
4+
TCustomFile extends Record<string, any> = Record<string, any>,
5+
TCustomDir extends Record<string, any> = Record<string, any>,
6+
TCustomResult extends Record<string, any> = TCustomFile & TCustomDir
117
>(
128
path: string,
139
options?: directoryTree.DirectoryTreeOptions,
@@ -18,7 +14,7 @@ declare function directoryTree<
1814
export as namespace directoryTree;
1915

2016
declare namespace directoryTree {
21-
export interface DirectoryTree<C extends IObj = IObj> {
17+
export interface DirectoryTree<C extends Record<string, any> = Record<string, any>> {
2218
path: string;
2319
name: string;
2420
size: number;

0 commit comments

Comments
 (0)