kordoc 4.2.9 → 4.3.1
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 +922 -885
- package/dist/{-ECUCTQTR.js → -RH6BEVTT.js} +28 -20
- package/dist/{chunk-J2RZ444H.js → chunk-3FFPHTXD.js} +1 -1
- package/dist/chunk-3FFPHTXD.js.map +1 -0
- package/dist/{chunk-PATPZTH7.cjs → chunk-5F5UCACZ.cjs} +6 -6
- package/dist/chunk-5F5UCACZ.cjs.map +1 -0
- package/dist/{chunk-5RPYBC2Q.js → chunk-6GBLFQMA.js} +1 -1
- package/dist/chunk-6GBLFQMA.js.map +1 -0
- package/dist/{chunk-GEPINOL6.js → chunk-6XPXIG57.js} +2 -2
- package/dist/chunk-6XPXIG57.js.map +1 -0
- package/dist/{chunk-4ZWKFDUC.cjs → chunk-7DZPPUQD.cjs} +44 -13
- package/dist/chunk-7DZPPUQD.cjs.map +1 -0
- package/dist/{chunk-MHMVFI2N.js → chunk-BPJSTJBN.js} +4 -4
- package/dist/chunk-BPJSTJBN.js.map +1 -0
- package/dist/{chunk-XU4VWOKL.js → chunk-BYEQDLZS.js} +4 -3
- package/dist/chunk-BYEQDLZS.js.map +1 -0
- package/dist/{chunk-3PLF5UIS.js → chunk-CD5X6UG5.js} +37 -6
- package/dist/chunk-CD5X6UG5.js.map +1 -0
- package/dist/chunk-DCZVOIEO.cjs.map +1 -1
- package/dist/{chunk-STYN45MS.js → chunk-FUXDD36A.js} +4 -4
- package/dist/chunk-FUXDD36A.js.map +1 -0
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-YR4PF56B.js → chunk-GTPEKBN6.js} +2 -2
- package/dist/chunk-GTPEKBN6.js.map +1 -0
- package/dist/{chunk-27Z4PUZZ.js → chunk-HPRK67YB.js} +38 -7
- package/dist/chunk-HPRK67YB.js.map +1 -0
- package/dist/{chunk-NIISBGSR.js → chunk-HZU7Y22R.js} +71 -29
- package/dist/chunk-HZU7Y22R.js.map +1 -0
- package/dist/{chunk-7ZARSBQ3.js → chunk-LEC2HG7A.js} +4 -3
- package/dist/chunk-LEC2HG7A.js.map +1 -0
- package/dist/{chunk-H7OWEYH2.cjs → chunk-MGGU3ZRK.cjs} +1 -1
- package/dist/chunk-MGGU3ZRK.cjs.map +1 -0
- package/dist/chunk-MOL7MDBG.js +0 -0
- package/dist/{chunk-DZIXKL7E.js → chunk-O5EK52TG.js} +1 -1
- package/dist/chunk-O5EK52TG.js.map +1 -0
- package/dist/{chunk-LXE7OR6N.js → chunk-PV3NVBGL.js} +3 -3
- package/dist/chunk-PV3NVBGL.js.map +1 -0
- package/dist/{chunk-G3DMDTZI.js → chunk-RO4Y4BFI.js} +1511 -1135
- package/dist/chunk-RO4Y4BFI.js.map +1 -0
- package/dist/{chunk-WTT2KJOM.js → chunk-SA22NK56.js} +14 -10
- package/dist/chunk-SA22NK56.js.map +1 -0
- package/dist/{chunk-GZ7W64QU.cjs → chunk-VQB5P5KJ.cjs} +4 -3
- package/dist/chunk-VQB5P5KJ.cjs.map +1 -0
- package/dist/{chunk-7FCNOKOR.js → chunk-W34QSJFF.js} +1 -1
- package/dist/chunk-W34QSJFF.js.map +1 -0
- package/dist/{chunk-VEHC4EJL.js → chunk-YDCD4AV4.js} +5 -5
- package/dist/chunk-YDCD4AV4.js.map +1 -0
- package/dist/{chunk-NNDVFNMJ.js → chunk-YNJDNP44.js} +1 -1
- package/dist/chunk-YNJDNP44.js.map +1 -0
- package/dist/{chunk-3TSTZGCJ.js → chunk-ZJ75YDW7.js} +4 -3
- package/dist/chunk-ZJ75YDW7.js.map +1 -0
- package/dist/{chunk-6GM2QLM3.cjs → chunk-ZMKTKJZN.cjs} +21 -21
- package/dist/chunk-ZMKTKJZN.cjs.map +1 -0
- package/dist/{chunk-LM7C6HI2.js → chunk-ZSL6MQVE.js} +1 -1
- package/dist/chunk-ZSL6MQVE.js.map +1 -0
- package/dist/{chunk-KTPZYXN2.js → chunk-ZYYTU7NY.js} +2 -2
- package/dist/chunk-ZYYTU7NY.js.map +1 -0
- package/dist/chunks-JEYQWXIZ.js +10 -0
- package/dist/cli.js +75 -39
- package/dist/cli.js.map +1 -1
- package/dist/{formula-SXC6LRRC.js → formula-7ZPC54JO.js} +2 -2
- package/dist/formula-7ZPC54JO.js.map +1 -0
- package/dist/{formula-KSNAEBZ2.js → formula-EQRHSMYW.js} +2 -2
- package/dist/formula-EQRHSMYW.js.map +1 -0
- package/dist/{formula-SB3NHDUM.cjs → formula-IWV5IJ3Y.cjs} +8 -8
- package/dist/formula-IWV5IJ3Y.cjs.map +1 -0
- package/dist/{image-ocr-PS7XCV6K.js → image-ocr-6MO4FXJK.js} +8 -6
- package/dist/image-ocr-6MO4FXJK.js.map +1 -0
- package/dist/{image-ocr-J5656BEE.cjs → image-ocr-MGVXT6XD.cjs} +13 -11
- package/dist/image-ocr-MGVXT6XD.cjs.map +1 -0
- package/dist/{image-ocr-KZTNJ62U.js → image-ocr-TWUU2RNG.js} +10 -8
- package/dist/image-ocr-TWUU2RNG.js.map +1 -0
- package/dist/index.cjs +1993 -1845
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -4
- package/dist/index.d.ts +75 -4
- package/dist/index.js +2128 -1980
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +123 -78
- package/dist/mcp.js.map +1 -1
- package/dist/{models-KA4GLQK5.js → models-6VMAVZR6.js} +3 -3
- package/dist/page-range-737B4EZW.js +0 -0
- package/dist/page-range-P7SDW6LR.cjs.map +1 -1
- package/dist/{parser-CSYU3CAW.cjs → parser-JFGLN4DA.cjs} +25 -25
- package/dist/parser-JFGLN4DA.cjs.map +1 -0
- package/dist/{parser-WNFWMBSL.js → parser-VR2BTUT7.js} +8 -8
- package/dist/parser-VR2BTUT7.js.map +1 -0
- package/dist/{parser-A34NAYKA.js → parser-YA7HSSPK.js} +6 -6
- package/dist/parser-YA7HSSPK.js.map +1 -0
- package/dist/pdf-ocr-4LISPZEM.cjs +13 -0
- package/dist/pdf-ocr-4LISPZEM.cjs.map +1 -0
- package/dist/pdf-ocr-AIWB2QCS.js +12 -0
- package/dist/pdf-ocr-QMOKUMC2.js +15 -0
- package/dist/{profile-io-43MF52H6.js → profile-io-QPIMGVO3.js} +3 -3
- package/dist/{rasterize-OG7KXBJS.js → rasterize-AFYGNKXG.js} +2 -2
- package/dist/rasterize-AFYGNKXG.js.map +1 -0
- package/dist/{redact-7ILEAUTS.js → redact-W5K3ILQH.js} +2 -2
- package/dist/render-PSPTMZIZ.js +10 -0
- package/dist/seal-4XBJ7ISE.js +10 -0
- package/dist/{setup-GUQT5ELJ.js → setup-I4I75QJU.js} +1 -1
- package/dist/setup-I4I75QJU.js.map +1 -0
- package/dist/{watch-SOHQMZN2.js → watch-D3JJEOAB.js} +12 -14
- package/dist/watch-D3JJEOAB.js.map +1 -0
- package/package.json +101 -98
- package/templates//352/260/204/354/235/264/352/270/260/354/225/210/353/254/270_/354/204/234/354/213/235.hwpx +0 -0
- package/templates//352/260/204/354/235/264/352/270/260/354/225/210/353/254/270_/354/230/210/354/213/234/352/260/222.json +9 -0
- package/templates//354/235/274/353/260/230/352/270/260/354/225/210/353/254/270_/354/204/234/354/213/235.hwpx +0 -0
- package/templates//354/235/274/353/260/230/352/270/260/354/225/210/353/254/270_/354/230/210/354/213/234/352/260/222.json +25 -0
- package/dist/chunk-27Z4PUZZ.js.map +0 -1
- package/dist/chunk-3PLF5UIS.js.map +0 -1
- package/dist/chunk-3TSTZGCJ.js.map +0 -1
- package/dist/chunk-4ZWKFDUC.cjs.map +0 -1
- package/dist/chunk-5RPYBC2Q.js.map +0 -1
- package/dist/chunk-6GM2QLM3.cjs.map +0 -1
- package/dist/chunk-7FCNOKOR.js.map +0 -1
- package/dist/chunk-7ZARSBQ3.js.map +0 -1
- package/dist/chunk-DZIXKL7E.js.map +0 -1
- package/dist/chunk-G3DMDTZI.js.map +0 -1
- package/dist/chunk-GEPINOL6.js.map +0 -1
- package/dist/chunk-GZ7W64QU.cjs.map +0 -1
- package/dist/chunk-H7OWEYH2.cjs.map +0 -1
- package/dist/chunk-J2RZ444H.js.map +0 -1
- package/dist/chunk-KTPZYXN2.js.map +0 -1
- package/dist/chunk-LM7C6HI2.js.map +0 -1
- package/dist/chunk-LXE7OR6N.js.map +0 -1
- package/dist/chunk-MHMVFI2N.js.map +0 -1
- package/dist/chunk-NIISBGSR.js.map +0 -1
- package/dist/chunk-NNDVFNMJ.js.map +0 -1
- package/dist/chunk-PATPZTH7.cjs.map +0 -1
- package/dist/chunk-STYN45MS.js.map +0 -1
- package/dist/chunk-TCJRGFYY.js +0 -280
- package/dist/chunk-TCJRGFYY.js.map +0 -1
- package/dist/chunk-VEHC4EJL.js.map +0 -1
- package/dist/chunk-WTT2KJOM.js.map +0 -1
- package/dist/chunk-XU4VWOKL.js.map +0 -1
- package/dist/chunk-YR4PF56B.js.map +0 -1
- package/dist/chunks-VFIMYK36.js +0 -10
- package/dist/detect-FX2ZHKZP.js +0 -26
- package/dist/formula-KSNAEBZ2.js.map +0 -1
- package/dist/formula-SB3NHDUM.cjs.map +0 -1
- package/dist/formula-SXC6LRRC.js.map +0 -1
- package/dist/image-ocr-J5656BEE.cjs.map +0 -1
- package/dist/image-ocr-KZTNJ62U.js.map +0 -1
- package/dist/image-ocr-PS7XCV6K.js.map +0 -1
- package/dist/parser-A34NAYKA.js.map +0 -1
- package/dist/parser-CSYU3CAW.cjs.map +0 -1
- package/dist/parser-WNFWMBSL.js.map +0 -1
- package/dist/pdf-ocr-KBMWPG2L.js +0 -12
- package/dist/pdf-ocr-NPZG67FN.js +0 -15
- package/dist/pdf-ocr-O44DAGTY.cjs +0 -13
- package/dist/pdf-ocr-O44DAGTY.cjs.map +0 -1
- package/dist/rasterize-OG7KXBJS.js.map +0 -1
- package/dist/render-336CJHAS.js +0 -10
- package/dist/seal-TM2XCE2R.js +0 -10
- package/dist/seal-TM2XCE2R.js.map +0 -1
- package/dist/setup-GUQT5ELJ.js.map +0 -1
- package/dist/watch-SOHQMZN2.js.map +0 -1
- /package/dist/{-ECUCTQTR.js.map → -RH6BEVTT.js.map} +0 -0
- /package/dist/{chunks-VFIMYK36.js.map → chunks-JEYQWXIZ.js.map} +0 -0
- /package/dist/{detect-FX2ZHKZP.js.map → models-6VMAVZR6.js.map} +0 -0
- /package/dist/{models-KA4GLQK5.js.map → pdf-ocr-AIWB2QCS.js.map} +0 -0
- /package/dist/{pdf-ocr-KBMWPG2L.js.map → pdf-ocr-QMOKUMC2.js.map} +0 -0
- /package/dist/{pdf-ocr-NPZG67FN.js.map → profile-io-QPIMGVO3.js.map} +0 -0
- /package/dist/{profile-io-43MF52H6.js.map → redact-W5K3ILQH.js.map} +0 -0
- /package/dist/{redact-7ILEAUTS.js.map → render-PSPTMZIZ.js.map} +0 -0
- /package/dist/{render-336CJHAS.js.map → seal-4XBJ7ISE.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -105,7 +105,9 @@ interface IRCell {
|
|
|
105
105
|
rowSpan: number;
|
|
106
106
|
/**
|
|
107
107
|
* 셀 내부 블록 콘텐츠 — v3.0.
|
|
108
|
-
* 중첩
|
|
108
|
+
* 중첩 표·이미지 등 구조 콘텐츠(또는 왕복 채널 span 문단)가 있는 셀에만 채워지며,
|
|
109
|
+
* 그 안의 문단·표·이미지를 문서(원문) 순서대로 보존한다. 다중 문단뿐인 평문 셀은
|
|
110
|
+
* blocks 없이 text 평탄화(문단을 `\n`으로 결합)로만 제공된다 (blocks 무게 억제, #57).
|
|
109
111
|
* 표와 텍스트가 한 줄에 번갈아 놓인 셀도 배치 순서를 따른다 (v4.2.3, #49).
|
|
110
112
|
* blocks가 있으면 text는 blocks의 평탄화 텍스트(하위 호환용)다.
|
|
111
113
|
*/
|
|
@@ -158,6 +160,12 @@ interface ParseOptions {
|
|
|
158
160
|
* 기본 false: 마크다운 가독성을 위해 후행 빈 열을 트림.
|
|
159
161
|
* 양식 인식 경로(parse_form·fill)는 내부적으로 항상 켠다. */
|
|
160
162
|
keepTrailingEmptyCols?: boolean;
|
|
163
|
+
/** 빈 문단(텍스트 없는 hp:p) 보존 (#57). 기본 false: 종전대로 빈 문단 제거.
|
|
164
|
+
* 켜면 본문은 `text: ""` paragraph 블록으로, 표 셀은 빈 줄로 순서대로 보존해
|
|
165
|
+
* "원문 문단 수 = 줄 수" 대응을 유지한다 (행 줄맞춤 서식 문서용).
|
|
166
|
+
* 개체(표·이미지·글상자)만 있는 문단은 개체 출력이 따로 있어 대상이 아니다.
|
|
167
|
+
* 현재 HWPX 경로 적용. */
|
|
168
|
+
keepEmptyParagraphs?: boolean;
|
|
161
169
|
/** 원본 파일 경로 (DRM COM fallback에 필요, 내부 전용) */
|
|
162
170
|
filePath?: string;
|
|
163
171
|
/**
|
|
@@ -369,8 +377,9 @@ interface FormResult {
|
|
|
369
377
|
/** 양식 확신도 (0-1) */
|
|
370
378
|
confidence: number;
|
|
371
379
|
}
|
|
372
|
-
/** 사용자 제공 OCR 함수 — 페이지 이미지를 받아 텍스트
|
|
373
|
-
|
|
380
|
+
/** 사용자 제공 OCR 함수 — 페이지 이미지를 받아 텍스트 반환.
|
|
381
|
+
* PDF 경로는 항상 "image/png", 이미지 직접 입력 경로는 원본 mime 그대로 전달. */
|
|
382
|
+
type OcrProvider = (pageImage: Uint8Array, pageNumber: number, mimeType: "image/png" | "image/jpeg" | "image/webp") => Promise<string>;
|
|
374
383
|
interface WatchOptions {
|
|
375
384
|
dir: string;
|
|
376
385
|
outDir?: string;
|
|
@@ -563,6 +572,68 @@ declare function fillHwpx(hwpxBuffer: ArrayBuffer, values: Record<string, FillIn
|
|
|
563
572
|
* 라벨 셀이 접두사 매칭으로 남의 값에 오염되는 것을 차단 (sfill-2) */
|
|
564
573
|
blockedLabels?: Set<string>): Promise<HwpxFillResult>;
|
|
565
574
|
|
|
575
|
+
/**
|
|
576
|
+
* 누름틀(CLICK_HERE fieldBegin) 인식·채우기 — 정부 표준 서식(기안문) 지원
|
|
577
|
+
*
|
|
578
|
+
* HWPX의 누름틀은 `<hp:ctrl><hp:fieldBegin type="CLICK_HERE" name="…">…</hp:fieldBegin>
|
|
579
|
+
* </hp:ctrl>` 과 `<hp:ctrl><hp:fieldEnd beginIDRef="…"/></hp:ctrl>` 쌍으로 표시되고,
|
|
580
|
+
* 실제 값은 두 ctrl **사이의** run 콘텐츠다. 안내문(placeholder)은 fieldBegin의
|
|
581
|
+
* Clickhere Command 파라미터에만 있고 본문 텍스트가 아니므로, 채우기는 안내문과
|
|
582
|
+
* 값을 비교하지 않고 무조건 사이 영역을 값으로 치환한다 — 값이 안내문과 동일해도
|
|
583
|
+
* 침묵 유실이 없다 (rhwp 코어 결함 #3380 교훈).
|
|
584
|
+
*
|
|
585
|
+
* 치환은 filler-hwpx와 같은 철학의 원본 XML splice — fieldBegin/fieldEnd·안내문
|
|
586
|
+
* 파라미터·둘러싼 run(charPr)을 1바이트도 건드리지 않고 사이 영역만 바꾼다.
|
|
587
|
+
*/
|
|
588
|
+
|
|
589
|
+
/** 문서에서 발견한 누름틀 필드 */
|
|
590
|
+
interface ClickHereField {
|
|
591
|
+
/** 누름틀 이름 (fieldBegin name 속성) */
|
|
592
|
+
name: string;
|
|
593
|
+
/** 안내문 — 필드가 비어 있을 때 한글이 표시하는 문구 (Clickhere Direction 파라미터) */
|
|
594
|
+
placeholder?: string;
|
|
595
|
+
/** begin~end 사이 현재 텍스트 — 빈 서식이면 "" (안내문은 값이 아니다) */
|
|
596
|
+
value: string;
|
|
597
|
+
/** 0-based 섹션 번호 */
|
|
598
|
+
section: number;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* HWPX의 CLICK_HERE 누름틀 필드 목록 — 이름·안내문·현재값을 문서 순서로 반환.
|
|
602
|
+
* 표준 서식(기안문 등)이 요구하는 필드를 채우기 전에 조사하는 용도.
|
|
603
|
+
*/
|
|
604
|
+
declare function extractClickHereFields(hwpxBuffer: ArrayBuffer): Promise<ClickHereField[]>;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* 내장 표준 서식 템플릿 — 정부 표준 기안문 (rhwp tools/forms 자산, MIT)
|
|
608
|
+
*
|
|
609
|
+
* templates/ 디렉토리의 누름틀(CLICK_HERE) 내장 HWPX 서식을 이름으로 제공한다.
|
|
610
|
+
* 서식 원본은 「행정 효율과 협업 촉진에 관한 규정 시행규칙」 별지 제1·2호서식
|
|
611
|
+
* (어트리뷰션: THIRD_PARTY/rhwp-forms.txt).
|
|
612
|
+
*/
|
|
613
|
+
/** 내장 템플릿 메타데이터 */
|
|
614
|
+
interface BuiltinTemplate {
|
|
615
|
+
/** 영문 식별자 — CLI/MCP에서 쓰는 정식 이름 */
|
|
616
|
+
id: string;
|
|
617
|
+
/** 한글 별칭 (`templates:일반기안문` 표기 포함 매칭) */
|
|
618
|
+
aliases: string[];
|
|
619
|
+
/** templates/ 안의 서식 파일명 */
|
|
620
|
+
file: string;
|
|
621
|
+
/** templates/ 안의 예시값 JSON 파일명 */
|
|
622
|
+
sampleFile: string;
|
|
623
|
+
/** 한 줄 소개 */
|
|
624
|
+
title: string;
|
|
625
|
+
}
|
|
626
|
+
declare const BUILTIN_TEMPLATES: readonly BuiltinTemplate[];
|
|
627
|
+
/**
|
|
628
|
+
* 이름/별칭으로 내장 템플릿 해석 — `templates:` 접두사 허용.
|
|
629
|
+
* 예: "gian", "gian-simple", "일반기안문", "templates:간이기안문"
|
|
630
|
+
*/
|
|
631
|
+
declare function resolveBuiltinTemplate(name: string): BuiltinTemplate | undefined;
|
|
632
|
+
/** 내장 템플릿 HWPX 버퍼 읽기 */
|
|
633
|
+
declare function readBuiltinTemplate(t: BuiltinTemplate): ArrayBuffer;
|
|
634
|
+
/** 내장 템플릿 예시값 JSON 읽기 */
|
|
635
|
+
declare function readBuiltinTemplateSample(t: BuiltinTemplate): Record<string, string>;
|
|
636
|
+
|
|
566
637
|
/**
|
|
567
638
|
* place_seal — 도장/서명 이미지를 앵커 문구("(인)"·"서명 또는 인" 등) 위에
|
|
568
639
|
* 부유(글 앞) 배치. 표/페이지 불확장 (P6, claw-hwp placeSeal 이식).
|
|
@@ -1680,4 +1751,4 @@ interface FillFormOutput {
|
|
|
1680
1751
|
*/
|
|
1681
1752
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
1682
1753
|
|
|
1683
|
-
export { type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, 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 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, 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, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|
|
1754
|
+
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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -105,7 +105,9 @@ interface IRCell {
|
|
|
105
105
|
rowSpan: number;
|
|
106
106
|
/**
|
|
107
107
|
* 셀 내부 블록 콘텐츠 — v3.0.
|
|
108
|
-
* 중첩
|
|
108
|
+
* 중첩 표·이미지 등 구조 콘텐츠(또는 왕복 채널 span 문단)가 있는 셀에만 채워지며,
|
|
109
|
+
* 그 안의 문단·표·이미지를 문서(원문) 순서대로 보존한다. 다중 문단뿐인 평문 셀은
|
|
110
|
+
* blocks 없이 text 평탄화(문단을 `\n`으로 결합)로만 제공된다 (blocks 무게 억제, #57).
|
|
109
111
|
* 표와 텍스트가 한 줄에 번갈아 놓인 셀도 배치 순서를 따른다 (v4.2.3, #49).
|
|
110
112
|
* blocks가 있으면 text는 blocks의 평탄화 텍스트(하위 호환용)다.
|
|
111
113
|
*/
|
|
@@ -158,6 +160,12 @@ interface ParseOptions {
|
|
|
158
160
|
* 기본 false: 마크다운 가독성을 위해 후행 빈 열을 트림.
|
|
159
161
|
* 양식 인식 경로(parse_form·fill)는 내부적으로 항상 켠다. */
|
|
160
162
|
keepTrailingEmptyCols?: boolean;
|
|
163
|
+
/** 빈 문단(텍스트 없는 hp:p) 보존 (#57). 기본 false: 종전대로 빈 문단 제거.
|
|
164
|
+
* 켜면 본문은 `text: ""` paragraph 블록으로, 표 셀은 빈 줄로 순서대로 보존해
|
|
165
|
+
* "원문 문단 수 = 줄 수" 대응을 유지한다 (행 줄맞춤 서식 문서용).
|
|
166
|
+
* 개체(표·이미지·글상자)만 있는 문단은 개체 출력이 따로 있어 대상이 아니다.
|
|
167
|
+
* 현재 HWPX 경로 적용. */
|
|
168
|
+
keepEmptyParagraphs?: boolean;
|
|
161
169
|
/** 원본 파일 경로 (DRM COM fallback에 필요, 내부 전용) */
|
|
162
170
|
filePath?: string;
|
|
163
171
|
/**
|
|
@@ -369,8 +377,9 @@ interface FormResult {
|
|
|
369
377
|
/** 양식 확신도 (0-1) */
|
|
370
378
|
confidence: number;
|
|
371
379
|
}
|
|
372
|
-
/** 사용자 제공 OCR 함수 — 페이지 이미지를 받아 텍스트
|
|
373
|
-
|
|
380
|
+
/** 사용자 제공 OCR 함수 — 페이지 이미지를 받아 텍스트 반환.
|
|
381
|
+
* PDF 경로는 항상 "image/png", 이미지 직접 입력 경로는 원본 mime 그대로 전달. */
|
|
382
|
+
type OcrProvider = (pageImage: Uint8Array, pageNumber: number, mimeType: "image/png" | "image/jpeg" | "image/webp") => Promise<string>;
|
|
374
383
|
interface WatchOptions {
|
|
375
384
|
dir: string;
|
|
376
385
|
outDir?: string;
|
|
@@ -563,6 +572,68 @@ declare function fillHwpx(hwpxBuffer: ArrayBuffer, values: Record<string, FillIn
|
|
|
563
572
|
* 라벨 셀이 접두사 매칭으로 남의 값에 오염되는 것을 차단 (sfill-2) */
|
|
564
573
|
blockedLabels?: Set<string>): Promise<HwpxFillResult>;
|
|
565
574
|
|
|
575
|
+
/**
|
|
576
|
+
* 누름틀(CLICK_HERE fieldBegin) 인식·채우기 — 정부 표준 서식(기안문) 지원
|
|
577
|
+
*
|
|
578
|
+
* HWPX의 누름틀은 `<hp:ctrl><hp:fieldBegin type="CLICK_HERE" name="…">…</hp:fieldBegin>
|
|
579
|
+
* </hp:ctrl>` 과 `<hp:ctrl><hp:fieldEnd beginIDRef="…"/></hp:ctrl>` 쌍으로 표시되고,
|
|
580
|
+
* 실제 값은 두 ctrl **사이의** run 콘텐츠다. 안내문(placeholder)은 fieldBegin의
|
|
581
|
+
* Clickhere Command 파라미터에만 있고 본문 텍스트가 아니므로, 채우기는 안내문과
|
|
582
|
+
* 값을 비교하지 않고 무조건 사이 영역을 값으로 치환한다 — 값이 안내문과 동일해도
|
|
583
|
+
* 침묵 유실이 없다 (rhwp 코어 결함 #3380 교훈).
|
|
584
|
+
*
|
|
585
|
+
* 치환은 filler-hwpx와 같은 철학의 원본 XML splice — fieldBegin/fieldEnd·안내문
|
|
586
|
+
* 파라미터·둘러싼 run(charPr)을 1바이트도 건드리지 않고 사이 영역만 바꾼다.
|
|
587
|
+
*/
|
|
588
|
+
|
|
589
|
+
/** 문서에서 발견한 누름틀 필드 */
|
|
590
|
+
interface ClickHereField {
|
|
591
|
+
/** 누름틀 이름 (fieldBegin name 속성) */
|
|
592
|
+
name: string;
|
|
593
|
+
/** 안내문 — 필드가 비어 있을 때 한글이 표시하는 문구 (Clickhere Direction 파라미터) */
|
|
594
|
+
placeholder?: string;
|
|
595
|
+
/** begin~end 사이 현재 텍스트 — 빈 서식이면 "" (안내문은 값이 아니다) */
|
|
596
|
+
value: string;
|
|
597
|
+
/** 0-based 섹션 번호 */
|
|
598
|
+
section: number;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* HWPX의 CLICK_HERE 누름틀 필드 목록 — 이름·안내문·현재값을 문서 순서로 반환.
|
|
602
|
+
* 표준 서식(기안문 등)이 요구하는 필드를 채우기 전에 조사하는 용도.
|
|
603
|
+
*/
|
|
604
|
+
declare function extractClickHereFields(hwpxBuffer: ArrayBuffer): Promise<ClickHereField[]>;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* 내장 표준 서식 템플릿 — 정부 표준 기안문 (rhwp tools/forms 자산, MIT)
|
|
608
|
+
*
|
|
609
|
+
* templates/ 디렉토리의 누름틀(CLICK_HERE) 내장 HWPX 서식을 이름으로 제공한다.
|
|
610
|
+
* 서식 원본은 「행정 효율과 협업 촉진에 관한 규정 시행규칙」 별지 제1·2호서식
|
|
611
|
+
* (어트리뷰션: THIRD_PARTY/rhwp-forms.txt).
|
|
612
|
+
*/
|
|
613
|
+
/** 내장 템플릿 메타데이터 */
|
|
614
|
+
interface BuiltinTemplate {
|
|
615
|
+
/** 영문 식별자 — CLI/MCP에서 쓰는 정식 이름 */
|
|
616
|
+
id: string;
|
|
617
|
+
/** 한글 별칭 (`templates:일반기안문` 표기 포함 매칭) */
|
|
618
|
+
aliases: string[];
|
|
619
|
+
/** templates/ 안의 서식 파일명 */
|
|
620
|
+
file: string;
|
|
621
|
+
/** templates/ 안의 예시값 JSON 파일명 */
|
|
622
|
+
sampleFile: string;
|
|
623
|
+
/** 한 줄 소개 */
|
|
624
|
+
title: string;
|
|
625
|
+
}
|
|
626
|
+
declare const BUILTIN_TEMPLATES: readonly BuiltinTemplate[];
|
|
627
|
+
/**
|
|
628
|
+
* 이름/별칭으로 내장 템플릿 해석 — `templates:` 접두사 허용.
|
|
629
|
+
* 예: "gian", "gian-simple", "일반기안문", "templates:간이기안문"
|
|
630
|
+
*/
|
|
631
|
+
declare function resolveBuiltinTemplate(name: string): BuiltinTemplate | undefined;
|
|
632
|
+
/** 내장 템플릿 HWPX 버퍼 읽기 */
|
|
633
|
+
declare function readBuiltinTemplate(t: BuiltinTemplate): ArrayBuffer;
|
|
634
|
+
/** 내장 템플릿 예시값 JSON 읽기 */
|
|
635
|
+
declare function readBuiltinTemplateSample(t: BuiltinTemplate): Record<string, string>;
|
|
636
|
+
|
|
566
637
|
/**
|
|
567
638
|
* place_seal — 도장/서명 이미지를 앵커 문구("(인)"·"서명 또는 인" 등) 위에
|
|
568
639
|
* 부유(글 앞) 배치. 표/페이지 불확장 (P6, claw-hwp placeSeal 이식).
|
|
@@ -1680,4 +1751,4 @@ interface FillFormOutput {
|
|
|
1680
1751
|
*/
|
|
1681
1752
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
1682
1753
|
|
|
1683
|
-
export { type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, 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 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, 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, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|
|
1754
|
+
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 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 };
|