Trying my hand at crafting a TypeScript object from JavaScript.
The specific JavaScript object I'm attempting to construct can be found here: https://cdnjs.cloudflare.com/ajax/libs/chess.js/0.10.2/chess.js
In the provided JavaScript example, the object is simply created like so:
this.engine = new Chess();
However, I am unsure of how to achieve this in TypeScript.
To import the object, I used the following method (downloading and adding the file into my project):
import * as Chess from './../chess.js';
Despite importing the object successfully, attempting to instantiate a Chess object results in a build error:
const engine = new Chess();
An error message is displayed: "Cannot use 'new' with an expression whose type lacks a call or construct signature."