Given:
types.ts
interface Test {
promise: Promise<any>;
}
tsconfig.json
{
"compilerOptions": {
"lib": [
"es2015", ],
}
and my usage file test.ts
const data = mock({
files: [
[
path.join(__dirname, 'types.ts'),
fs.readFileSync(path.join(__dirname, 'types.ts'), 'utf-8')
],
],
interfaces: ['Test'],
output: 'object',
});
I would expect the following interface to work, but I get the error:
Type 'Promise' is not specified in the provided files but is required for property: 'promise'. Please include it.
In the docs we see that 'Interfaces with property references to other complex types ' are supported. since Promise is an other complex types I would assume it would work.
Is there some special configuration for including a tsconfig or do we need to import all type dependencies? or how should we handle such cases. We are currently investigating using this lib for mocking in test and dev environments and will need to support many such use cases such as dom types, react component types, etc.
Please advise :)