* Ajout de création de fichier .ods * Ajout d'un outil pour créer un fichier .ods + rajout de styles.xml et meta.xml pour peut-être plaire à LibreOffice * Créer des fichiers considérés corrompus-mais-réparables LibreOffice * Creating libre-office-validated ods files * readme with ods creation
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
//@ts-check
|
|
|
|
import {DOMParser} from '@xmldom/xmldom'
|
|
|
|
import {
|
|
_getODSTableRawContent,
|
|
_getXLSXTableRawContent
|
|
} from './shared.js'
|
|
|
|
|
|
function parseXML(str){
|
|
return (new DOMParser()).parseFromString(str, 'application/xml');
|
|
}
|
|
|
|
|
|
/**
|
|
* @param {ArrayBuffer} odsArrBuff
|
|
* @returns {ReturnType<_getODSTableRawContent>}
|
|
*/
|
|
export function getODSTableRawContent(odsArrBuff){
|
|
return _getODSTableRawContent(odsArrBuff, parseXML)
|
|
}
|
|
|
|
/**
|
|
* @param {ArrayBuffer} xlsxArrBuff
|
|
* @returns {ReturnType<_getXLSXTableRawContent>}
|
|
*/
|
|
export function getXLSXTableRawContent(xlsxArrBuff){
|
|
return _getXLSXTableRawContent(xlsxArrBuff, parseXML)
|
|
}
|
|
|
|
export {createOdsFile} from './createOdsFile.js'
|
|
|
|
export {
|
|
// table-level exports
|
|
tableWithoutEmptyRows,
|
|
tableRawContentToValues,
|
|
tableRawContentToStrings,
|
|
tableRawContentToObjects,
|
|
|
|
// sheet-level exports
|
|
sheetRawContentToObjects,
|
|
sheetRawContentToStrings,
|
|
|
|
// row-level exports
|
|
rowRawContentToStrings,
|
|
isRowNotEmpty,
|
|
|
|
// cell-level exports
|
|
cellRawContentToStrings,
|
|
convertCellValue
|
|
} from './shared.js'
|
|
|