Merge pull request #7352 from panuhorsmalahti/rcloader

Add type definitions for rcloader.
This commit is contained in:
Masahiro Wakame
2015-12-28 14:39:09 +09:00
2 changed files with 29 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="./rcloader.d.ts" />
import RcLoader = require("rcloader");
const rcLoader = new RcLoader(".configfilename", {
lookup: true
});
rcLoader.for("foo.json", (err, fileOpts) => {
// send the file along
});
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for rcloader
// Project: hhttps://github.com/spalger/rcloader
// Definitions by: Panu Horsmalahti <https://github.com/panuhorsmalahti>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "rcloader" {
interface Options {
[property: string]: any;
lookup?: boolean;
}
class RcLoader {
constructor(configfilename: string, options: string | Options);
for(path: string, callback?: (error: any, fileOpts: any) => void): void;
}
export = RcLoader;
}