In my project, which is partially written in TypeScript and licensed under MIT, I am utilizing QUnit. I have some TypeScript functions that require QUnit as a parameter, and I would like to define their types based on its interface from the typings.
For example:
import { QUnit } from "qunit";
export function run_tests(q: QUnit)
{
q.module((a) => { ... });
}
However, I encountered an error when attempting to do so:
tsc --project lib/typescript/www/tsconfig.json
src/ts/web-fc-solve-tests.ts(12,23): error TS2306: File '/home/shlomif/progs/fre
ecell/git/fc-solve/fc-solve/site/wml/node_modules/@types/qunit/index.d.ts' is no
t a module.
You can find the code (note the branch) here: https://github.com/shlomif/fc-solve/tree/qunit-typescript - located under the fc-solve/site/wml
subdirectory.
This is my tsconfig.json
:
{
"compilerOptions": {
"baseUrl": ".",
"esModuleInterop": true,
"module": "amd",
"moduleResolution": "node",
"noImplicitReturns": true,
"outDir": "../../../lib/out-babel/js",
"paths": {
"big-integer": ["node_modules/big-integer/BigInteger.d.ts"],
"qunit": ["node_modules/@types/qunit"]
},
"target":"es6"
},
"include": ["../../../src/ts/**/*.ts"]
}
Any assistance would be greatly appreciated.