microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.43k stars 102 forks source link

dts-gen for excel4node 1.2.1 #67

Open shaunc opened 7 years ago

shaunc commented 7 years ago

I am a newbie in typescript following typescript node starter tutorial. I ran dts-gen on excel4node v1.2.1. The generated d.ts has error at:

export namespace Workbook {
    namespace prototype {
        function addWorksheet(name: any, opts: any): any;

        function createStyle(opts: any): any;

        function getStringIndex(val: any): any;

        function setSelectedTab(id: any): void;

        function write(fileName: any, handler: any): void;

        function writeToBuffer(): any;
...

-- typescript complains "src/types/excel4node.d.ts(475,15): error TS2300: Duplicate identifier 'prototype"

I would guess this is a bug triggered by source code referencing functions explicitly through the prototype property.... Will I be ok if I just delete the offending definition? After all above I see:

export class Workbook {
    constructor(opts: any);

    addWorksheet(name: any, opts: any): any;

    createStyle(opts: any): any;

    getStringIndex(val: any): any;

    setSelectedTab(id: any): void;

    write(fileName: any, handler: any): void;

    writeToBuffer(): any;

}
Meligy commented 7 years ago

I'm seeing the same thing with dts-gen -m snoowrap as well.