omni-viewer-core 0.1.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 (387) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -0
  3. package/THIRD_PARTY_NOTICES.md +49 -0
  4. package/dist/assets/audio-engine/audio_engine.mjs +2 -0
  5. package/dist/assets/audio-engine/audio_engine.wasm +0 -0
  6. package/dist/assets/pdfjs/pdf.worker.min.mjs +21 -0
  7. package/dist/host/index.d.ts +133 -0
  8. package/dist/host/index.js +10 -0
  9. package/dist/i18n/catalog.en.d.ts +1 -0
  10. package/dist/i18n/catalog.en.js +411 -0
  11. package/dist/i18n/catalog.ko.d.ts +1 -0
  12. package/dist/i18n/catalog.ko.js +68 -0
  13. package/dist/i18n/index.d.ts +18 -0
  14. package/dist/i18n/index.js +41 -0
  15. package/dist/licenses/emscripten.txt +101 -0
  16. package/dist/licenses/kissfft.txt +28 -0
  17. package/dist/licenses/pdfjs-dist.txt +177 -0
  18. package/dist/parsers/a2l/index.d.ts +1 -0
  19. package/dist/parsers/a2l/index.js +1 -0
  20. package/dist/parsers/archive/index.d.ts +22 -0
  21. package/dist/parsers/archive/index.js +46 -0
  22. package/dist/parsers/archive/model.d.ts +29 -0
  23. package/dist/parsers/archive/model.js +1 -0
  24. package/dist/parsers/archive/worker.d.ts +21 -0
  25. package/dist/parsers/archive/worker.js +1 -0
  26. package/dist/parsers/arxml/index.d.ts +1 -0
  27. package/dist/parsers/arxml/index.js +1 -0
  28. package/dist/parsers/asc/index.d.ts +1 -0
  29. package/dist/parsers/asc/index.js +1 -0
  30. package/dist/parsers/audio/index.d.ts +9 -0
  31. package/dist/parsers/audio/index.js +46 -0
  32. package/dist/parsers/automotive/index.d.ts +33 -0
  33. package/dist/parsers/automotive/index.js +973 -0
  34. package/dist/parsers/blf/index.d.ts +1 -0
  35. package/dist/parsers/blf/index.js +1 -0
  36. package/dist/parsers/csv/delimiter.d.ts +31 -0
  37. package/dist/parsers/csv/delimiter.js +151 -0
  38. package/dist/parsers/csv/index.d.ts +30 -0
  39. package/dist/parsers/csv/index.js +108 -0
  40. package/dist/parsers/csv/parseText.d.ts +20 -0
  41. package/dist/parsers/csv/parseText.js +108 -0
  42. package/dist/parsers/csv/sort.d.ts +26 -0
  43. package/dist/parsers/csv/sort.js +224 -0
  44. package/dist/parsers/csv/statistics.d.ts +49 -0
  45. package/dist/parsers/csv/statistics.js +150 -0
  46. package/dist/parsers/dbc/index.d.ts +56 -0
  47. package/dist/parsers/dbc/index.js +94 -0
  48. package/dist/parsers/doc-binary/index.d.ts +35 -0
  49. package/dist/parsers/doc-binary/index.js +267 -0
  50. package/dist/parsers/doc-binary/vscode-parser.d.ts +142 -0
  51. package/dist/parsers/doc-binary/vscode-parser.js +3747 -0
  52. package/dist/parsers/excel/index.d.ts +17 -0
  53. package/dist/parsers/excel/index.js +406 -0
  54. package/dist/parsers/excel/model.d.ts +80 -0
  55. package/dist/parsers/excel/model.js +48 -0
  56. package/dist/parsers/excel/serialize.d.ts +3 -0
  57. package/dist/parsers/excel/serialize.js +78 -0
  58. package/dist/parsers/hdf5/index.d.ts +75 -0
  59. package/dist/parsers/hdf5/index.js +658 -0
  60. package/dist/parsers/hdf5/node.d.ts +21 -0
  61. package/dist/parsers/hdf5/node.js +95 -0
  62. package/dist/parsers/json/index.d.ts +15 -0
  63. package/dist/parsers/json/index.js +102 -0
  64. package/dist/parsers/json/model.d.ts +42 -0
  65. package/dist/parsers/json/model.js +140 -0
  66. package/dist/parsers/json/parse.d.ts +22 -0
  67. package/dist/parsers/json/parse.js +279 -0
  68. package/dist/parsers/json/tokenizer.d.ts +17 -0
  69. package/dist/parsers/json/tokenizer.js +175 -0
  70. package/dist/parsers/jsonl/index.d.ts +14 -0
  71. package/dist/parsers/jsonl/index.js +18 -0
  72. package/dist/parsers/jsonl/model.d.ts +23 -0
  73. package/dist/parsers/jsonl/model.js +1 -0
  74. package/dist/parsers/jsonl/parse.d.ts +7 -0
  75. package/dist/parsers/jsonl/parse.js +34 -0
  76. package/dist/parsers/markdown/index.d.ts +37 -0
  77. package/dist/parsers/markdown/index.js +59 -0
  78. package/dist/parsers/mat/index.d.ts +31 -0
  79. package/dist/parsers/mat/index.js +426 -0
  80. package/dist/parsers/mermaid/index.d.ts +5 -0
  81. package/dist/parsers/mermaid/index.js +3 -0
  82. package/dist/parsers/mf4/index.d.ts +1 -0
  83. package/dist/parsers/mf4/index.js +1 -0
  84. package/dist/parsers/parquet/index.d.ts +21 -0
  85. package/dist/parsers/parquet/index.js +68 -0
  86. package/dist/parsers/pcap/index.d.ts +1 -0
  87. package/dist/parsers/pcap/index.js +1 -0
  88. package/dist/parsers/pcapng/index.d.ts +1 -0
  89. package/dist/parsers/pcapng/index.js +1 -0
  90. package/dist/parsers/plantuml/index.d.ts +5 -0
  91. package/dist/parsers/plantuml/index.js +4 -0
  92. package/dist/parsers/ppt-binary/index.d.ts +5 -0
  93. package/dist/parsers/ppt-binary/index.js +62 -0
  94. package/dist/parsers/ppt-binary/pptBinaryBuildContext.d.ts +12 -0
  95. package/dist/parsers/ppt-binary/pptBinaryBuildContext.js +40 -0
  96. package/dist/parsers/ppt-binary/pptBinaryContainer.d.ts +4 -0
  97. package/dist/parsers/ppt-binary/pptBinaryContainer.js +174 -0
  98. package/dist/parsers/ppt-binary/pptBinaryTypes.d.ts +125 -0
  99. package/dist/parsers/ppt-binary/pptBinaryTypes.js +1 -0
  100. package/dist/parsers/ppt-binary/pptSlideLayouts.d.ts +9 -0
  101. package/dist/parsers/ppt-binary/pptSlideLayouts.js +510 -0
  102. package/dist/parsers/ppt-binary/vscode-parser.d.ts +116 -0
  103. package/dist/parsers/ppt-binary/vscode-parser.js +2853 -0
  104. package/dist/parsers/ppt-binary/vscode.d.ts +4 -0
  105. package/dist/parsers/ppt-binary/vscode.js +12 -0
  106. package/dist/parsers/pptx/index.d.ts +15 -0
  107. package/dist/parsers/pptx/index.js +88 -0
  108. package/dist/parsers/pptx/vscode-parser.d.ts +167 -0
  109. package/dist/parsers/pptx/vscode-parser.js +1503 -0
  110. package/dist/parsers/pptx/vscode.d.ts +4 -0
  111. package/dist/parsers/pptx/vscode.js +18 -0
  112. package/dist/parsers/pptx/zip-reader.d.ts +3 -0
  113. package/dist/parsers/pptx/zip-reader.js +20 -0
  114. package/dist/parsers/proto/index.d.ts +90 -0
  115. package/dist/parsers/proto/index.js +197 -0
  116. package/dist/parsers/psd/index.d.ts +16 -0
  117. package/dist/parsers/psd/index.js +10 -0
  118. package/dist/parsers/shapefile/dbf.d.ts +23 -0
  119. package/dist/parsers/shapefile/dbf.js +112 -0
  120. package/dist/parsers/shapefile/index.d.ts +44 -0
  121. package/dist/parsers/shapefile/index.js +119 -0
  122. package/dist/parsers/shapefile/reproject.d.ts +10 -0
  123. package/dist/parsers/shapefile/reproject.js +41 -0
  124. package/dist/parsers/slide-model.d.ts +106 -0
  125. package/dist/parsers/slide-model.js +1 -0
  126. package/dist/parsers/toml/index.d.ts +15 -0
  127. package/dist/parsers/toml/index.js +18 -0
  128. package/dist/parsers/toml/model.d.ts +15 -0
  129. package/dist/parsers/toml/model.js +1 -0
  130. package/dist/parsers/toml/parse.d.ts +16 -0
  131. package/dist/parsers/toml/parse.js +266 -0
  132. package/dist/parsers/types.d.ts +103 -0
  133. package/dist/parsers/types.js +106 -0
  134. package/dist/parsers/video/index.d.ts +6 -0
  135. package/dist/parsers/video/index.js +2 -0
  136. package/dist/parsers/yaml/index.d.ts +16 -0
  137. package/dist/parsers/yaml/index.js +58 -0
  138. package/dist/parsers/yaml/model.d.ts +22 -0
  139. package/dist/parsers/yaml/model.js +1 -0
  140. package/dist/parsers/yaml/self-loading.d.ts +3 -0
  141. package/dist/parsers/yaml/self-loading.js +19 -0
  142. package/dist/parsers/zip-scan.d.ts +8 -0
  143. package/dist/parsers/zip-scan.js +80 -0
  144. package/dist/registry/container.d.ts +17 -0
  145. package/dist/registry/container.js +49 -0
  146. package/dist/registry/index.d.ts +133 -0
  147. package/dist/registry/index.js +348 -0
  148. package/dist/registry/probe.d.ts +3 -0
  149. package/dist/registry/probe.js +177 -0
  150. package/dist/registry/sniff.d.ts +17 -0
  151. package/dist/registry/sniff.js +57 -0
  152. package/dist/styles/archive.css +10 -0
  153. package/dist/styles/audio.css +66 -0
  154. package/dist/styles/automotive.css +1 -0
  155. package/dist/styles/csv.css +262 -0
  156. package/dist/styles/excel.css +212 -0
  157. package/dist/styles/fallback.css +48 -0
  158. package/dist/styles/hdf5.css +3 -0
  159. package/dist/styles/hwp.css +12 -0
  160. package/dist/styles/image.css +115 -0
  161. package/dist/styles/json.css +342 -0
  162. package/dist/styles/jsonl.css +1 -0
  163. package/dist/styles/markdown.css +10 -0
  164. package/dist/styles/mat.css +2 -0
  165. package/dist/styles/mermaid.css +1 -0
  166. package/dist/styles/parquet.css +2 -0
  167. package/dist/styles/pdf.css +551 -0
  168. package/dist/styles/plantuml.css +1 -0
  169. package/dist/styles/ppt.css +1 -0
  170. package/dist/styles/proto.css +2 -0
  171. package/dist/styles/psd.css +1 -0
  172. package/dist/styles/shapefile.css +25 -0
  173. package/dist/styles/toml.css +1 -0
  174. package/dist/styles/video.css +74 -0
  175. package/dist/styles/word.css +685 -0
  176. package/dist/styles/yaml.css +1 -0
  177. package/dist/viewers/a2l/index.d.ts +15 -0
  178. package/dist/viewers/a2l/index.js +5 -0
  179. package/dist/viewers/archive/archive-preview-decoder.d.ts +4 -0
  180. package/dist/viewers/archive/archive-preview-decoder.js +223 -0
  181. package/dist/viewers/archive/controller.d.ts +24 -0
  182. package/dist/viewers/archive/controller.js +18 -0
  183. package/dist/viewers/archive/index.d.ts +25 -0
  184. package/dist/viewers/archive/index.js +230 -0
  185. package/dist/viewers/archive/preview.d.ts +2 -0
  186. package/dist/viewers/archive/preview.js +2 -0
  187. package/dist/viewers/archive/styles.d.ts +1 -0
  188. package/dist/viewers/archive/styles.js +11 -0
  189. package/dist/viewers/arxml/index.d.ts +15 -0
  190. package/dist/viewers/arxml/index.js +5 -0
  191. package/dist/viewers/asc/index.d.ts +15 -0
  192. package/dist/viewers/asc/index.js +5 -0
  193. package/dist/viewers/audio/controller.d.ts +33 -0
  194. package/dist/viewers/audio/controller.js +49 -0
  195. package/dist/viewers/audio/engine.d.ts +44 -0
  196. package/dist/viewers/audio/engine.js +108 -0
  197. package/dist/viewers/audio/index.d.ts +92 -0
  198. package/dist/viewers/audio/index.js +448 -0
  199. package/dist/viewers/audio/self-loading.d.ts +7 -0
  200. package/dist/viewers/audio/self-loading.js +42 -0
  201. package/dist/viewers/audio/styles.d.ts +1 -0
  202. package/dist/viewers/audio/styles.js +73 -0
  203. package/dist/viewers/automotive/index.d.ts +8 -0
  204. package/dist/viewers/automotive/index.js +152 -0
  205. package/dist/viewers/automotive/styles.d.ts +1 -0
  206. package/dist/viewers/automotive/styles.js +1 -0
  207. package/dist/viewers/avro/index.d.ts +15 -0
  208. package/dist/viewers/avro/index.js +5 -0
  209. package/dist/viewers/bag/index.d.ts +15 -0
  210. package/dist/viewers/bag/index.js +5 -0
  211. package/dist/viewers/blf/index.d.ts +15 -0
  212. package/dist/viewers/blf/index.js +5 -0
  213. package/dist/viewers/csv/controller.d.ts +126 -0
  214. package/dist/viewers/csv/controller.js +598 -0
  215. package/dist/viewers/csv/index.d.ts +48 -0
  216. package/dist/viewers/csv/index.js +846 -0
  217. package/dist/viewers/csv/styles.d.ts +1 -0
  218. package/dist/viewers/csv/styles.js +267 -0
  219. package/dist/viewers/db3/index.d.ts +15 -0
  220. package/dist/viewers/db3/index.js +5 -0
  221. package/dist/viewers/dbc/index.d.ts +15 -0
  222. package/dist/viewers/dbc/index.js +5 -0
  223. package/dist/viewers/diagram.d.ts +14 -0
  224. package/dist/viewers/diagram.js +95 -0
  225. package/dist/viewers/excel/controller.d.ts +108 -0
  226. package/dist/viewers/excel/controller.js +548 -0
  227. package/dist/viewers/excel/grid.d.ts +28 -0
  228. package/dist/viewers/excel/grid.js +99 -0
  229. package/dist/viewers/excel/index.d.ts +37 -0
  230. package/dist/viewers/excel/index.js +620 -0
  231. package/dist/viewers/excel/self-loading.d.ts +6 -0
  232. package/dist/viewers/excel/self-loading.js +13 -0
  233. package/dist/viewers/excel/styles.d.ts +1 -0
  234. package/dist/viewers/excel/styles.js +216 -0
  235. package/dist/viewers/fallback/index.d.ts +17 -0
  236. package/dist/viewers/fallback/index.js +130 -0
  237. package/dist/viewers/fallback/styles.d.ts +1 -0
  238. package/dist/viewers/fallback/styles.js +49 -0
  239. package/dist/viewers/hdf5/index.d.ts +19 -0
  240. package/dist/viewers/hdf5/index.js +170 -0
  241. package/dist/viewers/hdf5/styles.d.ts +1 -0
  242. package/dist/viewers/hdf5/styles.js +4 -0
  243. package/dist/viewers/hwp/controller.d.ts +19 -0
  244. package/dist/viewers/hwp/controller.js +22 -0
  245. package/dist/viewers/hwp/index.d.ts +39 -0
  246. package/dist/viewers/hwp/index.js +271 -0
  247. package/dist/viewers/hwp/self-loading.d.ts +2 -0
  248. package/dist/viewers/hwp/self-loading.js +6 -0
  249. package/dist/viewers/hwp/styles.d.ts +1 -0
  250. package/dist/viewers/hwp/styles.js +13 -0
  251. package/dist/viewers/image/controller.d.ts +210 -0
  252. package/dist/viewers/image/controller.js +336 -0
  253. package/dist/viewers/image/decode.d.ts +54 -0
  254. package/dist/viewers/image/decode.js +150 -0
  255. package/dist/viewers/image/index.d.ts +38 -0
  256. package/dist/viewers/image/index.js +749 -0
  257. package/dist/viewers/image/limits.d.ts +18 -0
  258. package/dist/viewers/image/limits.js +20 -0
  259. package/dist/viewers/image/styles.d.ts +1 -0
  260. package/dist/viewers/image/styles.js +119 -0
  261. package/dist/viewers/json/controller.d.ts +89 -0
  262. package/dist/viewers/json/controller.js +411 -0
  263. package/dist/viewers/json/index.d.ts +25 -0
  264. package/dist/viewers/json/index.js +503 -0
  265. package/dist/viewers/json/styles.d.ts +1 -0
  266. package/dist/viewers/json/styles.js +346 -0
  267. package/dist/viewers/json/transforms.d.ts +27 -0
  268. package/dist/viewers/json/transforms.js +253 -0
  269. package/dist/viewers/jsonl/controller.d.ts +48 -0
  270. package/dist/viewers/jsonl/controller.js +136 -0
  271. package/dist/viewers/jsonl/index.d.ts +22 -0
  272. package/dist/viewers/jsonl/index.js +184 -0
  273. package/dist/viewers/jsonl/styles.d.ts +1 -0
  274. package/dist/viewers/jsonl/styles.js +1 -0
  275. package/dist/viewers/markdown/controller.d.ts +50 -0
  276. package/dist/viewers/markdown/controller.js +62 -0
  277. package/dist/viewers/markdown/index.d.ts +64 -0
  278. package/dist/viewers/markdown/index.js +425 -0
  279. package/dist/viewers/markdown/math.d.ts +21 -0
  280. package/dist/viewers/markdown/math.js +100 -0
  281. package/dist/viewers/markdown/self-loading.d.ts +5 -0
  282. package/dist/viewers/markdown/self-loading.js +48 -0
  283. package/dist/viewers/markdown/styles.d.ts +1 -0
  284. package/dist/viewers/markdown/styles.js +11 -0
  285. package/dist/viewers/mat/index.d.ts +19 -0
  286. package/dist/viewers/mat/index.js +113 -0
  287. package/dist/viewers/mat/styles.d.ts +1 -0
  288. package/dist/viewers/mat/styles.js +3 -0
  289. package/dist/viewers/media.d.ts +9 -0
  290. package/dist/viewers/media.js +77 -0
  291. package/dist/viewers/mermaid/index.d.ts +17 -0
  292. package/dist/viewers/mermaid/index.js +6 -0
  293. package/dist/viewers/mermaid/self-loading.d.ts +2 -0
  294. package/dist/viewers/mermaid/self-loading.js +2 -0
  295. package/dist/viewers/mf4/index.d.ts +15 -0
  296. package/dist/viewers/mf4/index.js +5 -0
  297. package/dist/viewers/parquet/controller.d.ts +37 -0
  298. package/dist/viewers/parquet/controller.js +26 -0
  299. package/dist/viewers/parquet/index.d.ts +23 -0
  300. package/dist/viewers/parquet/index.js +134 -0
  301. package/dist/viewers/parquet/styles.d.ts +1 -0
  302. package/dist/viewers/parquet/styles.js +3 -0
  303. package/dist/viewers/pcap/index.d.ts +15 -0
  304. package/dist/viewers/pcap/index.js +5 -0
  305. package/dist/viewers/pcapng/index.d.ts +15 -0
  306. package/dist/viewers/pcapng/index.js +5 -0
  307. package/dist/viewers/pdf/controller.d.ts +120 -0
  308. package/dist/viewers/pdf/controller.js +191 -0
  309. package/dist/viewers/pdf/editing.d.ts +26 -0
  310. package/dist/viewers/pdf/editing.js +265 -0
  311. package/dist/viewers/pdf/index.d.ts +88 -0
  312. package/dist/viewers/pdf/index.js +1400 -0
  313. package/dist/viewers/pdf/self-loading.d.ts +6 -0
  314. package/dist/viewers/pdf/self-loading.js +14 -0
  315. package/dist/viewers/pdf/styles.d.ts +1 -0
  316. package/dist/viewers/pdf/styles.js +555 -0
  317. package/dist/viewers/plantuml/index.d.ts +17 -0
  318. package/dist/viewers/plantuml/index.js +6 -0
  319. package/dist/viewers/plantuml/self-loading.d.ts +2 -0
  320. package/dist/viewers/plantuml/self-loading.js +2 -0
  321. package/dist/viewers/ppt/chart.d.ts +8 -0
  322. package/dist/viewers/ppt/chart.js +83 -0
  323. package/dist/viewers/ppt/controller.d.ts +34 -0
  324. package/dist/viewers/ppt/controller.js +27 -0
  325. package/dist/viewers/ppt/index.d.ts +33 -0
  326. package/dist/viewers/ppt/index.js +101 -0
  327. package/dist/viewers/ppt/render.d.ts +5 -0
  328. package/dist/viewers/ppt/render.js +144 -0
  329. package/dist/viewers/ppt/self-loading.d.ts +9 -0
  330. package/dist/viewers/ppt/self-loading.js +4 -0
  331. package/dist/viewers/ppt/styles.d.ts +1 -0
  332. package/dist/viewers/ppt/styles.js +1 -0
  333. package/dist/viewers/proto/index.d.ts +17 -0
  334. package/dist/viewers/proto/index.js +170 -0
  335. package/dist/viewers/proto/styles.d.ts +1 -0
  336. package/dist/viewers/proto/styles.js +2 -0
  337. package/dist/viewers/psd/index.d.ts +27 -0
  338. package/dist/viewers/psd/index.js +39 -0
  339. package/dist/viewers/psd/self-loading.d.ts +10 -0
  340. package/dist/viewers/psd/self-loading.js +20 -0
  341. package/dist/viewers/psd/styles.d.ts +1 -0
  342. package/dist/viewers/psd/styles.js +1 -0
  343. package/dist/viewers/reqif/index.d.ts +15 -0
  344. package/dist/viewers/reqif/index.js +5 -0
  345. package/dist/viewers/shapefile/index.d.ts +35 -0
  346. package/dist/viewers/shapefile/index.js +336 -0
  347. package/dist/viewers/shapefile/self-loading.d.ts +7 -0
  348. package/dist/viewers/shapefile/self-loading.js +32 -0
  349. package/dist/viewers/shapefile/styles.d.ts +1 -0
  350. package/dist/viewers/shapefile/styles.js +28 -0
  351. package/dist/viewers/stp/index.d.ts +15 -0
  352. package/dist/viewers/stp/index.js +5 -0
  353. package/dist/viewers/structured-styles.d.ts +1 -0
  354. package/dist/viewers/structured-styles.js +1 -0
  355. package/dist/viewers/structured.d.ts +36 -0
  356. package/dist/viewers/structured.js +138 -0
  357. package/dist/viewers/toml/controller.d.ts +38 -0
  358. package/dist/viewers/toml/controller.js +61 -0
  359. package/dist/viewers/toml/index.d.ts +18 -0
  360. package/dist/viewers/toml/index.js +34 -0
  361. package/dist/viewers/types.d.ts +36 -0
  362. package/dist/viewers/types.js +9 -0
  363. package/dist/viewers/video/controller.d.ts +29 -0
  364. package/dist/viewers/video/controller.js +54 -0
  365. package/dist/viewers/video/index.d.ts +18 -0
  366. package/dist/viewers/video/index.js +305 -0
  367. package/dist/viewers/video/styles.d.ts +1 -0
  368. package/dist/viewers/video/styles.js +79 -0
  369. package/dist/viewers/word/controller.d.ts +19 -0
  370. package/dist/viewers/word/controller.js +22 -0
  371. package/dist/viewers/word/docx-preprocess.d.ts +63 -0
  372. package/dist/viewers/word/docx-preprocess.js +136 -0
  373. package/dist/viewers/word/index.d.ts +32 -0
  374. package/dist/viewers/word/index.js +187 -0
  375. package/dist/viewers/word/normalize-docx.d.ts +2 -0
  376. package/dist/viewers/word/normalize-docx.js +50 -0
  377. package/dist/viewers/word/paginate.d.ts +1 -0
  378. package/dist/viewers/word/paginate.js +1035 -0
  379. package/dist/viewers/word/self-loading.d.ts +2 -0
  380. package/dist/viewers/word/self-loading.js +7 -0
  381. package/dist/viewers/word/styles.d.ts +1 -0
  382. package/dist/viewers/word/styles.js +686 -0
  383. package/dist/viewers/yaml/controller.d.ts +42 -0
  384. package/dist/viewers/yaml/controller.js +41 -0
  385. package/dist/viewers/yaml/index.d.ts +21 -0
  386. package/dist/viewers/yaml/index.js +20 -0
  387. package/package.json +375 -0
@@ -0,0 +1,18 @@
1
+ import type { I18nService } from '../host/index.js';
2
+ export { CATALOG_EN } from './catalog.en.js';
3
+ export { CATALOG_KO } from './catalog.ko.js';
4
+ /**
5
+ * Render a catalog template with `{name}` substitutions. Unknown placeholders
6
+ * are left verbatim so missing args are visible instead of silently dropped.
7
+ */
8
+ export declare function formatMessage(template: string, args?: Record<string, string | number>): string;
9
+ /**
10
+ * Resolve a message from the core catalog (English). Platform adapters wrap
11
+ * this: try the platform translation first, fall back here. The key itself is
12
+ * returned for unknown keys so broken lookups are visible in the UI and
13
+ * caught by tests.
14
+ */
15
+ export declare function resolveCatalogMessage(key: string, args?: Record<string, string | number>): string;
16
+ export declare function resolveLocalizedCatalogMessage(locale: string, key: string, args?: Record<string, string | number>): string;
17
+ /** An I18nService backed directly by the core catalog (tests, defaults). */
18
+ export declare function createCatalogI18n(locale?: string): I18nService;
@@ -0,0 +1,41 @@
1
+ import { CATALOG_EN } from './catalog.en.js';
2
+ import { CATALOG_KO } from './catalog.ko.js';
3
+ export { CATALOG_EN } from './catalog.en.js';
4
+ export { CATALOG_KO } from './catalog.ko.js';
5
+ /**
6
+ * Render a catalog template with `{name}` substitutions. Unknown placeholders
7
+ * are left verbatim so missing args are visible instead of silently dropped.
8
+ */
9
+ export function formatMessage(template, args) {
10
+ if (!args)
11
+ return template;
12
+ return template.replace(/\{([a-zA-Z0-9_.-]+)\}/g, (whole, name) => {
13
+ const value = args[name];
14
+ return value === undefined ? whole : String(value);
15
+ });
16
+ }
17
+ /**
18
+ * Resolve a message from the core catalog (English). Platform adapters wrap
19
+ * this: try the platform translation first, fall back here. The key itself is
20
+ * returned for unknown keys so broken lookups are visible in the UI and
21
+ * caught by tests.
22
+ */
23
+ export function resolveCatalogMessage(key, args) {
24
+ const template = CATALOG_EN[key];
25
+ if (template === undefined)
26
+ return key;
27
+ return formatMessage(template, args);
28
+ }
29
+ export function resolveLocalizedCatalogMessage(locale, key, args) {
30
+ const language = locale.toLowerCase().split(/[-_]/, 1)[0];
31
+ const template = language === 'ko' ? CATALOG_KO[key] ?? CATALOG_EN[key] : CATALOG_EN[key];
32
+ if (template === undefined)
33
+ return key;
34
+ return formatMessage(template, args);
35
+ }
36
+ /** An I18nService backed directly by the core catalog (tests, defaults). */
37
+ export function createCatalogI18n(locale = 'en') {
38
+ return {
39
+ t: (key, args) => resolveLocalizedCatalogMessage(locale, key, args)
40
+ };
41
+ }
@@ -0,0 +1,101 @@
1
+ Emscripten is available under 2 licenses, the MIT license and the
2
+ University of Illinois/NCSA Open Source License.
3
+
4
+ Both are permissive open source licenses, with little if any
5
+ practical difference between them.
6
+
7
+ The reason for offering both is that (1) the MIT license is
8
+ well-known, while (2) the University of Illinois/NCSA Open Source
9
+ License allows Emscripten's code to be integrated upstream into
10
+ LLVM, which uses that license, should the opportunity arise.
11
+
12
+ The full text of both licenses follows.
13
+
14
+ ==============================================================================
15
+
16
+ Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
17
+
18
+ Permission is hereby granted, free of charge, to any person obtaining a copy
19
+ of this software and associated documentation files (the "Software"), to deal
20
+ in the Software without restriction, including without limitation the rights
21
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
+ copies of the Software, and to permit persons to whom the Software is
23
+ furnished to do so, subject to the following conditions:
24
+
25
+ The above copyright notice and this permission notice shall be included in
26
+ all copies or substantial portions of the Software.
27
+
28
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
34
+ THE SOFTWARE.
35
+
36
+ ==============================================================================
37
+
38
+ Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
39
+ All rights reserved.
40
+
41
+ Permission is hereby granted, free of charge, to any person obtaining a
42
+ copy of this software and associated documentation files (the
43
+ "Software"), to deal with the Software without restriction, including
44
+ without limitation the rights to use, copy, modify, merge, publish,
45
+ distribute, sublicense, and/or sell copies of the Software, and to
46
+ permit persons to whom the Software is furnished to do so, subject to
47
+ the following conditions:
48
+
49
+ Redistributions of source code must retain the above copyright
50
+ notice, this list of conditions and the following disclaimers.
51
+
52
+ Redistributions in binary form must reproduce the above
53
+ copyright notice, this list of conditions and the following disclaimers
54
+ in the documentation and/or other materials provided with the
55
+ distribution.
56
+
57
+ Neither the names of Mozilla,
58
+ nor the names of its contributors may be used to endorse
59
+ or promote products derived from this Software without specific prior
60
+ written permission.
61
+
62
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
63
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
64
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
65
+ IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
66
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
67
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
68
+ SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
69
+
70
+ ==============================================================================
71
+
72
+ This program uses portions of Node.js source code located in src/library_path.js,
73
+ in accordance with the terms of the MIT license. Node's license follows:
74
+
75
+ """
76
+ Copyright Joyent, Inc. and other Node contributors. All rights reserved.
77
+ Permission is hereby granted, free of charge, to any person obtaining a copy
78
+ of this software and associated documentation files (the "Software"), to
79
+ deal in the Software without restriction, including without limitation the
80
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
81
+ sell copies of the Software, and to permit persons to whom the Software is
82
+ furnished to do so, subject to the following conditions:
83
+
84
+ The above copyright notice and this permission notice shall be included in
85
+ all copies or substantial portions of the Software.
86
+
87
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
90
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
93
+ IN THE SOFTWARE.
94
+ """
95
+
96
+ The musl libc project is bundled in this repo, and it has the MIT license, see
97
+ system/lib/libc/musl/COPYRIGHT
98
+
99
+ The third_party/ subdirectory contains code with other licenses. None of it is
100
+ used by default, but certain options use it (e.g., the optional closure compiler
101
+ flag will run closure compiler from third_party/).
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2003-2010 Mark Borgerding
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice,
9
+ this list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its contributors
16
+ may be used to endorse or promote products derived from this software
17
+ without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1 @@
1
+ export { parseA2l } from '../automotive/index.js';
@@ -0,0 +1 @@
1
+ export { parseA2l } from '../automotive/index.js';
@@ -0,0 +1,22 @@
1
+ import type { ParseOutcome, ParseOptions } from '../types.js';
2
+ import type { ArchiveDecoder, ArchiveDocument, OpenArchiveHandle } from './model.js';
3
+ export * from './model.js';
4
+ export declare const ARCHIVE_DEFAULT_LIMITS: {
5
+ readonly maxInputBytes: number;
6
+ readonly maxEntries: 100000;
7
+ readonly maxDecompressedBytes: number;
8
+ readonly maxPreviewBytes: number;
9
+ readonly maxHexBytes: 4096;
10
+ };
11
+ export declare class ArchiveError extends Error {
12
+ readonly code: 'invalid-format' | 'corrupted' | 'password-required' | 'limit-exceeded' | 'aborted' | 'missing-dependency';
13
+ readonly messageKey: string;
14
+ constructor(code: 'invalid-format' | 'corrupted' | 'password-required' | 'limit-exceeded' | 'aborted' | 'missing-dependency', messageKey: string);
15
+ }
16
+ export interface ArchiveParseOptions extends ParseOptions {
17
+ fileName?: string;
18
+ }
19
+ export declare function parseArchive(data: Uint8Array, decoder: ArchiveDecoder, options?: ArchiveParseOptions): Promise<{
20
+ outcome: ParseOutcome<ArchiveDocument>;
21
+ handle?: OpenArchiveHandle;
22
+ }>;
@@ -0,0 +1,46 @@
1
+ export * from './model.js';
2
+ export const ARCHIVE_DEFAULT_LIMITS = { maxInputBytes: 256 * 1024 * 1024, maxEntries: 100_000, maxDecompressedBytes: 1024 * 1024 * 1024, maxPreviewBytes: 8 * 1024 * 1024, maxHexBytes: 4096 };
3
+ export class ArchiveError extends Error {
4
+ code;
5
+ messageKey;
6
+ constructor(code, messageKey) {
7
+ super(messageKey);
8
+ this.code = code;
9
+ this.messageKey = messageKey;
10
+ }
11
+ }
12
+ export async function parseArchive(data, decoder, options = {}) {
13
+ const started = Date.now();
14
+ const max = options.limits?.maxInputBytes ?? ARCHIVE_DEFAULT_LIMITS.maxInputBytes;
15
+ if (data.byteLength > max)
16
+ return { outcome: { result: { status: 'failed', failure: { code: 'limit-exceeded', retryable: false, messageKey: 'diag.archive.limit-exceeded' }, diagnostics: [] }, execution: { workerUsed: false, hardLimitEnforced: true, elapsedMillis: Date.now() - started } } };
17
+ if (options.signal?.aborted)
18
+ return { outcome: { result: { status: 'failed', failure: { code: 'aborted', retryable: true, messageKey: 'diag.aborted' }, diagnostics: [] }, execution: { workerUsed: false, hardLimitEnforced: true, elapsedMillis: Date.now() - started } } };
19
+ if (options.fileName?.toLowerCase().endsWith('.dmg') && !hasDmgTrailer(data))
20
+ return failed('invalid-format', 'diag.archive.invalid-format', started);
21
+ try {
22
+ const openOptions = { maxEntries: options.limits?.maxEntries ?? ARCHIVE_DEFAULT_LIMITS.maxEntries, maxDecompressedBytes: options.limits?.maxDecompressedBytes ?? ARCHIVE_DEFAULT_LIMITS.maxDecompressedBytes, ...(options.signal ? { signal: options.signal } : {}) };
23
+ const raw = await decoder.openArchive(data, openOptions);
24
+ const entries = raw.entries.slice(0, options.limits?.maxEntries ?? ARCHIVE_DEFAULT_LIMITS.maxEntries);
25
+ const partial = entries.length !== raw.entries.length;
26
+ const handle = limitHandle(raw, options.limits?.maxDecompressedBytes ?? ARCHIVE_DEFAULT_LIMITS.maxDecompressedBytes);
27
+ return { handle, outcome: { result: partial ? { status: 'partial', document: { entries }, diagnostics: [{ severity: 'warning', code: 'archive.limit-exceeded', messageKey: 'diag.archive.limit-exceeded' }] } : { status: 'ok', document: { entries }, diagnostics: [] }, execution: { workerUsed: false, hardLimitEnforced: false, elapsedMillis: Date.now() - started } } };
28
+ }
29
+ catch (error) {
30
+ const known = error instanceof ArchiveError ? error : new ArchiveError('invalid-format', 'diag.archive.invalid-format');
31
+ return { outcome: { result: { status: 'failed', failure: { code: known.code, retryable: known.code === 'aborted' || known.code === 'password-required', messageKey: known.messageKey }, diagnostics: [] }, execution: { workerUsed: false, hardLimitEnforced: false, elapsedMillis: Date.now() - started } } };
32
+ }
33
+ }
34
+ function failed(code, messageKey, started) { return { outcome: { result: { status: 'failed', failure: { code, retryable: false, messageKey }, diagnostics: [] }, execution: { workerUsed: false, hardLimitEnforced: true, elapsedMillis: Date.now() - started } } }; }
35
+ function hasDmgTrailer(data) { return data.byteLength >= 512 && [0x6b, 0x6f, 0x6c, 0x79].every((x, i) => data[data.byteLength - 512 + i] === x); }
36
+ function limitHandle(raw, maxTotal) { let used = 0; let reserved = 0; return { entries: raw.entries, async extract(id, opts) { const allowance = Math.min(opts.maxBytes, maxTotal - used - reserved); if (allowance <= 0)
37
+ throw new ArchiveError('limit-exceeded', 'diag.archive.limit-exceeded'); reserved += allowance; try {
38
+ const bytes = await raw.extract(id, { ...opts, maxBytes: allowance });
39
+ used += bytes.byteLength;
40
+ if (bytes.byteLength > allowance || used > maxTotal)
41
+ throw new ArchiveError('limit-exceeded', 'diag.archive.limit-exceeded');
42
+ return bytes;
43
+ }
44
+ finally {
45
+ reserved -= allowance;
46
+ } }, close: () => raw.close() }; }
@@ -0,0 +1,29 @@
1
+ export interface ArchiveEntry {
2
+ entryId: number;
3
+ path: string;
4
+ isDirectory: boolean;
5
+ compressedSize?: number;
6
+ uncompressedSize?: number;
7
+ modifiedAt?: string | number | Date;
8
+ mimeType?: string;
9
+ encrypted?: boolean;
10
+ }
11
+ export interface ArchiveDocument {
12
+ entries: readonly ArchiveEntry[];
13
+ }
14
+ export interface ArchiveExtractOptions {
15
+ signal?: AbortSignal; /** Decoder must stop before allocating beyond this output size. */
16
+ maxBytes: number;
17
+ }
18
+ export interface OpenArchiveHandle {
19
+ entries: readonly ArchiveEntry[];
20
+ extract(entryId: number, options: ArchiveExtractOptions): Promise<Uint8Array>;
21
+ close(): void | Promise<void>;
22
+ }
23
+ export interface ArchiveDecoder {
24
+ openArchive(data: Uint8Array, options?: {
25
+ signal?: AbortSignal;
26
+ maxEntries?: number;
27
+ maxDecompressedBytes?: number;
28
+ }): Promise<OpenArchiveHandle>;
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ /** Protocol names shared by decoder-specific Worker adapters. */
2
+ export type ArchiveWorkerRequest = {
3
+ type: 'list';
4
+ } | {
5
+ type: 'extract';
6
+ entryId: number;
7
+ } | {
8
+ type: 'close';
9
+ };
10
+ export type ArchiveWorkerResponse = {
11
+ type: 'entries';
12
+ entries: unknown[];
13
+ } | {
14
+ type: 'bytes';
15
+ data: Uint8Array;
16
+ } | {
17
+ type: 'error';
18
+ messageKey: string;
19
+ } | {
20
+ type: 'closed';
21
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { parseArxml } from '../automotive/index.js';
@@ -0,0 +1 @@
1
+ export { parseArxml } from '../automotive/index.js';
@@ -0,0 +1 @@
1
+ export { parseAsc } from '../automotive/index.js';
@@ -0,0 +1 @@
1
+ export { parseAsc } from '../automotive/index.js';
@@ -0,0 +1,9 @@
1
+ export interface AudioInfo {
2
+ format: string;
3
+ mimeType: string;
4
+ sampleRate?: number;
5
+ channels?: number;
6
+ bitsPerSample?: number;
7
+ warnings: string[];
8
+ }
9
+ export declare function parseAudioInfo(fileName: string, data: Uint8Array): AudioInfo;
@@ -0,0 +1,46 @@
1
+ const MIME = { mp3: 'audio/mpeg', wav: 'audio/wav', pcm: 'audio/L16', aiff: 'audio/aiff', aif: 'audio/aiff', aifc: 'audio/aiff', amr: 'audio/amr', awb: 'audio/amr-wb', ogg: 'audio/ogg', flac: 'audio/flac', ac3: 'audio/ac3', aac: 'audio/aac', m4a: 'audio/mp4' };
2
+ export function parseAudioInfo(fileName, data) {
3
+ const ext = fileName.toLowerCase().split('.').pop() ?? '';
4
+ const info = { format: ext.toUpperCase() || 'AUDIO', mimeType: MIME[ext] ?? 'application/octet-stream', warnings: [] };
5
+ if (ext === 'wav')
6
+ parseWaveChunks(data, info);
7
+ else if (ext === 'pcm')
8
+ info.warnings.push('Raw PCM has no embedded sample-rate/channel metadata and may not be playable by the browser.');
9
+ if (data.byteLength === 0)
10
+ info.warnings.push('The audio file is empty.');
11
+ return info;
12
+ }
13
+ function parseWaveChunks(data, info) {
14
+ if (data.length < 12 || ascii(data, 0, 4) !== 'RIFF' || ascii(data, 8, 4) !== 'WAVE') {
15
+ info.warnings.push('The WAV file does not contain a valid RIFF/WAVE header.');
16
+ return;
17
+ }
18
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
19
+ let offset = 12;
20
+ let chunks = 0;
21
+ while (offset + 8 <= data.length && chunks++ < 10_000) {
22
+ const id = ascii(data, offset, 4);
23
+ const size = view.getUint32(offset + 4, true);
24
+ const start = offset + 8;
25
+ const end = start + size;
26
+ if (end > data.length) {
27
+ info.warnings.push(`The WAV ${id.trim() || 'unknown'} chunk is truncated.`);
28
+ return;
29
+ }
30
+ if (id === 'fmt ') {
31
+ if (size < 16) {
32
+ info.warnings.push('The WAV fmt chunk is shorter than 16 bytes.');
33
+ return;
34
+ }
35
+ info.channels = view.getUint16(start + 2, true);
36
+ info.sampleRate = view.getUint32(start + 4, true);
37
+ info.bitsPerSample = view.getUint16(start + 14, true);
38
+ return;
39
+ }
40
+ // RIFF chunks are padded to an even byte boundary; the padding byte is
41
+ // not included in the declared chunk size.
42
+ offset = end + (size & 1);
43
+ }
44
+ info.warnings.push('The WAV file does not contain a fmt chunk.');
45
+ }
46
+ function ascii(data, offset, length) { return [...data.subarray(offset, offset + length)].map(x => String.fromCharCode(x)).join(''); }
@@ -0,0 +1,33 @@
1
+ export type AutomotiveFormat = 'avro' | 'bag' | 'stp' | 'db3' | 'reqif' | 'dbc' | 'arxml' | 'a2l' | 'asc' | 'blf' | 'mf4' | 'pcap' | 'pcapng';
2
+ export type AutomotiveCell = string | number;
3
+ export interface AutomotiveSummaryItem {
4
+ label: string;
5
+ value: AutomotiveCell;
6
+ }
7
+ export interface AutomotiveTable {
8
+ title: string;
9
+ headers: string[];
10
+ rows: AutomotiveCell[][];
11
+ }
12
+ export interface AutomotiveViewerModel {
13
+ format: string;
14
+ title: string;
15
+ fileSizeBytes: number;
16
+ summary: AutomotiveSummaryItem[];
17
+ tables: AutomotiveTable[];
18
+ rawPreview?: string;
19
+ warnings: string[];
20
+ }
21
+ export declare function parseAutomotive(format: AutomotiveFormat, data: Uint8Array): AutomotiveViewerModel;
22
+ export declare function parseAvro(data: Uint8Array): AutomotiveViewerModel;
23
+ export declare function parseBag(data: Uint8Array): AutomotiveViewerModel;
24
+ export declare function parseStp(data: Uint8Array): AutomotiveViewerModel;
25
+ export declare function parseDb3(data: Uint8Array): AutomotiveViewerModel;
26
+ export declare function parseReqif(data: Uint8Array): AutomotiveViewerModel;
27
+ export declare function parseArxml(data: Uint8Array): AutomotiveViewerModel;
28
+ export declare function parseA2l(data: Uint8Array): AutomotiveViewerModel;
29
+ export declare function parseAsc(data: Uint8Array): AutomotiveViewerModel;
30
+ export declare function parseBlf(data: Uint8Array): AutomotiveViewerModel;
31
+ export declare function parseMf4(data: Uint8Array): AutomotiveViewerModel;
32
+ export declare function parsePcap(data: Uint8Array): AutomotiveViewerModel;
33
+ export declare function parsePcapng(data: Uint8Array): AutomotiveViewerModel;