office-viewer 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1732) hide show
  1. package/README.md +13 -3
  2. package/esm/Excel.d.ts +59 -0
  3. package/esm/Excel.js +200 -0
  4. package/esm/OfficeViewer.d.ts +10 -0
  5. package/esm/RenderOptions.d.ts +25 -0
  6. package/esm/UnSupport.d.ts +13 -0
  7. package/esm/UnSupport.js +33 -0
  8. package/esm/Word.d.ts +7 -24
  9. package/esm/Word.js +25 -22
  10. package/esm/common/__tests__/autoParse.test.d.ts +1 -0
  11. package/esm/common/autoParse.d.ts +9 -0
  12. package/esm/common/autoParse.js +192 -0
  13. package/esm/common/parseAttributes.d.ts +6 -0
  14. package/esm/common/parseAttributes.js +27 -0
  15. package/esm/common/parseChildren.d.ts +8 -0
  16. package/esm/common/parseContentType.d.ts +7 -0
  17. package/esm/common/parseContentType.js +50 -0
  18. package/esm/common/parseRelationship.d.ts +5 -0
  19. package/esm/common/parseRelationship.js +46 -0
  20. package/esm/createOfficeViewer.d.ts +16 -0
  21. package/esm/createOfficeViewer.js +98 -0
  22. package/esm/excel/StyleSheet.d.ts +8 -0
  23. package/esm/excel/StyleSheet.js +11 -0
  24. package/esm/excel/Workbook.d.ts +180 -0
  25. package/esm/excel/Workbook.js +209 -0
  26. package/esm/excel/data/LocalDataProvider.d.ts +146 -0
  27. package/esm/excel/data/LocalDataProvider.js +784 -0
  28. package/esm/excel/data/applyAutoFilter.d.ts +10 -0
  29. package/esm/excel/data/applyAutoFilter.js +86 -0
  30. package/esm/excel/data/autoFilter/CellValueNum.d.ts +5 -0
  31. package/esm/excel/data/autoFilter/__test__/customFilter.test.d.ts +1 -0
  32. package/esm/excel/data/autoFilter/__test__/filters.test.d.ts +1 -0
  33. package/esm/excel/data/autoFilter/__test__/sortByRange.test.d.ts +1 -0
  34. package/esm/excel/data/autoFilter/applySortState.d.ts +6 -0
  35. package/esm/excel/data/autoFilter/applySortState.js +36 -0
  36. package/esm/excel/data/autoFilter/customFilter.d.ts +6 -0
  37. package/esm/excel/data/autoFilter/customFilter.js +78 -0
  38. package/esm/excel/data/autoFilter/evalCustomFilter.d.ts +9 -0
  39. package/esm/excel/data/autoFilter/evalCustomFilter.js +61 -0
  40. package/esm/excel/data/autoFilter/filters.d.ts +3 -0
  41. package/esm/excel/data/autoFilter/filters.js +55 -0
  42. package/esm/excel/data/autoFilter/inDateGroupItems.d.ts +6 -0
  43. package/esm/excel/data/autoFilter/inDateGroupItems.js +71 -0
  44. package/esm/excel/data/autoFilter/sortByRange.d.ts +8 -0
  45. package/esm/excel/data/autoFilter/sortByRange.js +50 -0
  46. package/esm/excel/data/defaultFont.d.ts +25 -0
  47. package/esm/excel/data/defaultFont.js +27 -0
  48. package/esm/excel/data/getThemeColor.d.ts +2 -0
  49. package/esm/excel/data/getThemeColor.js +71 -0
  50. package/esm/excel/data/numfmt/amountInWords.d.ts +4 -0
  51. package/esm/excel/data/numfmt/amountInWords.js +39 -0
  52. package/esm/excel/data/numfmtExtend.d.ts +10 -0
  53. package/esm/excel/data/numfmtExtend.js +29 -0
  54. package/esm/excel/edit/Command.d.ts +19 -0
  55. package/esm/excel/edit/ui/CellEditor.d.ts +27 -0
  56. package/esm/excel/edit/ui/CellEditor.js +65 -0
  57. package/esm/excel/io/csv/emptyXLSX.d.ts +2 -0
  58. package/esm/excel/io/csv/emptyXLSX.js +6 -0
  59. package/esm/excel/io/excel/__tests__/parseSharedStrings.test.d.ts +1 -0
  60. package/esm/excel/io/excel/drawing/getRelationPath.d.ts +2 -0
  61. package/esm/excel/io/excel/drawing/getRelationPath.js +11 -0
  62. package/esm/excel/io/excel/drawing/parseAnchorCommon.d.ts +9 -0
  63. package/esm/excel/io/excel/drawing/parseAnchorCommon.js +78 -0
  64. package/esm/excel/io/excel/drawing/parseChart.d.ts +3 -0
  65. package/esm/excel/io/excel/drawing/parseChart.js +11 -0
  66. package/esm/excel/io/excel/drawing/parseDrawing.d.ts +8 -0
  67. package/esm/excel/io/excel/drawing/parseDrawing.js +103 -0
  68. package/esm/excel/io/excel/drawing/parsePic.d.ts +4 -0
  69. package/esm/excel/io/excel/drawing/parsePic.js +23 -0
  70. package/esm/excel/io/excel/drawing/parseShape.d.ts +4 -0
  71. package/esm/excel/io/excel/drawing/parseShape.js +159 -0
  72. package/esm/excel/io/excel/getRelPath.d.ts +4 -0
  73. package/esm/excel/io/excel/getRelPath.js +10 -0
  74. package/esm/excel/io/excel/initValueForContainsBlanks.d.ts +6 -0
  75. package/esm/excel/io/excel/initValueForContainsBlanks.js +58 -0
  76. package/esm/excel/io/excel/initValueForTable.d.ts +5 -0
  77. package/esm/excel/io/excel/initValueForTable.js +31 -0
  78. package/esm/excel/io/excel/parseDefinedNames.d.ts +5 -0
  79. package/esm/excel/io/excel/parseDefinedNames.js +11 -0
  80. package/esm/excel/io/excel/parseSharedStrings.d.ts +9 -0
  81. package/esm/excel/io/excel/parseSharedStrings.js +173 -0
  82. package/esm/excel/io/excel/parseSheet.d.ts +9 -0
  83. package/esm/excel/io/excel/parseSheet.js +84 -0
  84. package/esm/excel/io/excel/parseTableParts.d.ts +5 -0
  85. package/esm/excel/io/excel/parseTableParts.js +67 -0
  86. package/esm/excel/io/excel/parseTableStyleDef.d.ts +3 -0
  87. package/esm/excel/io/excel/parseTheme.d.ts +6 -0
  88. package/esm/excel/io/excel/parseTheme.js +42 -0
  89. package/esm/excel/io/excel/parseWorkbook.d.ts +8 -0
  90. package/esm/excel/io/excel/parseWorkbook.js +105 -0
  91. package/esm/excel/io/excel/parseWorkbookPr.d.ts +6 -0
  92. package/esm/excel/io/excel/parseWorkbookPr.js +13 -0
  93. package/esm/excel/io/excel/parseWorkbookView.d.ts +6 -0
  94. package/esm/excel/io/excel/parseWorkbookView.js +13 -0
  95. package/esm/excel/io/excel/parseWorksheet.d.ts +9 -0
  96. package/esm/excel/io/excel/parseWorksheet.js +207 -0
  97. package/esm/excel/io/excel/preset/defaultTheme.d.ts +1 -0
  98. package/esm/excel/io/excel/preset/defaultTheme.js +3 -0
  99. package/esm/excel/io/excel/preset/presetCellStyles.d.ts +3 -0
  100. package/esm/excel/io/excel/preset/presetIconSet.d.ts +6 -0
  101. package/esm/excel/io/excel/preset/presetIconSet.js +55 -0
  102. package/esm/excel/io/excel/preset/presetIcons.d.ts +3 -0
  103. package/esm/excel/io/excel/preset/presetIcons.js +44 -0
  104. package/esm/excel/io/excel/preset/presetTableStyles.d.ts +3 -0
  105. package/esm/excel/io/excel/preset/presetTableStyles.js +35117 -0
  106. package/esm/excel/io/excel/stylesheet/parseColor.d.ts +5 -0
  107. package/esm/excel/io/excel/stylesheet/parseColor.js +11 -0
  108. package/esm/excel/io/excel/util/Range.d.ts +66 -0
  109. package/esm/excel/io/excel/util/Range.js +120 -0
  110. package/esm/excel/io/excel/util/__tests__/makeBlankValue.test.d.ts +1 -0
  111. package/esm/excel/io/excel/util/decodeAddress.d.ts +11 -0
  112. package/esm/excel/io/excel/util/decodeAddress.js +63 -0
  113. package/esm/excel/io/excel/util/fromExcelDate.d.ts +14 -0
  114. package/esm/excel/io/excel/util/fromExcelDate.js +26 -0
  115. package/esm/excel/io/excel/util/lettersToNumber.d.ts +4 -0
  116. package/esm/excel/io/excel/util/makeBlankValue.d.ts +6 -0
  117. package/esm/excel/io/excel/util/makeBlankValue.js +21 -0
  118. package/esm/excel/io/excel/util/numberToLetters.d.ts +4 -0
  119. package/esm/excel/io/excel/util/numberToLetters.js +13 -0
  120. package/esm/excel/io/excel/worksheet/parseSheetData.d.ts +11 -0
  121. package/esm/excel/io/excel/worksheet/parseSheetData.js +154 -0
  122. package/esm/excel/io/parseExcel.d.ts +10 -0
  123. package/esm/excel/io/parseExcel.js +39 -0
  124. package/esm/excel/lang/en_US.d.ts +24 -0
  125. package/esm/excel/lang/en_US.js +25 -0
  126. package/esm/excel/lang/lang.d.ts +30 -0
  127. package/esm/excel/lang/lang.js +19 -0
  128. package/esm/excel/lang/zh_CN.d.ts +2 -0
  129. package/esm/excel/lang/zh_CN.js +25 -0
  130. package/esm/excel/print/printStyle.d.ts +4 -0
  131. package/esm/excel/print/printStyle.js +8 -0
  132. package/esm/excel/print/renderInIframe.d.ts +7 -0
  133. package/esm/excel/print/renderInIframe.js +26 -0
  134. package/esm/excel/render/Canvas.d.ts +108 -0
  135. package/esm/excel/render/Canvas.js +332 -0
  136. package/esm/excel/render/Consts.d.ts +20 -0
  137. package/esm/excel/render/Consts.js +22 -0
  138. package/esm/excel/render/ExcelRender.d.ts +120 -0
  139. package/esm/excel/render/ExcelRender.js +422 -0
  140. package/esm/excel/render/Icons.d.ts +13 -0
  141. package/esm/excel/render/Icons.js +15 -0
  142. package/esm/excel/render/IndexedColors.d.ts +1 -0
  143. package/esm/excel/render/IndexedColors.js +70 -0
  144. package/esm/excel/render/Line.d.ts +6 -0
  145. package/esm/excel/render/Rect.d.ts +17 -0
  146. package/esm/excel/render/Rect.js +20 -0
  147. package/esm/excel/render/ScrollBar.d.ts +54 -0
  148. package/esm/excel/render/ScrollBar.js +137 -0
  149. package/esm/excel/render/SelectionCanvas.d.ts +33 -0
  150. package/esm/excel/render/SelectionCanvas.js +92 -0
  151. package/esm/excel/render/SheetCanvas.d.ts +33 -0
  152. package/esm/excel/render/SheetCanvas.js +42 -0
  153. package/esm/excel/render/__test__/autoWrapText.test.d.ts +1 -0
  154. package/esm/excel/render/__test__/tokenizer.test.d.ts +1 -0
  155. package/esm/excel/render/autoFilter/AutoFilterIconUI.d.ts +33 -0
  156. package/esm/excel/render/autoFilter/AutoFilterIconUI.js +85 -0
  157. package/esm/excel/render/autoFilter/AutoFilterMenuUI.d.ts +13 -0
  158. package/esm/excel/render/autoFilter/AutoFilterMenuUI.js +34 -0
  159. package/esm/excel/render/autoFilter/filterColumn/CustomFiltersUI.d.ts +46 -0
  160. package/esm/excel/render/autoFilter/filterColumn/CustomFiltersUI.js +158 -0
  161. package/esm/excel/render/autoFilter/filterColumn/FilterColumnUI.d.ts +10 -0
  162. package/esm/excel/render/autoFilter/filterColumn/FilterColumnUI.js +47 -0
  163. package/esm/excel/render/autoFilter/filterColumn/FiltersUI.d.ts +10 -0
  164. package/esm/excel/render/autoFilter/filterColumn/FiltersUI.js +37 -0
  165. package/esm/excel/render/autoFilter/filterColumn/OperatorTypeUI.d.ts +5 -0
  166. package/esm/excel/render/autoFilter/filterColumn/buildOperatorOptions.d.ts +2 -0
  167. package/esm/excel/render/autoFilter/filterColumn/buildOperatorOptions.js +95 -0
  168. package/esm/excel/render/autoFilter/filterColumn/fromOperatorUI.d.ts +6 -0
  169. package/esm/excel/render/autoFilter/filterColumn/fromOperatorUI.js +48 -0
  170. package/esm/excel/render/autoFilter/filterColumn/getCustomFilters.d.ts +2 -0
  171. package/esm/excel/render/autoFilter/filterColumn/getCustomFilters.js +10 -0
  172. package/esm/excel/render/autoFilter/filterColumn/getFilterValues.d.ts +5 -0
  173. package/esm/excel/render/autoFilter/filterColumn/getFilterValues.js +31 -0
  174. package/esm/excel/render/autoFilter/filterColumn/hasFilterColumn.d.ts +5 -0
  175. package/esm/excel/render/autoFilter/filterColumn/hasFilterColumn.js +37 -0
  176. package/esm/excel/render/autoFilter/filterColumn/setCustomFilters.d.ts +5 -0
  177. package/esm/excel/render/autoFilter/filterColumn/setCustomFilters.js +19 -0
  178. package/esm/excel/render/autoFilter/filterColumn/setFilterValues.d.ts +6 -0
  179. package/esm/excel/render/autoFilter/filterColumn/setFilterValues.js +45 -0
  180. package/esm/excel/render/autoFilter/filterColumn/toOperatorUI.d.ts +6 -0
  181. package/esm/excel/render/autoFilter/filterColumn/toOperatorUI.js +30 -0
  182. package/esm/excel/render/autoFilter/renderAutoFilter.d.ts +2 -0
  183. package/esm/excel/render/autoFilter/renderAutoFilter.js +31 -0
  184. package/esm/excel/render/autoFilter/renderAutoFilterIcon.d.ts +6 -0
  185. package/esm/excel/render/autoFilter/renderAutoFilterIcon.js +52 -0
  186. package/esm/excel/render/autoFilter/sortState/ColumnSortOrder.d.ts +1 -0
  187. package/esm/excel/render/autoFilter/sortState/SortButtonUI.d.ts +12 -0
  188. package/esm/excel/render/autoFilter/sortState/SortButtonUI.js +41 -0
  189. package/esm/excel/render/autoFilter/sortState/SortStateUI.d.ts +22 -0
  190. package/esm/excel/render/autoFilter/sortState/SortStateUI.js +65 -0
  191. package/esm/excel/render/autoFilter/sortState/getColumnSortOrder.d.ts +6 -0
  192. package/esm/excel/render/autoFilter/sortState/getColumnSortOrder.js +36 -0
  193. package/esm/excel/render/autoFilter/sortState/setColumnSortOrder.d.ts +7 -0
  194. package/esm/excel/render/autoFilter/sortState/setColumnSortOrder.js +55 -0
  195. package/esm/excel/render/canvas/draw.d.ts +5 -0
  196. package/esm/excel/render/canvas/drawOffscreenCanvas.d.ts +6 -0
  197. package/esm/excel/render/canvas/drawOffscreenCanvas.js +14 -0
  198. package/esm/excel/render/canvas/setPixelRatio.d.ts +4 -0
  199. package/esm/excel/render/canvas/setPixelRatio.js +17 -0
  200. package/esm/excel/render/cell/CellInfoWithSize.d.ts +5 -0
  201. package/esm/excel/render/cell/LinkPosition.d.ts +14 -0
  202. package/esm/excel/render/cell/autoClip.d.ts +6 -0
  203. package/esm/excel/render/cell/autoClip.js +44 -0
  204. package/esm/excel/render/cell/autoWrapText.d.ts +24 -0
  205. package/esm/excel/render/cell/autoWrapText.js +157 -0
  206. package/esm/excel/render/cell/border/drawDoubleBorder.d.ts +2 -0
  207. package/esm/excel/render/cell/border/drawDoubleBorder.js +75 -0
  208. package/esm/excel/render/cell/border/setLineStyle.d.ts +5 -0
  209. package/esm/excel/render/cell/border/setLineStyle.js +43 -0
  210. package/esm/excel/render/cell/cellToMergeCell.d.ts +8 -0
  211. package/esm/excel/render/cell/cellToMergeCell.js +35 -0
  212. package/esm/excel/render/cell/checkFont.d.ts +8 -0
  213. package/esm/excel/render/cell/checkFont.js +31 -0
  214. package/esm/excel/render/cell/drawCell.d.ts +19 -0
  215. package/esm/excel/render/cell/drawCell.js +44 -0
  216. package/esm/excel/render/cell/drawCellBackground.d.ts +3 -0
  217. package/esm/excel/render/cell/drawCellBackground.js +11 -0
  218. package/esm/excel/render/cell/drawCellBorder.d.ts +6 -0
  219. package/esm/excel/render/cell/drawCellBorder.js +47 -0
  220. package/esm/excel/render/cell/drawCells.d.ts +9 -0
  221. package/esm/excel/render/cell/drawCells.js +54 -0
  222. package/esm/excel/render/cell/drawDataBar.d.ts +3 -0
  223. package/esm/excel/render/cell/drawDataBar.js +31 -0
  224. package/esm/excel/render/cell/drawDataBarX14.d.ts +7 -0
  225. package/esm/excel/render/cell/drawDataBarX14.js +48 -0
  226. package/esm/excel/render/cell/drawIconSet.d.ts +3 -0
  227. package/esm/excel/render/cell/drawIconSet.js +13 -0
  228. package/esm/excel/render/cell/drawMultiLineText.d.ts +8 -0
  229. package/esm/excel/render/cell/drawMultiLineText.js +107 -0
  230. package/esm/excel/render/cell/drawSingleLineRichText.d.ts +10 -0
  231. package/esm/excel/render/cell/drawSingleLineRichText.js +55 -0
  232. package/esm/excel/render/cell/drawSingleLineText.d.ts +17 -0
  233. package/esm/excel/render/cell/drawSingleLineText.js +73 -0
  234. package/esm/excel/render/cell/drawTextInCell.d.ts +15 -0
  235. package/esm/excel/render/cell/drawTextInCell.js +105 -0
  236. package/esm/excel/render/cell/frozen/drawFrozen.d.ts +17 -0
  237. package/esm/excel/render/cell/frozen/drawFrozen.js +45 -0
  238. package/esm/excel/render/cell/frozen/drawLeftFrozen.d.ts +10 -0
  239. package/esm/excel/render/cell/frozen/drawLeftFrozen.js +26 -0
  240. package/esm/excel/render/cell/frozen/drawTopFrozen.d.ts +10 -0
  241. package/esm/excel/render/cell/frozen/drawTopFrozen.js +26 -0
  242. package/esm/excel/render/cell/frozen/drawTopLeftFrozen.d.ts +14 -0
  243. package/esm/excel/render/cell/frozen/drawTopLeftFrozen.js +46 -0
  244. package/esm/excel/render/cell/frozen/getFrozenLeftViewPointRange.d.ts +14 -0
  245. package/esm/excel/render/cell/frozen/getFrozenLeftViewPointRange.js +32 -0
  246. package/esm/excel/render/cell/frozen/getFrozenRange.d.ts +5 -0
  247. package/esm/excel/render/cell/frozen/getFrozenRange.js +25 -0
  248. package/esm/excel/render/cell/frozen/getFrozenTopLeftViewPointRange.d.ts +5 -0
  249. package/esm/excel/render/cell/frozen/getFrozenTopLeftViewPointRange.js +22 -0
  250. package/esm/excel/render/cell/frozen/getFrozenTopViewPointRange.d.ts +14 -0
  251. package/esm/excel/render/cell/frozen/getFrozenTopViewPointRange.js +33 -0
  252. package/esm/excel/render/cell/genFontStr.d.ts +31 -0
  253. package/esm/excel/render/cell/genFontStr.js +61 -0
  254. package/esm/excel/render/cell/getBackgroundColor.d.ts +3 -0
  255. package/esm/excel/render/cell/getBackgroundColor.js +38 -0
  256. package/esm/excel/render/cell/isPointerOnLink.d.ts +5 -0
  257. package/esm/excel/render/cell/isPointerOnLink.js +39 -0
  258. package/esm/excel/render/cell/measureTextWithCache.d.ts +23 -0
  259. package/esm/excel/render/cell/measureTextWithCache.js +30 -0
  260. package/esm/excel/render/cell/tokenizer.d.ts +24 -0
  261. package/esm/excel/render/cell/tokenizer.js +94 -0
  262. package/esm/excel/render/dnd/DragState.d.ts +22 -0
  263. package/esm/excel/render/dnd/getMouseRelativePosition.d.ts +7 -0
  264. package/esm/excel/render/dnd/getMouseRelativePosition.js +11 -0
  265. package/esm/excel/render/dnd/handleDragCell.d.ts +4 -0
  266. package/esm/excel/render/dnd/handleDragCell.js +75 -0
  267. package/esm/excel/render/dnd/handleDragColGrid.d.ts +4 -0
  268. package/esm/excel/render/dnd/handleDragColGrid.js +23 -0
  269. package/esm/excel/render/dnd/handleDragColHeader.d.ts +4 -0
  270. package/esm/excel/render/dnd/handleDragColHeader.js +51 -0
  271. package/esm/excel/render/dnd/handleDragRowGrid.d.ts +4 -0
  272. package/esm/excel/render/dnd/handleDragRowGrid.js +23 -0
  273. package/esm/excel/render/dnd/handleDragRowHeader.d.ts +4 -0
  274. package/esm/excel/render/dnd/handleDragRowHeader.js +51 -0
  275. package/esm/excel/render/dnd/handleMousedown.d.ts +12 -0
  276. package/esm/excel/render/dnd/handleMousedown.js +74 -0
  277. package/esm/excel/render/dnd/handleMousemove.d.ts +4 -0
  278. package/esm/excel/render/dnd/handleMousemove.js +38 -0
  279. package/esm/excel/render/dnd/handleMouseup.d.ts +1 -0
  280. package/esm/excel/render/dnd/handleMouseup.js +17 -0
  281. package/esm/excel/render/dnd/mousedownCell.d.ts +10 -0
  282. package/esm/excel/render/dnd/mousedownCell.js +31 -0
  283. package/esm/excel/render/dnd/mousedownColHeader.d.ts +22 -0
  284. package/esm/excel/render/dnd/mousedownColHeader.js +29 -0
  285. package/esm/excel/render/dnd/mousedownCorner.d.ts +8 -0
  286. package/esm/excel/render/dnd/mousedownCorner.js +13 -0
  287. package/esm/excel/render/dnd/mousedownRowHeader.d.ts +22 -0
  288. package/esm/excel/render/dnd/mousedownRowHeader.js +29 -0
  289. package/esm/excel/render/dnd/removeEventListener.d.ts +4 -0
  290. package/esm/excel/render/dnd/removeEventListener.js +14 -0
  291. package/esm/excel/render/dnd/selectAll.d.ts +5 -0
  292. package/esm/excel/render/dnd/selectAll.js +26 -0
  293. package/esm/excel/render/drawing/BaseDrawingRender.d.ts +11 -0
  294. package/esm/excel/render/drawing/BaseDrawingRender.js +29 -0
  295. package/esm/excel/render/drawing/EChartsRender.d.ts +7 -0
  296. package/esm/excel/render/drawing/EChartsRender.js +20 -0
  297. package/esm/excel/render/drawing/PicRender.d.ts +6 -0
  298. package/esm/excel/render/drawing/PicRender.js +57 -0
  299. package/esm/excel/render/drawing/ResizeBox.d.ts +51 -0
  300. package/esm/excel/render/drawing/ResizeBox.js +83 -0
  301. package/esm/excel/render/drawing/chart/buildLabel.d.ts +63 -0
  302. package/esm/excel/render/drawing/chart/buildLabel.js +6 -0
  303. package/esm/excel/render/drawing/chart/calcPercentStacked.d.ts +5 -0
  304. package/esm/excel/render/drawing/chart/calcPercentStacked.js +43 -0
  305. package/esm/excel/render/drawing/chart/convertAxis.d.ts +11 -0
  306. package/esm/excel/render/drawing/chart/convertAxis.js +55 -0
  307. package/esm/excel/render/drawing/chart/convertLegend.d.ts +5 -0
  308. package/esm/excel/render/drawing/chart/convertLegend.js +38 -0
  309. package/esm/excel/render/drawing/chart/convertTitle.d.ts +8 -0
  310. package/esm/excel/render/drawing/chart/convertTitle.js +54 -0
  311. package/esm/excel/render/drawing/chart/fromAreaChart.d.ts +74 -0
  312. package/esm/excel/render/drawing/chart/fromAreaChart.js +51 -0
  313. package/esm/excel/render/drawing/chart/fromBarChart.d.ts +11 -0
  314. package/esm/excel/render/drawing/chart/fromBarChart.js +44 -0
  315. package/esm/excel/render/drawing/chart/fromDoughnutChart.d.ts +18 -0
  316. package/esm/excel/render/drawing/chart/fromDoughnutChart.js +48 -0
  317. package/esm/excel/render/drawing/chart/fromLineChart.d.ts +73 -0
  318. package/esm/excel/render/drawing/chart/fromLineChart.js +50 -0
  319. package/esm/excel/render/drawing/chart/fromPieChart.d.ts +10 -0
  320. package/esm/excel/render/drawing/chart/fromPieChart.js +40 -0
  321. package/esm/excel/render/drawing/chart/getData.d.ts +6 -0
  322. package/esm/excel/render/drawing/chart/getData.js +16 -0
  323. package/esm/excel/render/drawing/chart/getStack.d.ts +5 -0
  324. package/esm/excel/render/drawing/chart/getStack.js +17 -0
  325. package/esm/excel/render/drawing/convertToEChartOptions.d.ts +8 -0
  326. package/esm/excel/render/drawing/convertToEChartOptions.js +66 -0
  327. package/esm/excel/render/drawing/drawChart.d.ts +4 -0
  328. package/esm/excel/render/drawing/drawChart.js +49 -0
  329. package/esm/excel/render/drawing/drawDrawing.d.ts +8 -0
  330. package/esm/excel/render/drawing/drawDrawing.js +105 -0
  331. package/esm/excel/render/drawing/drawPic.d.ts +5 -0
  332. package/esm/excel/render/drawing/drawPic.js +68 -0
  333. package/esm/excel/render/drawing/drawShape.d.ts +9 -0
  334. package/esm/excel/render/drawing/drawShape.js +134 -0
  335. package/esm/excel/render/drawing/findPositionInViewRange.d.ts +7 -0
  336. package/esm/excel/render/drawing/findPositionInViewRange.js +28 -0
  337. package/esm/excel/render/drawing/getAbsoluteAnchorPosition.d.ts +11 -0
  338. package/esm/excel/render/drawing/getAbsoluteAnchorPosition.js +33 -0
  339. package/esm/excel/render/drawing/getOneCellAnchorPosition.d.ts +8 -0
  340. package/esm/excel/render/drawing/getOneCellAnchorPosition.js +31 -0
  341. package/esm/excel/render/drawing/getPositionByMaker.d.ts +11 -0
  342. package/esm/excel/render/drawing/getRectFromAnchorPoint.d.ts +18 -0
  343. package/esm/excel/render/drawing/getRectFromAnchorPoint.js +43 -0
  344. package/esm/excel/render/drawing/getTwoCellAnchorPosition.d.ts +8 -0
  345. package/esm/excel/render/drawing/getTwoCellAnchorPosition.js +37 -0
  346. package/esm/excel/render/formulaBar/FormulaBar.d.ts +29 -0
  347. package/esm/excel/render/formulaBar/FormulaBar.js +86 -0
  348. package/esm/excel/render/grid/drawGridLines.d.ts +12 -0
  349. package/esm/excel/render/grid/drawGridLines.js +40 -0
  350. package/esm/excel/render/header/drawRowColHeaders.d.ts +10 -0
  351. package/esm/excel/render/header/drawRowColHeaders.js +144 -0
  352. package/esm/excel/render/keyboard/handleCopy.d.ts +5 -0
  353. package/esm/excel/render/keyboard/handleCopy.js +19 -0
  354. package/esm/excel/render/keyboard/handleKeydown.d.ts +5 -0
  355. package/esm/excel/render/keyboard/handleKeydown.js +14 -0
  356. package/esm/excel/render/keyboard/handlePaste.d.ts +5 -0
  357. package/esm/excel/render/keyboard/handlePaste.js +16 -0
  358. package/esm/excel/render/keyboard/handleSelectAll.d.ts +5 -0
  359. package/esm/excel/render/keyboard/handleSelectAll.js +17 -0
  360. package/esm/excel/render/keyboard/handleSheetArrowKey.d.ts +5 -0
  361. package/esm/excel/render/keyboard/handleSheetArrowKey.js +41 -0
  362. package/esm/excel/render/scroll/Scroll.d.ts +7 -0
  363. package/esm/excel/render/selection/Position.d.ts +9 -0
  364. package/esm/excel/render/selection/SheetSelection.d.ts +29 -0
  365. package/esm/excel/render/selection/binarySearchSize.d.ts +8 -0
  366. package/esm/excel/render/selection/binarySearchSize.js +27 -0
  367. package/esm/excel/render/selection/buildHTML/buildBorder.d.ts +6 -0
  368. package/esm/excel/render/selection/buildHTML/buildBorder.js +36 -0
  369. package/esm/excel/render/selection/buildHTML/cellInfoToStyle.d.ts +6 -0
  370. package/esm/excel/render/selection/buildHTML/cellInfoToStyle.js +66 -0
  371. package/esm/excel/render/selection/buildHTML/rangeToHTML.d.ts +11 -0
  372. package/esm/excel/render/selection/buildHTML/rangeToHTML.js +64 -0
  373. package/esm/excel/render/selection/copySelection.d.ts +7 -0
  374. package/esm/excel/render/selection/copySelection.js +28 -0
  375. package/esm/excel/render/selection/drawAllSelection.d.ts +7 -0
  376. package/esm/excel/render/selection/drawAllSelection.js +17 -0
  377. package/esm/excel/render/selection/drawCellRanges.d.ts +10 -0
  378. package/esm/excel/render/selection/drawCellRanges.js +45 -0
  379. package/esm/excel/render/selection/drawCellSelection.d.ts +13 -0
  380. package/esm/excel/render/selection/drawCellSelection.js +77 -0
  381. package/esm/excel/render/selection/drawColSelection.d.ts +12 -0
  382. package/esm/excel/render/selection/drawColSelection.js +20 -0
  383. package/esm/excel/render/selection/drawRowSelection.d.ts +12 -0
  384. package/esm/excel/render/selection/drawRowSelection.js +21 -0
  385. package/esm/excel/render/selection/drawSelectionHeaderHighlight.d.ts +6 -0
  386. package/esm/excel/render/selection/drawSelectionHeaderHighlight.js +17 -0
  387. package/esm/excel/render/selection/findCell.d.ts +7 -0
  388. package/esm/excel/render/selection/findCell.js +15 -0
  389. package/esm/excel/render/selection/findInViewRange.d.ts +13 -0
  390. package/esm/excel/render/selection/findInViewRange.js +12 -0
  391. package/esm/excel/render/selection/findInViewRangeX.d.ts +10 -0
  392. package/esm/excel/render/selection/findInViewRangeX.js +42 -0
  393. package/esm/excel/render/selection/findInViewRangeY.d.ts +10 -0
  394. package/esm/excel/render/selection/findInViewRangeY.js +41 -0
  395. package/esm/excel/render/selection/getCellPosition.d.ts +43 -0
  396. package/esm/excel/render/selection/getCellPosition.js +131 -0
  397. package/esm/excel/render/selection/getRangePosition.d.ts +12 -0
  398. package/esm/excel/render/selection/getRangePosition.js +67 -0
  399. package/esm/excel/render/selection/hitTest.d.ts +41 -0
  400. package/esm/excel/render/selection/hitTest.js +46 -0
  401. package/esm/excel/render/selection/hitTestInRange.d.ts +7 -0
  402. package/esm/excel/render/selection/hitTestInRange.js +56 -0
  403. package/esm/excel/render/selection/updateCursor.d.ts +5 -0
  404. package/esm/excel/render/selection/updateCursor.js +22 -0
  405. package/esm/excel/render/sheetTab/SheetList.d.ts +43 -0
  406. package/esm/excel/render/sheetTab/SheetList.js +285 -0
  407. package/esm/excel/render/sheetTab/SheetTabBar.d.ts +8 -0
  408. package/esm/excel/render/sheetTab/SheetTabBar.js +20 -0
  409. package/esm/excel/render/sheetTab/StatusBar.d.ts +14 -0
  410. package/esm/excel/render/sheetTab/StatusBar.js +83 -0
  411. package/esm/excel/render/sheetTab/ZoomLevel.d.ts +6 -0
  412. package/esm/excel/render/sheetTab/ZoomLevel.js +39 -0
  413. package/esm/excel/render/sparkline/Numbers.d.ts +1 -0
  414. package/esm/excel/render/sparkline/applyColor.d.ts +7 -0
  415. package/esm/excel/render/sparkline/applyColor.js +36 -0
  416. package/esm/excel/render/sparkline/drawSparkline.d.ts +7 -0
  417. package/esm/excel/render/sparkline/drawSparkline.js +86 -0
  418. package/esm/excel/render/sparkline/renderColumn.d.ts +7 -0
  419. package/esm/excel/render/sparkline/renderColumn.js +47 -0
  420. package/esm/excel/render/sparkline/renderLine.d.ts +7 -0
  421. package/esm/excel/render/sparkline/renderLine.js +107 -0
  422. package/esm/excel/render/sparkline/renderSparkline.d.ts +9 -0
  423. package/esm/excel/render/sparkline/renderSparkline.js +59 -0
  424. package/esm/excel/render/sparkline/renderStacked.d.ts +7 -0
  425. package/esm/excel/render/sparkline/renderStacked.js +61 -0
  426. package/esm/excel/render/ui/Button.d.ts +7 -0
  427. package/esm/excel/render/ui/CheckBox.d.ts +16 -0
  428. package/esm/excel/render/ui/CheckBox.js +48 -0
  429. package/esm/excel/render/ui/CheckBoxList.d.ts +16 -0
  430. package/esm/excel/render/ui/CheckBoxList.js +109 -0
  431. package/esm/excel/render/ui/Divider.d.ts +3 -0
  432. package/esm/excel/render/ui/Divider.js +13 -0
  433. package/esm/excel/render/ui/Input.d.ts +11 -0
  434. package/esm/excel/render/ui/Input.js +48 -0
  435. package/esm/excel/render/ui/Radio.d.ts +11 -0
  436. package/esm/excel/render/ui/Radio.js +52 -0
  437. package/esm/excel/render/ui/Select.d.ts +13 -0
  438. package/esm/excel/render/ui/Select.js +29 -0
  439. package/esm/excel/render/widget/Widget.d.ts +29 -0
  440. package/esm/excel/sheet/BuiltInNumFmt.d.ts +5 -0
  441. package/esm/excel/sheet/BuiltInNumFmt.js +39 -0
  442. package/esm/excel/sheet/ColWidth.d.ts +19 -0
  443. package/esm/excel/sheet/ColWidth.js +30 -0
  444. package/esm/excel/sheet/ExcelRenderOptions.d.ts +149 -0
  445. package/esm/excel/sheet/RangeCache.d.ts +32 -0
  446. package/esm/excel/sheet/RangeCache.js +99 -0
  447. package/esm/excel/sheet/RowFilter.d.ts +3 -0
  448. package/esm/excel/sheet/Sheet.d.ts +280 -0
  449. package/esm/excel/sheet/Sheet.js +675 -0
  450. package/esm/excel/sheet/SheetBounding.d.ts +22 -0
  451. package/esm/excel/sheet/ViewRange.d.ts +52 -0
  452. package/esm/excel/sheet/__test__/applyDxf.test.d.ts +1 -0
  453. package/esm/excel/sheet/__test__/colWidth.test.d.ts +1 -0
  454. package/esm/excel/sheet/__test__/getViewRange.test.d.ts +1 -0
  455. package/esm/excel/sheet/applyConditionalFormat.d.ts +6 -0
  456. package/esm/excel/sheet/applyConditionalFormat.js +112 -0
  457. package/esm/excel/sheet/applyDxf.d.ts +6 -0
  458. package/esm/excel/sheet/applyDxf.js +20 -0
  459. package/esm/excel/sheet/applyTablePartsStyle.d.ts +6 -0
  460. package/esm/excel/sheet/applyTablePartsStyle.js +34 -0
  461. package/esm/excel/sheet/cfRule/__test__/aboveAverage.test.d.ts +1 -0
  462. package/esm/excel/sheet/cfRule/__test__/cellIs.test.d.ts +1 -0
  463. package/esm/excel/sheet/cfRule/__test__/top10.test.d.ts +1 -0
  464. package/esm/excel/sheet/cfRule/aboveAverage.d.ts +9 -0
  465. package/esm/excel/sheet/cfRule/aboveAverage.js +70 -0
  466. package/esm/excel/sheet/cfRule/applyCfRuleDxf.d.ts +7 -0
  467. package/esm/excel/sheet/cfRule/applyCfRuleDxf.js +13 -0
  468. package/esm/excel/sheet/cfRule/cellIs.d.ts +22 -0
  469. package/esm/excel/sheet/cfRule/cellIs.js +155 -0
  470. package/esm/excel/sheet/cfRule/colorScale.d.ts +8 -0
  471. package/esm/excel/sheet/cfRule/colorScale.js +141 -0
  472. package/esm/excel/sheet/cfRule/containsBlanks.d.ts +7 -0
  473. package/esm/excel/sheet/cfRule/containsBlanks.js +14 -0
  474. package/esm/excel/sheet/cfRule/containsErrors.d.ts +7 -0
  475. package/esm/excel/sheet/cfRule/containsErrors.js +15 -0
  476. package/esm/excel/sheet/cfRule/containsText.d.ts +7 -0
  477. package/esm/excel/sheet/cfRule/containsText.js +17 -0
  478. package/esm/excel/sheet/cfRule/dataBar.d.ts +8 -0
  479. package/esm/excel/sheet/cfRule/dataBar.js +232 -0
  480. package/esm/excel/sheet/cfRule/duplicateValues.d.ts +8 -0
  481. package/esm/excel/sheet/cfRule/duplicateValues.js +45 -0
  482. package/esm/excel/sheet/cfRule/getMinMax.d.ts +5 -0
  483. package/esm/excel/sheet/cfRule/getMinMax.js +37 -0
  484. package/esm/excel/sheet/cfRule/iconSet.d.ts +8 -0
  485. package/esm/excel/sheet/cfRule/iconSet.js +109 -0
  486. package/esm/excel/sheet/cfRule/notContainsText.d.ts +7 -0
  487. package/esm/excel/sheet/cfRule/notContainsText.js +17 -0
  488. package/esm/excel/sheet/cfRule/timePeriod.d.ts +9 -0
  489. package/esm/excel/sheet/cfRule/timePeriod.js +129 -0
  490. package/esm/excel/sheet/cfRule/top10.d.ts +9 -0
  491. package/esm/excel/sheet/cfRule/top10.js +72 -0
  492. package/esm/excel/sheet/cfRule/uniqueValues.d.ts +8 -0
  493. package/esm/excel/sheet/cfRule/uniqueValues.js +46 -0
  494. package/esm/excel/sheet/getCellAbsolutePosition.d.ts +10 -0
  495. package/esm/excel/sheet/getCellAbsolutePosition.js +41 -0
  496. package/esm/excel/sheet/getViewPointData.d.ts +24 -0
  497. package/esm/excel/sheet/getViewPointData.js +171 -0
  498. package/esm/excel/sheet/getViewRange.d.ts +68 -0
  499. package/esm/excel/sheet/getViewRange.js +193 -0
  500. package/esm/excel/sheet/table/__test__/calcTableRelativePosition.test.d.ts +1 -0
  501. package/esm/excel/sheet/table/applyTableStyle.d.ts +5 -0
  502. package/esm/excel/sheet/table/applyTableStyle.js +87 -0
  503. package/esm/excel/sheet/table/buildTableStyle.d.ts +13 -0
  504. package/esm/excel/sheet/table/buildTableStyle.js +68 -0
  505. package/esm/excel/sheet/table/calcTableRelativePosition.d.ts +11 -0
  506. package/esm/excel/sheet/table/calcTableRelativePosition.js +90 -0
  507. package/esm/excel/types/CT_Color.d.ts +9 -0
  508. package/esm/excel/types/CT_Color.js +20 -0
  509. package/esm/excel/types/CT_ExtensionList.d.ts +6 -0
  510. package/esm/excel/types/CT_ExtensionList.js +11 -0
  511. package/esm/excel/types/CT_Theme.d.ts +15 -0
  512. package/esm/excel/types/CellInfo.d.ts +57 -0
  513. package/esm/excel/types/CellValue.d.ts +14 -0
  514. package/esm/excel/types/DataBarDisplay.d.ts +58 -0
  515. package/esm/excel/types/ExcelFile.d.ts +12 -0
  516. package/esm/excel/types/Ext.d.ts +10 -0
  517. package/esm/excel/types/Ext.js +21 -0
  518. package/esm/excel/types/FontSize.d.ts +7 -0
  519. package/esm/excel/types/FontStyle.d.ts +16 -0
  520. package/esm/excel/types/IChartSpace.d.ts +7 -0
  521. package/esm/excel/types/IDataProvider.d.ts +158 -0
  522. package/esm/excel/types/IDrawing.d.ts +51 -0
  523. package/esm/excel/types/IRElt.d.ts +11 -0
  524. package/esm/excel/types/IRPrElt.d.ts +28 -0
  525. package/esm/excel/types/IRelationship.d.ts +10 -0
  526. package/esm/excel/types/ISheet.d.ts +14 -0
  527. package/esm/excel/types/ISheet.js +16 -0
  528. package/esm/excel/types/IWorkbook.d.ts +41 -0
  529. package/esm/excel/types/IWorksheet.d.ts +37 -0
  530. package/esm/excel/types/RangeRef.d.ts +21 -0
  531. package/esm/excel/types/RichText.d.ts +7 -0
  532. package/esm/excel/types/StringItem.d.ts +5 -0
  533. package/esm/excel/types/TableStyleDef.d.ts +8 -0
  534. package/esm/excel/types/X14CF/CT_Cfvo.d.ts +8 -0
  535. package/esm/excel/types/X14CF/CT_Cfvo.js +14 -0
  536. package/esm/excel/types/X14CF/ST_CfvoType.d.ts +1 -0
  537. package/esm/excel/types/X14CF/X14CfRule.d.ts +10 -0
  538. package/esm/excel/types/X14CF/X14CfRule.js +21 -0
  539. package/esm/excel/types/X14CF/X14ConditionalFormatting.d.ts +6 -0
  540. package/esm/excel/types/X14CF/X14ConditionalFormatting.js +11 -0
  541. package/esm/excel/types/X14CF/X14ConditionalFormattings.d.ts +6 -0
  542. package/esm/excel/types/X14CF/X14ConditionalFormattings.js +11 -0
  543. package/esm/excel/types/X14CF/X14DataBar.d.ts +18 -0
  544. package/esm/excel/types/X14CF/X14DataBar.js +54 -0
  545. package/esm/excel/types/X14CF/X14IconSet.d.ts +11 -0
  546. package/esm/excel/types/X14CF/X14IconSet.js +27 -0
  547. package/esm/excel/types/X14Sparkline/X14Sparkline.d.ts +6 -0
  548. package/esm/excel/types/X14Sparkline/X14Sparkline.js +10 -0
  549. package/esm/excel/types/X14Sparkline/X14SparklineGroup.d.ts +35 -0
  550. package/esm/excel/types/X14Sparkline/X14SparklineGroup.js +108 -0
  551. package/esm/excel/types/X14Sparkline/X14SparklineGroups.d.ts +6 -0
  552. package/esm/excel/types/X14Sparkline/X14SparklineGroups.js +11 -0
  553. package/esm/excel/types/X14Sparkline/x14:sparklines.d.ts +6 -0
  554. package/esm/excel/types/X14Sparkline/x14_sparklines.js +11 -0
  555. package/esm/excel/types/worksheet/CellData.d.ts +56 -0
  556. package/esm/excel/types/worksheet/CellData.js +38 -0
  557. package/esm/excel/types/worksheet/ICell.d.ts +39 -0
  558. package/esm/excel/types/worksheet/ICell.js +22 -0
  559. package/esm/index.d.ts +3 -1
  560. package/esm/index.js +2 -0
  561. package/esm/openxml/Attributes.d.ts +33 -0
  562. package/esm/openxml/Attributes.js +3 -0
  563. package/esm/openxml/ChartTypes.d.ts +2971 -0
  564. package/esm/openxml/ChartTypes.js +5154 -0
  565. package/esm/openxml/ContentType.d.ts +5 -0
  566. package/esm/openxml/ContentType.js +1 -1
  567. package/esm/openxml/DMLTypes.d.ts +1836 -0
  568. package/esm/openxml/DMLTypes.js +2849 -0
  569. package/esm/openxml/ExcelTypes.d.ts +5147 -0
  570. package/esm/openxml/ExcelTypes.js +5362 -0
  571. package/esm/openxml/Style.js +3 -3
  572. package/esm/openxml/Theme.js +1 -1
  573. package/esm/openxml/Types.d.ts +2757 -95
  574. package/esm/openxml/colorNameMap.d.ts +6 -0
  575. package/esm/openxml/drawing/Blip.d.ts +1 -1
  576. package/esm/openxml/drawing/CustomGeom.js +1 -1
  577. package/esm/openxml/drawing/Drawing.js +1 -1
  578. package/esm/openxml/drawing/Geom.js +1 -1
  579. package/esm/openxml/drawing/ShapeProperties.d.ts +1 -0
  580. package/esm/openxml/drawing/ShapeProperties.js +7 -7
  581. package/esm/openxml/drawing/Transform.js +1 -1
  582. package/esm/openxml/drawing/svg/shapeToSVG.d.ts +11 -2
  583. package/esm/openxml/drawing/svg/shapeToSVG.js +6 -6
  584. package/esm/openxml/word/Body.js +2 -2
  585. package/esm/openxml/word/Header.js +2 -2
  586. package/esm/openxml/word/Hyperlink.d.ts +1 -1
  587. package/esm/openxml/word/Note.js +1 -1
  588. package/esm/openxml/word/Paragraph.js +2 -2
  589. package/esm/openxml/word/Run.js +1 -1
  590. package/esm/openxml/word/Section.js +1 -1
  591. package/esm/openxml/word/Tab.js +1 -1
  592. package/esm/openxml/word/WDocument.js +1 -1
  593. package/esm/openxml/word/wps/WPS.js +2 -2
  594. package/esm/openxml/word/wps/WPSStyle.js +4 -4
  595. package/esm/package/PackageParser.d.ts +4 -0
  596. package/esm/package/XMLPackageParser.d.ts +5 -1
  597. package/esm/package/ZipPackageParser.d.ts +5 -1
  598. package/esm/package/ZipPackageParser.js +30 -2
  599. package/esm/util/EventEmitter.d.ts +38 -0
  600. package/esm/util/EventEmitter.js +112 -0
  601. package/esm/util/H.d.ts +7 -0
  602. package/esm/util/H.js +69 -0
  603. package/esm/util/LRUCache.d.ts +17 -0
  604. package/esm/util/LinkedMap.d.ts +40 -0
  605. package/esm/util/__tests__/autoSpace.test.d.ts +1 -0
  606. package/esm/util/__tests__/color.test.d.ts +1 -0
  607. package/esm/util/__tests__/replaceVar.test.d.ts +2 -0
  608. package/esm/util/__tests__/xml.test.d.ts +1 -0
  609. package/esm/util/arrayBufferToString.d.ts +1 -0
  610. package/esm/util/arrayBufferToString.js +7 -0
  611. package/esm/util/base64ToArrayBuffer.d.ts +1 -0
  612. package/esm/util/base64ToArrayBuffer.js +10 -0
  613. package/esm/util/binarySearch.d.ts +5 -0
  614. package/esm/util/binarySearch.js +23 -0
  615. package/esm/util/color.d.ts +5 -0
  616. package/esm/util/color.js +101 -1
  617. package/esm/util/createObject.d.ts +0 -1
  618. package/esm/util/createObject.js +2 -10
  619. package/esm/util/debounce.d.ts +1 -0
  620. package/esm/util/debounce.js +15 -0
  621. package/esm/util/emuToPx.d.ts +4 -0
  622. package/esm/util/emuToPx.js +14 -0
  623. package/esm/util/escapeHTML.d.ts +4 -0
  624. package/esm/util/escapeHTML.js +13 -0
  625. package/esm/util/fileType.d.ts +1 -0
  626. package/esm/util/fileType.js +17 -1
  627. package/esm/util/getChineseDay.d.ts +4 -0
  628. package/esm/util/isFontAvailable.d.ts +5 -0
  629. package/esm/util/isFontAvailable.js +37 -0
  630. package/esm/util/isNumeric.d.ts +4 -0
  631. package/esm/util/isNumeric.js +8 -0
  632. package/esm/util/isObject.d.ts +6 -0
  633. package/esm/util/isObject.js +10 -0
  634. package/esm/util/isValidURL.d.ts +4 -0
  635. package/esm/util/isValidURL.js +18 -0
  636. package/esm/util/isVisible.d.ts +4 -0
  637. package/esm/util/joinPath.d.ts +6 -0
  638. package/esm/util/joinPath.js +27 -0
  639. package/esm/util/mergeRun.js +1 -1
  640. package/esm/util/number.d.ts +9 -0
  641. package/esm/util/number.js +20 -0
  642. package/esm/util/objectEqual.d.ts +4 -0
  643. package/esm/util/objectEqual.js +13 -0
  644. package/esm/util/onClickOutside.d.ts +4 -0
  645. package/esm/util/onClickOutside.js +13 -0
  646. package/esm/util/ptToPx.d.ts +4 -0
  647. package/esm/util/ptToPx.js +10 -0
  648. package/esm/util/px2pt.d.ts +1 -0
  649. package/esm/util/px2pt.js +5 -0
  650. package/esm/util/runWorker.d.ts +6 -0
  651. package/esm/util/saxes.d.ts +638 -0
  652. package/esm/util/saxes.js +2077 -0
  653. package/esm/util/stringToArray.d.ts +10 -0
  654. package/esm/util/stringToArray.js +84 -0
  655. package/esm/util/stripNumber.d.ts +4 -0
  656. package/esm/util/stripNumber.js +14 -0
  657. package/esm/util/throttle.d.ts +5 -0
  658. package/esm/util/xml.d.ts +44 -0
  659. package/esm/util/xml.js +85 -1
  660. package/esm/util/xmlchars/xml/1.0/ed4.d.ts +31 -0
  661. package/esm/util/xmlchars/xml/1.0/ed5.d.ts +51 -0
  662. package/esm/util/xmlchars/xml/1.0/ed5.js +89 -0
  663. package/esm/util/xmlchars/xml/1.1/ed2.d.ts +73 -0
  664. package/esm/util/xmlchars/xml/1.1/ed2.js +21 -0
  665. package/esm/util/xmlchars/xmlns/1.0/ed3.d.ts +28 -0
  666. package/esm/util/xmlchars/xmlns/1.0/ed3.js +57 -0
  667. package/esm/word/parse/Footnotes.d.ts +3 -0
  668. package/esm/word/parse/Footnotes.js +25 -0
  669. package/esm/word/parse/modifyColor.js +106 -0
  670. package/esm/word/parse/parseBorder.d.ts +13 -0
  671. package/esm/word/parse/parseBorder.js +59 -0
  672. package/esm/word/parse/parseCellMargin.d.ts +2 -0
  673. package/esm/word/parse/parseChildColor.d.ts +4 -0
  674. package/esm/word/parse/parseChildColor.js +66 -0
  675. package/esm/word/parse/parseColor.d.ts +26 -0
  676. package/esm/word/parse/parseColor.js +126 -0
  677. package/esm/word/parse/parseEndnotes.d.ts +3 -0
  678. package/esm/word/parse/parseEndnotes.js +25 -0
  679. package/esm/word/parse/parseFont.d.ts +7 -0
  680. package/esm/word/parse/parseInd.d.ts +5 -0
  681. package/esm/word/parse/parseInsideBorders.d.ts +9 -0
  682. package/esm/word/parse/parsePr.d.ts +11 -0
  683. package/esm/word/parse/parsePr.js +424 -0
  684. package/esm/word/parse/parseShape.d.ts +10 -0
  685. package/esm/word/parse/parseShape.js +239 -0
  686. package/esm/word/parse/parseSpacing.d.ts +7 -0
  687. package/esm/word/parse/parseTable.d.ts +3 -0
  688. package/esm/word/parse/parseTable.js +62 -0
  689. package/esm/word/parse/parseTablePr.d.ts +3 -0
  690. package/esm/word/parse/parseTablePr.js +185 -0
  691. package/esm/word/parse/parseTc.d.ts +10 -0
  692. package/esm/word/parse/parseTc.js +64 -0
  693. package/esm/word/parse/parseTcPr.d.ts +5 -0
  694. package/esm/word/parse/parseTcPr.js +99 -0
  695. package/esm/word/parse/parseTextDirection.d.ts +2 -0
  696. package/esm/word/parse/parseTr.d.ts +6 -0
  697. package/esm/word/parse/parseTr.js +49 -0
  698. package/esm/word/parse/parseTrHeight.d.ts +2 -0
  699. package/esm/word/parse/parseTrPr.d.ts +3 -0
  700. package/esm/word/parse/parseTrPr.js +59 -0
  701. package/esm/word/render/fixAbsolutePosition.d.ts +8 -0
  702. package/esm/word/render/renderBody.d.ts +10 -0
  703. package/esm/word/render/renderBody.js +207 -0
  704. package/esm/word/render/renderBookmark.d.ts +6 -0
  705. package/esm/word/render/renderBookmark.js +17 -0
  706. package/esm/word/render/renderBr.d.ts +8 -0
  707. package/esm/word/render/renderBr.js +16 -0
  708. package/esm/word/render/renderCustGeom.d.ts +4 -0
  709. package/esm/word/render/renderCustGeom.js +10 -0
  710. package/esm/word/render/renderDocument.d.ts +7 -0
  711. package/esm/word/render/renderDocument.js +14 -0
  712. package/esm/word/render/renderDrawing.d.ts +9 -0
  713. package/esm/word/render/renderDrawing.js +255 -0
  714. package/esm/word/render/renderFont.d.ts +5 -0
  715. package/esm/word/render/renderFont.js +39 -0
  716. package/esm/word/render/renderGeom.d.ts +4 -0
  717. package/esm/word/render/renderGeom.js +14 -0
  718. package/esm/word/render/renderHeader.d.ts +6 -0
  719. package/esm/word/render/renderHeader.js +40 -0
  720. package/esm/word/render/renderHyperLink.d.ts +7 -0
  721. package/esm/word/render/renderHyperLink.js +44 -0
  722. package/esm/word/render/renderInlineText.d.ts +6 -0
  723. package/esm/word/render/renderInlineText.js +39 -0
  724. package/esm/word/render/renderInstrText.d.ts +8 -0
  725. package/esm/word/render/renderInstrText.js +40 -0
  726. package/esm/word/render/renderMath.d.ts +3 -0
  727. package/esm/word/render/renderMath.js +7 -0
  728. package/esm/word/render/renderNoBreakHyphen.js +9 -0
  729. package/esm/word/render/renderNotes.d.ts +5 -0
  730. package/esm/word/render/renderNotes.js +77 -0
  731. package/esm/word/render/renderNumbering.d.ts +7 -0
  732. package/esm/word/render/renderNumbering.js +159 -0
  733. package/esm/word/render/renderParagraph.d.ts +7 -0
  734. package/esm/word/render/renderParagraph.js +97 -0
  735. package/esm/word/render/renderPict.d.ts +6 -0
  736. package/esm/word/render/renderRuby.d.ts +6 -0
  737. package/esm/word/render/renderRuby.js +53 -0
  738. package/esm/word/render/renderRun.d.ts +16 -0
  739. package/esm/word/render/renderRun.js +146 -0
  740. package/esm/word/render/renderSection.d.ts +7 -0
  741. package/esm/word/render/renderSection.js +110 -0
  742. package/esm/word/render/renderSeparator.js +9 -0
  743. package/esm/word/render/renderSoftHyphen.js +9 -0
  744. package/esm/word/render/renderStyle.d.ts +13 -0
  745. package/esm/word/render/renderStyle.js +195 -0
  746. package/esm/word/render/renderSym.d.ts +3 -0
  747. package/esm/word/render/renderSym.js +10 -0
  748. package/esm/word/render/renderTab.d.ts +8 -0
  749. package/esm/word/render/renderTab.js +23 -0
  750. package/esm/word/render/renderTable.d.ts +6 -0
  751. package/esm/word/render/renderTable.js +189 -0
  752. package/esm/word/render/setElementStyle.d.ts +6 -0
  753. package/esm/word/render/setElementStyle.js +26 -0
  754. package/lib/Excel.d.ts +59 -0
  755. package/lib/Excel.js +222 -0
  756. package/lib/OfficeViewer.d.ts +10 -0
  757. package/lib/RenderOptions.d.ts +25 -0
  758. package/lib/UnSupport.d.ts +13 -0
  759. package/lib/UnSupport.js +37 -0
  760. package/lib/Word.d.ts +7 -24
  761. package/lib/Word.js +24 -21
  762. package/lib/common/__tests__/autoParse.test.d.ts +1 -0
  763. package/lib/common/autoParse.d.ts +9 -0
  764. package/lib/common/autoParse.js +196 -0
  765. package/lib/common/parseAttributes.d.ts +6 -0
  766. package/lib/common/parseAttributes.js +31 -0
  767. package/lib/common/parseChildren.d.ts +8 -0
  768. package/lib/common/parseContentType.d.ts +7 -0
  769. package/lib/common/parseContentType.js +54 -0
  770. package/lib/common/parseRelationship.d.ts +5 -0
  771. package/lib/common/parseRelationship.js +50 -0
  772. package/lib/createOfficeViewer.d.ts +16 -0
  773. package/lib/createOfficeViewer.js +102 -0
  774. package/lib/excel/StyleSheet.d.ts +8 -0
  775. package/lib/excel/StyleSheet.js +15 -0
  776. package/lib/excel/Workbook.d.ts +180 -0
  777. package/lib/excel/Workbook.js +213 -0
  778. package/lib/excel/data/LocalDataProvider.d.ts +146 -0
  779. package/lib/excel/data/LocalDataProvider.js +792 -0
  780. package/lib/excel/data/applyAutoFilter.d.ts +10 -0
  781. package/lib/excel/data/applyAutoFilter.js +90 -0
  782. package/lib/excel/data/autoFilter/CellValueNum.d.ts +5 -0
  783. package/lib/excel/data/autoFilter/__test__/customFilter.test.d.ts +1 -0
  784. package/lib/excel/data/autoFilter/__test__/filters.test.d.ts +1 -0
  785. package/lib/excel/data/autoFilter/__test__/sortByRange.test.d.ts +1 -0
  786. package/lib/excel/data/autoFilter/applySortState.d.ts +6 -0
  787. package/lib/excel/data/autoFilter/applySortState.js +40 -0
  788. package/lib/excel/data/autoFilter/customFilter.d.ts +6 -0
  789. package/lib/excel/data/autoFilter/customFilter.js +82 -0
  790. package/lib/excel/data/autoFilter/evalCustomFilter.d.ts +9 -0
  791. package/lib/excel/data/autoFilter/evalCustomFilter.js +65 -0
  792. package/lib/excel/data/autoFilter/filters.d.ts +3 -0
  793. package/lib/excel/data/autoFilter/filters.js +59 -0
  794. package/lib/excel/data/autoFilter/inDateGroupItems.d.ts +6 -0
  795. package/lib/excel/data/autoFilter/inDateGroupItems.js +75 -0
  796. package/lib/excel/data/autoFilter/sortByRange.d.ts +8 -0
  797. package/lib/excel/data/autoFilter/sortByRange.js +55 -0
  798. package/lib/excel/data/defaultFont.d.ts +25 -0
  799. package/lib/excel/data/defaultFont.js +31 -0
  800. package/lib/excel/data/getThemeColor.d.ts +2 -0
  801. package/lib/excel/data/getThemeColor.js +75 -0
  802. package/lib/excel/data/numfmt/amountInWords.d.ts +4 -0
  803. package/lib/excel/data/numfmt/amountInWords.js +43 -0
  804. package/lib/excel/data/numfmtExtend.d.ts +10 -0
  805. package/lib/excel/data/numfmtExtend.js +33 -0
  806. package/lib/excel/edit/Command.d.ts +19 -0
  807. package/lib/excel/edit/ui/CellEditor.d.ts +27 -0
  808. package/lib/excel/edit/ui/CellEditor.js +69 -0
  809. package/lib/excel/io/csv/emptyXLSX.d.ts +2 -0
  810. package/lib/excel/io/csv/emptyXLSX.js +10 -0
  811. package/lib/excel/io/excel/__tests__/parseSharedStrings.test.d.ts +1 -0
  812. package/lib/excel/io/excel/drawing/getRelationPath.d.ts +2 -0
  813. package/lib/excel/io/excel/drawing/getRelationPath.js +15 -0
  814. package/lib/excel/io/excel/drawing/parseAnchorCommon.d.ts +9 -0
  815. package/lib/excel/io/excel/drawing/parseAnchorCommon.js +82 -0
  816. package/lib/excel/io/excel/drawing/parseChart.d.ts +3 -0
  817. package/lib/excel/io/excel/drawing/parseChart.js +15 -0
  818. package/lib/excel/io/excel/drawing/parseDrawing.d.ts +8 -0
  819. package/lib/excel/io/excel/drawing/parseDrawing.js +107 -0
  820. package/lib/excel/io/excel/drawing/parsePic.d.ts +4 -0
  821. package/lib/excel/io/excel/drawing/parsePic.js +27 -0
  822. package/lib/excel/io/excel/drawing/parseShape.d.ts +4 -0
  823. package/lib/excel/io/excel/drawing/parseShape.js +163 -0
  824. package/lib/excel/io/excel/getRelPath.d.ts +4 -0
  825. package/lib/excel/io/excel/getRelPath.js +14 -0
  826. package/lib/excel/io/excel/initValueForContainsBlanks.d.ts +6 -0
  827. package/lib/excel/io/excel/initValueForContainsBlanks.js +62 -0
  828. package/lib/excel/io/excel/initValueForTable.d.ts +5 -0
  829. package/lib/excel/io/excel/initValueForTable.js +35 -0
  830. package/lib/excel/io/excel/parseDefinedNames.d.ts +5 -0
  831. package/lib/excel/io/excel/parseDefinedNames.js +15 -0
  832. package/lib/excel/io/excel/parseSharedStrings.d.ts +9 -0
  833. package/lib/excel/io/excel/parseSharedStrings.js +177 -0
  834. package/lib/excel/io/excel/parseSheet.d.ts +9 -0
  835. package/lib/excel/io/excel/parseSheet.js +88 -0
  836. package/lib/excel/io/excel/parseTableParts.d.ts +5 -0
  837. package/lib/excel/io/excel/parseTableParts.js +71 -0
  838. package/lib/excel/io/excel/parseTableStyleDef.d.ts +3 -0
  839. package/lib/excel/io/excel/parseTheme.d.ts +6 -0
  840. package/lib/excel/io/excel/parseTheme.js +46 -0
  841. package/lib/excel/io/excel/parseWorkbook.d.ts +8 -0
  842. package/lib/excel/io/excel/parseWorkbook.js +109 -0
  843. package/lib/excel/io/excel/parseWorkbookPr.d.ts +6 -0
  844. package/lib/excel/io/excel/parseWorkbookPr.js +17 -0
  845. package/lib/excel/io/excel/parseWorkbookView.d.ts +6 -0
  846. package/lib/excel/io/excel/parseWorkbookView.js +17 -0
  847. package/lib/excel/io/excel/parseWorksheet.d.ts +9 -0
  848. package/lib/excel/io/excel/parseWorksheet.js +211 -0
  849. package/lib/excel/io/excel/preset/defaultTheme.d.ts +1 -0
  850. package/lib/excel/io/excel/preset/defaultTheme.js +7 -0
  851. package/lib/excel/io/excel/preset/presetCellStyles.d.ts +3 -0
  852. package/lib/excel/io/excel/preset/presetIconSet.d.ts +6 -0
  853. package/lib/excel/io/excel/preset/presetIconSet.js +59 -0
  854. package/lib/excel/io/excel/preset/presetIcons.d.ts +3 -0
  855. package/lib/excel/io/excel/preset/presetIcons.js +48 -0
  856. package/lib/excel/io/excel/preset/presetTableStyles.d.ts +3 -0
  857. package/lib/excel/io/excel/preset/presetTableStyles.js +35121 -0
  858. package/lib/excel/io/excel/stylesheet/parseColor.d.ts +5 -0
  859. package/lib/excel/io/excel/stylesheet/parseColor.js +15 -0
  860. package/lib/excel/io/excel/util/Range.d.ts +66 -0
  861. package/lib/excel/io/excel/util/Range.js +132 -0
  862. package/lib/excel/io/excel/util/__tests__/makeBlankValue.test.d.ts +1 -0
  863. package/lib/excel/io/excel/util/decodeAddress.d.ts +11 -0
  864. package/lib/excel/io/excel/util/decodeAddress.js +67 -0
  865. package/lib/excel/io/excel/util/fromExcelDate.d.ts +14 -0
  866. package/lib/excel/io/excel/util/fromExcelDate.js +30 -0
  867. package/lib/excel/io/excel/util/lettersToNumber.d.ts +4 -0
  868. package/lib/excel/io/excel/util/makeBlankValue.d.ts +6 -0
  869. package/lib/excel/io/excel/util/makeBlankValue.js +25 -0
  870. package/lib/excel/io/excel/util/numberToLetters.d.ts +4 -0
  871. package/lib/excel/io/excel/util/numberToLetters.js +17 -0
  872. package/lib/excel/io/excel/worksheet/parseSheetData.d.ts +11 -0
  873. package/lib/excel/io/excel/worksheet/parseSheetData.js +158 -0
  874. package/lib/excel/io/parseExcel.d.ts +10 -0
  875. package/lib/excel/io/parseExcel.js +43 -0
  876. package/lib/excel/lang/en_US.d.ts +24 -0
  877. package/lib/excel/lang/en_US.js +29 -0
  878. package/lib/excel/lang/lang.d.ts +30 -0
  879. package/lib/excel/lang/lang.js +23 -0
  880. package/lib/excel/lang/zh_CN.d.ts +2 -0
  881. package/lib/excel/lang/zh_CN.js +29 -0
  882. package/lib/excel/print/printStyle.d.ts +4 -0
  883. package/lib/excel/print/printStyle.js +12 -0
  884. package/lib/excel/print/renderInIframe.d.ts +7 -0
  885. package/lib/excel/print/renderInIframe.js +30 -0
  886. package/lib/excel/render/Canvas.d.ts +108 -0
  887. package/lib/excel/render/Canvas.js +336 -0
  888. package/lib/excel/render/Consts.d.ts +20 -0
  889. package/lib/excel/render/Consts.js +30 -0
  890. package/lib/excel/render/ExcelRender.d.ts +120 -0
  891. package/lib/excel/render/ExcelRender.js +426 -0
  892. package/lib/excel/render/Icons.d.ts +13 -0
  893. package/lib/excel/render/Icons.js +19 -0
  894. package/lib/excel/render/IndexedColors.d.ts +1 -0
  895. package/lib/excel/render/IndexedColors.js +74 -0
  896. package/lib/excel/render/Line.d.ts +6 -0
  897. package/lib/excel/render/Rect.d.ts +17 -0
  898. package/lib/excel/render/Rect.js +25 -0
  899. package/lib/excel/render/ScrollBar.d.ts +54 -0
  900. package/lib/excel/render/ScrollBar.js +141 -0
  901. package/lib/excel/render/SelectionCanvas.d.ts +33 -0
  902. package/lib/excel/render/SelectionCanvas.js +96 -0
  903. package/lib/excel/render/SheetCanvas.d.ts +33 -0
  904. package/lib/excel/render/SheetCanvas.js +46 -0
  905. package/lib/excel/render/__test__/autoWrapText.test.d.ts +1 -0
  906. package/lib/excel/render/__test__/tokenizer.test.d.ts +1 -0
  907. package/lib/excel/render/autoFilter/AutoFilterIconUI.d.ts +33 -0
  908. package/lib/excel/render/autoFilter/AutoFilterIconUI.js +89 -0
  909. package/lib/excel/render/autoFilter/AutoFilterMenuUI.d.ts +13 -0
  910. package/lib/excel/render/autoFilter/AutoFilterMenuUI.js +38 -0
  911. package/lib/excel/render/autoFilter/filterColumn/CustomFiltersUI.d.ts +46 -0
  912. package/lib/excel/render/autoFilter/filterColumn/CustomFiltersUI.js +162 -0
  913. package/lib/excel/render/autoFilter/filterColumn/FilterColumnUI.d.ts +10 -0
  914. package/lib/excel/render/autoFilter/filterColumn/FilterColumnUI.js +51 -0
  915. package/lib/excel/render/autoFilter/filterColumn/FiltersUI.d.ts +10 -0
  916. package/lib/excel/render/autoFilter/filterColumn/FiltersUI.js +41 -0
  917. package/lib/excel/render/autoFilter/filterColumn/OperatorTypeUI.d.ts +5 -0
  918. package/lib/excel/render/autoFilter/filterColumn/buildOperatorOptions.d.ts +2 -0
  919. package/lib/excel/render/autoFilter/filterColumn/buildOperatorOptions.js +99 -0
  920. package/lib/excel/render/autoFilter/filterColumn/fromOperatorUI.d.ts +6 -0
  921. package/lib/excel/render/autoFilter/filterColumn/fromOperatorUI.js +52 -0
  922. package/lib/excel/render/autoFilter/filterColumn/getCustomFilters.d.ts +2 -0
  923. package/lib/excel/render/autoFilter/filterColumn/getCustomFilters.js +14 -0
  924. package/lib/excel/render/autoFilter/filterColumn/getFilterValues.d.ts +5 -0
  925. package/lib/excel/render/autoFilter/filterColumn/getFilterValues.js +35 -0
  926. package/lib/excel/render/autoFilter/filterColumn/hasFilterColumn.d.ts +5 -0
  927. package/lib/excel/render/autoFilter/filterColumn/hasFilterColumn.js +41 -0
  928. package/lib/excel/render/autoFilter/filterColumn/setCustomFilters.d.ts +5 -0
  929. package/lib/excel/render/autoFilter/filterColumn/setCustomFilters.js +23 -0
  930. package/lib/excel/render/autoFilter/filterColumn/setFilterValues.d.ts +6 -0
  931. package/lib/excel/render/autoFilter/filterColumn/setFilterValues.js +49 -0
  932. package/lib/excel/render/autoFilter/filterColumn/toOperatorUI.d.ts +6 -0
  933. package/lib/excel/render/autoFilter/filterColumn/toOperatorUI.js +34 -0
  934. package/lib/excel/render/autoFilter/renderAutoFilter.d.ts +2 -0
  935. package/lib/excel/render/autoFilter/renderAutoFilter.js +35 -0
  936. package/lib/excel/render/autoFilter/renderAutoFilterIcon.d.ts +6 -0
  937. package/lib/excel/render/autoFilter/renderAutoFilterIcon.js +56 -0
  938. package/lib/excel/render/autoFilter/sortState/ColumnSortOrder.d.ts +1 -0
  939. package/lib/excel/render/autoFilter/sortState/SortButtonUI.d.ts +12 -0
  940. package/lib/excel/render/autoFilter/sortState/SortButtonUI.js +45 -0
  941. package/lib/excel/render/autoFilter/sortState/SortStateUI.d.ts +22 -0
  942. package/lib/excel/render/autoFilter/sortState/SortStateUI.js +69 -0
  943. package/lib/excel/render/autoFilter/sortState/getColumnSortOrder.d.ts +6 -0
  944. package/lib/excel/render/autoFilter/sortState/getColumnSortOrder.js +40 -0
  945. package/lib/excel/render/autoFilter/sortState/setColumnSortOrder.d.ts +7 -0
  946. package/lib/excel/render/autoFilter/sortState/setColumnSortOrder.js +59 -0
  947. package/lib/excel/render/canvas/draw.d.ts +5 -0
  948. package/lib/excel/render/canvas/drawOffscreenCanvas.d.ts +6 -0
  949. package/lib/excel/render/canvas/drawOffscreenCanvas.js +18 -0
  950. package/lib/excel/render/canvas/setPixelRatio.d.ts +4 -0
  951. package/lib/excel/render/canvas/setPixelRatio.js +21 -0
  952. package/lib/excel/render/cell/CellInfoWithSize.d.ts +5 -0
  953. package/lib/excel/render/cell/LinkPosition.d.ts +14 -0
  954. package/lib/excel/render/cell/autoClip.d.ts +6 -0
  955. package/lib/excel/render/cell/autoClip.js +48 -0
  956. package/lib/excel/render/cell/autoWrapText.d.ts +24 -0
  957. package/lib/excel/render/cell/autoWrapText.js +161 -0
  958. package/lib/excel/render/cell/border/drawDoubleBorder.d.ts +2 -0
  959. package/lib/excel/render/cell/border/drawDoubleBorder.js +79 -0
  960. package/lib/excel/render/cell/border/setLineStyle.d.ts +5 -0
  961. package/lib/excel/render/cell/border/setLineStyle.js +47 -0
  962. package/lib/excel/render/cell/cellToMergeCell.d.ts +8 -0
  963. package/lib/excel/render/cell/cellToMergeCell.js +39 -0
  964. package/lib/excel/render/cell/checkFont.d.ts +8 -0
  965. package/lib/excel/render/cell/checkFont.js +36 -0
  966. package/lib/excel/render/cell/drawCell.d.ts +19 -0
  967. package/lib/excel/render/cell/drawCell.js +48 -0
  968. package/lib/excel/render/cell/drawCellBackground.d.ts +3 -0
  969. package/lib/excel/render/cell/drawCellBackground.js +15 -0
  970. package/lib/excel/render/cell/drawCellBorder.d.ts +6 -0
  971. package/lib/excel/render/cell/drawCellBorder.js +51 -0
  972. package/lib/excel/render/cell/drawCells.d.ts +9 -0
  973. package/lib/excel/render/cell/drawCells.js +58 -0
  974. package/lib/excel/render/cell/drawDataBar.d.ts +3 -0
  975. package/lib/excel/render/cell/drawDataBar.js +35 -0
  976. package/lib/excel/render/cell/drawDataBarX14.d.ts +7 -0
  977. package/lib/excel/render/cell/drawDataBarX14.js +52 -0
  978. package/lib/excel/render/cell/drawIconSet.d.ts +3 -0
  979. package/lib/excel/render/cell/drawIconSet.js +17 -0
  980. package/lib/excel/render/cell/drawMultiLineText.d.ts +8 -0
  981. package/lib/excel/render/cell/drawMultiLineText.js +111 -0
  982. package/lib/excel/render/cell/drawSingleLineRichText.d.ts +10 -0
  983. package/lib/excel/render/cell/drawSingleLineRichText.js +59 -0
  984. package/lib/excel/render/cell/drawSingleLineText.d.ts +17 -0
  985. package/lib/excel/render/cell/drawSingleLineText.js +77 -0
  986. package/lib/excel/render/cell/drawTextInCell.d.ts +15 -0
  987. package/lib/excel/render/cell/drawTextInCell.js +109 -0
  988. package/lib/excel/render/cell/frozen/drawFrozen.d.ts +17 -0
  989. package/lib/excel/render/cell/frozen/drawFrozen.js +49 -0
  990. package/lib/excel/render/cell/frozen/drawLeftFrozen.d.ts +10 -0
  991. package/lib/excel/render/cell/frozen/drawLeftFrozen.js +30 -0
  992. package/lib/excel/render/cell/frozen/drawTopFrozen.d.ts +10 -0
  993. package/lib/excel/render/cell/frozen/drawTopFrozen.js +30 -0
  994. package/lib/excel/render/cell/frozen/drawTopLeftFrozen.d.ts +14 -0
  995. package/lib/excel/render/cell/frozen/drawTopLeftFrozen.js +50 -0
  996. package/lib/excel/render/cell/frozen/getFrozenLeftViewPointRange.d.ts +14 -0
  997. package/lib/excel/render/cell/frozen/getFrozenLeftViewPointRange.js +36 -0
  998. package/lib/excel/render/cell/frozen/getFrozenRange.d.ts +5 -0
  999. package/lib/excel/render/cell/frozen/getFrozenRange.js +29 -0
  1000. package/lib/excel/render/cell/frozen/getFrozenTopLeftViewPointRange.d.ts +5 -0
  1001. package/lib/excel/render/cell/frozen/getFrozenTopLeftViewPointRange.js +26 -0
  1002. package/lib/excel/render/cell/frozen/getFrozenTopViewPointRange.d.ts +14 -0
  1003. package/lib/excel/render/cell/frozen/getFrozenTopViewPointRange.js +37 -0
  1004. package/lib/excel/render/cell/genFontStr.d.ts +31 -0
  1005. package/lib/excel/render/cell/genFontStr.js +68 -0
  1006. package/lib/excel/render/cell/getBackgroundColor.d.ts +3 -0
  1007. package/lib/excel/render/cell/getBackgroundColor.js +42 -0
  1008. package/lib/excel/render/cell/isPointerOnLink.d.ts +5 -0
  1009. package/lib/excel/render/cell/isPointerOnLink.js +43 -0
  1010. package/lib/excel/render/cell/measureTextWithCache.d.ts +23 -0
  1011. package/lib/excel/render/cell/measureTextWithCache.js +35 -0
  1012. package/lib/excel/render/cell/tokenizer.d.ts +24 -0
  1013. package/lib/excel/render/cell/tokenizer.js +98 -0
  1014. package/lib/excel/render/dnd/DragState.d.ts +22 -0
  1015. package/lib/excel/render/dnd/getMouseRelativePosition.d.ts +7 -0
  1016. package/lib/excel/render/dnd/getMouseRelativePosition.js +15 -0
  1017. package/lib/excel/render/dnd/handleDragCell.d.ts +4 -0
  1018. package/lib/excel/render/dnd/handleDragCell.js +79 -0
  1019. package/lib/excel/render/dnd/handleDragColGrid.d.ts +4 -0
  1020. package/lib/excel/render/dnd/handleDragColGrid.js +27 -0
  1021. package/lib/excel/render/dnd/handleDragColHeader.d.ts +4 -0
  1022. package/lib/excel/render/dnd/handleDragColHeader.js +55 -0
  1023. package/lib/excel/render/dnd/handleDragRowGrid.d.ts +4 -0
  1024. package/lib/excel/render/dnd/handleDragRowGrid.js +27 -0
  1025. package/lib/excel/render/dnd/handleDragRowHeader.d.ts +4 -0
  1026. package/lib/excel/render/dnd/handleDragRowHeader.js +55 -0
  1027. package/lib/excel/render/dnd/handleMousedown.d.ts +12 -0
  1028. package/lib/excel/render/dnd/handleMousedown.js +80 -0
  1029. package/lib/excel/render/dnd/handleMousemove.d.ts +4 -0
  1030. package/lib/excel/render/dnd/handleMousemove.js +42 -0
  1031. package/lib/excel/render/dnd/handleMouseup.d.ts +1 -0
  1032. package/lib/excel/render/dnd/handleMouseup.js +21 -0
  1033. package/lib/excel/render/dnd/mousedownCell.d.ts +10 -0
  1034. package/lib/excel/render/dnd/mousedownCell.js +35 -0
  1035. package/lib/excel/render/dnd/mousedownColHeader.d.ts +22 -0
  1036. package/lib/excel/render/dnd/mousedownColHeader.js +33 -0
  1037. package/lib/excel/render/dnd/mousedownCorner.d.ts +8 -0
  1038. package/lib/excel/render/dnd/mousedownCorner.js +17 -0
  1039. package/lib/excel/render/dnd/mousedownRowHeader.d.ts +22 -0
  1040. package/lib/excel/render/dnd/mousedownRowHeader.js +33 -0
  1041. package/lib/excel/render/dnd/removeEventListener.d.ts +4 -0
  1042. package/lib/excel/render/dnd/removeEventListener.js +18 -0
  1043. package/lib/excel/render/dnd/selectAll.d.ts +5 -0
  1044. package/lib/excel/render/dnd/selectAll.js +30 -0
  1045. package/lib/excel/render/drawing/BaseDrawingRender.d.ts +11 -0
  1046. package/lib/excel/render/drawing/BaseDrawingRender.js +33 -0
  1047. package/lib/excel/render/drawing/EChartsRender.d.ts +7 -0
  1048. package/lib/excel/render/drawing/EChartsRender.js +42 -0
  1049. package/lib/excel/render/drawing/PicRender.d.ts +6 -0
  1050. package/lib/excel/render/drawing/PicRender.js +61 -0
  1051. package/lib/excel/render/drawing/ResizeBox.d.ts +51 -0
  1052. package/lib/excel/render/drawing/ResizeBox.js +87 -0
  1053. package/lib/excel/render/drawing/chart/buildLabel.d.ts +63 -0
  1054. package/lib/excel/render/drawing/chart/buildLabel.js +10 -0
  1055. package/lib/excel/render/drawing/chart/calcPercentStacked.d.ts +5 -0
  1056. package/lib/excel/render/drawing/chart/calcPercentStacked.js +47 -0
  1057. package/lib/excel/render/drawing/chart/convertAxis.d.ts +11 -0
  1058. package/lib/excel/render/drawing/chart/convertAxis.js +59 -0
  1059. package/lib/excel/render/drawing/chart/convertLegend.d.ts +5 -0
  1060. package/lib/excel/render/drawing/chart/convertLegend.js +42 -0
  1061. package/lib/excel/render/drawing/chart/convertTitle.d.ts +8 -0
  1062. package/lib/excel/render/drawing/chart/convertTitle.js +58 -0
  1063. package/lib/excel/render/drawing/chart/fromAreaChart.d.ts +74 -0
  1064. package/lib/excel/render/drawing/chart/fromAreaChart.js +55 -0
  1065. package/lib/excel/render/drawing/chart/fromBarChart.d.ts +11 -0
  1066. package/lib/excel/render/drawing/chart/fromBarChart.js +48 -0
  1067. package/lib/excel/render/drawing/chart/fromDoughnutChart.d.ts +18 -0
  1068. package/lib/excel/render/drawing/chart/fromDoughnutChart.js +52 -0
  1069. package/lib/excel/render/drawing/chart/fromLineChart.d.ts +73 -0
  1070. package/lib/excel/render/drawing/chart/fromLineChart.js +54 -0
  1071. package/lib/excel/render/drawing/chart/fromPieChart.d.ts +10 -0
  1072. package/lib/excel/render/drawing/chart/fromPieChart.js +44 -0
  1073. package/lib/excel/render/drawing/chart/getData.d.ts +6 -0
  1074. package/lib/excel/render/drawing/chart/getData.js +20 -0
  1075. package/lib/excel/render/drawing/chart/getStack.d.ts +5 -0
  1076. package/lib/excel/render/drawing/chart/getStack.js +21 -0
  1077. package/lib/excel/render/drawing/convertToEChartOptions.d.ts +8 -0
  1078. package/lib/excel/render/drawing/convertToEChartOptions.js +70 -0
  1079. package/lib/excel/render/drawing/drawChart.d.ts +4 -0
  1080. package/lib/excel/render/drawing/drawChart.js +53 -0
  1081. package/lib/excel/render/drawing/drawDrawing.d.ts +8 -0
  1082. package/lib/excel/render/drawing/drawDrawing.js +109 -0
  1083. package/lib/excel/render/drawing/drawPic.d.ts +5 -0
  1084. package/lib/excel/render/drawing/drawPic.js +72 -0
  1085. package/lib/excel/render/drawing/drawShape.d.ts +9 -0
  1086. package/lib/excel/render/drawing/drawShape.js +138 -0
  1087. package/lib/excel/render/drawing/findPositionInViewRange.d.ts +7 -0
  1088. package/lib/excel/render/drawing/findPositionInViewRange.js +32 -0
  1089. package/lib/excel/render/drawing/getAbsoluteAnchorPosition.d.ts +11 -0
  1090. package/lib/excel/render/drawing/getAbsoluteAnchorPosition.js +37 -0
  1091. package/lib/excel/render/drawing/getOneCellAnchorPosition.d.ts +8 -0
  1092. package/lib/excel/render/drawing/getOneCellAnchorPosition.js +35 -0
  1093. package/lib/excel/render/drawing/getPositionByMaker.d.ts +11 -0
  1094. package/lib/excel/render/drawing/getRectFromAnchorPoint.d.ts +18 -0
  1095. package/lib/excel/render/drawing/getRectFromAnchorPoint.js +48 -0
  1096. package/lib/excel/render/drawing/getTwoCellAnchorPosition.d.ts +8 -0
  1097. package/lib/excel/render/drawing/getTwoCellAnchorPosition.js +41 -0
  1098. package/lib/excel/render/formulaBar/FormulaBar.d.ts +29 -0
  1099. package/lib/excel/render/formulaBar/FormulaBar.js +90 -0
  1100. package/lib/excel/render/grid/drawGridLines.d.ts +12 -0
  1101. package/lib/excel/render/grid/drawGridLines.js +45 -0
  1102. package/lib/excel/render/header/drawRowColHeaders.d.ts +10 -0
  1103. package/lib/excel/render/header/drawRowColHeaders.js +148 -0
  1104. package/lib/excel/render/keyboard/handleCopy.d.ts +5 -0
  1105. package/lib/excel/render/keyboard/handleCopy.js +23 -0
  1106. package/lib/excel/render/keyboard/handleKeydown.d.ts +5 -0
  1107. package/lib/excel/render/keyboard/handleKeydown.js +18 -0
  1108. package/lib/excel/render/keyboard/handlePaste.d.ts +5 -0
  1109. package/lib/excel/render/keyboard/handlePaste.js +20 -0
  1110. package/lib/excel/render/keyboard/handleSelectAll.d.ts +5 -0
  1111. package/lib/excel/render/keyboard/handleSelectAll.js +21 -0
  1112. package/lib/excel/render/keyboard/handleSheetArrowKey.d.ts +5 -0
  1113. package/lib/excel/render/keyboard/handleSheetArrowKey.js +45 -0
  1114. package/lib/excel/render/scroll/Scroll.d.ts +7 -0
  1115. package/lib/excel/render/selection/Position.d.ts +9 -0
  1116. package/lib/excel/render/selection/SheetSelection.d.ts +29 -0
  1117. package/lib/excel/render/selection/binarySearchSize.d.ts +8 -0
  1118. package/lib/excel/render/selection/binarySearchSize.js +31 -0
  1119. package/lib/excel/render/selection/buildHTML/buildBorder.d.ts +6 -0
  1120. package/lib/excel/render/selection/buildHTML/buildBorder.js +40 -0
  1121. package/lib/excel/render/selection/buildHTML/cellInfoToStyle.d.ts +6 -0
  1122. package/lib/excel/render/selection/buildHTML/cellInfoToStyle.js +70 -0
  1123. package/lib/excel/render/selection/buildHTML/rangeToHTML.d.ts +11 -0
  1124. package/lib/excel/render/selection/buildHTML/rangeToHTML.js +68 -0
  1125. package/lib/excel/render/selection/copySelection.d.ts +7 -0
  1126. package/lib/excel/render/selection/copySelection.js +32 -0
  1127. package/lib/excel/render/selection/drawAllSelection.d.ts +7 -0
  1128. package/lib/excel/render/selection/drawAllSelection.js +21 -0
  1129. package/lib/excel/render/selection/drawCellRanges.d.ts +10 -0
  1130. package/lib/excel/render/selection/drawCellRanges.js +49 -0
  1131. package/lib/excel/render/selection/drawCellSelection.d.ts +13 -0
  1132. package/lib/excel/render/selection/drawCellSelection.js +81 -0
  1133. package/lib/excel/render/selection/drawColSelection.d.ts +12 -0
  1134. package/lib/excel/render/selection/drawColSelection.js +24 -0
  1135. package/lib/excel/render/selection/drawRowSelection.d.ts +12 -0
  1136. package/lib/excel/render/selection/drawRowSelection.js +25 -0
  1137. package/lib/excel/render/selection/drawSelectionHeaderHighlight.d.ts +6 -0
  1138. package/lib/excel/render/selection/drawSelectionHeaderHighlight.js +21 -0
  1139. package/lib/excel/render/selection/findCell.d.ts +7 -0
  1140. package/lib/excel/render/selection/findCell.js +19 -0
  1141. package/lib/excel/render/selection/findInViewRange.d.ts +13 -0
  1142. package/lib/excel/render/selection/findInViewRange.js +16 -0
  1143. package/lib/excel/render/selection/findInViewRangeX.d.ts +10 -0
  1144. package/lib/excel/render/selection/findInViewRangeX.js +46 -0
  1145. package/lib/excel/render/selection/findInViewRangeY.d.ts +10 -0
  1146. package/lib/excel/render/selection/findInViewRangeY.js +45 -0
  1147. package/lib/excel/render/selection/getCellPosition.d.ts +43 -0
  1148. package/lib/excel/render/selection/getCellPosition.js +137 -0
  1149. package/lib/excel/render/selection/getRangePosition.d.ts +12 -0
  1150. package/lib/excel/render/selection/getRangePosition.js +71 -0
  1151. package/lib/excel/render/selection/hitTest.d.ts +41 -0
  1152. package/lib/excel/render/selection/hitTest.js +50 -0
  1153. package/lib/excel/render/selection/hitTestInRange.d.ts +7 -0
  1154. package/lib/excel/render/selection/hitTestInRange.js +60 -0
  1155. package/lib/excel/render/selection/updateCursor.d.ts +5 -0
  1156. package/lib/excel/render/selection/updateCursor.js +26 -0
  1157. package/lib/excel/render/sheetTab/SheetList.d.ts +43 -0
  1158. package/lib/excel/render/sheetTab/SheetList.js +289 -0
  1159. package/lib/excel/render/sheetTab/SheetTabBar.d.ts +8 -0
  1160. package/lib/excel/render/sheetTab/SheetTabBar.js +24 -0
  1161. package/lib/excel/render/sheetTab/StatusBar.d.ts +14 -0
  1162. package/lib/excel/render/sheetTab/StatusBar.js +87 -0
  1163. package/lib/excel/render/sheetTab/ZoomLevel.d.ts +6 -0
  1164. package/lib/excel/render/sheetTab/ZoomLevel.js +43 -0
  1165. package/lib/excel/render/sparkline/Numbers.d.ts +1 -0
  1166. package/lib/excel/render/sparkline/applyColor.d.ts +7 -0
  1167. package/lib/excel/render/sparkline/applyColor.js +40 -0
  1168. package/lib/excel/render/sparkline/drawSparkline.d.ts +7 -0
  1169. package/lib/excel/render/sparkline/drawSparkline.js +90 -0
  1170. package/lib/excel/render/sparkline/renderColumn.d.ts +7 -0
  1171. package/lib/excel/render/sparkline/renderColumn.js +51 -0
  1172. package/lib/excel/render/sparkline/renderLine.d.ts +7 -0
  1173. package/lib/excel/render/sparkline/renderLine.js +111 -0
  1174. package/lib/excel/render/sparkline/renderSparkline.d.ts +9 -0
  1175. package/lib/excel/render/sparkline/renderSparkline.js +63 -0
  1176. package/lib/excel/render/sparkline/renderStacked.d.ts +7 -0
  1177. package/lib/excel/render/sparkline/renderStacked.js +65 -0
  1178. package/lib/excel/render/ui/Button.d.ts +7 -0
  1179. package/lib/excel/render/ui/CheckBox.d.ts +16 -0
  1180. package/lib/excel/render/ui/CheckBox.js +52 -0
  1181. package/lib/excel/render/ui/CheckBoxList.d.ts +16 -0
  1182. package/lib/excel/render/ui/CheckBoxList.js +113 -0
  1183. package/lib/excel/render/ui/Divider.d.ts +3 -0
  1184. package/lib/excel/render/ui/Divider.js +17 -0
  1185. package/lib/excel/render/ui/Input.d.ts +11 -0
  1186. package/lib/excel/render/ui/Input.js +52 -0
  1187. package/lib/excel/render/ui/Radio.d.ts +11 -0
  1188. package/lib/excel/render/ui/Radio.js +56 -0
  1189. package/lib/excel/render/ui/Select.d.ts +13 -0
  1190. package/lib/excel/render/ui/Select.js +33 -0
  1191. package/lib/excel/render/widget/Widget.d.ts +29 -0
  1192. package/lib/excel/sheet/BuiltInNumFmt.d.ts +5 -0
  1193. package/lib/excel/sheet/BuiltInNumFmt.js +43 -0
  1194. package/lib/excel/sheet/ColWidth.d.ts +19 -0
  1195. package/lib/excel/sheet/ColWidth.js +36 -0
  1196. package/lib/excel/sheet/ExcelRenderOptions.d.ts +149 -0
  1197. package/lib/excel/sheet/RangeCache.d.ts +32 -0
  1198. package/lib/excel/sheet/RangeCache.js +105 -0
  1199. package/lib/excel/sheet/RowFilter.d.ts +3 -0
  1200. package/lib/excel/sheet/Sheet.d.ts +280 -0
  1201. package/lib/excel/sheet/Sheet.js +679 -0
  1202. package/lib/excel/sheet/SheetBounding.d.ts +22 -0
  1203. package/lib/excel/sheet/ViewRange.d.ts +52 -0
  1204. package/lib/excel/sheet/__test__/applyDxf.test.d.ts +1 -0
  1205. package/lib/excel/sheet/__test__/colWidth.test.d.ts +1 -0
  1206. package/lib/excel/sheet/__test__/getViewRange.test.d.ts +1 -0
  1207. package/lib/excel/sheet/applyConditionalFormat.d.ts +6 -0
  1208. package/lib/excel/sheet/applyConditionalFormat.js +116 -0
  1209. package/lib/excel/sheet/applyDxf.d.ts +6 -0
  1210. package/lib/excel/sheet/applyDxf.js +24 -0
  1211. package/lib/excel/sheet/applyTablePartsStyle.d.ts +6 -0
  1212. package/lib/excel/sheet/applyTablePartsStyle.js +38 -0
  1213. package/lib/excel/sheet/cfRule/__test__/aboveAverage.test.d.ts +1 -0
  1214. package/lib/excel/sheet/cfRule/__test__/cellIs.test.d.ts +1 -0
  1215. package/lib/excel/sheet/cfRule/__test__/top10.test.d.ts +1 -0
  1216. package/lib/excel/sheet/cfRule/aboveAverage.d.ts +9 -0
  1217. package/lib/excel/sheet/cfRule/aboveAverage.js +75 -0
  1218. package/lib/excel/sheet/cfRule/applyCfRuleDxf.d.ts +7 -0
  1219. package/lib/excel/sheet/cfRule/applyCfRuleDxf.js +17 -0
  1220. package/lib/excel/sheet/cfRule/cellIs.d.ts +22 -0
  1221. package/lib/excel/sheet/cfRule/cellIs.js +171 -0
  1222. package/lib/excel/sheet/cfRule/colorScale.d.ts +8 -0
  1223. package/lib/excel/sheet/cfRule/colorScale.js +145 -0
  1224. package/lib/excel/sheet/cfRule/containsBlanks.d.ts +7 -0
  1225. package/lib/excel/sheet/cfRule/containsBlanks.js +18 -0
  1226. package/lib/excel/sheet/cfRule/containsErrors.d.ts +7 -0
  1227. package/lib/excel/sheet/cfRule/containsErrors.js +19 -0
  1228. package/lib/excel/sheet/cfRule/containsText.d.ts +7 -0
  1229. package/lib/excel/sheet/cfRule/containsText.js +21 -0
  1230. package/lib/excel/sheet/cfRule/dataBar.d.ts +8 -0
  1231. package/lib/excel/sheet/cfRule/dataBar.js +236 -0
  1232. package/lib/excel/sheet/cfRule/duplicateValues.d.ts +8 -0
  1233. package/lib/excel/sheet/cfRule/duplicateValues.js +49 -0
  1234. package/lib/excel/sheet/cfRule/getMinMax.d.ts +5 -0
  1235. package/lib/excel/sheet/cfRule/getMinMax.js +41 -0
  1236. package/lib/excel/sheet/cfRule/iconSet.d.ts +8 -0
  1237. package/lib/excel/sheet/cfRule/iconSet.js +113 -0
  1238. package/lib/excel/sheet/cfRule/notContainsText.d.ts +7 -0
  1239. package/lib/excel/sheet/cfRule/notContainsText.js +21 -0
  1240. package/lib/excel/sheet/cfRule/timePeriod.d.ts +9 -0
  1241. package/lib/excel/sheet/cfRule/timePeriod.js +134 -0
  1242. package/lib/excel/sheet/cfRule/top10.d.ts +9 -0
  1243. package/lib/excel/sheet/cfRule/top10.js +77 -0
  1244. package/lib/excel/sheet/cfRule/uniqueValues.d.ts +8 -0
  1245. package/lib/excel/sheet/cfRule/uniqueValues.js +50 -0
  1246. package/lib/excel/sheet/getCellAbsolutePosition.d.ts +10 -0
  1247. package/lib/excel/sheet/getCellAbsolutePosition.js +45 -0
  1248. package/lib/excel/sheet/getViewPointData.d.ts +24 -0
  1249. package/lib/excel/sheet/getViewPointData.js +176 -0
  1250. package/lib/excel/sheet/getViewRange.d.ts +68 -0
  1251. package/lib/excel/sheet/getViewRange.js +199 -0
  1252. package/lib/excel/sheet/table/__test__/calcTableRelativePosition.test.d.ts +1 -0
  1253. package/lib/excel/sheet/table/applyTableStyle.d.ts +5 -0
  1254. package/lib/excel/sheet/table/applyTableStyle.js +91 -0
  1255. package/lib/excel/sheet/table/buildTableStyle.d.ts +13 -0
  1256. package/lib/excel/sheet/table/buildTableStyle.js +72 -0
  1257. package/lib/excel/sheet/table/calcTableRelativePosition.d.ts +11 -0
  1258. package/lib/excel/sheet/table/calcTableRelativePosition.js +94 -0
  1259. package/lib/excel/types/CT_Color.d.ts +9 -0
  1260. package/lib/excel/types/CT_Color.js +24 -0
  1261. package/lib/excel/types/CT_ExtensionList.d.ts +6 -0
  1262. package/lib/excel/types/CT_ExtensionList.js +15 -0
  1263. package/lib/excel/types/CT_Theme.d.ts +15 -0
  1264. package/lib/excel/types/CellInfo.d.ts +57 -0
  1265. package/lib/excel/types/CellValue.d.ts +14 -0
  1266. package/lib/excel/types/DataBarDisplay.d.ts +58 -0
  1267. package/lib/excel/types/ExcelFile.d.ts +12 -0
  1268. package/lib/excel/types/Ext.d.ts +10 -0
  1269. package/lib/excel/types/Ext.js +25 -0
  1270. package/lib/excel/types/FontSize.d.ts +7 -0
  1271. package/lib/excel/types/FontStyle.d.ts +16 -0
  1272. package/lib/excel/types/IChartSpace.d.ts +7 -0
  1273. package/lib/excel/types/IDataProvider.d.ts +158 -0
  1274. package/lib/excel/types/IDrawing.d.ts +51 -0
  1275. package/lib/excel/types/IRElt.d.ts +11 -0
  1276. package/lib/excel/types/IRPrElt.d.ts +28 -0
  1277. package/lib/excel/types/IRelationship.d.ts +10 -0
  1278. package/lib/excel/types/ISheet.d.ts +14 -0
  1279. package/lib/excel/types/ISheet.js +20 -0
  1280. package/lib/excel/types/IWorkbook.d.ts +41 -0
  1281. package/lib/excel/types/IWorksheet.d.ts +37 -0
  1282. package/lib/excel/types/RangeRef.d.ts +21 -0
  1283. package/lib/excel/types/RichText.d.ts +7 -0
  1284. package/lib/excel/types/StringItem.d.ts +5 -0
  1285. package/lib/excel/types/TableStyleDef.d.ts +8 -0
  1286. package/lib/excel/types/X14CF/CT_Cfvo.d.ts +8 -0
  1287. package/lib/excel/types/X14CF/CT_Cfvo.js +18 -0
  1288. package/lib/excel/types/X14CF/ST_CfvoType.d.ts +1 -0
  1289. package/lib/excel/types/X14CF/X14CfRule.d.ts +10 -0
  1290. package/lib/excel/types/X14CF/X14CfRule.js +25 -0
  1291. package/lib/excel/types/X14CF/X14ConditionalFormatting.d.ts +6 -0
  1292. package/lib/excel/types/X14CF/X14ConditionalFormatting.js +15 -0
  1293. package/lib/excel/types/X14CF/X14ConditionalFormattings.d.ts +6 -0
  1294. package/lib/excel/types/X14CF/X14ConditionalFormattings.js +15 -0
  1295. package/lib/excel/types/X14CF/X14DataBar.d.ts +18 -0
  1296. package/lib/excel/types/X14CF/X14DataBar.js +58 -0
  1297. package/lib/excel/types/X14CF/X14IconSet.d.ts +11 -0
  1298. package/lib/excel/types/X14CF/X14IconSet.js +31 -0
  1299. package/lib/excel/types/X14Sparkline/X14Sparkline.d.ts +6 -0
  1300. package/lib/excel/types/X14Sparkline/X14Sparkline.js +14 -0
  1301. package/lib/excel/types/X14Sparkline/X14SparklineGroup.d.ts +35 -0
  1302. package/lib/excel/types/X14Sparkline/X14SparklineGroup.js +112 -0
  1303. package/lib/excel/types/X14Sparkline/X14SparklineGroups.d.ts +6 -0
  1304. package/lib/excel/types/X14Sparkline/X14SparklineGroups.js +15 -0
  1305. package/lib/excel/types/X14Sparkline/x14:sparklines.d.ts +6 -0
  1306. package/lib/excel/types/X14Sparkline/x14_sparklines.js +15 -0
  1307. package/lib/excel/types/worksheet/CellData.d.ts +56 -0
  1308. package/lib/excel/types/worksheet/CellData.js +43 -0
  1309. package/lib/excel/types/worksheet/ICell.d.ts +39 -0
  1310. package/lib/excel/types/worksheet/ICell.js +26 -0
  1311. package/lib/index.d.ts +3 -1
  1312. package/lib/index.js +4 -0
  1313. package/lib/openxml/Attributes.d.ts +33 -0
  1314. package/lib/openxml/Attributes.js +7 -0
  1315. package/lib/openxml/ChartTypes.d.ts +2971 -0
  1316. package/lib/openxml/ChartTypes.js +5416 -0
  1317. package/lib/openxml/ContentType.d.ts +5 -0
  1318. package/lib/openxml/ContentType.js +1 -1
  1319. package/lib/openxml/DMLTypes.d.ts +1836 -0
  1320. package/lib/openxml/DMLTypes.js +2988 -0
  1321. package/lib/openxml/ExcelTypes.d.ts +5147 -0
  1322. package/lib/openxml/ExcelTypes.js +5617 -0
  1323. package/lib/openxml/Style.js +3 -3
  1324. package/lib/openxml/Theme.js +1 -1
  1325. package/lib/openxml/Types.d.ts +2757 -95
  1326. package/lib/openxml/colorNameMap.d.ts +6 -0
  1327. package/lib/openxml/drawing/Blip.d.ts +1 -1
  1328. package/lib/openxml/drawing/CustomGeom.js +1 -1
  1329. package/lib/openxml/drawing/Drawing.js +1 -1
  1330. package/lib/openxml/drawing/Geom.js +1 -1
  1331. package/lib/openxml/drawing/ShapeProperties.d.ts +1 -0
  1332. package/lib/openxml/drawing/ShapeProperties.js +7 -6
  1333. package/lib/openxml/drawing/Transform.js +1 -1
  1334. package/lib/openxml/drawing/svg/shapeToSVG.d.ts +11 -2
  1335. package/lib/openxml/drawing/svg/shapeToSVG.js +6 -6
  1336. package/lib/openxml/word/Body.js +2 -2
  1337. package/lib/openxml/word/Header.js +2 -2
  1338. package/lib/openxml/word/Hyperlink.d.ts +1 -1
  1339. package/lib/openxml/word/Note.js +1 -1
  1340. package/lib/openxml/word/Paragraph.js +2 -2
  1341. package/lib/openxml/word/Run.js +1 -1
  1342. package/lib/openxml/word/Section.js +1 -1
  1343. package/lib/openxml/word/Tab.js +1 -1
  1344. package/lib/openxml/word/WDocument.js +1 -1
  1345. package/lib/openxml/word/wps/WPS.js +2 -2
  1346. package/lib/openxml/word/wps/WPSStyle.js +4 -4
  1347. package/lib/package/PackageParser.d.ts +4 -0
  1348. package/lib/package/XMLPackageParser.d.ts +4 -0
  1349. package/lib/package/ZipPackageParser.d.ts +5 -1
  1350. package/lib/package/ZipPackageParser.js +30 -2
  1351. package/lib/util/EventEmitter.d.ts +38 -0
  1352. package/lib/util/EventEmitter.js +116 -0
  1353. package/lib/util/H.d.ts +7 -0
  1354. package/lib/util/H.js +73 -0
  1355. package/lib/util/LRUCache.d.ts +17 -0
  1356. package/lib/util/LinkedMap.d.ts +40 -0
  1357. package/lib/util/__tests__/autoSpace.test.d.ts +1 -0
  1358. package/lib/util/__tests__/color.test.d.ts +1 -0
  1359. package/lib/util/__tests__/replaceVar.test.d.ts +2 -0
  1360. package/lib/util/__tests__/xml.test.d.ts +1 -0
  1361. package/lib/util/arrayBufferToString.d.ts +1 -0
  1362. package/lib/util/arrayBufferToString.js +11 -0
  1363. package/lib/util/base64ToArrayBuffer.d.ts +1 -0
  1364. package/lib/util/base64ToArrayBuffer.js +14 -0
  1365. package/lib/util/binarySearch.d.ts +5 -0
  1366. package/lib/util/binarySearch.js +27 -0
  1367. package/lib/util/color.d.ts +5 -0
  1368. package/lib/util/color.js +102 -0
  1369. package/lib/util/createObject.d.ts +0 -1
  1370. package/lib/util/createObject.js +2 -11
  1371. package/lib/util/debounce.d.ts +1 -0
  1372. package/lib/util/debounce.js +19 -0
  1373. package/lib/util/emuToPx.d.ts +4 -0
  1374. package/lib/util/emuToPx.js +18 -0
  1375. package/lib/util/escapeHTML.d.ts +4 -0
  1376. package/lib/util/escapeHTML.js +17 -0
  1377. package/lib/util/fileType.d.ts +1 -0
  1378. package/lib/util/fileType.js +17 -0
  1379. package/lib/util/getChineseDay.d.ts +4 -0
  1380. package/lib/util/isFontAvailable.d.ts +5 -0
  1381. package/lib/util/isFontAvailable.js +41 -0
  1382. package/lib/util/isNumeric.d.ts +4 -0
  1383. package/lib/util/isNumeric.js +12 -0
  1384. package/lib/util/isObject.d.ts +6 -0
  1385. package/lib/util/isObject.js +14 -0
  1386. package/lib/util/isValidURL.d.ts +4 -0
  1387. package/lib/util/isValidURL.js +22 -0
  1388. package/lib/util/isVisible.d.ts +4 -0
  1389. package/lib/util/joinPath.d.ts +6 -0
  1390. package/lib/util/joinPath.js +31 -0
  1391. package/lib/util/mergeRun.js +1 -1
  1392. package/lib/util/number.d.ts +9 -0
  1393. package/lib/util/number.js +28 -0
  1394. package/lib/util/objectEqual.d.ts +4 -0
  1395. package/lib/util/objectEqual.js +17 -0
  1396. package/lib/util/onClickOutside.d.ts +4 -0
  1397. package/lib/util/onClickOutside.js +17 -0
  1398. package/lib/util/ptToPx.d.ts +4 -0
  1399. package/lib/util/ptToPx.js +14 -0
  1400. package/lib/util/px2pt.d.ts +1 -0
  1401. package/lib/util/px2pt.js +9 -0
  1402. package/lib/util/runWorker.d.ts +6 -0
  1403. package/lib/util/saxes.d.ts +638 -0
  1404. package/lib/util/saxes.js +2081 -0
  1405. package/lib/util/stringToArray.d.ts +10 -0
  1406. package/lib/util/stringToArray.js +88 -0
  1407. package/lib/util/stripNumber.d.ts +4 -0
  1408. package/lib/util/stripNumber.js +18 -0
  1409. package/lib/util/throttle.d.ts +5 -0
  1410. package/lib/util/xml.d.ts +44 -0
  1411. package/lib/util/xml.js +86 -0
  1412. package/lib/util/xmlchars/xml/1.0/ed4.d.ts +31 -0
  1413. package/lib/util/xmlchars/xml/1.0/ed5.d.ts +51 -0
  1414. package/lib/util/xmlchars/xml/1.0/ed5.js +100 -0
  1415. package/lib/util/xmlchars/xml/1.1/ed2.d.ts +73 -0
  1416. package/lib/util/xmlchars/xml/1.1/ed2.js +25 -0
  1417. package/lib/util/xmlchars/xmlns/1.0/ed3.d.ts +28 -0
  1418. package/lib/util/xmlchars/xmlns/1.0/ed3.js +65 -0
  1419. package/lib/word/parse/Footnotes.d.ts +3 -0
  1420. package/lib/word/parse/Footnotes.js +29 -0
  1421. package/lib/word/parse/modifyColor.js +110 -0
  1422. package/lib/word/parse/parseBorder.d.ts +13 -0
  1423. package/lib/word/parse/parseBorder.js +64 -0
  1424. package/lib/word/parse/parseCellMargin.d.ts +2 -0
  1425. package/lib/word/parse/parseChildColor.d.ts +4 -0
  1426. package/lib/word/parse/parseChildColor.js +70 -0
  1427. package/lib/word/parse/parseColor.d.ts +26 -0
  1428. package/lib/word/parse/parseColor.js +133 -0
  1429. package/lib/word/parse/parseEndnotes.d.ts +3 -0
  1430. package/lib/word/parse/parseEndnotes.js +29 -0
  1431. package/lib/word/parse/parseFont.d.ts +7 -0
  1432. package/lib/word/parse/parseInd.d.ts +5 -0
  1433. package/lib/word/parse/parseInsideBorders.d.ts +9 -0
  1434. package/lib/word/parse/parsePr.d.ts +11 -0
  1435. package/lib/word/parse/parsePr.js +428 -0
  1436. package/lib/word/parse/parseShape.d.ts +10 -0
  1437. package/lib/word/parse/parseShape.js +247 -0
  1438. package/lib/word/parse/parseSpacing.d.ts +7 -0
  1439. package/lib/word/parse/parseTable.d.ts +3 -0
  1440. package/lib/word/parse/parseTable.js +66 -0
  1441. package/lib/word/parse/parseTablePr.d.ts +3 -0
  1442. package/lib/word/parse/parseTablePr.js +189 -0
  1443. package/lib/word/parse/parseTc.d.ts +10 -0
  1444. package/lib/word/parse/parseTc.js +68 -0
  1445. package/lib/word/parse/parseTcPr.d.ts +5 -0
  1446. package/lib/word/parse/parseTcPr.js +104 -0
  1447. package/lib/word/parse/parseTextDirection.d.ts +2 -0
  1448. package/lib/word/parse/parseTr.d.ts +6 -0
  1449. package/lib/word/parse/parseTr.js +53 -0
  1450. package/lib/word/parse/parseTrHeight.d.ts +2 -0
  1451. package/lib/word/parse/parseTrPr.d.ts +3 -0
  1452. package/lib/word/parse/parseTrPr.js +63 -0
  1453. package/lib/word/render/fixAbsolutePosition.d.ts +8 -0
  1454. package/lib/word/render/renderBody.d.ts +10 -0
  1455. package/lib/word/render/renderBody.js +211 -0
  1456. package/lib/word/render/renderBookmark.d.ts +6 -0
  1457. package/lib/word/render/renderBookmark.js +21 -0
  1458. package/lib/word/render/renderBr.d.ts +8 -0
  1459. package/lib/word/render/renderBr.js +20 -0
  1460. package/lib/word/render/renderCustGeom.d.ts +4 -0
  1461. package/lib/word/render/renderCustGeom.js +14 -0
  1462. package/lib/word/render/renderDocument.d.ts +7 -0
  1463. package/lib/word/render/renderDocument.js +18 -0
  1464. package/lib/word/render/renderDrawing.d.ts +9 -0
  1465. package/lib/word/render/renderDrawing.js +259 -0
  1466. package/lib/word/render/renderFont.d.ts +5 -0
  1467. package/lib/word/render/renderFont.js +43 -0
  1468. package/lib/word/render/renderGeom.d.ts +4 -0
  1469. package/lib/word/render/renderGeom.js +18 -0
  1470. package/lib/word/render/renderHeader.d.ts +6 -0
  1471. package/lib/word/render/renderHeader.js +44 -0
  1472. package/lib/word/render/renderHyperLink.d.ts +7 -0
  1473. package/lib/word/render/renderHyperLink.js +48 -0
  1474. package/lib/word/render/renderInlineText.d.ts +6 -0
  1475. package/lib/word/render/renderInlineText.js +43 -0
  1476. package/lib/word/render/renderInstrText.d.ts +8 -0
  1477. package/lib/word/render/renderInstrText.js +44 -0
  1478. package/lib/word/render/renderMath.d.ts +3 -0
  1479. package/lib/word/render/renderMath.js +11 -0
  1480. package/lib/word/render/renderNoBreakHyphen.js +13 -0
  1481. package/lib/word/render/renderNotes.d.ts +5 -0
  1482. package/lib/word/render/renderNotes.js +81 -0
  1483. package/lib/word/render/renderNumbering.d.ts +7 -0
  1484. package/lib/word/render/renderNumbering.js +163 -0
  1485. package/lib/word/render/renderParagraph.d.ts +7 -0
  1486. package/lib/word/render/renderParagraph.js +101 -0
  1487. package/lib/word/render/renderPict.d.ts +6 -0
  1488. package/lib/word/render/renderRuby.d.ts +6 -0
  1489. package/lib/word/render/renderRuby.js +57 -0
  1490. package/lib/word/render/renderRun.d.ts +16 -0
  1491. package/lib/word/render/renderRun.js +151 -0
  1492. package/lib/word/render/renderSection.d.ts +7 -0
  1493. package/lib/word/render/renderSection.js +114 -0
  1494. package/lib/word/render/renderSeparator.js +13 -0
  1495. package/lib/word/render/renderSoftHyphen.js +13 -0
  1496. package/lib/word/render/renderStyle.d.ts +13 -0
  1497. package/lib/word/render/renderStyle.js +200 -0
  1498. package/lib/word/render/renderSym.d.ts +3 -0
  1499. package/lib/word/render/renderSym.js +14 -0
  1500. package/lib/word/render/renderTab.d.ts +8 -0
  1501. package/lib/word/render/renderTab.js +27 -0
  1502. package/lib/word/render/renderTable.d.ts +6 -0
  1503. package/lib/word/render/renderTable.js +193 -0
  1504. package/lib/word/render/setElementStyle.d.ts +6 -0
  1505. package/lib/word/render/setElementStyle.js +30 -0
  1506. package/package.json +37 -18
  1507. package/esm/parse/Footnotes.d.ts +0 -3
  1508. package/esm/parse/Footnotes.js +0 -25
  1509. package/esm/parse/colorNameMap.d.ts +0 -6
  1510. package/esm/parse/modifyColor.js +0 -106
  1511. package/esm/parse/parseBorder.d.ts +0 -13
  1512. package/esm/parse/parseBorder.js +0 -59
  1513. package/esm/parse/parseCellMargin.d.ts +0 -2
  1514. package/esm/parse/parseChildColor.d.ts +0 -5
  1515. package/esm/parse/parseChildColor.js +0 -66
  1516. package/esm/parse/parseColor.d.ts +0 -26
  1517. package/esm/parse/parseColor.js +0 -126
  1518. package/esm/parse/parseEndnotes.d.ts +0 -3
  1519. package/esm/parse/parseEndnotes.js +0 -25
  1520. package/esm/parse/parseFont.d.ts +0 -7
  1521. package/esm/parse/parseInd.d.ts +0 -5
  1522. package/esm/parse/parseInsideBorders.d.ts +0 -9
  1523. package/esm/parse/parsePr.d.ts +0 -11
  1524. package/esm/parse/parsePr.js +0 -422
  1525. package/esm/parse/parseShape.d.ts +0 -10
  1526. package/esm/parse/parseShape.js +0 -239
  1527. package/esm/parse/parseSpacing.d.ts +0 -7
  1528. package/esm/parse/parseTable.d.ts +0 -3
  1529. package/esm/parse/parseTable.js +0 -62
  1530. package/esm/parse/parseTablePr.d.ts +0 -3
  1531. package/esm/parse/parseTablePr.js +0 -185
  1532. package/esm/parse/parseTc.d.ts +0 -10
  1533. package/esm/parse/parseTc.js +0 -64
  1534. package/esm/parse/parseTcPr.d.ts +0 -5
  1535. package/esm/parse/parseTcPr.js +0 -99
  1536. package/esm/parse/parseTextDirection.d.ts +0 -2
  1537. package/esm/parse/parseTr.d.ts +0 -6
  1538. package/esm/parse/parseTr.js +0 -49
  1539. package/esm/parse/parseTrHeight.d.ts +0 -2
  1540. package/esm/parse/parseTrPr.d.ts +0 -3
  1541. package/esm/parse/parseTrPr.js +0 -59
  1542. package/esm/render/fixAbsolutePosition.d.ts +0 -8
  1543. package/esm/render/renderBody.d.ts +0 -10
  1544. package/esm/render/renderBody.js +0 -207
  1545. package/esm/render/renderBookmark.d.ts +0 -6
  1546. package/esm/render/renderBookmark.js +0 -17
  1547. package/esm/render/renderBr.d.ts +0 -8
  1548. package/esm/render/renderBr.js +0 -16
  1549. package/esm/render/renderCustGeom.d.ts +0 -4
  1550. package/esm/render/renderCustGeom.js +0 -10
  1551. package/esm/render/renderDocument.d.ts +0 -7
  1552. package/esm/render/renderDocument.js +0 -14
  1553. package/esm/render/renderDrawing.d.ts +0 -9
  1554. package/esm/render/renderDrawing.js +0 -255
  1555. package/esm/render/renderFont.d.ts +0 -5
  1556. package/esm/render/renderFont.js +0 -39
  1557. package/esm/render/renderGeom.d.ts +0 -4
  1558. package/esm/render/renderGeom.js +0 -14
  1559. package/esm/render/renderHeader.d.ts +0 -6
  1560. package/esm/render/renderHeader.js +0 -40
  1561. package/esm/render/renderHyperLink.d.ts +0 -7
  1562. package/esm/render/renderHyperLink.js +0 -44
  1563. package/esm/render/renderInlineText.d.ts +0 -6
  1564. package/esm/render/renderInlineText.js +0 -39
  1565. package/esm/render/renderInstrText.d.ts +0 -8
  1566. package/esm/render/renderInstrText.js +0 -40
  1567. package/esm/render/renderMath.d.ts +0 -3
  1568. package/esm/render/renderMath.js +0 -7
  1569. package/esm/render/renderNoBreakHyphen.js +0 -9
  1570. package/esm/render/renderNotes.d.ts +0 -5
  1571. package/esm/render/renderNotes.js +0 -77
  1572. package/esm/render/renderNumbering.d.ts +0 -7
  1573. package/esm/render/renderNumbering.js +0 -159
  1574. package/esm/render/renderParagraph.d.ts +0 -7
  1575. package/esm/render/renderParagraph.js +0 -97
  1576. package/esm/render/renderPict.d.ts +0 -6
  1577. package/esm/render/renderRuby.d.ts +0 -6
  1578. package/esm/render/renderRuby.js +0 -53
  1579. package/esm/render/renderRun.d.ts +0 -16
  1580. package/esm/render/renderRun.js +0 -146
  1581. package/esm/render/renderSection.d.ts +0 -7
  1582. package/esm/render/renderSection.js +0 -110
  1583. package/esm/render/renderSeparator.js +0 -9
  1584. package/esm/render/renderSoftHyphen.js +0 -9
  1585. package/esm/render/renderStyle.d.ts +0 -13
  1586. package/esm/render/renderStyle.js +0 -195
  1587. package/esm/render/renderSym.d.ts +0 -3
  1588. package/esm/render/renderSym.js +0 -10
  1589. package/esm/render/renderTab.d.ts +0 -8
  1590. package/esm/render/renderTab.js +0 -23
  1591. package/esm/render/renderTable.d.ts +0 -6
  1592. package/esm/render/renderTable.js +0 -189
  1593. package/esm/render/setElementStyle.d.ts +0 -6
  1594. package/esm/render/setElementStyle.js +0 -26
  1595. package/lib/parse/Footnotes.d.ts +0 -3
  1596. package/lib/parse/Footnotes.js +0 -29
  1597. package/lib/parse/colorNameMap.d.ts +0 -6
  1598. package/lib/parse/modifyColor.js +0 -110
  1599. package/lib/parse/parseBorder.d.ts +0 -13
  1600. package/lib/parse/parseBorder.js +0 -64
  1601. package/lib/parse/parseCellMargin.d.ts +0 -2
  1602. package/lib/parse/parseChildColor.d.ts +0 -5
  1603. package/lib/parse/parseChildColor.js +0 -70
  1604. package/lib/parse/parseColor.d.ts +0 -26
  1605. package/lib/parse/parseColor.js +0 -133
  1606. package/lib/parse/parseEndnotes.d.ts +0 -3
  1607. package/lib/parse/parseEndnotes.js +0 -29
  1608. package/lib/parse/parseFont.d.ts +0 -7
  1609. package/lib/parse/parseInd.d.ts +0 -5
  1610. package/lib/parse/parseInsideBorders.d.ts +0 -9
  1611. package/lib/parse/parsePr.d.ts +0 -11
  1612. package/lib/parse/parsePr.js +0 -426
  1613. package/lib/parse/parseShape.d.ts +0 -10
  1614. package/lib/parse/parseShape.js +0 -247
  1615. package/lib/parse/parseSpacing.d.ts +0 -7
  1616. package/lib/parse/parseTable.d.ts +0 -3
  1617. package/lib/parse/parseTable.js +0 -66
  1618. package/lib/parse/parseTablePr.d.ts +0 -3
  1619. package/lib/parse/parseTablePr.js +0 -189
  1620. package/lib/parse/parseTc.d.ts +0 -10
  1621. package/lib/parse/parseTc.js +0 -68
  1622. package/lib/parse/parseTcPr.d.ts +0 -5
  1623. package/lib/parse/parseTcPr.js +0 -104
  1624. package/lib/parse/parseTextDirection.d.ts +0 -2
  1625. package/lib/parse/parseTr.d.ts +0 -6
  1626. package/lib/parse/parseTr.js +0 -53
  1627. package/lib/parse/parseTrHeight.d.ts +0 -2
  1628. package/lib/parse/parseTrPr.d.ts +0 -3
  1629. package/lib/parse/parseTrPr.js +0 -63
  1630. package/lib/render/fixAbsolutePosition.d.ts +0 -8
  1631. package/lib/render/renderBody.d.ts +0 -10
  1632. package/lib/render/renderBody.js +0 -211
  1633. package/lib/render/renderBookmark.d.ts +0 -6
  1634. package/lib/render/renderBookmark.js +0 -21
  1635. package/lib/render/renderBr.d.ts +0 -8
  1636. package/lib/render/renderBr.js +0 -20
  1637. package/lib/render/renderCustGeom.d.ts +0 -4
  1638. package/lib/render/renderCustGeom.js +0 -14
  1639. package/lib/render/renderDocument.d.ts +0 -7
  1640. package/lib/render/renderDocument.js +0 -18
  1641. package/lib/render/renderDrawing.d.ts +0 -9
  1642. package/lib/render/renderDrawing.js +0 -259
  1643. package/lib/render/renderFont.d.ts +0 -5
  1644. package/lib/render/renderFont.js +0 -43
  1645. package/lib/render/renderGeom.d.ts +0 -4
  1646. package/lib/render/renderGeom.js +0 -18
  1647. package/lib/render/renderHeader.d.ts +0 -6
  1648. package/lib/render/renderHeader.js +0 -44
  1649. package/lib/render/renderHyperLink.d.ts +0 -7
  1650. package/lib/render/renderHyperLink.js +0 -48
  1651. package/lib/render/renderInlineText.d.ts +0 -6
  1652. package/lib/render/renderInlineText.js +0 -43
  1653. package/lib/render/renderInstrText.d.ts +0 -8
  1654. package/lib/render/renderInstrText.js +0 -44
  1655. package/lib/render/renderMath.d.ts +0 -3
  1656. package/lib/render/renderMath.js +0 -11
  1657. package/lib/render/renderNoBreakHyphen.js +0 -13
  1658. package/lib/render/renderNotes.d.ts +0 -5
  1659. package/lib/render/renderNotes.js +0 -81
  1660. package/lib/render/renderNumbering.d.ts +0 -7
  1661. package/lib/render/renderNumbering.js +0 -163
  1662. package/lib/render/renderParagraph.d.ts +0 -7
  1663. package/lib/render/renderParagraph.js +0 -101
  1664. package/lib/render/renderPict.d.ts +0 -6
  1665. package/lib/render/renderRuby.d.ts +0 -6
  1666. package/lib/render/renderRuby.js +0 -57
  1667. package/lib/render/renderRun.d.ts +0 -16
  1668. package/lib/render/renderRun.js +0 -151
  1669. package/lib/render/renderSection.d.ts +0 -7
  1670. package/lib/render/renderSection.js +0 -114
  1671. package/lib/render/renderSeparator.js +0 -13
  1672. package/lib/render/renderSoftHyphen.js +0 -13
  1673. package/lib/render/renderStyle.d.ts +0 -13
  1674. package/lib/render/renderStyle.js +0 -200
  1675. package/lib/render/renderSym.d.ts +0 -3
  1676. package/lib/render/renderSym.js +0 -14
  1677. package/lib/render/renderTab.d.ts +0 -8
  1678. package/lib/render/renderTab.js +0 -27
  1679. package/lib/render/renderTable.d.ts +0 -6
  1680. package/lib/render/renderTable.js +0 -193
  1681. package/lib/render/setElementStyle.d.ts +0 -6
  1682. package/lib/render/setElementStyle.js +0 -30
  1683. /package/esm/{parse → openxml}/colorNameMap.js +0 -0
  1684. /package/esm/{parse → word/parse}/jcToTextAlign.d.ts +0 -0
  1685. /package/esm/{parse → word/parse}/jcToTextAlign.js +0 -0
  1686. /package/esm/{parse → word/parse}/mergeSdt.d.ts +0 -0
  1687. /package/esm/{parse → word/parse}/mergeSdt.js +0 -0
  1688. /package/esm/{parse → word/parse}/modifyColor.d.ts +0 -0
  1689. /package/esm/{parse → word/parse}/parseCellMargin.js +0 -0
  1690. /package/esm/{parse → word/parse}/parseFont.js +0 -0
  1691. /package/esm/{parse → word/parse}/parseInd.js +0 -0
  1692. /package/esm/{parse → word/parse}/parseInsideBorders.js +0 -0
  1693. /package/esm/{parse → word/parse}/parseRelationship.d.ts +0 -0
  1694. /package/esm/{parse → word/parse}/parseRelationship.js +0 -0
  1695. /package/esm/{parse → word/parse}/parseSdt.d.ts +0 -0
  1696. /package/esm/{parse → word/parse}/parseSize.d.ts +0 -0
  1697. /package/esm/{parse → word/parse}/parseSize.js +0 -0
  1698. /package/esm/{parse → word/parse}/parseSpacing.js +0 -0
  1699. /package/esm/{parse → word/parse}/parseTblWidth.d.ts +0 -0
  1700. /package/esm/{parse → word/parse}/parseTblWidth.js +0 -0
  1701. /package/esm/{parse → word/parse}/parseTextDirection.js +0 -0
  1702. /package/esm/{parse → word/parse}/parseTrHeight.js +0 -0
  1703. /package/esm/{render → word/render}/renderNoBreakHyphen.d.ts +0 -0
  1704. /package/esm/{render → word/render}/renderPict.js +0 -0
  1705. /package/esm/{render → word/render}/renderSeparator.d.ts +0 -0
  1706. /package/esm/{render → word/render}/renderSoftHyphen.d.ts +0 -0
  1707. /package/esm/{render → word/render}/zindex.d.ts +0 -0
  1708. /package/lib/{parse → openxml}/colorNameMap.js +0 -0
  1709. /package/lib/{parse → word/parse}/jcToTextAlign.d.ts +0 -0
  1710. /package/lib/{parse → word/parse}/jcToTextAlign.js +0 -0
  1711. /package/lib/{parse → word/parse}/mergeSdt.d.ts +0 -0
  1712. /package/lib/{parse → word/parse}/mergeSdt.js +0 -0
  1713. /package/lib/{parse → word/parse}/modifyColor.d.ts +0 -0
  1714. /package/lib/{parse → word/parse}/parseCellMargin.js +0 -0
  1715. /package/lib/{parse → word/parse}/parseFont.js +0 -0
  1716. /package/lib/{parse → word/parse}/parseInd.js +0 -0
  1717. /package/lib/{parse → word/parse}/parseInsideBorders.js +0 -0
  1718. /package/lib/{parse → word/parse}/parseRelationship.d.ts +0 -0
  1719. /package/lib/{parse → word/parse}/parseRelationship.js +0 -0
  1720. /package/lib/{parse → word/parse}/parseSdt.d.ts +0 -0
  1721. /package/lib/{parse → word/parse}/parseSize.d.ts +0 -0
  1722. /package/lib/{parse → word/parse}/parseSize.js +0 -0
  1723. /package/lib/{parse → word/parse}/parseSpacing.js +0 -0
  1724. /package/lib/{parse → word/parse}/parseTblWidth.d.ts +0 -0
  1725. /package/lib/{parse → word/parse}/parseTblWidth.js +0 -0
  1726. /package/lib/{parse → word/parse}/parseTextDirection.js +0 -0
  1727. /package/lib/{parse → word/parse}/parseTrHeight.js +0 -0
  1728. /package/lib/{render → word/render}/renderNoBreakHyphen.d.ts +0 -0
  1729. /package/lib/{render → word/render}/renderPict.js +0 -0
  1730. /package/lib/{render → word/render}/renderSeparator.d.ts +0 -0
  1731. /package/lib/{render → word/render}/renderSoftHyphen.d.ts +0 -0
  1732. /package/lib/{render → word/render}/zindex.d.ts +0 -0
@@ -0,0 +1,2077 @@
1
+ import { __spreadArray, __read, __values, __assign } from 'tslib';
2
+ import { isS as isS$1, isChar, isNameStartChar as isNameStartChar$1, isNameChar as isNameChar$1, S_LIST as S_LIST$1, NAME_RE as NAME_RE$1 } from './xmlchars/xml/1.0/ed5.js';
3
+ import { isChar as isChar$1 } from './xmlchars/xml/1.1/ed2.js';
4
+ import { isNCNameStartChar as isNCNameStartChar$1, isNCNameChar as isNCNameChar$1, NC_NAME_RE as NC_NAME_RE$1 } from './xmlchars/xmlns/1.0/ed3.js';
5
+
6
+ /**
7
+ * 来自 https://github.com/lddubeau/saxes,修了些类型报错,后续优化性能
8
+ */
9
+ var isS = isS$1;
10
+ var isChar10 = isChar;
11
+ var isNameStartChar = isNameStartChar$1;
12
+ var isNameChar = isNameChar$1;
13
+ var S_LIST = S_LIST$1;
14
+ var NAME_RE = NAME_RE$1;
15
+ var isChar11 = isChar$1;
16
+ var isNCNameStartChar = isNCNameStartChar$1;
17
+ var isNCNameChar = isNCNameChar$1;
18
+ var NC_NAME_RE = NC_NAME_RE$1;
19
+ var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
20
+ var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/';
21
+ var rootNS = {
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
23
+ __proto__: null,
24
+ xml: XML_NAMESPACE,
25
+ xmlns: XMLNS_NAMESPACE
26
+ };
27
+ var XML_ENTITIES = {
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
29
+ __proto__: null,
30
+ amp: '&',
31
+ gt: '>',
32
+ lt: '<',
33
+ quot: '"',
34
+ apos: "'"
35
+ };
36
+ // EOC: end-of-chunk
37
+ var EOC = -1;
38
+ var NL_LIKE = -2;
39
+ var S_BEGIN = 0; // Initial state.
40
+ var S_BEGIN_WHITESPACE = 1; // leading whitespace
41
+ var S_DOCTYPE = 2; // <!DOCTYPE
42
+ var S_DOCTYPE_QUOTE = 3; // <!DOCTYPE "//blah
43
+ var S_DTD = 4; // <!DOCTYPE "//blah" [ ...
44
+ var S_DTD_QUOTED = 5; // <!DOCTYPE "//blah" [ "foo
45
+ var S_DTD_OPEN_WAKA = 6;
46
+ var S_DTD_OPEN_WAKA_BANG = 7;
47
+ var S_DTD_COMMENT = 8; // <!--
48
+ var S_DTD_COMMENT_ENDING = 9; // <!-- blah -
49
+ var S_DTD_COMMENT_ENDED = 10; // <!-- blah --
50
+ var S_DTD_PI = 11; // <?
51
+ var S_DTD_PI_ENDING = 12; // <?hi "there" ?
52
+ var S_TEXT = 13; // general stuff
53
+ var S_ENTITY = 14; // &amp and such
54
+ var S_OPEN_WAKA = 15; // <
55
+ var S_OPEN_WAKA_BANG = 16; // <!...
56
+ var S_COMMENT = 17; // <!--
57
+ var S_COMMENT_ENDING = 18; // <!-- blah -
58
+ var S_COMMENT_ENDED = 19; // <!-- blah --
59
+ var S_CDATA = 20; // <![CDATA[ something
60
+ var S_CDATA_ENDING = 21; // ]
61
+ var S_CDATA_ENDING_2 = 22; // ]]
62
+ var S_PI_FIRST_CHAR = 23; // <?hi, first char
63
+ var S_PI_REST = 24; // <?hi, rest of the name
64
+ var S_PI_BODY = 25; // <?hi there
65
+ var S_PI_ENDING = 26; // <?hi "there" ?
66
+ var S_XML_DECL_NAME_START = 27; // <?xml
67
+ var S_XML_DECL_NAME = 28; // <?xml foo
68
+ var S_XML_DECL_EQ = 29; // <?xml foo=
69
+ var S_XML_DECL_VALUE_START = 30; // <?xml foo=
70
+ var S_XML_DECL_VALUE = 31; // <?xml foo="bar"
71
+ var S_XML_DECL_SEPARATOR = 32; // <?xml foo="bar"
72
+ var S_XML_DECL_ENDING = 33; // <?xml ... ?
73
+ var S_OPEN_TAG = 34; // <strong
74
+ var S_OPEN_TAG_SLASH = 35; // <strong /
75
+ var S_ATTRIB = 36; // <a
76
+ var S_ATTRIB_NAME = 37; // <a foo
77
+ var S_ATTRIB_NAME_SAW_WHITE = 38; // <a foo _
78
+ var S_ATTRIB_VALUE = 39; // <a foo=
79
+ var S_ATTRIB_VALUE_QUOTED = 40; // <a foo="bar
80
+ var S_ATTRIB_VALUE_CLOSED = 41; // <a foo="bar"
81
+ var S_ATTRIB_VALUE_UNQUOTED = 42; // <a foo=bar
82
+ var S_CLOSE_TAG = 43; // </a
83
+ var S_CLOSE_TAG_SAW_WHITE = 44; // </a >
84
+ var TAB = 9;
85
+ var NL = 0xa;
86
+ var CR = 0xd;
87
+ var SPACE = 0x20;
88
+ var BANG = 0x21;
89
+ var DQUOTE = 0x22;
90
+ var AMP = 0x26;
91
+ var SQUOTE = 0x27;
92
+ var MINUS = 0x2d;
93
+ var FORWARD_SLASH = 0x2f;
94
+ var SEMICOLON = 0x3b;
95
+ var LESS = 0x3c;
96
+ var EQUAL = 0x3d;
97
+ var GREATER = 0x3e;
98
+ var QUESTION = 0x3f;
99
+ var OPEN_BRACKET = 0x5b;
100
+ var CLOSE_BRACKET = 0x5d;
101
+ var NEL = 0x85;
102
+ var LS = 0x2028; // Line Separator
103
+ var isQuote = function (c) { return c === DQUOTE || c === SQUOTE; };
104
+ var QUOTES = [DQUOTE, SQUOTE];
105
+ var DOCTYPE_TERMINATOR = __spreadArray(__spreadArray([], __read(QUOTES), false), [OPEN_BRACKET, GREATER], false);
106
+ var DTD_TERMINATOR = __spreadArray(__spreadArray([], __read(QUOTES), false), [LESS, CLOSE_BRACKET], false);
107
+ var XML_DECL_NAME_TERMINATOR = __spreadArray([EQUAL, QUESTION], __read(S_LIST), false);
108
+ var ATTRIB_VALUE_UNQUOTED_TERMINATOR = __spreadArray(__spreadArray([], __read(S_LIST), false), [GREATER, AMP, LESS], false);
109
+ function nsPairCheck(parser, prefix, uri) {
110
+ switch (prefix) {
111
+ case 'xml':
112
+ if (uri !== XML_NAMESPACE) {
113
+ parser.fail("xml prefix must be bound to ".concat(XML_NAMESPACE, "."));
114
+ }
115
+ break;
116
+ case 'xmlns':
117
+ if (uri !== XMLNS_NAMESPACE) {
118
+ parser.fail("xmlns prefix must be bound to ".concat(XMLNS_NAMESPACE, "."));
119
+ }
120
+ break;
121
+ }
122
+ switch (uri) {
123
+ case XMLNS_NAMESPACE:
124
+ parser.fail(prefix === ''
125
+ ? "the default namespace may not be set to ".concat(uri, ".")
126
+ : "may not assign a prefix (even \"xmlns\") to the URI ".concat(XMLNS_NAMESPACE, "."));
127
+ break;
128
+ case XML_NAMESPACE:
129
+ switch (prefix) {
130
+ case 'xml':
131
+ // Assinging the XML namespace to "xml" is fine.
132
+ break;
133
+ case '':
134
+ parser.fail("the default namespace may not be set to ".concat(uri, "."));
135
+ break;
136
+ default:
137
+ parser.fail('may not assign the xml namespace to another prefix.');
138
+ }
139
+ break;
140
+ }
141
+ }
142
+ function nsMappingCheck(parser, mapping) {
143
+ var e_1, _a;
144
+ try {
145
+ for (var _b = __values(Object.keys(mapping)), _c = _b.next(); !_c.done; _c = _b.next()) {
146
+ var local = _c.value;
147
+ nsPairCheck(parser, local, mapping[local]);
148
+ }
149
+ }
150
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
151
+ finally {
152
+ try {
153
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
154
+ }
155
+ finally { if (e_1) throw e_1.error; }
156
+ }
157
+ }
158
+ var isNCName = function (name) { return NC_NAME_RE.test(name); };
159
+ var isName = function (name) { return NAME_RE.test(name); };
160
+ var FORBIDDEN_START = 0;
161
+ var FORBIDDEN_BRACKET = 1;
162
+ var FORBIDDEN_BRACKET_BRACKET = 2;
163
+ var EVENT_NAME_TO_HANDLER_NAME = {
164
+ xmldecl: 'xmldeclHandler',
165
+ text: 'textHandler',
166
+ processinginstruction: 'piHandler',
167
+ doctype: 'doctypeHandler',
168
+ comment: 'commentHandler',
169
+ opentagstart: 'openTagStartHandler',
170
+ attribute: 'attributeHandler',
171
+ opentag: 'openTagHandler',
172
+ closetag: 'closeTagHandler',
173
+ cdata: 'cdataHandler',
174
+ error: 'errorHandler',
175
+ end: 'endHandler',
176
+ ready: 'readyHandler'
177
+ };
178
+ // eslint-disable-next-line @typescript-eslint/ban-types
179
+ var SaxesParser = /** @class */ (function () {
180
+ /**
181
+ * @param opt The parser options.
182
+ */
183
+ function SaxesParser(opt) {
184
+ this.opt = opt !== null && opt !== void 0 ? opt : {};
185
+ this.fragmentOpt = !!this.opt.fragment;
186
+ var xmlnsOpt = (this.xmlnsOpt = !!this.opt.xmlns);
187
+ this.trackPosition = this.opt.position !== false;
188
+ this.fileName = this.opt.fileName;
189
+ if (xmlnsOpt) {
190
+ // This is the function we use to perform name checks on PIs and entities.
191
+ // When namespaces are used, colons are not allowed in PI target names or
192
+ // entity names. So the check depends on whether namespaces are used. See:
193
+ //
194
+ // https://www.w3.org/XML/xml-names-19990114-errata.html
195
+ // NE08
196
+ //
197
+ this.nameStartCheck = isNCNameStartChar;
198
+ this.nameCheck = isNCNameChar;
199
+ this.isName = isNCName;
200
+ // eslint-disable-next-line @typescript-eslint/unbound-method
201
+ this.processAttribs = this.processAttribsNS;
202
+ // eslint-disable-next-line @typescript-eslint/unbound-method
203
+ this.pushAttrib = this.pushAttribNS;
204
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
205
+ this.ns = __assign({ __proto__: null }, rootNS);
206
+ var additional = this.opt.additionalNamespaces;
207
+ if (additional != null) {
208
+ nsMappingCheck(this, additional);
209
+ Object.assign(this.ns, additional);
210
+ }
211
+ }
212
+ else {
213
+ this.nameStartCheck = isNameStartChar;
214
+ this.nameCheck = isNameChar;
215
+ this.isName = isName;
216
+ // eslint-disable-next-line @typescript-eslint/unbound-method
217
+ this.processAttribs = this.processAttribsPlain;
218
+ // eslint-disable-next-line @typescript-eslint/unbound-method
219
+ this.pushAttrib = this.pushAttribPlain;
220
+ }
221
+ //
222
+ // The order of the members in this table needs to correspond to the state
223
+ // numbers given to the states that correspond to the methods being recorded
224
+ // here.
225
+ //
226
+ this.stateTable = [
227
+ /* eslint-disable @typescript-eslint/unbound-method */
228
+ this.sBegin,
229
+ this.sBeginWhitespace,
230
+ this.sDoctype,
231
+ this.sDoctypeQuote,
232
+ this.sDTD,
233
+ this.sDTDQuoted,
234
+ this.sDTDOpenWaka,
235
+ this.sDTDOpenWakaBang,
236
+ this.sDTDComment,
237
+ this.sDTDCommentEnding,
238
+ this.sDTDCommentEnded,
239
+ this.sDTDPI,
240
+ this.sDTDPIEnding,
241
+ this.sText,
242
+ this.sEntity,
243
+ this.sOpenWaka,
244
+ this.sOpenWakaBang,
245
+ this.sComment,
246
+ this.sCommentEnding,
247
+ this.sCommentEnded,
248
+ this.sCData,
249
+ this.sCDataEnding,
250
+ this.sCDataEnding2,
251
+ this.sPIFirstChar,
252
+ this.sPIRest,
253
+ this.sPIBody,
254
+ this.sPIEnding,
255
+ this.sXMLDeclNameStart,
256
+ this.sXMLDeclName,
257
+ this.sXMLDeclEq,
258
+ this.sXMLDeclValueStart,
259
+ this.sXMLDeclValue,
260
+ this.sXMLDeclSeparator,
261
+ this.sXMLDeclEnding,
262
+ this.sOpenTag,
263
+ this.sOpenTagSlash,
264
+ this.sAttrib,
265
+ this.sAttribName,
266
+ this.sAttribNameSawWhite,
267
+ this.sAttribValue,
268
+ this.sAttribValueQuoted,
269
+ this.sAttribValueClosed,
270
+ this.sAttribValueUnquoted,
271
+ this.sCloseTag,
272
+ this.sCloseTagSawWhite
273
+ /* eslint-enable @typescript-eslint/unbound-method */
274
+ ];
275
+ this._init();
276
+ }
277
+ Object.defineProperty(SaxesParser.prototype, "closed", {
278
+ /**
279
+ * Indicates whether or not the parser is closed. If ``true``, wait for
280
+ * the ``ready`` event to write again.
281
+ */
282
+ get: function () {
283
+ return this._closed;
284
+ },
285
+ enumerable: false,
286
+ configurable: true
287
+ });
288
+ SaxesParser.prototype._init = function () {
289
+ var _a;
290
+ this.openWakaBang = '';
291
+ this.text = '';
292
+ this.name = '';
293
+ this.piTarget = '';
294
+ this.entity = '';
295
+ this.q = null;
296
+ this.tags = [];
297
+ this.tag = null;
298
+ this.topNS = null;
299
+ this.chunk = '';
300
+ this.chunkPosition = 0;
301
+ this.i = 0;
302
+ this.prevI = 0;
303
+ this.carriedFromPrevious = undefined;
304
+ this.forbiddenState = FORBIDDEN_START;
305
+ this.attribList = [];
306
+ // The logic is organized so as to minimize the need to check
307
+ // this.opt.fragment while parsing.
308
+ var fragmentOpt = this.fragmentOpt;
309
+ this.state = fragmentOpt ? S_TEXT : S_BEGIN;
310
+ // We want these to be all true if we are dealing with a fragment.
311
+ this.reportedTextBeforeRoot =
312
+ this.reportedTextAfterRoot =
313
+ this.closedRoot =
314
+ this.sawRoot =
315
+ fragmentOpt;
316
+ // An XML declaration is intially possible only when parsing whole
317
+ // documents.
318
+ this.xmlDeclPossible = !fragmentOpt;
319
+ this.xmlDeclExpects = ['version'];
320
+ this.entityReturnState = undefined;
321
+ var defaultXMLVersion = this.opt.defaultXMLVersion;
322
+ if (defaultXMLVersion === undefined) {
323
+ if (this.opt.forceXMLVersion === true) {
324
+ throw new Error('forceXMLVersion set but defaultXMLVersion is not set');
325
+ }
326
+ defaultXMLVersion = '1.0';
327
+ }
328
+ this.setXMLVersion(defaultXMLVersion);
329
+ this.positionAtNewLine = 0;
330
+ this.doctype = false;
331
+ this._closed = false;
332
+ this.xmlDecl = {
333
+ version: undefined,
334
+ encoding: undefined,
335
+ standalone: undefined
336
+ };
337
+ this.line = 1;
338
+ this.column = 0;
339
+ this.ENTITIES = Object.create(XML_ENTITIES);
340
+ (_a = this.readyHandler) === null || _a === void 0 ? void 0 : _a.call(this);
341
+ };
342
+ Object.defineProperty(SaxesParser.prototype, "position", {
343
+ /**
344
+ * The stream position the parser is currently looking at. This field is
345
+ * zero-based.
346
+ *
347
+ * This field is not based on counting Unicode characters but is to be
348
+ * interpreted as a plain index into a JavaScript string.
349
+ */
350
+ get: function () {
351
+ return this.chunkPosition + this.i;
352
+ },
353
+ enumerable: false,
354
+ configurable: true
355
+ });
356
+ Object.defineProperty(SaxesParser.prototype, "columnIndex", {
357
+ /**
358
+ * The column number of the next character to be read by the parser. *
359
+ * This field is zero-based. (The first column in a line is 0.)
360
+ *
361
+ * This field reports the index at which the next character would be in the
362
+ * line if the line were represented as a JavaScript string. Note that this
363
+ * *can* be different to a count based on the number of *Unicode characters*
364
+ * due to how JavaScript handles astral plane characters.
365
+ *
366
+ * See [[column]] for a number that corresponds to a count of Unicode
367
+ * characters.
368
+ */
369
+ get: function () {
370
+ return this.position - this.positionAtNewLine;
371
+ },
372
+ enumerable: false,
373
+ configurable: true
374
+ });
375
+ /**
376
+ * Set an event listener on an event. The parser supports one handler per
377
+ * event type. If you try to set an event handler over an existing handler,
378
+ * the old handler is silently overwritten.
379
+ *
380
+ * @param name The event to listen to.
381
+ *
382
+ * @param handler The handler to set.
383
+ */
384
+ SaxesParser.prototype.on = function (name, handler) {
385
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
386
+ this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;
387
+ };
388
+ /**
389
+ * Unset an event handler.
390
+ *
391
+ * @parma name The event to stop listening to.
392
+ */
393
+ SaxesParser.prototype.off = function (name) {
394
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
395
+ this[EVENT_NAME_TO_HANDLER_NAME[name]] = undefined;
396
+ };
397
+ /**
398
+ * Make an error object. The error object will have a message that contains
399
+ * the ``fileName`` option passed at the creation of the parser. If position
400
+ * tracking was turned on, it will also have line and column number
401
+ * information.
402
+ *
403
+ * @param message The message describing the error to report.
404
+ *
405
+ * @returns An error object with a properly formatted message.
406
+ */
407
+ SaxesParser.prototype.makeError = function (message) {
408
+ var _a;
409
+ var msg = (_a = this.fileName) !== null && _a !== void 0 ? _a : '';
410
+ if (this.trackPosition) {
411
+ if (msg.length > 0) {
412
+ msg += ':';
413
+ }
414
+ msg += "".concat(this.line, ":").concat(this.column);
415
+ }
416
+ if (msg.length > 0) {
417
+ msg += ': ';
418
+ }
419
+ return new Error(msg + message);
420
+ };
421
+ /**
422
+ * Report a parsing error. This method is made public so that client code may
423
+ * check for issues that are outside the scope of this project and can report
424
+ * errors.
425
+ *
426
+ * @param message The error to report.
427
+ *
428
+ * @returns this
429
+ */
430
+ SaxesParser.prototype.fail = function (message) {
431
+ var err = this.makeError(message);
432
+ var handler = this.errorHandler;
433
+ if (handler === undefined) {
434
+ throw err;
435
+ }
436
+ else {
437
+ handler(err);
438
+ }
439
+ return this;
440
+ };
441
+ /**
442
+ * Write a XML data to the parser.
443
+ *
444
+ * @param chunk The XML data to write.
445
+ *
446
+ * @returns this
447
+ */
448
+ // We do need object for the type here. Yes, it often causes problems
449
+ // but not in this case.
450
+ SaxesParser.prototype.write = function (chunk) {
451
+ if (this.closed) {
452
+ return this.fail('cannot write after close; assign an onready handler.');
453
+ }
454
+ var end = false;
455
+ if (chunk === null) {
456
+ // We cannot return immediately because carriedFromPrevious may need
457
+ // processing.
458
+ end = true;
459
+ chunk = '';
460
+ }
461
+ else if (typeof chunk === 'object') {
462
+ chunk = chunk.toString();
463
+ }
464
+ // We checked if performing a pre-decomposition of the string into an array
465
+ // of single complete characters (``Array.from(chunk)``) would be faster
466
+ // than the current repeated calls to ``charCodeAt``. As of August 2018, it
467
+ // isn't. (There may be Node-specific code that would perform faster than
468
+ // ``Array.from`` but don't want to be dependent on Node.)
469
+ if (this.carriedFromPrevious !== undefined) {
470
+ // The previous chunk had char we must carry over.
471
+ chunk = "".concat(this.carriedFromPrevious).concat(chunk);
472
+ this.carriedFromPrevious = undefined;
473
+ }
474
+ var limit = chunk.length;
475
+ var lastCode = chunk.charCodeAt(limit - 1);
476
+ if (!end &&
477
+ // A trailing CR or surrogate must be carried over to the next
478
+ // chunk.
479
+ (lastCode === CR || (lastCode >= 0xd800 && lastCode <= 0xdbff))) {
480
+ // The chunk ends with a character that must be carried over. We cannot
481
+ // know how to handle it until we get the next chunk or the end of the
482
+ // stream. So save it for later.
483
+ this.carriedFromPrevious = chunk[limit - 1];
484
+ limit--;
485
+ chunk = chunk.slice(0, limit);
486
+ }
487
+ var stateTable = this.stateTable;
488
+ this.chunk = chunk;
489
+ this.i = 0;
490
+ while (this.i < limit) {
491
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
492
+ stateTable[this.state].call(this);
493
+ }
494
+ this.chunkPosition += limit;
495
+ return end ? this.end() : this;
496
+ };
497
+ /**
498
+ * Close the current stream. Perform final well-formedness checks and reset
499
+ * the parser tstate.
500
+ *
501
+ * @returns this
502
+ */
503
+ SaxesParser.prototype.close = function () {
504
+ return this.write(null);
505
+ };
506
+ /**
507
+ * Get a single code point out of the current chunk. This updates the current
508
+ * position if we do position tracking.
509
+ *
510
+ * This is the algorithm to use for XML 1.0.
511
+ *
512
+ * @returns The character read.
513
+ */
514
+ SaxesParser.prototype.getCode10 = function () {
515
+ var _a = this, chunk = _a.chunk, i = _a.i;
516
+ this.prevI = i;
517
+ // Yes, we do this instead of doing this.i++. Doing it this way, we do not
518
+ // read this.i again, which is a bit faster.
519
+ this.i = i + 1;
520
+ if (i >= chunk.length) {
521
+ return EOC;
522
+ }
523
+ // Using charCodeAt and handling the surrogates ourselves is faster
524
+ // than using codePointAt.
525
+ var code = chunk.charCodeAt(i);
526
+ this.column++;
527
+ if (code < 0xd800) {
528
+ if (code >= SPACE || code === TAB) {
529
+ return code;
530
+ }
531
+ switch (code) {
532
+ case NL:
533
+ this.line++;
534
+ this.column = 0;
535
+ this.positionAtNewLine = this.position;
536
+ return NL;
537
+ case CR:
538
+ // We may get NaN if we read past the end of the chunk, which is fine.
539
+ if (chunk.charCodeAt(i + 1) === NL) {
540
+ // A \r\n sequence is converted to \n so we have to skip over the
541
+ // next character. We already know it has a size of 1 so ++ is fine
542
+ // here.
543
+ this.i = i + 2;
544
+ }
545
+ // Otherwise, a \r is just converted to \n, so we don't have to skip
546
+ // ahead.
547
+ // In either case, \r becomes \n.
548
+ this.line++;
549
+ this.column = 0;
550
+ this.positionAtNewLine = this.position;
551
+ return NL_LIKE;
552
+ default:
553
+ // If we get here, then code < SPACE and it is not NL CR or TAB.
554
+ this.fail('disallowed character.');
555
+ return code;
556
+ }
557
+ }
558
+ if (code > 0xdbff) {
559
+ // This is a specialized version of isChar10 that takes into account
560
+ // that in this context code > 0xDBFF and code <= 0xFFFF. So it does not
561
+ // test cases that don't need testing.
562
+ if (!(code >= 0xe000 && code <= 0xfffd)) {
563
+ this.fail('disallowed character.');
564
+ }
565
+ return code;
566
+ }
567
+ var final = 0x10000 + (code - 0xd800) * 0x400 + (chunk.charCodeAt(i + 1) - 0xdc00);
568
+ this.i = i + 2;
569
+ // This is a specialized version of isChar10 that takes into account that in
570
+ // this context necessarily final >= 0x10000.
571
+ if (final > 0x10ffff) {
572
+ this.fail('disallowed character.');
573
+ }
574
+ return final;
575
+ };
576
+ /**
577
+ * Get a single code point out of the current chunk. This updates the current
578
+ * position if we do position tracking.
579
+ *
580
+ * This is the algorithm to use for XML 1.1.
581
+ *
582
+ * @returns {number} The character read.
583
+ */
584
+ SaxesParser.prototype.getCode11 = function () {
585
+ var _a = this, chunk = _a.chunk, i = _a.i;
586
+ this.prevI = i;
587
+ // Yes, we do this instead of doing this.i++. Doing it this way, we do not
588
+ // read this.i again, which is a bit faster.
589
+ this.i = i + 1;
590
+ if (i >= chunk.length) {
591
+ return EOC;
592
+ }
593
+ // Using charCodeAt and handling the surrogates ourselves is faster
594
+ // than using codePointAt.
595
+ var code = chunk.charCodeAt(i);
596
+ this.column++;
597
+ if (code < 0xd800) {
598
+ if ((code > 0x1f && code < 0x7f) ||
599
+ (code > 0x9f && code !== LS) ||
600
+ code === TAB) {
601
+ return code;
602
+ }
603
+ switch (code) {
604
+ case NL: // 0xA
605
+ this.line++;
606
+ this.column = 0;
607
+ this.positionAtNewLine = this.position;
608
+ return NL;
609
+ case CR: {
610
+ // 0xD
611
+ // We may get NaN if we read past the end of the chunk, which is
612
+ // fine.
613
+ var next = chunk.charCodeAt(i + 1);
614
+ if (next === NL || next === NEL) {
615
+ // A CR NL or CR NEL sequence is converted to NL so we have to skip
616
+ // over the next character. We already know it has a size of 1.
617
+ this.i = i + 2;
618
+ }
619
+ // Otherwise, a CR is just converted to NL, no skip.
620
+ }
621
+ /* yes, fall through */
622
+ case NEL: // 0x85
623
+ case LS: // Ox2028
624
+ this.line++;
625
+ this.column = 0;
626
+ this.positionAtNewLine = this.position;
627
+ return NL_LIKE;
628
+ default:
629
+ this.fail('disallowed character.');
630
+ return code;
631
+ }
632
+ }
633
+ if (code > 0xdbff) {
634
+ // This is a specialized version of isCharAndNotRestricted that takes into
635
+ // account that in this context code > 0xDBFF and code <= 0xFFFF. So it
636
+ // does not test cases that don't need testing.
637
+ if (!(code >= 0xe000 && code <= 0xfffd)) {
638
+ this.fail('disallowed character.');
639
+ }
640
+ return code;
641
+ }
642
+ var final = 0x10000 + (code - 0xd800) * 0x400 + (chunk.charCodeAt(i + 1) - 0xdc00);
643
+ this.i = i + 2;
644
+ // This is a specialized version of isCharAndNotRestricted that takes into
645
+ // account that in this context necessarily final >= 0x10000.
646
+ if (final > 0x10ffff) {
647
+ this.fail('disallowed character.');
648
+ }
649
+ return final;
650
+ };
651
+ /**
652
+ * Like ``getCode`` but with the return value normalized so that ``NL`` is
653
+ * returned for ``NL_LIKE``.
654
+ */
655
+ SaxesParser.prototype.getCodeNorm = function () {
656
+ var c = this.getCode();
657
+ return c === NL_LIKE ? NL : c;
658
+ };
659
+ SaxesParser.prototype.unget = function () {
660
+ this.i = this.prevI;
661
+ this.column--;
662
+ };
663
+ /**
664
+ * Capture characters into a buffer until encountering one of a set of
665
+ * characters.
666
+ *
667
+ * @param chars An array of codepoints. Encountering a character in the array
668
+ * ends the capture. (``chars`` may safely contain ``NL``.)
669
+ *
670
+ * @return The character code that made the capture end, or ``EOC`` if we hit
671
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
672
+ * instead.
673
+ */
674
+ SaxesParser.prototype.captureTo = function (chars) {
675
+ var start = this.i;
676
+ var chunk = this.chunk;
677
+ // eslint-disable-next-line no-constant-condition
678
+ while (true) {
679
+ var c = this.getCode();
680
+ var isNLLike = c === NL_LIKE;
681
+ var final = isNLLike ? NL : c;
682
+ if (final === EOC || chars.includes(final)) {
683
+ this.text += chunk.slice(start, this.prevI);
684
+ return final;
685
+ }
686
+ if (isNLLike) {
687
+ this.text += "".concat(chunk.slice(start, this.prevI), "\n");
688
+ start = this.i;
689
+ }
690
+ }
691
+ };
692
+ /**
693
+ * Capture characters into a buffer until encountering a character.
694
+ *
695
+ * @param char The codepoint that ends the capture. **NOTE ``char`` MAY NOT
696
+ * CONTAIN ``NL``.** Passing ``NL`` will result in buggy behavior.
697
+ *
698
+ * @return ``true`` if we ran into the character. Otherwise, we ran into the
699
+ * end of the current chunk.
700
+ */
701
+ SaxesParser.prototype.captureToChar = function (char) {
702
+ var start = this.i;
703
+ var chunk = this.chunk;
704
+ // eslint-disable-next-line no-constant-condition
705
+ while (true) {
706
+ var c = this.getCode();
707
+ switch (c) {
708
+ case NL_LIKE:
709
+ this.text += "".concat(chunk.slice(start, this.prevI), "\n");
710
+ start = this.i;
711
+ c = NL;
712
+ break;
713
+ case EOC:
714
+ this.text += chunk.slice(start);
715
+ return false;
716
+ }
717
+ if (c === char) {
718
+ this.text += chunk.slice(start, this.prevI);
719
+ return true;
720
+ }
721
+ }
722
+ };
723
+ /**
724
+ * Capture characters that satisfy ``isNameChar`` into the ``name`` field of
725
+ * this parser.
726
+ *
727
+ * @return The character code that made the test fail, or ``EOC`` if we hit
728
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
729
+ * instead.
730
+ */
731
+ SaxesParser.prototype.captureNameChars = function () {
732
+ var _a = this, chunk = _a.chunk, start = _a.i;
733
+ // eslint-disable-next-line no-constant-condition
734
+ while (true) {
735
+ var c = this.getCode();
736
+ if (c === EOC) {
737
+ this.name += chunk.slice(start);
738
+ return EOC;
739
+ }
740
+ // NL is not a name char so we don't have to test specifically for it.
741
+ if (!isNameChar(c)) {
742
+ this.name += chunk.slice(start, this.prevI);
743
+ return c === NL_LIKE ? NL : c;
744
+ }
745
+ }
746
+ };
747
+ /**
748
+ * Skip white spaces.
749
+ *
750
+ * @return The character that ended the skip, or ``EOC`` if we hit
751
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
752
+ * instead.
753
+ */
754
+ SaxesParser.prototype.skipSpaces = function () {
755
+ // eslint-disable-next-line no-constant-condition
756
+ while (true) {
757
+ var c = this.getCodeNorm();
758
+ if (c === EOC || !isS(c)) {
759
+ return c;
760
+ }
761
+ }
762
+ };
763
+ SaxesParser.prototype.setXMLVersion = function (version) {
764
+ this.currentXMLVersion = version;
765
+ /* eslint-disable @typescript-eslint/unbound-method */
766
+ if (version === '1.0') {
767
+ this.isChar = isChar10;
768
+ this.getCode = this.getCode10;
769
+ }
770
+ else {
771
+ this.isChar = isChar11;
772
+ this.getCode = this.getCode11;
773
+ }
774
+ /* eslint-enable @typescript-eslint/unbound-method */
775
+ };
776
+ // STATE ENGINE METHODS
777
+ // This needs to be a state separate from S_BEGIN_WHITESPACE because we want
778
+ // to be sure never to come back to this state later.
779
+ SaxesParser.prototype.sBegin = function () {
780
+ // We are essentially peeking at the first character of the chunk. Since
781
+ // S_BEGIN can be in effect only when we start working on the first chunk,
782
+ // the index at which we must look is necessarily 0. Note also that the
783
+ // following test does not depend on decoding surrogates.
784
+ // If the initial character is 0xFEFF, ignore it.
785
+ if (this.chunk.charCodeAt(0) === 0xfeff) {
786
+ this.i++;
787
+ this.column++;
788
+ }
789
+ this.state = S_BEGIN_WHITESPACE;
790
+ };
791
+ SaxesParser.prototype.sBeginWhitespace = function () {
792
+ // We need to know whether we've encountered spaces or not because as soon
793
+ // as we run into a space, an XML declaration is no longer possible. Rather
794
+ // than slow down skipSpaces even in places where we don't care whether it
795
+ // skipped anything or not, we check whether prevI is equal to the value of
796
+ // i from before we skip spaces.
797
+ var iBefore = this.i;
798
+ var c = this.skipSpaces();
799
+ if (this.prevI !== iBefore) {
800
+ this.xmlDeclPossible = false;
801
+ }
802
+ switch (c) {
803
+ case LESS:
804
+ this.state = S_OPEN_WAKA;
805
+ // We could naively call closeText but in this state, it is not normal
806
+ // to have text be filled with any data.
807
+ if (this.text.length !== 0) {
808
+ throw new Error('no-empty text at start');
809
+ }
810
+ break;
811
+ case EOC:
812
+ break;
813
+ default:
814
+ this.unget();
815
+ this.state = S_TEXT;
816
+ this.xmlDeclPossible = false;
817
+ }
818
+ };
819
+ SaxesParser.prototype.sDoctype = function () {
820
+ var _a;
821
+ var c = this.captureTo(DOCTYPE_TERMINATOR);
822
+ switch (c) {
823
+ case GREATER: {
824
+ (_a = this.doctypeHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
825
+ this.text = '';
826
+ this.state = S_TEXT;
827
+ this.doctype = true; // just remember that we saw it.
828
+ break;
829
+ }
830
+ case EOC:
831
+ break;
832
+ default:
833
+ this.text += String.fromCodePoint(c);
834
+ if (c === OPEN_BRACKET) {
835
+ this.state = S_DTD;
836
+ }
837
+ else if (isQuote(c)) {
838
+ this.state = S_DOCTYPE_QUOTE;
839
+ this.q = c;
840
+ }
841
+ }
842
+ };
843
+ SaxesParser.prototype.sDoctypeQuote = function () {
844
+ var q = this.q;
845
+ if (this.captureToChar(q)) {
846
+ this.text += String.fromCodePoint(q);
847
+ this.q = null;
848
+ this.state = S_DOCTYPE;
849
+ }
850
+ };
851
+ SaxesParser.prototype.sDTD = function () {
852
+ var c = this.captureTo(DTD_TERMINATOR);
853
+ if (c === EOC) {
854
+ return;
855
+ }
856
+ this.text += String.fromCodePoint(c);
857
+ if (c === CLOSE_BRACKET) {
858
+ this.state = S_DOCTYPE;
859
+ }
860
+ else if (c === LESS) {
861
+ this.state = S_DTD_OPEN_WAKA;
862
+ }
863
+ else if (isQuote(c)) {
864
+ this.state = S_DTD_QUOTED;
865
+ this.q = c;
866
+ }
867
+ };
868
+ SaxesParser.prototype.sDTDQuoted = function () {
869
+ var q = this.q;
870
+ if (this.captureToChar(q)) {
871
+ this.text += String.fromCodePoint(q);
872
+ this.state = S_DTD;
873
+ this.q = null;
874
+ }
875
+ };
876
+ SaxesParser.prototype.sDTDOpenWaka = function () {
877
+ var c = this.getCodeNorm();
878
+ this.text += String.fromCodePoint(c);
879
+ switch (c) {
880
+ case BANG:
881
+ this.state = S_DTD_OPEN_WAKA_BANG;
882
+ this.openWakaBang = '';
883
+ break;
884
+ case QUESTION:
885
+ this.state = S_DTD_PI;
886
+ break;
887
+ default:
888
+ this.state = S_DTD;
889
+ }
890
+ };
891
+ SaxesParser.prototype.sDTDOpenWakaBang = function () {
892
+ var char = String.fromCodePoint(this.getCodeNorm());
893
+ var owb = (this.openWakaBang += char);
894
+ this.text += char;
895
+ if (owb !== '-') {
896
+ this.state = owb === '--' ? S_DTD_COMMENT : S_DTD;
897
+ this.openWakaBang = '';
898
+ }
899
+ };
900
+ SaxesParser.prototype.sDTDComment = function () {
901
+ if (this.captureToChar(MINUS)) {
902
+ this.text += '-';
903
+ this.state = S_DTD_COMMENT_ENDING;
904
+ }
905
+ };
906
+ SaxesParser.prototype.sDTDCommentEnding = function () {
907
+ var c = this.getCodeNorm();
908
+ this.text += String.fromCodePoint(c);
909
+ this.state = c === MINUS ? S_DTD_COMMENT_ENDED : S_DTD_COMMENT;
910
+ };
911
+ SaxesParser.prototype.sDTDCommentEnded = function () {
912
+ var c = this.getCodeNorm();
913
+ this.text += String.fromCodePoint(c);
914
+ if (c === GREATER) {
915
+ this.state = S_DTD;
916
+ }
917
+ else {
918
+ this.fail('malformed comment.');
919
+ // <!-- blah -- bloo --> will be recorded as
920
+ // a comment of " blah -- bloo "
921
+ this.state = S_DTD_COMMENT;
922
+ }
923
+ };
924
+ SaxesParser.prototype.sDTDPI = function () {
925
+ if (this.captureToChar(QUESTION)) {
926
+ this.text += '?';
927
+ this.state = S_DTD_PI_ENDING;
928
+ }
929
+ };
930
+ SaxesParser.prototype.sDTDPIEnding = function () {
931
+ var c = this.getCodeNorm();
932
+ this.text += String.fromCodePoint(c);
933
+ if (c === GREATER) {
934
+ this.state = S_DTD;
935
+ }
936
+ };
937
+ SaxesParser.prototype.sText = function () {
938
+ //
939
+ // We did try a version of saxes where the S_TEXT state was split in two
940
+ // states: one for text inside the root element, and one for text
941
+ // outside. This was avoiding having to test this.tags.length to decide
942
+ // what implementation to actually use.
943
+ //
944
+ // Peformance testing on gigabyte-size files did not show any advantage to
945
+ // using the two states solution instead of the current one. Conversely, it
946
+ // made the code a bit more complicated elsewhere. For instance, a comment
947
+ // can appear before the root element so when a comment ended it was
948
+ // necessary to determine whether to return to the S_TEXT state or to the
949
+ // new text-outside-root state.
950
+ //
951
+ if (this.tags.length !== 0) {
952
+ this.handleTextInRoot();
953
+ }
954
+ else {
955
+ this.handleTextOutsideRoot();
956
+ }
957
+ };
958
+ SaxesParser.prototype.sEntity = function () {
959
+ // This is essentially a specialized version of captureToChar(SEMICOLON...)
960
+ var start = this.i;
961
+ var chunk = this.chunk;
962
+ // eslint-disable-next-line no-labels, no-restricted-syntax
963
+ // eslint-disable-next-line no-constant-condition
964
+ loop: while (true) {
965
+ switch (this.getCode()) {
966
+ case NL_LIKE:
967
+ this.entity += "".concat(chunk.slice(start, this.prevI), "\n");
968
+ start = this.i;
969
+ break;
970
+ case SEMICOLON: {
971
+ var entityReturnState = this.entityReturnState;
972
+ var entity = this.entity + chunk.slice(start, this.prevI);
973
+ this.state = entityReturnState;
974
+ var parsed = void 0;
975
+ if (entity === '') {
976
+ this.fail('empty entity name.');
977
+ parsed = '&;';
978
+ }
979
+ else {
980
+ parsed = this.parseEntity(entity);
981
+ this.entity = '';
982
+ }
983
+ if (entityReturnState !== S_TEXT || this.textHandler !== undefined) {
984
+ this.text += parsed;
985
+ }
986
+ // eslint-disable-next-line no-labels
987
+ break loop;
988
+ }
989
+ case EOC:
990
+ this.entity += chunk.slice(start);
991
+ // eslint-disable-next-line no-labels
992
+ break loop;
993
+ }
994
+ }
995
+ };
996
+ SaxesParser.prototype.sOpenWaka = function () {
997
+ // Reminder: a state handler is called with at least one character
998
+ // available in the current chunk. So the first call to get code inside of
999
+ // a state handler cannot return ``EOC``. That's why we don't test
1000
+ // for it.
1001
+ var c = this.getCode();
1002
+ // either a /, ?, !, or text is coming next.
1003
+ if (isNameStartChar(c)) {
1004
+ this.state = S_OPEN_TAG;
1005
+ this.unget();
1006
+ this.xmlDeclPossible = false;
1007
+ }
1008
+ else {
1009
+ switch (c) {
1010
+ case FORWARD_SLASH:
1011
+ this.state = S_CLOSE_TAG;
1012
+ this.xmlDeclPossible = false;
1013
+ break;
1014
+ case BANG:
1015
+ this.state = S_OPEN_WAKA_BANG;
1016
+ this.openWakaBang = '';
1017
+ this.xmlDeclPossible = false;
1018
+ break;
1019
+ case QUESTION:
1020
+ this.state = S_PI_FIRST_CHAR;
1021
+ break;
1022
+ default:
1023
+ this.fail('disallowed character in tag name');
1024
+ this.state = S_TEXT;
1025
+ this.xmlDeclPossible = false;
1026
+ }
1027
+ }
1028
+ };
1029
+ SaxesParser.prototype.sOpenWakaBang = function () {
1030
+ this.openWakaBang += String.fromCodePoint(this.getCodeNorm());
1031
+ switch (this.openWakaBang) {
1032
+ case '[CDATA[':
1033
+ if (!this.sawRoot && !this.reportedTextBeforeRoot) {
1034
+ this.fail('text data outside of root node.');
1035
+ this.reportedTextBeforeRoot = true;
1036
+ }
1037
+ if (this.closedRoot && !this.reportedTextAfterRoot) {
1038
+ this.fail('text data outside of root node.');
1039
+ this.reportedTextAfterRoot = true;
1040
+ }
1041
+ this.state = S_CDATA;
1042
+ this.openWakaBang = '';
1043
+ break;
1044
+ case '--':
1045
+ this.state = S_COMMENT;
1046
+ this.openWakaBang = '';
1047
+ break;
1048
+ case 'DOCTYPE':
1049
+ this.state = S_DOCTYPE;
1050
+ if (this.doctype || this.sawRoot) {
1051
+ this.fail('inappropriately located doctype declaration.');
1052
+ }
1053
+ this.openWakaBang = '';
1054
+ break;
1055
+ default:
1056
+ // 7 happens to be the maximum length of the string that can possibly
1057
+ // match one of the cases above.
1058
+ if (this.openWakaBang.length >= 7) {
1059
+ this.fail('incorrect syntax.');
1060
+ }
1061
+ }
1062
+ };
1063
+ SaxesParser.prototype.sComment = function () {
1064
+ if (this.captureToChar(MINUS)) {
1065
+ this.state = S_COMMENT_ENDING;
1066
+ }
1067
+ };
1068
+ SaxesParser.prototype.sCommentEnding = function () {
1069
+ var _a;
1070
+ var c = this.getCodeNorm();
1071
+ if (c === MINUS) {
1072
+ this.state = S_COMMENT_ENDED;
1073
+ (_a = this.commentHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
1074
+ this.text = '';
1075
+ }
1076
+ else {
1077
+ this.text += "-".concat(String.fromCodePoint(c));
1078
+ this.state = S_COMMENT;
1079
+ }
1080
+ };
1081
+ SaxesParser.prototype.sCommentEnded = function () {
1082
+ var c = this.getCodeNorm();
1083
+ if (c !== GREATER) {
1084
+ this.fail('malformed comment.');
1085
+ // <!-- blah -- bloo --> will be recorded as
1086
+ // a comment of " blah -- bloo "
1087
+ this.text += "--".concat(String.fromCodePoint(c));
1088
+ this.state = S_COMMENT;
1089
+ }
1090
+ else {
1091
+ this.state = S_TEXT;
1092
+ }
1093
+ };
1094
+ SaxesParser.prototype.sCData = function () {
1095
+ if (this.captureToChar(CLOSE_BRACKET)) {
1096
+ this.state = S_CDATA_ENDING;
1097
+ }
1098
+ };
1099
+ SaxesParser.prototype.sCDataEnding = function () {
1100
+ var c = this.getCodeNorm();
1101
+ if (c === CLOSE_BRACKET) {
1102
+ this.state = S_CDATA_ENDING_2;
1103
+ }
1104
+ else {
1105
+ this.text += "]".concat(String.fromCodePoint(c));
1106
+ this.state = S_CDATA;
1107
+ }
1108
+ };
1109
+ SaxesParser.prototype.sCDataEnding2 = function () {
1110
+ var _a;
1111
+ var c = this.getCodeNorm();
1112
+ switch (c) {
1113
+ case GREATER: {
1114
+ (_a = this.cdataHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
1115
+ this.text = '';
1116
+ this.state = S_TEXT;
1117
+ break;
1118
+ }
1119
+ case CLOSE_BRACKET:
1120
+ this.text += ']';
1121
+ break;
1122
+ default:
1123
+ this.text += "]]".concat(String.fromCodePoint(c));
1124
+ this.state = S_CDATA;
1125
+ }
1126
+ };
1127
+ // We need this separate state to check the first character fo the pi target
1128
+ // with this.nameStartCheck which allows less characters than this.nameCheck.
1129
+ SaxesParser.prototype.sPIFirstChar = function () {
1130
+ var c = this.getCodeNorm();
1131
+ // This is first because in the case where the file is well-formed this is
1132
+ // the branch taken. We optimize for well-formedness.
1133
+ if (this.nameStartCheck(c)) {
1134
+ this.piTarget += String.fromCodePoint(c);
1135
+ this.state = S_PI_REST;
1136
+ }
1137
+ else if (c === QUESTION || isS(c)) {
1138
+ this.fail('processing instruction without a target.');
1139
+ this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY;
1140
+ }
1141
+ else {
1142
+ this.fail('disallowed character in processing instruction name.');
1143
+ this.piTarget += String.fromCodePoint(c);
1144
+ this.state = S_PI_REST;
1145
+ }
1146
+ };
1147
+ SaxesParser.prototype.sPIRest = function () {
1148
+ // Capture characters into a piTarget while ``this.nameCheck`` run on the
1149
+ // character read returns true.
1150
+ var _a = this, chunk = _a.chunk, start = _a.i;
1151
+ // eslint-disable-next-line no-constant-condition
1152
+ while (true) {
1153
+ var c = this.getCodeNorm();
1154
+ if (c === EOC) {
1155
+ this.piTarget += chunk.slice(start);
1156
+ return;
1157
+ }
1158
+ // NL cannot satisfy this.nameCheck so we don't have to test specifically
1159
+ // for it.
1160
+ if (!this.nameCheck(c)) {
1161
+ this.piTarget += chunk.slice(start, this.prevI);
1162
+ var isQuestion = c === QUESTION;
1163
+ if (isQuestion || isS(c)) {
1164
+ if (this.piTarget === 'xml') {
1165
+ if (!this.xmlDeclPossible) {
1166
+ this.fail('an XML declaration must be at the start of the document.');
1167
+ }
1168
+ this.state = isQuestion ? S_XML_DECL_ENDING : S_XML_DECL_NAME_START;
1169
+ }
1170
+ else {
1171
+ this.state = isQuestion ? S_PI_ENDING : S_PI_BODY;
1172
+ }
1173
+ }
1174
+ else {
1175
+ this.fail('disallowed character in processing instruction name.');
1176
+ this.piTarget += String.fromCodePoint(c);
1177
+ }
1178
+ break;
1179
+ }
1180
+ }
1181
+ };
1182
+ SaxesParser.prototype.sPIBody = function () {
1183
+ if (this.text.length === 0) {
1184
+ var c = this.getCodeNorm();
1185
+ if (c === QUESTION) {
1186
+ this.state = S_PI_ENDING;
1187
+ }
1188
+ else if (!isS(c)) {
1189
+ this.text = String.fromCodePoint(c);
1190
+ }
1191
+ }
1192
+ // The question mark character is not valid inside any of the XML
1193
+ // declaration name/value pairs.
1194
+ else if (this.captureToChar(QUESTION)) {
1195
+ this.state = S_PI_ENDING;
1196
+ }
1197
+ };
1198
+ SaxesParser.prototype.sPIEnding = function () {
1199
+ var _a;
1200
+ var c = this.getCodeNorm();
1201
+ if (c === GREATER) {
1202
+ var piTarget = this.piTarget;
1203
+ if (piTarget.toLowerCase() === 'xml') {
1204
+ this.fail('the XML declaration must appear at the start of the document.');
1205
+ }
1206
+ (_a = this.piHandler) === null || _a === void 0 ? void 0 : _a.call(this, {
1207
+ target: piTarget,
1208
+ body: this.text
1209
+ });
1210
+ this.piTarget = this.text = '';
1211
+ this.state = S_TEXT;
1212
+ }
1213
+ else if (c === QUESTION) {
1214
+ // We ran into ?? as part of a processing instruction. We initially took
1215
+ // the first ? as a sign that the PI was ending, but it is not. So we have
1216
+ // to add it to the body but we take the new ? as a sign that the PI is
1217
+ // ending.
1218
+ this.text += '?';
1219
+ }
1220
+ else {
1221
+ this.text += "?".concat(String.fromCodePoint(c));
1222
+ this.state = S_PI_BODY;
1223
+ }
1224
+ this.xmlDeclPossible = false;
1225
+ };
1226
+ SaxesParser.prototype.sXMLDeclNameStart = function () {
1227
+ var c = this.skipSpaces();
1228
+ // The question mark character is not valid inside any of the XML
1229
+ // declaration name/value pairs.
1230
+ if (c === QUESTION) {
1231
+ // It is valid to go to S_XML_DECL_ENDING from this state.
1232
+ this.state = S_XML_DECL_ENDING;
1233
+ return;
1234
+ }
1235
+ if (c !== EOC) {
1236
+ this.state = S_XML_DECL_NAME;
1237
+ this.name = String.fromCodePoint(c);
1238
+ }
1239
+ };
1240
+ SaxesParser.prototype.sXMLDeclName = function () {
1241
+ var c = this.captureTo(XML_DECL_NAME_TERMINATOR);
1242
+ // The question mark character is not valid inside any of the XML
1243
+ // declaration name/value pairs.
1244
+ if (c === QUESTION) {
1245
+ this.state = S_XML_DECL_ENDING;
1246
+ this.name += this.text;
1247
+ this.text = '';
1248
+ this.fail('XML declaration is incomplete.');
1249
+ return;
1250
+ }
1251
+ if (!(isS(c) || c === EQUAL)) {
1252
+ return;
1253
+ }
1254
+ this.name += this.text;
1255
+ this.text = '';
1256
+ if (!this.xmlDeclExpects.includes(this.name)) {
1257
+ switch (this.name.length) {
1258
+ case 0:
1259
+ this.fail('did not expect any more name/value pairs.');
1260
+ break;
1261
+ case 1:
1262
+ this.fail("expected the name ".concat(this.xmlDeclExpects[0], "."));
1263
+ break;
1264
+ default:
1265
+ this.fail("expected one of ".concat(this.xmlDeclExpects.join(', ')));
1266
+ }
1267
+ }
1268
+ this.state = c === EQUAL ? S_XML_DECL_VALUE_START : S_XML_DECL_EQ;
1269
+ };
1270
+ SaxesParser.prototype.sXMLDeclEq = function () {
1271
+ var c = this.getCodeNorm();
1272
+ // The question mark character is not valid inside any of the XML
1273
+ // declaration name/value pairs.
1274
+ if (c === QUESTION) {
1275
+ this.state = S_XML_DECL_ENDING;
1276
+ this.fail('XML declaration is incomplete.');
1277
+ return;
1278
+ }
1279
+ if (isS(c)) {
1280
+ return;
1281
+ }
1282
+ if (c !== EQUAL) {
1283
+ this.fail('value required.');
1284
+ }
1285
+ this.state = S_XML_DECL_VALUE_START;
1286
+ };
1287
+ SaxesParser.prototype.sXMLDeclValueStart = function () {
1288
+ var c = this.getCodeNorm();
1289
+ // The question mark character is not valid inside any of the XML
1290
+ // declaration name/value pairs.
1291
+ if (c === QUESTION) {
1292
+ this.state = S_XML_DECL_ENDING;
1293
+ this.fail('XML declaration is incomplete.');
1294
+ return;
1295
+ }
1296
+ if (isS(c)) {
1297
+ return;
1298
+ }
1299
+ if (!isQuote(c)) {
1300
+ this.fail('value must be quoted.');
1301
+ this.q = SPACE;
1302
+ }
1303
+ else {
1304
+ this.q = c;
1305
+ }
1306
+ this.state = S_XML_DECL_VALUE;
1307
+ };
1308
+ SaxesParser.prototype.sXMLDeclValue = function () {
1309
+ var c = this.captureTo([this.q, QUESTION]);
1310
+ // The question mark character is not valid inside any of the XML
1311
+ // declaration name/value pairs.
1312
+ if (c === QUESTION) {
1313
+ this.state = S_XML_DECL_ENDING;
1314
+ this.text = '';
1315
+ this.fail('XML declaration is incomplete.');
1316
+ return;
1317
+ }
1318
+ if (c === EOC) {
1319
+ return;
1320
+ }
1321
+ var value = this.text;
1322
+ this.text = '';
1323
+ switch (this.name) {
1324
+ case 'version': {
1325
+ this.xmlDeclExpects = ['encoding', 'standalone'];
1326
+ var version = value;
1327
+ this.xmlDecl.version = version;
1328
+ // This is the test specified by XML 1.0 but it is fine for XML 1.1.
1329
+ if (!/^1\.[0-9]+$/.test(version)) {
1330
+ this.fail('version number must match /^1\\.[0-9]+$/.');
1331
+ }
1332
+ // When forceXMLVersion is set, the XML declaration is ignored.
1333
+ else if (!this.opt.forceXMLVersion) {
1334
+ this.setXMLVersion(version);
1335
+ }
1336
+ break;
1337
+ }
1338
+ case 'encoding':
1339
+ if (!/^[A-Za-z][A-Za-z0-9._-]*$/.test(value)) {
1340
+ this.fail('encoding value must match \
1341
+ /^[A-Za-z0-9][A-Za-z0-9._-]*$/.');
1342
+ }
1343
+ this.xmlDeclExpects = ['standalone'];
1344
+ this.xmlDecl.encoding = value;
1345
+ break;
1346
+ case 'standalone':
1347
+ if (value !== 'yes' && value !== 'no') {
1348
+ this.fail('standalone value must match "yes" or "no".');
1349
+ }
1350
+ this.xmlDeclExpects = [];
1351
+ this.xmlDecl.standalone = value;
1352
+ break;
1353
+ // We don't need to raise an error here since we've already raised one
1354
+ // when checking what name was expected.
1355
+ }
1356
+ this.name = '';
1357
+ this.state = S_XML_DECL_SEPARATOR;
1358
+ };
1359
+ SaxesParser.prototype.sXMLDeclSeparator = function () {
1360
+ var c = this.getCodeNorm();
1361
+ // The question mark character is not valid inside any of the XML
1362
+ // declaration name/value pairs.
1363
+ if (c === QUESTION) {
1364
+ // It is valid to go to S_XML_DECL_ENDING from this state.
1365
+ this.state = S_XML_DECL_ENDING;
1366
+ return;
1367
+ }
1368
+ if (!isS(c)) {
1369
+ this.fail('whitespace required.');
1370
+ this.unget();
1371
+ }
1372
+ this.state = S_XML_DECL_NAME_START;
1373
+ };
1374
+ SaxesParser.prototype.sXMLDeclEnding = function () {
1375
+ var _a;
1376
+ var c = this.getCodeNorm();
1377
+ if (c === GREATER) {
1378
+ if (this.piTarget !== 'xml') {
1379
+ this.fail('processing instructions are not allowed before root.');
1380
+ }
1381
+ else if (this.name !== 'version' &&
1382
+ this.xmlDeclExpects.includes('version')) {
1383
+ this.fail('XML declaration must contain a version.');
1384
+ }
1385
+ (_a = this.xmldeclHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.xmlDecl);
1386
+ this.name = '';
1387
+ this.piTarget = this.text = '';
1388
+ this.state = S_TEXT;
1389
+ }
1390
+ else {
1391
+ // We got here because the previous character was a ?, but the question
1392
+ // mark character is not valid inside any of the XML declaration
1393
+ // name/value pairs.
1394
+ this.fail('The character ? is disallowed anywhere in XML declarations.');
1395
+ }
1396
+ this.xmlDeclPossible = false;
1397
+ };
1398
+ SaxesParser.prototype.sOpenTag = function () {
1399
+ var _a;
1400
+ var c = this.captureNameChars();
1401
+ if (c === EOC) {
1402
+ return;
1403
+ }
1404
+ var tag = (this.tag = {
1405
+ name: this.name,
1406
+ attributes: Object.create(null)
1407
+ });
1408
+ this.name = '';
1409
+ if (this.xmlnsOpt) {
1410
+ this.topNS = tag.ns = Object.create(null);
1411
+ }
1412
+ (_a = this.openTagStartHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
1413
+ this.sawRoot = true;
1414
+ if (!this.fragmentOpt && this.closedRoot) {
1415
+ this.fail('documents may contain only one root.');
1416
+ }
1417
+ switch (c) {
1418
+ case GREATER:
1419
+ this.openTag();
1420
+ break;
1421
+ case FORWARD_SLASH:
1422
+ this.state = S_OPEN_TAG_SLASH;
1423
+ break;
1424
+ default:
1425
+ if (!isS(c)) {
1426
+ this.fail('disallowed character in tag name.');
1427
+ }
1428
+ this.state = S_ATTRIB;
1429
+ }
1430
+ };
1431
+ SaxesParser.prototype.sOpenTagSlash = function () {
1432
+ if (this.getCode() === GREATER) {
1433
+ this.openSelfClosingTag();
1434
+ }
1435
+ else {
1436
+ this.fail('forward-slash in opening tag not followed by >.');
1437
+ this.state = S_ATTRIB;
1438
+ }
1439
+ };
1440
+ SaxesParser.prototype.sAttrib = function () {
1441
+ var c = this.skipSpaces();
1442
+ if (c === EOC) {
1443
+ return;
1444
+ }
1445
+ if (isNameStartChar(c)) {
1446
+ this.unget();
1447
+ this.state = S_ATTRIB_NAME;
1448
+ }
1449
+ else if (c === GREATER) {
1450
+ this.openTag();
1451
+ }
1452
+ else if (c === FORWARD_SLASH) {
1453
+ this.state = S_OPEN_TAG_SLASH;
1454
+ }
1455
+ else {
1456
+ this.fail('disallowed character in attribute name.');
1457
+ }
1458
+ };
1459
+ SaxesParser.prototype.sAttribName = function () {
1460
+ var c = this.captureNameChars();
1461
+ if (c === EQUAL) {
1462
+ this.state = S_ATTRIB_VALUE;
1463
+ }
1464
+ else if (isS(c)) {
1465
+ this.state = S_ATTRIB_NAME_SAW_WHITE;
1466
+ }
1467
+ else if (c === GREATER) {
1468
+ this.fail('attribute without value.');
1469
+ this.pushAttrib(this.name, this.name);
1470
+ this.name = this.text = '';
1471
+ this.openTag();
1472
+ }
1473
+ else if (c !== EOC) {
1474
+ this.fail('disallowed character in attribute name.');
1475
+ }
1476
+ };
1477
+ SaxesParser.prototype.sAttribNameSawWhite = function () {
1478
+ var c = this.skipSpaces();
1479
+ switch (c) {
1480
+ case EOC:
1481
+ return;
1482
+ case EQUAL:
1483
+ this.state = S_ATTRIB_VALUE;
1484
+ break;
1485
+ default:
1486
+ this.fail('attribute without value.');
1487
+ // Should we do this???
1488
+ // this.tag.attributes[this.name] = "";
1489
+ this.text = '';
1490
+ this.name = '';
1491
+ if (c === GREATER) {
1492
+ this.openTag();
1493
+ }
1494
+ else if (isNameStartChar(c)) {
1495
+ this.unget();
1496
+ this.state = S_ATTRIB_NAME;
1497
+ }
1498
+ else {
1499
+ this.fail('disallowed character in attribute name.');
1500
+ this.state = S_ATTRIB;
1501
+ }
1502
+ }
1503
+ };
1504
+ SaxesParser.prototype.sAttribValue = function () {
1505
+ var c = this.getCodeNorm();
1506
+ if (isQuote(c)) {
1507
+ this.q = c;
1508
+ this.state = S_ATTRIB_VALUE_QUOTED;
1509
+ }
1510
+ else if (!isS(c)) {
1511
+ this.fail('unquoted attribute value.');
1512
+ this.state = S_ATTRIB_VALUE_UNQUOTED;
1513
+ this.unget();
1514
+ }
1515
+ };
1516
+ SaxesParser.prototype.sAttribValueQuoted = function () {
1517
+ // We deliberately do not use captureTo here. The specialized code we use
1518
+ // here is faster than using captureTo.
1519
+ var _a = this, q = _a.q, chunk = _a.chunk;
1520
+ var start = this.i;
1521
+ // eslint-disable-next-line no-constant-condition
1522
+ while (true) {
1523
+ switch (this.getCode()) {
1524
+ case q:
1525
+ this.pushAttrib(this.name, this.text + chunk.slice(start, this.prevI));
1526
+ this.name = this.text = '';
1527
+ this.q = null;
1528
+ this.state = S_ATTRIB_VALUE_CLOSED;
1529
+ return;
1530
+ case AMP:
1531
+ this.text += chunk.slice(start, this.prevI);
1532
+ this.state = S_ENTITY;
1533
+ this.entityReturnState = S_ATTRIB_VALUE_QUOTED;
1534
+ return;
1535
+ case NL:
1536
+ case NL_LIKE:
1537
+ case TAB:
1538
+ this.text += "".concat(chunk.slice(start, this.prevI), " ");
1539
+ start = this.i;
1540
+ break;
1541
+ case LESS:
1542
+ this.text += chunk.slice(start, this.prevI);
1543
+ this.fail('disallowed character.');
1544
+ return;
1545
+ case EOC:
1546
+ this.text += chunk.slice(start);
1547
+ return;
1548
+ }
1549
+ }
1550
+ };
1551
+ SaxesParser.prototype.sAttribValueClosed = function () {
1552
+ var c = this.getCodeNorm();
1553
+ if (isS(c)) {
1554
+ this.state = S_ATTRIB;
1555
+ }
1556
+ else if (c === GREATER) {
1557
+ this.openTag();
1558
+ }
1559
+ else if (c === FORWARD_SLASH) {
1560
+ this.state = S_OPEN_TAG_SLASH;
1561
+ }
1562
+ else if (isNameStartChar(c)) {
1563
+ this.fail('no whitespace between attributes.');
1564
+ this.unget();
1565
+ this.state = S_ATTRIB_NAME;
1566
+ }
1567
+ else {
1568
+ this.fail('disallowed character in attribute name.');
1569
+ }
1570
+ };
1571
+ SaxesParser.prototype.sAttribValueUnquoted = function () {
1572
+ // We don't do anything regarding EOL or space handling for unquoted
1573
+ // attributes. We already have failed by the time we get here, and the
1574
+ // contract that saxes upholds states that upon failure, it is not safe to
1575
+ // rely on the data passed to event handlers (other than
1576
+ // ``onerror``). Passing "bad" data is not a problem.
1577
+ var c = this.captureTo(ATTRIB_VALUE_UNQUOTED_TERMINATOR);
1578
+ switch (c) {
1579
+ case AMP:
1580
+ this.state = S_ENTITY;
1581
+ this.entityReturnState = S_ATTRIB_VALUE_UNQUOTED;
1582
+ break;
1583
+ case LESS:
1584
+ this.fail('disallowed character.');
1585
+ break;
1586
+ case EOC:
1587
+ break;
1588
+ default:
1589
+ if (this.text.includes(']]>')) {
1590
+ this.fail('the string "]]>" is disallowed in char data.');
1591
+ }
1592
+ this.pushAttrib(this.name, this.text);
1593
+ this.name = this.text = '';
1594
+ if (c === GREATER) {
1595
+ this.openTag();
1596
+ }
1597
+ else {
1598
+ this.state = S_ATTRIB;
1599
+ }
1600
+ }
1601
+ };
1602
+ SaxesParser.prototype.sCloseTag = function () {
1603
+ var c = this.captureNameChars();
1604
+ if (c === GREATER) {
1605
+ this.closeTag();
1606
+ }
1607
+ else if (isS(c)) {
1608
+ this.state = S_CLOSE_TAG_SAW_WHITE;
1609
+ }
1610
+ else if (c !== EOC) {
1611
+ this.fail('disallowed character in closing tag.');
1612
+ }
1613
+ };
1614
+ SaxesParser.prototype.sCloseTagSawWhite = function () {
1615
+ switch (this.skipSpaces()) {
1616
+ case GREATER:
1617
+ this.closeTag();
1618
+ break;
1619
+ case EOC:
1620
+ break;
1621
+ default:
1622
+ this.fail('disallowed character in closing tag.');
1623
+ }
1624
+ };
1625
+ // END OF STATE ENGINE METHODS
1626
+ SaxesParser.prototype.handleTextInRoot = function () {
1627
+ // This is essentially a specialized version of captureTo which is optimized
1628
+ // for performing the ]]> check. A previous version of this code, checked
1629
+ // ``this.text`` for the presence of ]]>. It simplified the code but was
1630
+ // very costly when character data contained a lot of entities to be parsed.
1631
+ //
1632
+ // Since we are using a specialized loop, we also keep track of the presence
1633
+ // of ]]> in text data. The sequence ]]> is forbidden to appear as-is.
1634
+ //
1635
+ var _a = this, start = _a.i, forbiddenState = _a.forbiddenState;
1636
+ var _b = this, chunk = _b.chunk, handler = _b.textHandler;
1637
+ // eslint-disable-next-line no-labels, no-restricted-syntax
1638
+ // eslint-disable-next-line no-constant-condition
1639
+ scanLoop: while (true) {
1640
+ switch (this.getCode()) {
1641
+ case LESS: {
1642
+ this.state = S_OPEN_WAKA;
1643
+ if (handler !== undefined) {
1644
+ var text = this.text;
1645
+ var slice = chunk.slice(start, this.prevI);
1646
+ if (text.length !== 0) {
1647
+ handler(text + slice);
1648
+ this.text = '';
1649
+ }
1650
+ else if (slice.length !== 0) {
1651
+ handler(slice);
1652
+ }
1653
+ }
1654
+ forbiddenState = FORBIDDEN_START;
1655
+ // eslint-disable-next-line no-labels
1656
+ break scanLoop;
1657
+ }
1658
+ case AMP:
1659
+ this.state = S_ENTITY;
1660
+ this.entityReturnState = S_TEXT;
1661
+ if (handler !== undefined) {
1662
+ this.text += chunk.slice(start, this.prevI);
1663
+ }
1664
+ forbiddenState = FORBIDDEN_START;
1665
+ // eslint-disable-next-line no-labels
1666
+ break scanLoop;
1667
+ case CLOSE_BRACKET:
1668
+ switch (forbiddenState) {
1669
+ case FORBIDDEN_START:
1670
+ forbiddenState = FORBIDDEN_BRACKET;
1671
+ break;
1672
+ case FORBIDDEN_BRACKET:
1673
+ forbiddenState = FORBIDDEN_BRACKET_BRACKET;
1674
+ break;
1675
+ case FORBIDDEN_BRACKET_BRACKET:
1676
+ break;
1677
+ default:
1678
+ throw new Error('impossible state');
1679
+ }
1680
+ break;
1681
+ case GREATER:
1682
+ if (forbiddenState === FORBIDDEN_BRACKET_BRACKET) {
1683
+ this.fail('the string "]]>" is disallowed in char data.');
1684
+ }
1685
+ forbiddenState = FORBIDDEN_START;
1686
+ break;
1687
+ case NL_LIKE:
1688
+ if (handler !== undefined) {
1689
+ this.text += "".concat(chunk.slice(start, this.prevI), "\n");
1690
+ }
1691
+ start = this.i;
1692
+ forbiddenState = FORBIDDEN_START;
1693
+ break;
1694
+ case EOC:
1695
+ if (handler !== undefined) {
1696
+ this.text += chunk.slice(start);
1697
+ }
1698
+ // eslint-disable-next-line no-labels
1699
+ break scanLoop;
1700
+ default:
1701
+ forbiddenState = FORBIDDEN_START;
1702
+ }
1703
+ }
1704
+ this.forbiddenState = forbiddenState;
1705
+ };
1706
+ SaxesParser.prototype.handleTextOutsideRoot = function () {
1707
+ // This is essentially a specialized version of captureTo which is optimized
1708
+ // for a specialized task. We keep track of the presence of non-space
1709
+ // characters in the text since these are errors when appearing outside the
1710
+ // document root element.
1711
+ var start = this.i;
1712
+ var _a = this, chunk = _a.chunk, handler = _a.textHandler;
1713
+ var nonSpace = false;
1714
+ // eslint-disable-next-line no-labels, no-restricted-syntax
1715
+ // eslint-disable-next-line no-constant-condition
1716
+ outRootLoop: while (true) {
1717
+ var code = this.getCode();
1718
+ switch (code) {
1719
+ case LESS: {
1720
+ this.state = S_OPEN_WAKA;
1721
+ if (handler !== undefined) {
1722
+ var text = this.text;
1723
+ var slice = chunk.slice(start, this.prevI);
1724
+ if (text.length !== 0) {
1725
+ handler(text + slice);
1726
+ this.text = '';
1727
+ }
1728
+ else if (slice.length !== 0) {
1729
+ handler(slice);
1730
+ }
1731
+ }
1732
+ // eslint-disable-next-line no-labels
1733
+ break outRootLoop;
1734
+ }
1735
+ case AMP:
1736
+ this.state = S_ENTITY;
1737
+ this.entityReturnState = S_TEXT;
1738
+ if (handler !== undefined) {
1739
+ this.text += chunk.slice(start, this.prevI);
1740
+ }
1741
+ nonSpace = true;
1742
+ // eslint-disable-next-line no-labels
1743
+ break outRootLoop;
1744
+ case NL_LIKE:
1745
+ if (handler !== undefined) {
1746
+ this.text += "".concat(chunk.slice(start, this.prevI), "\n");
1747
+ }
1748
+ start = this.i;
1749
+ break;
1750
+ case EOC:
1751
+ if (handler !== undefined) {
1752
+ this.text += chunk.slice(start);
1753
+ }
1754
+ // eslint-disable-next-line no-labels
1755
+ break outRootLoop;
1756
+ default:
1757
+ if (!isS(code)) {
1758
+ nonSpace = true;
1759
+ }
1760
+ }
1761
+ }
1762
+ if (!nonSpace) {
1763
+ return;
1764
+ }
1765
+ // We use the reportedTextBeforeRoot and reportedTextAfterRoot flags
1766
+ // to avoid reporting errors for every single character that is out of
1767
+ // place.
1768
+ if (!this.sawRoot && !this.reportedTextBeforeRoot) {
1769
+ this.fail('text data outside of root node.');
1770
+ this.reportedTextBeforeRoot = true;
1771
+ }
1772
+ if (this.closedRoot && !this.reportedTextAfterRoot) {
1773
+ this.fail('text data outside of root node.');
1774
+ this.reportedTextAfterRoot = true;
1775
+ }
1776
+ };
1777
+ SaxesParser.prototype.pushAttribNS = function (name, value) {
1778
+ var _a;
1779
+ var _b = this.qname(name), prefix = _b.prefix, local = _b.local;
1780
+ var attr = { name: name, prefix: prefix, local: local, value: value };
1781
+ this.attribList.push(attr);
1782
+ (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);
1783
+ if (prefix === 'xmlns') {
1784
+ var trimmed = value.trim();
1785
+ if (this.currentXMLVersion === '1.0' && trimmed === '') {
1786
+ this.fail('invalid attempt to undefine prefix in XML 1.0');
1787
+ }
1788
+ this.topNS[local] = trimmed;
1789
+ nsPairCheck(this, local, trimmed);
1790
+ }
1791
+ else if (name === 'xmlns') {
1792
+ var trimmed = value.trim();
1793
+ this.topNS[''] = trimmed;
1794
+ nsPairCheck(this, '', trimmed);
1795
+ }
1796
+ };
1797
+ SaxesParser.prototype.pushAttribPlain = function (name, value) {
1798
+ var _a;
1799
+ var attr = { name: name, value: value };
1800
+ this.attribList.push(attr);
1801
+ (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);
1802
+ };
1803
+ /**
1804
+ * End parsing. This performs final well-formedness checks and resets the
1805
+ * parser to a clean state.
1806
+ *
1807
+ * @returns this
1808
+ */
1809
+ SaxesParser.prototype.end = function () {
1810
+ var _a, _b;
1811
+ if (!this.sawRoot) {
1812
+ this.fail('document must contain a root element.');
1813
+ }
1814
+ var tags = this.tags;
1815
+ while (tags.length > 0) {
1816
+ var tag = tags.pop();
1817
+ this.fail("unclosed tag: ".concat(tag.name));
1818
+ }
1819
+ if (this.state !== S_BEGIN && this.state !== S_TEXT) {
1820
+ this.fail('unexpected end.');
1821
+ }
1822
+ var text = this.text;
1823
+ if (text.length !== 0) {
1824
+ (_a = this.textHandler) === null || _a === void 0 ? void 0 : _a.call(this, text);
1825
+ this.text = '';
1826
+ }
1827
+ this._closed = true;
1828
+ (_b = this.endHandler) === null || _b === void 0 ? void 0 : _b.call(this);
1829
+ this._init();
1830
+ return this;
1831
+ };
1832
+ /**
1833
+ * Resolve a namespace prefix.
1834
+ *
1835
+ * @param prefix The prefix to resolve.
1836
+ *
1837
+ * @returns The namespace URI or ``undefined`` if the prefix is not defined.
1838
+ */
1839
+ SaxesParser.prototype.resolve = function (prefix) {
1840
+ var _a, _b;
1841
+ var uri = this.topNS[prefix];
1842
+ if (uri !== undefined) {
1843
+ return uri;
1844
+ }
1845
+ var tags = this.tags;
1846
+ for (var index = tags.length - 1; index >= 0; index--) {
1847
+ uri = tags[index].ns[prefix];
1848
+ if (uri !== undefined) {
1849
+ return uri;
1850
+ }
1851
+ }
1852
+ uri = this.ns[prefix];
1853
+ if (uri !== undefined) {
1854
+ return uri;
1855
+ }
1856
+ return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);
1857
+ };
1858
+ /**
1859
+ * Parse a qname into its prefix and local name parts.
1860
+ *
1861
+ * @param name The name to parse
1862
+ *
1863
+ * @returns
1864
+ */
1865
+ SaxesParser.prototype.qname = function (name) {
1866
+ // This is faster than using name.split(":").
1867
+ var colon = name.indexOf(':');
1868
+ if (colon === -1) {
1869
+ return { prefix: '', local: name };
1870
+ }
1871
+ var local = name.slice(colon + 1);
1872
+ var prefix = name.slice(0, colon);
1873
+ if (prefix === '' || local === '' || local.includes(':')) {
1874
+ this.fail("malformed name: ".concat(name, "."));
1875
+ }
1876
+ return { prefix: prefix, local: local };
1877
+ };
1878
+ SaxesParser.prototype.processAttribsNS = function () {
1879
+ var e_2, _a;
1880
+ var _b;
1881
+ var attribList = this.attribList;
1882
+ var tag = this.tag;
1883
+ {
1884
+ // add namespace info to tag
1885
+ var _c = this.qname(tag.name), prefix = _c.prefix, local = _c.local;
1886
+ tag.prefix = prefix;
1887
+ tag.local = local;
1888
+ var uri = (tag.uri = (_b = this.resolve(prefix)) !== null && _b !== void 0 ? _b : '');
1889
+ if (prefix !== '') {
1890
+ if (prefix === 'xmlns') {
1891
+ this.fail('tags may not have "xmlns" as prefix.');
1892
+ }
1893
+ if (uri === '') {
1894
+ this.fail("unbound namespace prefix: ".concat(JSON.stringify(prefix), "."));
1895
+ tag.uri = prefix;
1896
+ }
1897
+ }
1898
+ }
1899
+ if (attribList.length === 0) {
1900
+ return;
1901
+ }
1902
+ var attributes = tag.attributes;
1903
+ var seen = new Set();
1904
+ try {
1905
+ // Note: do not apply default ns to attributes:
1906
+ // http://www.w3.org/TR/REC-xml-names/#defaulting
1907
+ for (var _d = __values(attribList), _e = _d.next(); !_e.done; _e = _d.next()) {
1908
+ var attr = _e.value;
1909
+ var name_1 = attr.name, prefix = attr.prefix, local = attr.local;
1910
+ var uri = void 0;
1911
+ var eqname = void 0;
1912
+ if (prefix === '') {
1913
+ uri = name_1 === 'xmlns' ? XMLNS_NAMESPACE : '';
1914
+ eqname = name_1;
1915
+ }
1916
+ else {
1917
+ uri = this.resolve(prefix);
1918
+ // if there's any attributes with an undefined namespace,
1919
+ // then fail on them now.
1920
+ if (uri === undefined) {
1921
+ this.fail("unbound namespace prefix: ".concat(JSON.stringify(prefix), "."));
1922
+ uri = prefix;
1923
+ }
1924
+ eqname = "{".concat(uri, "}").concat(local);
1925
+ }
1926
+ if (seen.has(eqname)) {
1927
+ this.fail("duplicate attribute: ".concat(eqname, "."));
1928
+ }
1929
+ seen.add(eqname);
1930
+ attr.uri = uri;
1931
+ attributes[name_1] = attr;
1932
+ }
1933
+ }
1934
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1935
+ finally {
1936
+ try {
1937
+ if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
1938
+ }
1939
+ finally { if (e_2) throw e_2.error; }
1940
+ }
1941
+ this.attribList = [];
1942
+ };
1943
+ SaxesParser.prototype.processAttribsPlain = function () {
1944
+ var e_3, _a;
1945
+ var attribList = this.attribList;
1946
+ // eslint-disable-next-line prefer-destructuring
1947
+ var attributes = this.tag.attributes;
1948
+ try {
1949
+ for (var attribList_1 = __values(attribList), attribList_1_1 = attribList_1.next(); !attribList_1_1.done; attribList_1_1 = attribList_1.next()) {
1950
+ var _b = attribList_1_1.value, name_2 = _b.name, value = _b.value;
1951
+ if (attributes[name_2] !== undefined) {
1952
+ this.fail("duplicate attribute: ".concat(name_2, "."));
1953
+ }
1954
+ attributes[name_2] = value;
1955
+ }
1956
+ }
1957
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1958
+ finally {
1959
+ try {
1960
+ if (attribList_1_1 && !attribList_1_1.done && (_a = attribList_1.return)) _a.call(attribList_1);
1961
+ }
1962
+ finally { if (e_3) throw e_3.error; }
1963
+ }
1964
+ this.attribList = [];
1965
+ };
1966
+ /**
1967
+ * Handle a complete open tag. This parser code calls this once it has seen
1968
+ * the whole tag. This method checks for well-formeness and then emits
1969
+ * ``onopentag``.
1970
+ */
1971
+ SaxesParser.prototype.openTag = function () {
1972
+ var _a;
1973
+ this.processAttribs();
1974
+ var tags = this.tags;
1975
+ var tag = this.tag;
1976
+ tag.isSelfClosing = false;
1977
+ // There cannot be any pending text here due to the onopentagstart that was
1978
+ // necessarily emitted before we get here. So we do not check text.
1979
+ (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
1980
+ tags.push(tag);
1981
+ this.state = S_TEXT;
1982
+ this.name = '';
1983
+ };
1984
+ /**
1985
+ * Handle a complete self-closing tag. This parser code calls this once it has
1986
+ * seen the whole tag. This method checks for well-formeness and then emits
1987
+ * ``onopentag`` and ``onclosetag``.
1988
+ */
1989
+ SaxesParser.prototype.openSelfClosingTag = function () {
1990
+ var _a, _b, _c;
1991
+ this.processAttribs();
1992
+ var tags = this.tags;
1993
+ var tag = this.tag;
1994
+ tag.isSelfClosing = true;
1995
+ // There cannot be any pending text here due to the onopentagstart that was
1996
+ // necessarily emitted before we get here. So we do not check text.
1997
+ (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
1998
+ (_b = this.closeTagHandler) === null || _b === void 0 ? void 0 : _b.call(this, tag);
1999
+ var top = (this.tag = (_c = tags[tags.length - 1]) !== null && _c !== void 0 ? _c : null);
2000
+ if (top === null) {
2001
+ this.closedRoot = true;
2002
+ }
2003
+ this.state = S_TEXT;
2004
+ this.name = '';
2005
+ };
2006
+ /**
2007
+ * Handle a complete close tag. This parser code calls this once it has seen
2008
+ * the whole tag. This method checks for well-formeness and then emits
2009
+ * ``onclosetag``.
2010
+ */
2011
+ SaxesParser.prototype.closeTag = function () {
2012
+ var _a = this, tags = _a.tags, name = _a.name;
2013
+ // Our state after this will be S_TEXT, no matter what, and we can clear
2014
+ // tagName now.
2015
+ this.state = S_TEXT;
2016
+ this.name = '';
2017
+ if (name === '') {
2018
+ this.fail('weird empty close tag.');
2019
+ this.text += '</>';
2020
+ return;
2021
+ }
2022
+ var handler = this.closeTagHandler;
2023
+ var l = tags.length;
2024
+ while (l-- > 0) {
2025
+ var tag = (this.tag = tags.pop());
2026
+ this.topNS = tag.ns;
2027
+ handler === null || handler === void 0 ? void 0 : handler(tag);
2028
+ if (tag.name === name) {
2029
+ break;
2030
+ }
2031
+ this.fail('unexpected close tag.');
2032
+ }
2033
+ if (l === 0) {
2034
+ this.closedRoot = true;
2035
+ }
2036
+ else if (l < 0) {
2037
+ this.fail("unmatched closing tag: ".concat(name, "."));
2038
+ this.text += "</".concat(name, ">");
2039
+ }
2040
+ };
2041
+ /**
2042
+ * Resolves an entity. Makes any necessary well-formedness checks.
2043
+ *
2044
+ * @param entity The entity to resolve.
2045
+ *
2046
+ * @returns The parsed entity.
2047
+ */
2048
+ SaxesParser.prototype.parseEntity = function (entity) {
2049
+ // startsWith would be significantly slower for this test.
2050
+ if (entity[0] !== '#') {
2051
+ var defined = this.ENTITIES[entity];
2052
+ if (defined !== undefined) {
2053
+ return defined;
2054
+ }
2055
+ this.fail(this.isName(entity)
2056
+ ? 'undefined entity.'
2057
+ : 'disallowed character in entity name.');
2058
+ return "&".concat(entity, ";");
2059
+ }
2060
+ var num = NaN;
2061
+ if (entity[1] === 'x' && /^#x[0-9a-f]+$/i.test(entity)) {
2062
+ num = parseInt(entity.slice(2), 16);
2063
+ }
2064
+ else if (/^#[0-9]+$/.test(entity)) {
2065
+ num = parseInt(entity.slice(1), 10);
2066
+ }
2067
+ // The character reference is required to match the CHAR production.
2068
+ if (!this.isChar(num)) {
2069
+ this.fail('malformed character entity.');
2070
+ return "&".concat(entity, ";");
2071
+ }
2072
+ return String.fromCodePoint(num);
2073
+ };
2074
+ return SaxesParser;
2075
+ }());
2076
+
2077
+ export { SaxesParser };