clarketm / TableExport

The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
https://tableexport.travismclarke.com/
Apache License 2.0
888 stars 289 forks source link

Missing parameter in the typings of the export2file method #169

Open d-fankhauser opened 5 years ago

d-fankhauser commented 5 years ago

Some parameters are missing in the .ts file.

Version: 5.2.0

File: tableexport.d.ts

    /**
     * Exports and downloads the file
     */
    export2file: (data: string, mime: string, name: string, extension: String) => void;

It should be something like this

    export2file: (data: string, mime: string, name: string, extension: String, merges: Object, rtl: Boolean, sheetname: String) => void;

File: tableexport.js

    /**
     * Exports and downloads the file
     * @memberof TableExport.prototype
     * @param data {String}
     * @param mime {String} mime type
     * @param name {String} filename
     * @param extension {String} file extension
     * @param merges {Object[]}
     * @param RTL {Boolean}
     */
    export2file: function(data, mime, name, extension, merges, RTL, sheetname) {

Without sheetname, you can't use export2file Method - excel will bring the warning, that the file is corrupt.

churongcon commented 5 years ago

Yes, same error with xlsx

dickeylth commented 5 years ago

It's really a big trouble for guys who want to customize buttons but fall into this trap, along with the misleading example: https://github.com/clarketm/TableExport/blob/master/examples/exportButtons.html#L105