I have developed a Node C++ Addon that wraps a class similar to the one outlined in the official Node documentation. By using require(), I am able to access my addon and retrieve the constructor for my class in order to instantiate it.
const { MyClass } = require('myaddon');
const obj = new MyClass('data');
My next goal is to replicate this process using TypeScript. However, I am struggling to find the correct combination of .d.ts file and import statement to achieve this. Ideally, I would like to define my class within the module and specify that it has a constructor that accepts a string parameter. This way, I could simply do:
import { MyClass } from 'myaddon';
const obj = new MyClass('data');
Has anyone come across any examples of how to accomplish this task?