Exporting classes and interfaces to a module in typescript for the node.js package

I have one interface for Exception and one concrete class that inherits from this interface. I want to export these types to a module as a node.js package.

iexp.ts

interface IException {}

      

exp.ts

class Exception implements IException {}

      

index.ts

module AB_Company {
    export IException;
    export Exception;
}
export {AB_Company};

      

Codes below for viewing the scene. But I was unable to achieve this in order to export this module.

client will be used like this

import {AB_Company} from "AB_Company_Exception";
let exp:AB_Company.IException;

      

+3
javascript node.js module package typescript


source to share


No one has answered this question yet

Check out similar questions:

711
Using Node.js requires ES6 imports / exports
692
module.exports versus export to Node.js
453
What's the difference between a Python module and a Python package?
228
How can I share code between Node.js and the browser?
8
Node.js ES6 how to export a class from a module?
3
How to properly export and import modules in TypeScript
1
Export TypScript interface from private npm module
0
TypScript uses module import as an interface
0
Node.js: Error "Exported file of typed package files"
-2
TypeScript Node.js Package



All Articles
Loading...
X
Show
Funny
Dev
Pics