kordoc 4.7.2 → 4.8.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.
- package/README.md +24 -2
- package/dist/{-CVPGGSAB.js → -URO5XBEB.js} +11 -9
- package/dist/{chunk-IMY4LQ3J.js → chunk-2ANLGAUG.js} +2 -2
- package/dist/{chunk-7CWNBDWQ.js → chunk-37SAM3LH.js} +3 -3
- package/dist/{chunk-QXC5NPO2.js → chunk-3CBHCDYD.js} +418 -80
- package/dist/chunk-3CBHCDYD.js.map +1 -0
- package/dist/{chunk-PV6WSN6E.cjs → chunk-5IRX3TQP.cjs} +3 -3
- package/dist/chunk-5IRX3TQP.cjs.map +1 -0
- package/dist/{chunk-O4VLHQVG.js → chunk-7OHDTS5Q.js} +2 -2
- package/dist/{chunk-I4TP7HYB.js → chunk-BN33O25L.js} +1 -1
- package/dist/chunk-BN33O25L.js.map +1 -0
- package/dist/{chunk-E2XTVK7H.cjs → chunk-CX2LRBC5.cjs} +11 -11
- package/dist/chunk-CX2LRBC5.cjs.map +1 -0
- package/dist/chunk-DCZVOIEO.cjs.map +1 -1
- package/dist/{chunk-Y3VDFFAW.js → chunk-E6OJKTYS.js} +2 -2
- package/dist/{chunk-IN2AOMX6.js → chunk-F7RZZI5P.js} +3 -3
- package/dist/{chunk-46VU6YXF.cjs → chunk-GGZ5PSJO.cjs} +4 -4
- package/dist/chunk-GGZ5PSJO.cjs.map +1 -0
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-IVSEGHI2.js → chunk-HFVMCUXF.js} +3 -3
- package/dist/{chunk-TYIFZT5H.js → chunk-HS4762CD.js} +2 -2
- package/dist/{chunk-DZBMQC2N.cjs → chunk-J7DBL77B.cjs} +2 -2
- package/dist/chunk-J7DBL77B.cjs.map +1 -0
- package/dist/{chunk-VXB52EWX.js → chunk-L2Q3NLHX.js} +2 -2
- package/dist/{chunk-URTDBXV6.cjs → chunk-L5CDTOC3.cjs} +1 -1
- package/dist/chunk-L5CDTOC3.cjs.map +1 -0
- package/dist/{chunk-PGDJUJ4L.js → chunk-NFCQ5XNT.js} +2 -2
- package/dist/{chunk-P7HPLWEP.js → chunk-OKE6G67G.js} +2 -2
- package/dist/{chunk-YU3PLOX4.cjs → chunk-OKISH2NK.cjs} +6 -6
- package/dist/chunk-OKISH2NK.cjs.map +1 -0
- package/dist/{chunk-JMWBMGNH.js → chunk-S4SMUQAT.js} +2 -2
- package/dist/{chunk-BSWJCSG7.js → chunk-TXRTH5BV.js} +2 -2
- package/dist/{chunk-FJBOVJAG.js → chunk-VPAYFTMH.js} +3 -3
- package/dist/{chunk-QKHN7LEV.js → chunk-WG473BIB.js} +2 -2
- package/dist/{chunk-VEBTOI3I.js → chunk-WXC4HKSD.js} +3 -3
- package/dist/{chunk-4VNUQYUE.js → chunk-XINP35F4.js} +1 -1
- package/dist/chunk-XINP35F4.js.map +1 -0
- package/dist/{chunk-GLZMUKYL.js → chunk-YB2TYOYY.js} +3 -3
- package/dist/{chunk-LJW5EQXS.js → chunk-ZEQPTIWN.js} +8 -3
- package/dist/chunk-ZEQPTIWN.js.map +1 -0
- package/dist/chunks-M64IY7AK.js +10 -0
- package/dist/cli.js +22 -22
- package/dist/cli.js.map +1 -1
- package/dist/{formula-7D3MLOSV.cjs → formula-3K5KC3VV.cjs} +9 -9
- package/dist/formula-3K5KC3VV.cjs.map +1 -0
- package/dist/{formula-GHGK7T3S.js → formula-7BNCJ55B.js} +3 -3
- package/dist/{formula-RTGCS55B.js → formula-YRMQ7BTI.js} +4 -4
- package/dist/{image-ocr-PRI2JKDW.cjs → image-ocr-CBMJIJTQ.cjs} +12 -12
- package/dist/image-ocr-CBMJIJTQ.cjs.map +1 -0
- package/dist/{image-ocr-2UMWFGRS.js → image-ocr-O7TKPDTY.js} +8 -8
- package/dist/{image-ocr-TQ5THN35.js → image-ocr-XRVXVYKO.js} +6 -6
- package/dist/index.cjs +896 -553
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -3
- package/dist/index.d.ts +52 -3
- package/dist/index.js +420 -77
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +19 -18
- package/dist/mcp.js.map +1 -1
- package/dist/{model-bundle-5RLZV7P2.js → model-bundle-GNDUKNME.js} +5 -5
- package/dist/{models-RSHR2BY7.js → models-TJ45RB2Z.js} +5 -5
- package/dist/page-range-P7SDW6LR.cjs.map +1 -1
- package/dist/{parser-FXEIK3VJ.js → parser-5MLJHSRX.js} +8 -8
- package/dist/{parser-QPMTNRPU.js.map → parser-5MLJHSRX.js.map} +1 -1
- package/dist/{parser-SCQ7NJUJ.cjs → parser-GIVQWVKJ.cjs} +28 -28
- package/dist/parser-GIVQWVKJ.cjs.map +1 -0
- package/dist/{parser-QPMTNRPU.js → parser-U3SMCGRK.js} +8 -8
- package/dist/{parser-FXEIK3VJ.js.map → parser-U3SMCGRK.js.map} +1 -1
- package/dist/pdf-ocr-BUBZA4EE.cjs +14 -0
- package/dist/pdf-ocr-BUBZA4EE.cjs.map +1 -0
- package/dist/pdf-ocr-HITVPJLV.js +13 -0
- package/dist/pdf-ocr-K4WOCJGJ.js +16 -0
- package/dist/{profile-io-I4UGTNP6.js → profile-io-VATWYLZX.js} +3 -3
- package/dist/{rasterize-QY3XJKCH.js → rasterize-PNRXMSL2.js} +2 -2
- package/dist/render-YY5RKZEB.js +10 -0
- package/dist/seal-5ZNJXOOQ.js +10 -0
- package/dist/{setup-T2BY3VME.js → setup-OEUDZ4BT.js} +3 -3
- package/dist/{watch-JJE2UGVK.js → watch-USNQJXQC.js} +10 -10
- package/package.json +2 -2
- package/dist/chunk-46VU6YXF.cjs.map +0 -1
- package/dist/chunk-4VNUQYUE.js.map +0 -1
- package/dist/chunk-DZBMQC2N.cjs.map +0 -1
- package/dist/chunk-E2XTVK7H.cjs.map +0 -1
- package/dist/chunk-I4TP7HYB.js.map +0 -1
- package/dist/chunk-LJW5EQXS.js.map +0 -1
- package/dist/chunk-PV6WSN6E.cjs.map +0 -1
- package/dist/chunk-QXC5NPO2.js.map +0 -1
- package/dist/chunk-URTDBXV6.cjs.map +0 -1
- package/dist/chunk-YU3PLOX4.cjs.map +0 -1
- package/dist/chunks-RNP6VLGK.js +0 -10
- package/dist/formula-7D3MLOSV.cjs.map +0 -1
- package/dist/image-ocr-PRI2JKDW.cjs.map +0 -1
- package/dist/parser-SCQ7NJUJ.cjs.map +0 -1
- package/dist/pdf-ocr-HPRM24SP.js +0 -16
- package/dist/pdf-ocr-I6DISTBR.js +0 -13
- package/dist/pdf-ocr-JNWL65YW.cjs +0 -14
- package/dist/pdf-ocr-JNWL65YW.cjs.map +0 -1
- package/dist/render-HEQX5DII.js +0 -10
- package/dist/seal-NB2YJ5F4.js +0 -10
- /package/dist/{-CVPGGSAB.js.map → -URO5XBEB.js.map} +0 -0
- /package/dist/{chunk-IMY4LQ3J.js.map → chunk-2ANLGAUG.js.map} +0 -0
- /package/dist/{chunk-7CWNBDWQ.js.map → chunk-37SAM3LH.js.map} +0 -0
- /package/dist/{chunk-O4VLHQVG.js.map → chunk-7OHDTS5Q.js.map} +0 -0
- /package/dist/{chunk-Y3VDFFAW.js.map → chunk-E6OJKTYS.js.map} +0 -0
- /package/dist/{chunk-IN2AOMX6.js.map → chunk-F7RZZI5P.js.map} +0 -0
- /package/dist/{chunk-IVSEGHI2.js.map → chunk-HFVMCUXF.js.map} +0 -0
- /package/dist/{chunk-TYIFZT5H.js.map → chunk-HS4762CD.js.map} +0 -0
- /package/dist/{chunk-VXB52EWX.js.map → chunk-L2Q3NLHX.js.map} +0 -0
- /package/dist/{chunk-PGDJUJ4L.js.map → chunk-NFCQ5XNT.js.map} +0 -0
- /package/dist/{chunk-P7HPLWEP.js.map → chunk-OKE6G67G.js.map} +0 -0
- /package/dist/{chunk-JMWBMGNH.js.map → chunk-S4SMUQAT.js.map} +0 -0
- /package/dist/{chunk-BSWJCSG7.js.map → chunk-TXRTH5BV.js.map} +0 -0
- /package/dist/{chunk-FJBOVJAG.js.map → chunk-VPAYFTMH.js.map} +0 -0
- /package/dist/{chunk-QKHN7LEV.js.map → chunk-WG473BIB.js.map} +0 -0
- /package/dist/{chunk-VEBTOI3I.js.map → chunk-WXC4HKSD.js.map} +0 -0
- /package/dist/{chunk-GLZMUKYL.js.map → chunk-YB2TYOYY.js.map} +0 -0
- /package/dist/{chunks-RNP6VLGK.js.map → chunks-M64IY7AK.js.map} +0 -0
- /package/dist/{formula-GHGK7T3S.js.map → formula-7BNCJ55B.js.map} +0 -0
- /package/dist/{formula-RTGCS55B.js.map → formula-YRMQ7BTI.js.map} +0 -0
- /package/dist/{image-ocr-2UMWFGRS.js.map → image-ocr-O7TKPDTY.js.map} +0 -0
- /package/dist/{image-ocr-TQ5THN35.js.map → image-ocr-XRVXVYKO.js.map} +0 -0
- /package/dist/{model-bundle-5RLZV7P2.js.map → model-bundle-GNDUKNME.js.map} +0 -0
- /package/dist/{models-RSHR2BY7.js.map → models-TJ45RB2Z.js.map} +0 -0
- /package/dist/{pdf-ocr-HPRM24SP.js.map → pdf-ocr-HITVPJLV.js.map} +0 -0
- /package/dist/{pdf-ocr-I6DISTBR.js.map → pdf-ocr-K4WOCJGJ.js.map} +0 -0
- /package/dist/{profile-io-I4UGTNP6.js.map → profile-io-VATWYLZX.js.map} +0 -0
- /package/dist/{rasterize-QY3XJKCH.js.map → rasterize-PNRXMSL2.js.map} +0 -0
- /package/dist/{render-HEQX5DII.js.map → render-YY5RKZEB.js.map} +0 -0
- /package/dist/{seal-NB2YJ5F4.js.map → seal-5ZNJXOOQ.js.map} +0 -0
- /package/dist/{setup-T2BY3VME.js.map → setup-OEUDZ4BT.js.map} +0 -0
- /package/dist/{watch-JJE2UGVK.js.map → watch-USNQJXQC.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -131,8 +131,14 @@ interface DocumentMetadata {
|
|
|
131
131
|
createdAt?: string;
|
|
132
132
|
/** 수정일시 (ISO 8601) */
|
|
133
133
|
modifiedAt?: string;
|
|
134
|
-
/** 페이지/섹션 수 */
|
|
134
|
+
/** 페이지/섹션 수 — pageMode="layout"이면 실제 페이지 수, "section"이면 섹션 수 */
|
|
135
135
|
pageCount?: number;
|
|
136
|
+
/**
|
|
137
|
+
* 페이지 경계 신뢰도 (#66) — "layout": 조판 정보 기반 실제 페이지
|
|
138
|
+
* (한컴 저장본 HWP/HWPX·PDF·COM), "section": 섹션 단위 근사
|
|
139
|
+
* (조판 캐시 없는 생성 파일). HWP/HWPX/PDF에서만 설정된다.
|
|
140
|
+
*/
|
|
141
|
+
pageMode?: "layout" | "section";
|
|
136
142
|
/** 문서 포맷 버전 (예: HWP "5.1.0.1") */
|
|
137
143
|
version?: string;
|
|
138
144
|
/** 설명 */
|
|
@@ -229,7 +235,9 @@ interface ParseWarning {
|
|
|
229
235
|
/** 구조화된 경고 코드 */
|
|
230
236
|
code: WarningCode;
|
|
231
237
|
}
|
|
232
|
-
type WarningCode = "SKIPPED_IMAGE" | "SKIPPED_OLE" | "TRUNCATED_TABLE" | "OCR_FALLBACK" | "UNSUPPORTED_ELEMENT" | "BROKEN_ZIP_RECOVERY" | "HIDDEN_TEXT_FILTERED" | "MALFORMED_XML" | "PARTIAL_PARSE" | "LENIENT_CFB_RECOVERY" | "NEEDS_OCR" | "OCR_FAILED" | "OCR_APPLIED" | "OCR_LOW_CONF" | "COM_EMPTY" | "DRM_COM_FALLBACK"
|
|
238
|
+
type WarningCode = "SKIPPED_IMAGE" | "SKIPPED_OLE" | "TRUNCATED_TABLE" | "OCR_FALLBACK" | "UNSUPPORTED_ELEMENT" | "BROKEN_ZIP_RECOVERY" | "HIDDEN_TEXT_FILTERED" | "MALFORMED_XML" | "PARTIAL_PARSE" | "LENIENT_CFB_RECOVERY" | "NEEDS_OCR" | "OCR_FAILED" | "OCR_APPLIED" | "OCR_LOW_CONF" | "COM_EMPTY" | "DRM_COM_FALLBACK"
|
|
239
|
+
/** pages 옵션 요청됐으나 조판 캐시가 없어 섹션 단위 근사로 적용됨 (#66) */
|
|
240
|
+
| "PAGE_BOUNDARY_APPROXIMATE";
|
|
233
241
|
/** 문서 구조 (헤딩 트리) */
|
|
234
242
|
interface OutlineItem {
|
|
235
243
|
level: number;
|
|
@@ -266,11 +274,29 @@ interface ParseSuccess extends ParseResultBase {
|
|
|
266
274
|
warnings?: ParseWarning[];
|
|
267
275
|
/** 추출된 이미지 목록 — 마크다운에서 파일명으로 참조됨 */
|
|
268
276
|
images?: ExtractedImage[];
|
|
277
|
+
/**
|
|
278
|
+
* 페이지별 마크다운 (#68) — `blocks` 의 `pageNumber` 로 갈라 페이지마다 다시
|
|
279
|
+
* 마크다운을 만든 것. 페이지 경계의 신뢰도는 `metadata.pageMode` 를 따른다
|
|
280
|
+
* ("layout" = 실제 페이지, "section" = 섹션 근사). `pages` 옵션으로 범위를
|
|
281
|
+
* 줄이면 그 범위만 담긴다. 페이지 번호를 매기지 않는 포맷(DOCX 등)에서는 없고,
|
|
282
|
+
* XLSX 는 `pageCount` 와 같은 의미로 시트 한 장이 한 쪽이다.
|
|
283
|
+
*
|
|
284
|
+
* 여러 페이지에 걸친 표는 시작 페이지 한 블록이라, 표가 이어지는 중간
|
|
285
|
+
* 페이지의 `markdown` 은 빈 문자열일 수 있다 (현 IR 구조의 한계).
|
|
286
|
+
*/
|
|
287
|
+
pages?: PageMarkdown[];
|
|
269
288
|
/** 페이지별 텍스트 품질 신호 — PDF에서만 제공 */
|
|
270
289
|
pageQuality?: PageQuality[];
|
|
271
290
|
/** 문서 단위 품질 요약 — PDF에서만 제공 */
|
|
272
291
|
qualitySummary?: DocumentQualitySummary;
|
|
273
292
|
}
|
|
293
|
+
/** 페이지 한 장의 마크다운 (#68). ParseSuccess.pages 항목. */
|
|
294
|
+
interface PageMarkdown {
|
|
295
|
+
/** 원본 페이지 번호 (1-based) */
|
|
296
|
+
pageNumber: number;
|
|
297
|
+
/** 그 페이지 블록만으로 만든 마크다운. 블록이 없으면 빈 문자열 */
|
|
298
|
+
markdown: string;
|
|
299
|
+
}
|
|
274
300
|
/** 페이지별 텍스트 품질 신호 (PDF 전용). 자세한 설명은 src/pdf/quality.ts */
|
|
275
301
|
interface PageQuality {
|
|
276
302
|
page: number;
|
|
@@ -1741,6 +1767,29 @@ declare function detectZipFormat(buffer: ArrayBuffer): Promise<"hwpx" | "xlsx" |
|
|
|
1741
1767
|
|
|
1742
1768
|
declare function blocksToMarkdown(blocks: IRBlock[]): string;
|
|
1743
1769
|
|
|
1770
|
+
/**
|
|
1771
|
+
* 페이지별 마크다운 사영 (#68)
|
|
1772
|
+
*
|
|
1773
|
+
* 문서를 다시 파싱하지 않고 이미 만들어진 `IRBlock.pageNumber` 로만 블록을 갈라
|
|
1774
|
+
* 페이지마다 `blocksToMarkdown()` 을 돌린다. 페이지 번호의 신뢰도는 파서가
|
|
1775
|
+
* 정하는 것이고(`metadata.pageMode` — "layout" 은 실제 페이지, "section" 은
|
|
1776
|
+
* 섹션 근사), 여기서는 그 값을 그대로 존중한다.
|
|
1777
|
+
*/
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* 블록을 페이지 번호로 묶어 페이지별 마크다운을 만든다.
|
|
1781
|
+
*
|
|
1782
|
+
* - 어떤 블록에도 페이지 번호가 없으면 `undefined` — 페이지 개념이 없는 포맷에
|
|
1783
|
+
* "전부 1페이지" 같은 없는 사실을 만들어 내지 않는다.
|
|
1784
|
+
* - 번호가 없는 블록은 **직전 블록의 페이지로 이어붙인다.** 블록은 읽기 순서라
|
|
1785
|
+
* 이게 원문 위치에 가장 가깝고, 무엇보다 어느 페이지에도 안 실려 조용히
|
|
1786
|
+
* 사라지는 블록이 생기지 않는다. 선두의 번호 없는 블록은 첫 실번호 페이지로.
|
|
1787
|
+
* - 관측된 최소~최대 페이지 사이의 빈 페이지도 항목으로 낸다. 여러 페이지에
|
|
1788
|
+
* 걸친 표는 시작 페이지 한 블록이라 중간 페이지가 실제로 비어 있고, 이때
|
|
1789
|
+
* 항목을 빼면 소비자가 배열 길이로 페이지 수를 셀 수 없다.
|
|
1790
|
+
*/
|
|
1791
|
+
declare function blocksToPages(blocks: IRBlock[]): PageMarkdown[] | undefined;
|
|
1792
|
+
|
|
1744
1793
|
/** kordoc 공용 유틸리티 */
|
|
1745
1794
|
declare const VERSION: string;
|
|
1746
1795
|
|
|
@@ -1814,4 +1863,4 @@ interface FillFormOutput {
|
|
|
1814
1863
|
*/
|
|
1815
1864
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
1816
1865
|
|
|
1817
|
-
export { BUILTIN_TEMPLATES, type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type BuiltinTemplate, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageMargin, type PageOptions, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|
|
1866
|
+
export { BUILTIN_TEMPLATES, type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type BuiltinTemplate, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageMargin, type PageMarkdown, type PageOptions, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|
package/dist/index.d.ts
CHANGED
|
@@ -131,8 +131,14 @@ interface DocumentMetadata {
|
|
|
131
131
|
createdAt?: string;
|
|
132
132
|
/** 수정일시 (ISO 8601) */
|
|
133
133
|
modifiedAt?: string;
|
|
134
|
-
/** 페이지/섹션 수 */
|
|
134
|
+
/** 페이지/섹션 수 — pageMode="layout"이면 실제 페이지 수, "section"이면 섹션 수 */
|
|
135
135
|
pageCount?: number;
|
|
136
|
+
/**
|
|
137
|
+
* 페이지 경계 신뢰도 (#66) — "layout": 조판 정보 기반 실제 페이지
|
|
138
|
+
* (한컴 저장본 HWP/HWPX·PDF·COM), "section": 섹션 단위 근사
|
|
139
|
+
* (조판 캐시 없는 생성 파일). HWP/HWPX/PDF에서만 설정된다.
|
|
140
|
+
*/
|
|
141
|
+
pageMode?: "layout" | "section";
|
|
136
142
|
/** 문서 포맷 버전 (예: HWP "5.1.0.1") */
|
|
137
143
|
version?: string;
|
|
138
144
|
/** 설명 */
|
|
@@ -229,7 +235,9 @@ interface ParseWarning {
|
|
|
229
235
|
/** 구조화된 경고 코드 */
|
|
230
236
|
code: WarningCode;
|
|
231
237
|
}
|
|
232
|
-
type WarningCode = "SKIPPED_IMAGE" | "SKIPPED_OLE" | "TRUNCATED_TABLE" | "OCR_FALLBACK" | "UNSUPPORTED_ELEMENT" | "BROKEN_ZIP_RECOVERY" | "HIDDEN_TEXT_FILTERED" | "MALFORMED_XML" | "PARTIAL_PARSE" | "LENIENT_CFB_RECOVERY" | "NEEDS_OCR" | "OCR_FAILED" | "OCR_APPLIED" | "OCR_LOW_CONF" | "COM_EMPTY" | "DRM_COM_FALLBACK"
|
|
238
|
+
type WarningCode = "SKIPPED_IMAGE" | "SKIPPED_OLE" | "TRUNCATED_TABLE" | "OCR_FALLBACK" | "UNSUPPORTED_ELEMENT" | "BROKEN_ZIP_RECOVERY" | "HIDDEN_TEXT_FILTERED" | "MALFORMED_XML" | "PARTIAL_PARSE" | "LENIENT_CFB_RECOVERY" | "NEEDS_OCR" | "OCR_FAILED" | "OCR_APPLIED" | "OCR_LOW_CONF" | "COM_EMPTY" | "DRM_COM_FALLBACK"
|
|
239
|
+
/** pages 옵션 요청됐으나 조판 캐시가 없어 섹션 단위 근사로 적용됨 (#66) */
|
|
240
|
+
| "PAGE_BOUNDARY_APPROXIMATE";
|
|
233
241
|
/** 문서 구조 (헤딩 트리) */
|
|
234
242
|
interface OutlineItem {
|
|
235
243
|
level: number;
|
|
@@ -266,11 +274,29 @@ interface ParseSuccess extends ParseResultBase {
|
|
|
266
274
|
warnings?: ParseWarning[];
|
|
267
275
|
/** 추출된 이미지 목록 — 마크다운에서 파일명으로 참조됨 */
|
|
268
276
|
images?: ExtractedImage[];
|
|
277
|
+
/**
|
|
278
|
+
* 페이지별 마크다운 (#68) — `blocks` 의 `pageNumber` 로 갈라 페이지마다 다시
|
|
279
|
+
* 마크다운을 만든 것. 페이지 경계의 신뢰도는 `metadata.pageMode` 를 따른다
|
|
280
|
+
* ("layout" = 실제 페이지, "section" = 섹션 근사). `pages` 옵션으로 범위를
|
|
281
|
+
* 줄이면 그 범위만 담긴다. 페이지 번호를 매기지 않는 포맷(DOCX 등)에서는 없고,
|
|
282
|
+
* XLSX 는 `pageCount` 와 같은 의미로 시트 한 장이 한 쪽이다.
|
|
283
|
+
*
|
|
284
|
+
* 여러 페이지에 걸친 표는 시작 페이지 한 블록이라, 표가 이어지는 중간
|
|
285
|
+
* 페이지의 `markdown` 은 빈 문자열일 수 있다 (현 IR 구조의 한계).
|
|
286
|
+
*/
|
|
287
|
+
pages?: PageMarkdown[];
|
|
269
288
|
/** 페이지별 텍스트 품질 신호 — PDF에서만 제공 */
|
|
270
289
|
pageQuality?: PageQuality[];
|
|
271
290
|
/** 문서 단위 품질 요약 — PDF에서만 제공 */
|
|
272
291
|
qualitySummary?: DocumentQualitySummary;
|
|
273
292
|
}
|
|
293
|
+
/** 페이지 한 장의 마크다운 (#68). ParseSuccess.pages 항목. */
|
|
294
|
+
interface PageMarkdown {
|
|
295
|
+
/** 원본 페이지 번호 (1-based) */
|
|
296
|
+
pageNumber: number;
|
|
297
|
+
/** 그 페이지 블록만으로 만든 마크다운. 블록이 없으면 빈 문자열 */
|
|
298
|
+
markdown: string;
|
|
299
|
+
}
|
|
274
300
|
/** 페이지별 텍스트 품질 신호 (PDF 전용). 자세한 설명은 src/pdf/quality.ts */
|
|
275
301
|
interface PageQuality {
|
|
276
302
|
page: number;
|
|
@@ -1741,6 +1767,29 @@ declare function detectZipFormat(buffer: ArrayBuffer): Promise<"hwpx" | "xlsx" |
|
|
|
1741
1767
|
|
|
1742
1768
|
declare function blocksToMarkdown(blocks: IRBlock[]): string;
|
|
1743
1769
|
|
|
1770
|
+
/**
|
|
1771
|
+
* 페이지별 마크다운 사영 (#68)
|
|
1772
|
+
*
|
|
1773
|
+
* 문서를 다시 파싱하지 않고 이미 만들어진 `IRBlock.pageNumber` 로만 블록을 갈라
|
|
1774
|
+
* 페이지마다 `blocksToMarkdown()` 을 돌린다. 페이지 번호의 신뢰도는 파서가
|
|
1775
|
+
* 정하는 것이고(`metadata.pageMode` — "layout" 은 실제 페이지, "section" 은
|
|
1776
|
+
* 섹션 근사), 여기서는 그 값을 그대로 존중한다.
|
|
1777
|
+
*/
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* 블록을 페이지 번호로 묶어 페이지별 마크다운을 만든다.
|
|
1781
|
+
*
|
|
1782
|
+
* - 어떤 블록에도 페이지 번호가 없으면 `undefined` — 페이지 개념이 없는 포맷에
|
|
1783
|
+
* "전부 1페이지" 같은 없는 사실을 만들어 내지 않는다.
|
|
1784
|
+
* - 번호가 없는 블록은 **직전 블록의 페이지로 이어붙인다.** 블록은 읽기 순서라
|
|
1785
|
+
* 이게 원문 위치에 가장 가깝고, 무엇보다 어느 페이지에도 안 실려 조용히
|
|
1786
|
+
* 사라지는 블록이 생기지 않는다. 선두의 번호 없는 블록은 첫 실번호 페이지로.
|
|
1787
|
+
* - 관측된 최소~최대 페이지 사이의 빈 페이지도 항목으로 낸다. 여러 페이지에
|
|
1788
|
+
* 걸친 표는 시작 페이지 한 블록이라 중간 페이지가 실제로 비어 있고, 이때
|
|
1789
|
+
* 항목을 빼면 소비자가 배열 길이로 페이지 수를 셀 수 없다.
|
|
1790
|
+
*/
|
|
1791
|
+
declare function blocksToPages(blocks: IRBlock[]): PageMarkdown[] | undefined;
|
|
1792
|
+
|
|
1744
1793
|
/** kordoc 공용 유틸리티 */
|
|
1745
1794
|
declare const VERSION: string;
|
|
1746
1795
|
|
|
@@ -1814,4 +1863,4 @@ interface FillFormOutput {
|
|
|
1814
1863
|
*/
|
|
1815
1864
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
1816
1865
|
|
|
1817
|
-
export { BUILTIN_TEMPLATES, type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type BuiltinTemplate, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageMargin, type PageOptions, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|
|
1866
|
+
export { BUILTIN_TEMPLATES, type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type BuiltinTemplate, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageMargin, type PageMarkdown, type PageOptions, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|