UNPKG

753 BTypeScriptView Raw
1declare function autoload(
2 baseDirectory: string,
3 options?: autoload.AutoloadOptions
4): autoload.AutoloadTree;
5
6// Dirty hack so we can import this module using ES6 syntax
7// TypeScript won't let you import modules using ES6 syntax using `import * as` if `export =` refers to a function.
8// However, using declare namespace autoload {} TypeScript will merge the function declaration and the namespace
9// declaration so that this works. This has the added benefit of letting us expose interface types in a CommonJS
10// module.
11declare namespace autoload {
12 export interface AutoloadOptions {
13 deep?: boolean
14 js?: boolean
15 json?: boolean
16 }
17
18 export interface AutoloadTree {
19 [key: string]: AutoloadTree | any
20 }
21}
22
23export = autoload;