I have a file that imports a bunch of classes and Id like to reexport them from there as properties something like
/** Class representing a point. */
class Point {
/**
* Create a point.
* @param {number} x - The x value.
* @param {number} y - The y value.
*/
constructor(x, y) {
// ...
}
/**
* Get the x value.
* @return {number} The x value.
*/
getX() {
// ...
}
}
but my types.d.ts makes the Point export a var and I get the complaint that it can't be new since its not a function or constrcutor
/**
* Create a point.
* @param x - The x value.
* @param y - The y value.
*/
declare class Point {
constructor(x: number, y: number);
/**
* Get the x value.
* @returns The x value.
*/
getX(): number;
}
/**
* App Module
*/
declare module "app" {
var Point: Point;
}
is it possible to add Point as an export to app so I can call new app.Point(x,y) ?
I have a file that imports a bunch of classes and Id like to reexport them from there as properties something like
but my types.d.ts makes the
Point
export a var and I get the complaint that it can't benew
since its not a function or constrcutoris it possible to add
Point
as an export to app so I can callnew app.Point(x,y)
?