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

The merge parameter is not present in the typings of the export2file method. #120

Open el-frontend opened 6 years ago

el-frontend commented 6 years ago

The merge parameter is not present in the typings of the export2file method.

File: tableexport.d.ts

      * Exports and downloads the file
      * /
     export2file: (data: string, mime: string, name: string, extension: 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[]}
             */
            export2file: function (data, mime, name, extension, merges) {
                data = this.getRawData(data, extension, name, merges);

                if (_isMobile) {
                    // TODO: fix dataURI on iphone (xlsx & xls)
                    var dataURI = 'data:' + mime + ';' + this.charset + ',' + data;
                    this.downloadDataURI(dataURI, name, extension);
                } else {
                    // TODO: error and fallback when `saveAs` not available
                    saveAs(new Blob([data],
                        {type: mime + ';' + this.charset}),
                        name + extension, true);
                }
            },