How to implement an interface module in aurelia?

Sadly, both don’t work.

The first option results in build errors. I suppose this happens because it only exports interfaces and no classes or so.
The second option doens’t work either because I simply want to get an SqlClient object from the module and SqlClient is a single interface in the module.

I wonder if this has to do with the typescript configs in both projects since the node example uses common js and the aurelia project uses amd.

Here is the config of the node example:

{
“compilerOptions”: {
“module”: “commonjs”,
“esModuleInterop”: true,
“target”: “es6”,
“moduleResolution”: “node”,
“sourceMap”: true,
“outDir”: “dist”
},
“lib”: [“es2015”]
}

And here is the tsconfig of the aurelia project:

{
“compileOnSave”: false,
“compilerOptions”: {
“module”: “amd”,
“noImplicitAny”: false,
“declaration”: false,
“typeRoots”: [“./node_modules/@types”],
“removeComments”: true,
“emitDecoratorMetadata”: true,
“experimentalDecorators”: true,
“sourceMap”: true,
“target”: “es5”,
“lib”: [“es2015”, “dom”],
“moduleResolution”: “node”,
“baseUrl”: “src”,
“resolveJsonModule”: true,
“allowJs”: true
},
“include”: [“./src//*.ts", "./test//.ts", "./types/**/.d.ts”],
“atom”: {
“rewriteTsconfig”: false
}
}

1 Like