odfjs/scripts/browser.js

52 lines
1.0 KiB
JavaScript
Raw Normal View History

2024-06-15 12:54:53 +02:00
//@ts-check
import {
_getODSTableRawContent,
_getXLSXTableRawContent
} from './shared.js'
2024-06-15 12:54:53 +02:00
function parseXML(str){
return (new DOMParser()).parseFromString(str, 'application/xml');
}
2024-06-15 12:54:53 +02:00
/**
* @param {ArrayBuffer} odsArrBuff
* @returns {ReturnType<_getODSTableRawContent>}
2024-06-15 12:54:53 +02:00
*/
export function getODSTableRawContent(odsArrBuff){
return _getODSTableRawContent(odsArrBuff, parseXML)
2024-06-15 12:54:53 +02:00
}
2024-06-15 16:29:16 +02:00
/**
* @param {ArrayBuffer} xlsxArrBuff
* @returns {ReturnType<_getXLSXTableRawContent>}
2024-06-15 16:29:16 +02:00
*/
export function getXLSXTableRawContent(xlsxArrBuff){
return _getXLSXTableRawContent(xlsxArrBuff, parseXML)
2024-06-15 16:29:16 +02:00
}
2024-06-16 13:57:12 +02:00
export {createOdsFile} from './createOdsFile.js'
export {
// table-level exports
tableWithoutEmptyRows,
tableRawContentToValues,
tableRawContentToStrings,
tableRawContentToObjects,
2024-06-18 11:49:57 +02:00
// sheet-level exports
sheetRawContentToObjects,
sheetRawContentToStrings,
// row-level exports
rowRawContentToStrings,
isRowNotEmpty,
// cell-level exports
cellRawContentToStrings,
convertCellValue
} from './shared.js'
2024-06-15 16:29:16 +02:00