diff --git a/types/little-loader/index.d.ts b/types/little-loader/index.d.ts new file mode 100644 index 0000000000..eab91adc75 --- /dev/null +++ b/types/little-loader/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for little-loader 0.2 +// Project: https://github.com/walmartlabs/little-loader +// Definitions by: Chris Drackett +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Options { + context?: any; + setup?: (this: any, script: any) => void; + callback?: (this: any, err: string) => void; +} + +declare function loader( + module: string, + callback?: (this: any, err: string) => void, + context?: any +): void; + +declare function loader( + module: string, + options?: Options +): void; + +export = loader; diff --git a/types/little-loader/little-loader-tests.ts b/types/little-loader/little-loader-tests.ts new file mode 100644 index 0000000000..1abbf5d2f0 --- /dev/null +++ b/types/little-loader/little-loader-tests.ts @@ -0,0 +1,3 @@ +import load = require("little-loader"); + +load("http://google.com/test.js", () => console.log("loaded!"), ""); // $ExpectType void diff --git a/types/little-loader/tsconfig.json b/types/little-loader/tsconfig.json new file mode 100644 index 0000000000..6fcf740298 --- /dev/null +++ b/types/little-loader/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "little-loader-tests.ts"] +} diff --git a/types/little-loader/tslint.json b/types/little-loader/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/little-loader/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }