Add types for rechoir

This commit is contained in:
Dimitri Benin
2018-12-05 08:41:49 +01:00
parent e1a9b84984
commit 0421278fae
4 changed files with 48 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for rechoir 0.6
// Project: https://github.com/tkellen/node-rechoir
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Extensions } from 'interpret';
export function prepare(
config: Extensions,
filepath: string,
requireFrom?: string
): true | Attempt[];
export interface Attempt {
moduleName: string;
module: any;
error: Error | null;
}
+6
View File
@@ -0,0 +1,6 @@
import { extensions as config } from 'interpret';
import { prepare } from 'rechoir';
// $ExpectType true | Attempt[]
prepare(config, './test/fixtures/test.coffee');
prepare(config, './test/fixtures/test.coffee', './');
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"rechoir-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }