- The dynamoose library provides the following signature for constructing a model:
model: {
<T extends Document>(name: string, schema?: SchemaDefinition | Schema, options?: Partial<import("./Model").ModelOptions>): T & Model<T> & ModelDocumentConstructor<T>;
defaults: any;
};
- Consumption in a TypeScript file is being done as follows:
import * as dynamoose from 'dynamoose';
...
const ExampleRepository = dynamoose.model(
schemaName,
ExampleSchema,
);
export default ExampleRepository;
- Compilation produces the error:
Exported variable 'ExampleRepository' has or is using name 'ModelDocumentConstructor' from external module ".../node_modules/dynamoose/dist/index" but cannot be named.
Other answers to similar questions on SO would suggest that the ModelDocumentConstructor
should be imported. TS4023: Exported Variable <x> has or is using name <y> from external module but cannot be named
However the interface itself is not exported, so cannot be imported.