If you want to declare and import typescript interfaces in a separate file. You need to export the interface from the file in which is defined and import it wherever you want to use it.
In IfcSampleInterface.ts:
1 2 3 4 | export interface IfcSampleInterface { key: string; value: string; } |
In SampleInterface.ts
1 2 | import { IfcSampleInterface } from './IfcSampleInterface'; let sampleVar: IfcSampleInterface; |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.