@@ -23,19 +23,19 @@ class ExcelBuilder {
2323 /** Turns a workbook into a downloadable file.
2424 * @param {Excel/Workbook } workbook The workbook that is being converted
2525 * @param {Object } options
26- * @param {Boolean } options.base64 Whether to 'return' the generated file as a base64 string
26+ * @param {boolean } options.base64 Whether to 'return' the generated file as a base64 string
2727 * @param {Function } options.success The callback function to run after workbook creation is successful.
2828 * @param {Function } options.error The callback function to run if there is an error creating the workbook.
29- * @param {String } options.requireJsPath (Optional) The path to requirejs. Will use the id 'requirejs' to look up the script if not specified.
29+ * @param {string } options.requireJsPath (Optional) The path to requirejs. Will use the id 'requirejs' to look up the script if not specified.
3030 */
31- public createFileAsync ( workbook : Workbook , options : { base64 : boolean ; error : ( ) => void ; requireJsPath ?: string ; success : ( data : any ) => void ; } , jszipPath : string , zipWorkerPath : string , worksheetExportWorkerPath : string ) {
31+ static createFileAsync ( workbook : Workbook , options : { base64 : boolean ; error : ( ) => void ; requireJsPath ?: string ; success : ( data : any ) => void ; } , jszipPath : string , zipWorkerPath : string , worksheetExportWorkerPath : string ) {
3232
3333 workbook . generateFilesAsync ( {
3434 requireJsPath : options . requireJsPath ,
3535 success : function ( files ) {
3636 var worker = new Worker ( zipWorkerPath ) ; //require.toUrl('./Excel/ZipWorker.js')
37- worker . addEventListener ( ' message' , < any > function ( event , data ) {
38- if ( event . data . status == ' done' ) {
37+ worker . addEventListener ( " message" , < any > function ( event : MessageEvent ) {
38+ if ( event . data . status == " done" ) {
3939 options . success ( event . data . data ) ;
4040 }
4141 } ) ;
@@ -53,16 +53,17 @@ class ExcelBuilder {
5353
5454
5555 /** Turns a workbook into a downloadable file.
56+ * @param {JSZip } jszip A JSZip equivalent library to use to generate/zip the excel file
5657 * @param {Excel/Workbook } workbook The workbook that is being converted
5758 * @param {Object } options - options to modify how the excel doc is created. Only accepts a base64 boolean at the moment.
5859 */
59- public createFile ( jszip : typeof JSZip , workbook : Workbook , options ?: { base64 ?: boolean ; } ) {
60+ static createFile ( jszip : typeof JSZip , workbook : Workbook , options ?: { base64 ?: boolean ; } ) {
6061 var zip = new jszip ( ) ;
6162 var files = workbook . generateFiles ( ) ;
6263 Object . keys ( files ) . forEach ( function ( path ) {
6364 var content = files [ path ] ;
6465 path = path . substr ( 1 ) ;
65- if ( path . indexOf ( ' .xml' ) !== - 1 || path . indexOf ( ' .rel' ) !== - 1 ) {
66+ if ( path . indexOf ( " .xml" ) !== - 1 || path . indexOf ( " .rel" ) !== - 1 ) {
6667 zip . file ( path , content , { base64 : false } ) ;
6768 } else {
6869 zip . file ( path , content , { base64 : true , binary : true } ) ;
0 commit comments