typescript module augmentation

adding typings for libraries without thier own types and no 3rd party ones published under the npm @types scope

November 14, 2024
//custom.d.ts


declare module "html-table-to-json" {

  export default class HtmlTableToJson {

    constructor(html: string);

    static parse(html: string): {
        _results: Record<string, string>[];
        _headers: string[];
        _count: null;
        _firstRowUsedAsHeaders: boolean;
    };

    getResults(): any;

  }

}