To export a default interface in TypeScript, you can define the interface as usual and then use the export default keywords before the interface definition. Here's an example:
index.ts86 chars6 linesIn this example, we define an interface Person with three properties. The interface is marked as the default export for this module by using the export default keywords before the interface keyword.
To import this default interface in another module, we can use import Person from './person'. Note that we don't need to specify the name of the exported interface because it's the default export.
index.ts111 chars8 linesIn this example, we import the Person interface from the person module using import Person from './person'. We can then use the Person interface like any other interface in TypeScript.
gistlibby LogSnag