mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-30 23:30:06 +00:00
little-loader types (#36127)
* adding types for little-loader * adding support files * use 4 spaces * export directly * export default? * I'm so confused. * going back to original. giving up. * missing version and ; * trying to just export a function one more time... * remove export? * *sigh* * updating import on test * context is optional * update to deal with options case. * remove unnecessary generic?
This commit is contained in:
committed by
Daniel Rosenwasser
parent
d54c178c24
commit
af9ceddfdf
23
types/little-loader/index.d.ts
vendored
Normal file
23
types/little-loader/index.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// Type definitions for little-loader 0.2
|
||||
// Project: https://github.com/walmartlabs/little-loader
|
||||
// Definitions by: Chris Drackett <https://github.com/chrisdrackett>
|
||||
// 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;
|
||||
3
types/little-loader/little-loader-tests.ts
Normal file
3
types/little-loader/little-loader-tests.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import load = require("little-loader");
|
||||
|
||||
load("http://google.com/test.js", () => console.log("loaded!"), ""); // $ExpectType void
|
||||
16
types/little-loader/tsconfig.json
Normal file
16
types/little-loader/tsconfig.json
Normal file
@@ -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"]
|
||||
}
|
||||
1
types/little-loader/tslint.json
Normal file
1
types/little-loader/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user