kordoc 4.14.2 → 4.14.3
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 +38 -5
- package/dist/{-AQKXLFIM.js → -7XBPXCXN.js} +13 -11
- package/dist/{chunk-FOJZNMMK.js → chunk-2LQGSDZ6.js} +1 -1
- package/dist/chunk-2LQGSDZ6.js.map +1 -0
- package/dist/chunk-4R67INKT.js +1002 -0
- package/dist/chunk-4R67INKT.js.map +1 -0
- package/dist/{chunk-ILU76UF3.js → chunk-4RJ5D7MT.js} +2 -2
- package/dist/chunk-4RJ5D7MT.js.map +1 -0
- package/dist/{chunk-EQZI77PP.cjs → chunk-5VVS2QIJ.cjs} +3 -3
- package/dist/{chunk-EQZI77PP.cjs.map → chunk-5VVS2QIJ.cjs.map} +1 -1
- package/dist/{chunk-3DUADAY2.js → chunk-A275ZQLX.js} +209 -87
- package/dist/chunk-A275ZQLX.js.map +1 -0
- package/dist/{chunk-EISO3POT.js → chunk-CVEERPMP.js} +788 -194
- package/dist/chunk-CVEERPMP.js.map +1 -0
- package/dist/{chunk-ZWD734EY.js → chunk-D6KQKMU3.js} +2 -2
- package/dist/{chunk-QOMNEWCQ.cjs → chunk-EBZUZC6F.cjs} +305 -31
- package/dist/chunk-EBZUZC6F.cjs.map +1 -0
- package/dist/{chunk-HR2XNERB.cjs → chunk-EMGF6EEV.cjs} +2 -2
- package/dist/{chunk-HR2XNERB.cjs.map → chunk-EMGF6EEV.cjs.map} +1 -1
- package/dist/{chunk-GDW4YP7K.js → chunk-FAZR34CA.js} +2 -2
- package/dist/{chunk-TNCKOL2O.js → chunk-GTINVM5K.js} +2 -2
- package/dist/{chunk-L7DMSMAG.cjs → chunk-HX4UUF7Y.cjs} +1 -1
- package/dist/chunk-HX4UUF7Y.cjs.map +1 -0
- package/dist/{chunk-UET462HB.js → chunk-I4NNYWIR.js} +2 -2
- package/dist/chunk-IH56ZISC.js +620 -0
- package/dist/chunk-IH56ZISC.js.map +1 -0
- package/dist/{chunk-EDNJLUSE.js → chunk-IHZEFW4L.js} +2 -2
- package/dist/chunk-IW2CB755.cjs +1002 -0
- package/dist/chunk-IW2CB755.cjs.map +1 -0
- package/dist/{chunk-ZWOFQRIB.js → chunk-JCVIOLBF.js} +3 -3
- package/dist/{chunk-JQEFP45L.js → chunk-L5EH2NVO.js} +2 -2
- package/dist/{chunk-247ANM72.cjs → chunk-NOAQRCV6.cjs} +219 -97
- package/dist/chunk-NOAQRCV6.cjs.map +1 -0
- package/dist/{chunk-7IAQ4HOK.js → chunk-NQCUAGLR.js} +1 -1
- package/dist/chunk-NQCUAGLR.js.map +1 -0
- package/dist/{chunk-NS55SM7A.js → chunk-O2PGQNYE.js} +2 -2
- package/dist/{chunk-QC5T6D4J.js → chunk-QGW7NMTX.js} +299 -25
- package/dist/chunk-QGW7NMTX.js.map +1 -0
- package/dist/{chunk-A7QC2ZVP.js → chunk-UVVEBI22.js} +209 -87
- package/dist/chunk-UVVEBI22.js.map +1 -0
- package/dist/chunk-VJHAUMCF.js +949 -0
- package/dist/chunk-VJHAUMCF.js.map +1 -0
- package/dist/{chunk-C7FQBSON.js → chunk-VNFJPTU4.js} +2 -2
- package/dist/{chunk-VQ5W4MYO.js → chunk-VYOGXNQ3.js} +298 -24
- package/dist/chunk-VYOGXNQ3.js.map +1 -0
- package/dist/{chunk-DOGPOY4B.js → chunk-WB5LW52Z.js} +2 -2
- package/dist/{chunk-TSFS5VKD.js → chunk-YGBZABI4.js} +332 -141
- package/dist/chunk-YGBZABI4.js.map +1 -0
- package/dist/chunks-I7TEMJXH.js +10 -0
- package/dist/cli.js +228 -97
- package/dist/cli.js.map +1 -1
- package/dist/{formula-PJJ6S3Z2.cjs → formula-CPO2TZGB.cjs} +9 -9
- package/dist/{formula-PJJ6S3Z2.cjs.map → formula-CPO2TZGB.cjs.map} +1 -1
- package/dist/{formula-5S7WWXGH.js → formula-NOIDZEBA.js} +4 -4
- package/dist/{formula-JGFTXWYT.js → formula-X44GV7TN.js} +3 -3
- package/dist/{image-ocr-WCAYXLOA.js → image-ocr-72RAR4WR.js} +34 -16
- package/dist/image-ocr-72RAR4WR.js.map +1 -0
- package/dist/{image-ocr-FLIL7MGN.js → image-ocr-R6W6A75P.js} +32 -14
- package/dist/image-ocr-R6W6A75P.js.map +1 -0
- package/dist/{image-ocr-ZTYAGV3W.cjs → image-ocr-SUGT64ZM.cjs} +36 -18
- package/dist/image-ocr-SUGT64ZM.cjs.map +1 -0
- package/dist/index.cjs +2416 -1184
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -25
- package/dist/index.d.ts +62 -25
- package/dist/index.js +1853 -621
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +74 -53
- package/dist/mcp.js.map +1 -1
- package/dist/{model-bundle-FSPZZ2EM.js → model-bundle-57CLEBCO.js} +5 -5
- package/dist/{models-CJPAQK5R.js → models-7ELIFTD7.js} +5 -5
- package/dist/{parser-SCUTZAIJ.js → parser-4NKAYWAX.js} +261 -241
- package/dist/parser-4NKAYWAX.js.map +1 -0
- package/dist/{parser-A4TMPJAM.js → parser-HWFQRSUQ.js} +261 -241
- package/dist/parser-HWFQRSUQ.js.map +1 -0
- package/dist/{parser-VCXE4I5A.cjs → parser-RANGXGBD.cjs} +289 -269
- package/dist/parser-RANGXGBD.cjs.map +1 -0
- package/dist/pdf-ocr-BNC34MNU.js +13 -0
- package/dist/pdf-ocr-QX2GB33Q.js +16 -0
- package/dist/pdf-ocr-VHSFACH7.cjs +14 -0
- package/dist/{pdf-ocr-MBZZ57LD.cjs.map → pdf-ocr-VHSFACH7.cjs.map} +1 -1
- package/dist/{profile-io-LBM263K7.js → profile-io-V52PL5ZO.js} +3 -3
- package/dist/{rasterize-46RG4ZF6.js → rasterize-ZIGLJDOG.js} +3 -3
- package/dist/redact-TIQEQI3M.js +18 -0
- package/dist/redact-doc-KXZ3TZAG.js +1216 -0
- package/dist/redact-doc-KXZ3TZAG.js.map +1 -0
- package/dist/{render-NGP5T24S.js → render-U5PE6V2E.js} +7 -7
- package/dist/seal-DNXJBILR.js +10 -0
- package/dist/{setup-AU4OCHNH.js → setup-YRDM4ODP.js} +3 -3
- package/dist/visual-5XWMA4EV.js +19 -0
- package/dist/{watch-MKPUCPXM.js → watch-5IOLBATT.js} +12 -12
- package/package.json +2 -2
- package/dist/chunk-247ANM72.cjs.map +0 -1
- package/dist/chunk-3DUADAY2.js.map +0 -1
- package/dist/chunk-422427XJ.cjs +0 -571
- package/dist/chunk-422427XJ.cjs.map +0 -1
- package/dist/chunk-7IAQ4HOK.js.map +0 -1
- package/dist/chunk-A7QC2ZVP.js.map +0 -1
- package/dist/chunk-DZIXKL7E.js +0 -145
- package/dist/chunk-DZIXKL7E.js.map +0 -1
- package/dist/chunk-EISO3POT.js.map +0 -1
- package/dist/chunk-EP7KOI2V.js +0 -571
- package/dist/chunk-EP7KOI2V.js.map +0 -1
- package/dist/chunk-FOJZNMMK.js.map +0 -1
- package/dist/chunk-ILU76UF3.js.map +0 -1
- package/dist/chunk-KVWV4ULP.js +0 -516
- package/dist/chunk-KVWV4ULP.js.map +0 -1
- package/dist/chunk-L7DMSMAG.cjs.map +0 -1
- package/dist/chunk-QC5T6D4J.js.map +0 -1
- package/dist/chunk-QOMNEWCQ.cjs.map +0 -1
- package/dist/chunk-TSFS5VKD.js.map +0 -1
- package/dist/chunk-VQ5W4MYO.js.map +0 -1
- package/dist/chunks-SX77P5CV.js +0 -10
- package/dist/image-ocr-FLIL7MGN.js.map +0 -1
- package/dist/image-ocr-WCAYXLOA.js.map +0 -1
- package/dist/image-ocr-ZTYAGV3W.cjs.map +0 -1
- package/dist/parser-A4TMPJAM.js.map +0 -1
- package/dist/parser-SCUTZAIJ.js.map +0 -1
- package/dist/parser-VCXE4I5A.cjs.map +0 -1
- package/dist/pdf-ocr-76SAUXMZ.js +0 -13
- package/dist/pdf-ocr-CPU55CVF.js +0 -16
- package/dist/pdf-ocr-MBZZ57LD.cjs +0 -14
- package/dist/redact-7ILEAUTS.js +0 -12
- package/dist/seal-RGUPOLXD.js +0 -10
- package/dist/visual-NZLYIYEM.js +0 -19
- /package/dist/{-AQKXLFIM.js.map → -7XBPXCXN.js.map} +0 -0
- /package/dist/{chunk-ZWD734EY.js.map → chunk-D6KQKMU3.js.map} +0 -0
- /package/dist/{chunk-GDW4YP7K.js.map → chunk-FAZR34CA.js.map} +0 -0
- /package/dist/{chunk-TNCKOL2O.js.map → chunk-GTINVM5K.js.map} +0 -0
- /package/dist/{chunk-UET462HB.js.map → chunk-I4NNYWIR.js.map} +0 -0
- /package/dist/{chunk-EDNJLUSE.js.map → chunk-IHZEFW4L.js.map} +0 -0
- /package/dist/{chunk-ZWOFQRIB.js.map → chunk-JCVIOLBF.js.map} +0 -0
- /package/dist/{chunk-JQEFP45L.js.map → chunk-L5EH2NVO.js.map} +0 -0
- /package/dist/{chunk-NS55SM7A.js.map → chunk-O2PGQNYE.js.map} +0 -0
- /package/dist/{chunk-C7FQBSON.js.map → chunk-VNFJPTU4.js.map} +0 -0
- /package/dist/{chunk-DOGPOY4B.js.map → chunk-WB5LW52Z.js.map} +0 -0
- /package/dist/{chunks-SX77P5CV.js.map → chunks-I7TEMJXH.js.map} +0 -0
- /package/dist/{formula-5S7WWXGH.js.map → formula-NOIDZEBA.js.map} +0 -0
- /package/dist/{formula-JGFTXWYT.js.map → formula-X44GV7TN.js.map} +0 -0
- /package/dist/{model-bundle-FSPZZ2EM.js.map → model-bundle-57CLEBCO.js.map} +0 -0
- /package/dist/{models-CJPAQK5R.js.map → models-7ELIFTD7.js.map} +0 -0
- /package/dist/{pdf-ocr-76SAUXMZ.js.map → pdf-ocr-BNC34MNU.js.map} +0 -0
- /package/dist/{pdf-ocr-CPU55CVF.js.map → pdf-ocr-QX2GB33Q.js.map} +0 -0
- /package/dist/{profile-io-LBM263K7.js.map → profile-io-V52PL5ZO.js.map} +0 -0
- /package/dist/{rasterize-46RG4ZF6.js.map → rasterize-ZIGLJDOG.js.map} +0 -0
- /package/dist/{redact-7ILEAUTS.js.map → redact-TIQEQI3M.js.map} +0 -0
- /package/dist/{render-NGP5T24S.js.map → render-U5PE6V2E.js.map} +0 -0
- /package/dist/{seal-RGUPOLXD.js.map → seal-DNXJBILR.js.map} +0 -0
- /package/dist/{setup-AU4OCHNH.js.map → setup-YRDM4ODP.js.map} +0 -0
- /package/dist/{visual-NZLYIYEM.js.map → visual-5XWMA4EV.js.map} +0 -0
- /package/dist/{watch-MKPUCPXM.js.map → watch-5IOLBATT.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -19,9 +19,15 @@ interface IRSpan {
|
|
|
19
19
|
/** 밑줄 — 개정문 추가·변경 표시 등. GFM 문법이 없어 <u>…</u> 인라인 HTML 로 방출 */
|
|
20
20
|
underline?: boolean;
|
|
21
21
|
code?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 미기입 누름틀의 안내문(HWPX CLICK_HERE, 수정 안 됨). 한컴은 화면에만 흐리게 보이고 인쇄하지 않는다.
|
|
24
|
+
* 블록 `text` 에는 남기고(양식 채우기·패치가 원문 자리와 맞대도록) 마크다운에서는 뺀다 (v4.14.3)
|
|
25
|
+
*/
|
|
26
|
+
placeholder?: boolean;
|
|
22
27
|
}
|
|
23
28
|
interface IRBlock {
|
|
24
29
|
type: IRBlockType;
|
|
30
|
+
/** 블록 글. HWPX·HWP5·HWP3 은 원문의 리터럴 `$` 를 `\$` 로 담고 `$…$`·`$$…$$` 는 수식 스팬에만 쓴다 (v4.14.3) */
|
|
25
31
|
text?: string;
|
|
26
32
|
table?: IRTable;
|
|
27
33
|
/** 헤딩 레벨 (1-6), type="heading"일 때 사용 */
|
|
@@ -234,6 +240,18 @@ interface ParseOptions {
|
|
|
234
240
|
* (현재 HWP5 경로 지원)
|
|
235
241
|
*/
|
|
236
242
|
inlineImages?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* 이미지 바이트 추출 (기본 true). false 면 결과에 이미지 바이트를 싣지 않는다.
|
|
245
|
+
* `images` 는 비고, 블록의 `imageData` 도 떼며, HWP5 `inlineImages` 도 무시한다.
|
|
246
|
+
* 그림 자리 표시(``)는 마크다운·블록에 그대로 남아 위치는 알 수 있다.
|
|
247
|
+
* PDF 는 PNG 인코딩을 건너뛴다. 거르는 기준은 같되 메모리 보호용 128MB 누적 상한은 걸리지
|
|
248
|
+
* 않아, 그 상한 뒤의 그림도 자리 표시가 남는다.
|
|
249
|
+
*
|
|
250
|
+
* 검색 색인처럼 글자만 필요한 호출자용이다. 그림이 많은 문서는 base64 로 불어난 이미지가
|
|
251
|
+
* JSON 출력의 대부분을 차지했다 (PDF 실측 200MB → 9.5MB, CPU 시간 30% 감소). 본문 글자와
|
|
252
|
+
* OCR 은 이 옵션과 무관하다.
|
|
253
|
+
*/
|
|
254
|
+
images?: boolean;
|
|
237
255
|
/**
|
|
238
256
|
* PDF 표 감지 활성화 (기본 true). false 면 선 기반 그리드·클러스터 표 감지를 모두 끄고
|
|
239
257
|
* 자연 읽기순 텍스트만 뽑는다 (#64).
|
|
@@ -653,8 +671,10 @@ blockedLabels?: Set<string>): Promise<HwpxFillResult>;
|
|
|
653
671
|
* 값을 비교하지 않고 무조건 사이 영역을 값으로 치환한다 — 값이 안내문과 동일해도
|
|
654
672
|
* 침묵 유실이 없다 (rhwp 코어 결함 #3380 교훈).
|
|
655
673
|
*
|
|
656
|
-
* 치환은 filler-hwpx와 같은 철학의 원본 XML splice —
|
|
657
|
-
*
|
|
674
|
+
* 치환은 filler-hwpx와 같은 철학의 원본 XML splice — fieldEnd·안내문 파라미터·둘러싼
|
|
675
|
+
* run(charPr)을 1바이트도 건드리지 않고 사이 영역만 바꾼다. 값을 넣으면 fieldBegin 의 수정
|
|
676
|
+
* 표시(dirty)만 "1" 로 켠다 — 미수정(dirty=0) 필드의 값이 안내문과 같으면 한컴은 화면에만 흐리게
|
|
677
|
+
* 보이고 인쇄하지 않으며 kordoc 파서도 그렇게 읽는다(v4.14.3). 한컴이 직접 채운 필드도 dirty=1.
|
|
658
678
|
*/
|
|
659
679
|
|
|
660
680
|
/** 문서에서 발견한 누름틀 필드 */
|
|
@@ -1493,6 +1513,17 @@ declare function buildParagraphSplices(para: ScanParagraph, newText: string, xml
|
|
|
1493
1513
|
declare function buildRangeSplices(para: ScanParagraph, xml: string, start: number, end: number, replacement: string): SpliceEdit[] | null;
|
|
1494
1514
|
declare function applySplices(xml: string, splices: SpliceEdit[]): string;
|
|
1495
1515
|
|
|
1516
|
+
/** 2-pass colSpan/rowSpan 테이블 빌더 및 Markdown 변환 */
|
|
1517
|
+
|
|
1518
|
+
declare function flattenLayoutTables(blocks: IRBlock[]): IRBlock[];
|
|
1519
|
+
declare function blocksToMarkdown(blocks: IRBlock[]): string;
|
|
1520
|
+
/**
|
|
1521
|
+
* 셀에 GFM 표 문법으로 담을 수 없는 구조 콘텐츠(중첩표·구분선)가 있는가 (#76 Task 4) — hasNestedTables 의 일반화.
|
|
1522
|
+
* 이미지는 GFM 셀에 `` 로 인라인할 수 있어 여기 세지 않는다 — 대신 GFM 경로가 blocks 를 직접 직렬화해
|
|
1523
|
+
* (아래 tableToMarkdown) 병합 없는 단순 표의 셀 이미지가 사라지지 않게 한다. span 문단(왕복 채널)도 GFM 그대로.
|
|
1524
|
+
*/
|
|
1525
|
+
declare function hasStructuredCellContent(table: IRTable): boolean;
|
|
1526
|
+
|
|
1496
1527
|
/**
|
|
1497
1528
|
* HWPX 서식 보존 무손실 라운드트립 패치 — v3.0 킬러기능.
|
|
1498
1529
|
*
|
|
@@ -1572,17 +1603,26 @@ declare function validateHwpx(buffer: ArrayBuffer | Uint8Array): Promise<Validat
|
|
|
1572
1603
|
/**
|
|
1573
1604
|
* 한국 공문서 PII(개인정보) 탐지·마스킹 순수 로직.
|
|
1574
1605
|
*
|
|
1575
|
-
* 텍스트 in → 마스킹된 텍스트 + 히트 리포트 out. 문서
|
|
1576
|
-
*
|
|
1606
|
+
* 텍스트 in → 마스킹된 텍스트 + 히트 리포트 out. 문서 파일 단위 마스킹(머리말·각주·미리보기·메타데이터
|
|
1607
|
+
* 포함)은 redact-doc.ts 가 이 엔진을 불러 쓴다.
|
|
1577
1608
|
*
|
|
1578
1609
|
* 원칙:
|
|
1579
|
-
* - 서식 보존 마스킹 — 자릿수·구분자를 유지해 마스킹 전후
|
|
1610
|
+
* - 서식 보존 마스킹 — 자릿수·구분자를 유지해 마스킹 전후 길이(UTF-16 단위)가 동일
|
|
1580
1611
|
* - 히트 리포트에 원본 PII를 절대 담지 않는다 (`masked` 필드만 존재)
|
|
1581
|
-
* -
|
|
1582
|
-
*
|
|
1612
|
+
* - 탐지는 같은 길이로 정규화한 그림자 문자열에서 한다 — 전각 숫자·영문·@, 유니코드 대시(‐‑–—−-·─·ㅡ),
|
|
1613
|
+
* NBSP·전각 공백을 ASCII 로 1:1 치환하므로 오프셋이 그대로이고, 마스킹은 원문 글자에 적용한다
|
|
1614
|
+
* - 번호 모양만으로 모호한 형태(구분자 없는 13자리·10~14자리, 여권 구형 등)는 바로 앞 라벨
|
|
1615
|
+
* ("주민등록번호", "계좌", "여권" …) 이나 표 열 머리글이 해당 유형일 때만 잡는다. 가장 가까운
|
|
1616
|
+
* 라벨이 이긴다 — "법인등록번호" 옆 6-7 번호는 주민번호로 보지 않는다
|
|
1617
|
+
* - 체크섬: 카드 Luhn, 사업자·법인등록번호 가중합. 주민·외국인등록번호는 2020-10 이후 뒷자리가
|
|
1618
|
+
* 임의 번호라 체크섬으로 거르지 않고 생년월일(세기 포함)·성별 자리만 검증한다
|
|
1619
|
+
* - 룰 우선순위 겹침 처리 — 우선순위순으로 매치를 수집하고, 이미 점유된 구간과 겹치는 하위 룰
|
|
1620
|
+
* 매치는 스킵 (RULE_PRIORITY 참조)
|
|
1583
1621
|
* - 정규식은 모듈 로드 시 1회 컴파일 (matchAll은 내부 클론이라 lastIndex 안전)
|
|
1622
|
+
*
|
|
1623
|
+
* 룰별 근거·오탐 실측은 bench/redact-bench.mjs (합성 정답 셋 + 실코퍼스) 참조.
|
|
1584
1624
|
*/
|
|
1585
|
-
type RedactRule = "rrn" | "phone" | "email" | "card" | "account" | "passport" | "driver";
|
|
1625
|
+
type RedactRule = "rrn" | "phone" | "email" | "card" | "account" | "passport" | "driver" | "brn" | "crn" | "ip";
|
|
1586
1626
|
interface RedactHit {
|
|
1587
1627
|
rule: RedactRule;
|
|
1588
1628
|
/** 마스킹 후 문자열 — 원본 PII는 리포트에 담지 않는다 */
|
|
@@ -1597,25 +1637,32 @@ interface RedactTextResult {
|
|
|
1597
1637
|
hits: RedactHit[];
|
|
1598
1638
|
}
|
|
1599
1639
|
interface RedactOptions {
|
|
1600
|
-
/** 적용할 룰 (기본: DEFAULT_REDACT_RULES —
|
|
1601
|
-
rules?: RedactRule[];
|
|
1602
|
-
/** 마스크 문자 — 1글자(UTF-16 1단위)
|
|
1640
|
+
/** 적용할 룰 (기본: DEFAULT_REDACT_RULES — crn·ip는 기본 OFF) */
|
|
1641
|
+
rules?: readonly RedactRule[];
|
|
1642
|
+
/** 마스크 문자 — 1글자(UTF-16 1단위). 영숫자·공백·제어문자·마크다운/XML 특수문자(|\<>&"')는 금지. 기본 "●" */
|
|
1603
1643
|
maskChar?: string;
|
|
1604
1644
|
}
|
|
1605
|
-
/**
|
|
1645
|
+
/**
|
|
1646
|
+
* 기본 적용 룰. 실코퍼스 2,303문서 오탐 실측 근거(bench/redact-bench.mjs --corpus):
|
|
1647
|
+
* - brn(사업자등록번호)은 종전 account 가 잡던 것을 체크섬으로 분리 — 기본 마스킹 범위 그대로
|
|
1648
|
+
* - passport 는 신형(M123A4567)만 무문맥, 구형(M12345678)은 "여권" 라벨이 있을 때만 → 기본 ON
|
|
1649
|
+
* - driver 는 지역코드(11~28)·지역명 검증으로 좁혔고 종전에도 account 로 가려지던 모양 → 기본 ON
|
|
1650
|
+
* - crn(법인등록번호)은 개인정보가 아니고, ip 는 "1.2.3.4" 절 번호·버전과 겹쳐 opt-in
|
|
1651
|
+
*/
|
|
1606
1652
|
declare const DEFAULT_REDACT_RULES: readonly RedactRule[];
|
|
1607
1653
|
/**
|
|
1608
1654
|
* 텍스트에서 PII를 탐지해 서식 보존 마스킹.
|
|
1609
1655
|
*
|
|
1610
1656
|
* @param text - 대상 텍스트 (마크다운 포함)
|
|
1611
|
-
* @param options - 룰 선택·마스크 문자 (기본:
|
|
1657
|
+
* @param options - 룰 선택·마스크 문자 (기본: DEFAULT_REDACT_RULES, "●")
|
|
1612
1658
|
* @returns 마스킹된 텍스트 + 히트 리포트 (index 오름차순, 원본 PII 미포함)
|
|
1613
1659
|
*/
|
|
1614
1660
|
declare function redactText(text: string, options?: RedactOptions): RedactTextResult;
|
|
1615
1661
|
/**
|
|
1616
1662
|
* 마크다운 문서 전용 래퍼 — base64 이미지(data URI) 라인은 마스킹에서 제외한다.
|
|
1617
1663
|
* base64 페이로드의 숫자열이 phone 등에 오탐되면 이미지가 깨지기 때문.
|
|
1618
|
-
*
|
|
1664
|
+
* 표 셀은 열 머리글("주민등록번호"·"계좌번호" …)을 라벨 문맥으로 쓰고, 인라인 서식 표지(**·\\ 이스케이프 등)가
|
|
1665
|
+
* 번호를 갈라도 잡는다. hits의 index는 문서 전체 기준 절대 오프셋으로 환산된다 (masked 에는 표지가 그대로).
|
|
1619
1666
|
*/
|
|
1620
1667
|
declare function redactMarkdown(markdown: string, options?: RedactOptions): RedactTextResult;
|
|
1621
1668
|
|
|
@@ -2094,16 +2141,6 @@ declare function chooseTableRepresentation(table: IRTable, opts?: {
|
|
|
2094
2141
|
smartVisual?: boolean;
|
|
2095
2142
|
}): TableRepresentation;
|
|
2096
2143
|
|
|
2097
|
-
/** 2-pass colSpan/rowSpan 테이블 빌더 및 Markdown 변환 */
|
|
2098
|
-
|
|
2099
|
-
declare function blocksToMarkdown(blocks: IRBlock[]): string;
|
|
2100
|
-
/**
|
|
2101
|
-
* 셀에 GFM 표 문법으로 담을 수 없는 구조 콘텐츠(중첩표·구분선)가 있는가 (#76 Task 4) — hasNestedTables 의 일반화.
|
|
2102
|
-
* 이미지는 GFM 셀에 `` 로 인라인할 수 있어 여기 세지 않는다 — 대신 GFM 경로가 blocks 를 직접 직렬화해
|
|
2103
|
-
* (아래 tableToMarkdown) 병합 없는 단순 표의 셀 이미지가 사라지지 않게 한다. span 문단(왕복 채널)도 GFM 그대로.
|
|
2104
|
-
*/
|
|
2105
|
-
declare function hasStructuredCellContent(table: IRTable): boolean;
|
|
2106
|
-
|
|
2107
2144
|
/**
|
|
2108
2145
|
* 분류된 표 ↔ 렌더 region 조인 (#76 Task 6·7). bbox 는 여기서 계산하지 않는다 — #75 의 RenderRegion.sourceId 로 IRTable.sourceId 를 잇는다
|
|
2109
2146
|
* (HWPX 는 `hp:tbl id`, HWP5 는 table-ids.ts 의 문서 순번 `t{N}` — 파서·렌더 어댑터가 같은 프리패스를 쓴다).
|
|
@@ -2260,4 +2297,4 @@ interface FillFormOutput {
|
|
|
2260
2297
|
*/
|
|
2261
2298
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
2262
2299
|
|
|
2263
|
-
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 ClassifyContext, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractRegionOptions, type ExtractTableVisualOptions, type ExtractedImage, type ExtractedTable, type ExtractedTableCrop, 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 MuncheLineKind, type MuncheLintFinding, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageBBox, 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 RegionAsset, type RenderAsset, type RenderDocumentOptions, type RenderDocumentResult, type RenderFormat, type RenderObjectType, type RenderRegion, type RenderScene, type RenderSourceFormat, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type ScenePage, type SceneRenderOptions, type SceneRenderResult, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, type TableRepresentation, type TableVisualPolicy, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hasStructuredCellContent, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, lintMuncheText, markdownToHwpx, markdownToPdf, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, usesGaejosikMunche, validateHwpx };
|
|
2300
|
+
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 ClassifyContext, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractRegionOptions, type ExtractTableVisualOptions, type ExtractedImage, type ExtractedTable, type ExtractedTableCrop, 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 MuncheLineKind, type MuncheLintFinding, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageBBox, 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 RegionAsset, type RenderAsset, type RenderDocumentOptions, type RenderDocumentResult, type RenderFormat, type RenderObjectType, type RenderRegion, type RenderScene, type RenderSourceFormat, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type ScenePage, type SceneRenderOptions, type SceneRenderResult, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, type TableRepresentation, type TableVisualPolicy, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, flattenLayoutTables, formatFillValue, gongmunLintWarnings, hasStructuredCellContent, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, lintMuncheText, markdownToHwpx, markdownToPdf, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, usesGaejosikMunche, validateHwpx };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,9 +19,15 @@ interface IRSpan {
|
|
|
19
19
|
/** 밑줄 — 개정문 추가·변경 표시 등. GFM 문법이 없어 <u>…</u> 인라인 HTML 로 방출 */
|
|
20
20
|
underline?: boolean;
|
|
21
21
|
code?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 미기입 누름틀의 안내문(HWPX CLICK_HERE, 수정 안 됨). 한컴은 화면에만 흐리게 보이고 인쇄하지 않는다.
|
|
24
|
+
* 블록 `text` 에는 남기고(양식 채우기·패치가 원문 자리와 맞대도록) 마크다운에서는 뺀다 (v4.14.3)
|
|
25
|
+
*/
|
|
26
|
+
placeholder?: boolean;
|
|
22
27
|
}
|
|
23
28
|
interface IRBlock {
|
|
24
29
|
type: IRBlockType;
|
|
30
|
+
/** 블록 글. HWPX·HWP5·HWP3 은 원문의 리터럴 `$` 를 `\$` 로 담고 `$…$`·`$$…$$` 는 수식 스팬에만 쓴다 (v4.14.3) */
|
|
25
31
|
text?: string;
|
|
26
32
|
table?: IRTable;
|
|
27
33
|
/** 헤딩 레벨 (1-6), type="heading"일 때 사용 */
|
|
@@ -234,6 +240,18 @@ interface ParseOptions {
|
|
|
234
240
|
* (현재 HWP5 경로 지원)
|
|
235
241
|
*/
|
|
236
242
|
inlineImages?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* 이미지 바이트 추출 (기본 true). false 면 결과에 이미지 바이트를 싣지 않는다.
|
|
245
|
+
* `images` 는 비고, 블록의 `imageData` 도 떼며, HWP5 `inlineImages` 도 무시한다.
|
|
246
|
+
* 그림 자리 표시(``)는 마크다운·블록에 그대로 남아 위치는 알 수 있다.
|
|
247
|
+
* PDF 는 PNG 인코딩을 건너뛴다. 거르는 기준은 같되 메모리 보호용 128MB 누적 상한은 걸리지
|
|
248
|
+
* 않아, 그 상한 뒤의 그림도 자리 표시가 남는다.
|
|
249
|
+
*
|
|
250
|
+
* 검색 색인처럼 글자만 필요한 호출자용이다. 그림이 많은 문서는 base64 로 불어난 이미지가
|
|
251
|
+
* JSON 출력의 대부분을 차지했다 (PDF 실측 200MB → 9.5MB, CPU 시간 30% 감소). 본문 글자와
|
|
252
|
+
* OCR 은 이 옵션과 무관하다.
|
|
253
|
+
*/
|
|
254
|
+
images?: boolean;
|
|
237
255
|
/**
|
|
238
256
|
* PDF 표 감지 활성화 (기본 true). false 면 선 기반 그리드·클러스터 표 감지를 모두 끄고
|
|
239
257
|
* 자연 읽기순 텍스트만 뽑는다 (#64).
|
|
@@ -653,8 +671,10 @@ blockedLabels?: Set<string>): Promise<HwpxFillResult>;
|
|
|
653
671
|
* 값을 비교하지 않고 무조건 사이 영역을 값으로 치환한다 — 값이 안내문과 동일해도
|
|
654
672
|
* 침묵 유실이 없다 (rhwp 코어 결함 #3380 교훈).
|
|
655
673
|
*
|
|
656
|
-
* 치환은 filler-hwpx와 같은 철학의 원본 XML splice —
|
|
657
|
-
*
|
|
674
|
+
* 치환은 filler-hwpx와 같은 철학의 원본 XML splice — fieldEnd·안내문 파라미터·둘러싼
|
|
675
|
+
* run(charPr)을 1바이트도 건드리지 않고 사이 영역만 바꾼다. 값을 넣으면 fieldBegin 의 수정
|
|
676
|
+
* 표시(dirty)만 "1" 로 켠다 — 미수정(dirty=0) 필드의 값이 안내문과 같으면 한컴은 화면에만 흐리게
|
|
677
|
+
* 보이고 인쇄하지 않으며 kordoc 파서도 그렇게 읽는다(v4.14.3). 한컴이 직접 채운 필드도 dirty=1.
|
|
658
678
|
*/
|
|
659
679
|
|
|
660
680
|
/** 문서에서 발견한 누름틀 필드 */
|
|
@@ -1493,6 +1513,17 @@ declare function buildParagraphSplices(para: ScanParagraph, newText: string, xml
|
|
|
1493
1513
|
declare function buildRangeSplices(para: ScanParagraph, xml: string, start: number, end: number, replacement: string): SpliceEdit[] | null;
|
|
1494
1514
|
declare function applySplices(xml: string, splices: SpliceEdit[]): string;
|
|
1495
1515
|
|
|
1516
|
+
/** 2-pass colSpan/rowSpan 테이블 빌더 및 Markdown 변환 */
|
|
1517
|
+
|
|
1518
|
+
declare function flattenLayoutTables(blocks: IRBlock[]): IRBlock[];
|
|
1519
|
+
declare function blocksToMarkdown(blocks: IRBlock[]): string;
|
|
1520
|
+
/**
|
|
1521
|
+
* 셀에 GFM 표 문법으로 담을 수 없는 구조 콘텐츠(중첩표·구분선)가 있는가 (#76 Task 4) — hasNestedTables 의 일반화.
|
|
1522
|
+
* 이미지는 GFM 셀에 `` 로 인라인할 수 있어 여기 세지 않는다 — 대신 GFM 경로가 blocks 를 직접 직렬화해
|
|
1523
|
+
* (아래 tableToMarkdown) 병합 없는 단순 표의 셀 이미지가 사라지지 않게 한다. span 문단(왕복 채널)도 GFM 그대로.
|
|
1524
|
+
*/
|
|
1525
|
+
declare function hasStructuredCellContent(table: IRTable): boolean;
|
|
1526
|
+
|
|
1496
1527
|
/**
|
|
1497
1528
|
* HWPX 서식 보존 무손실 라운드트립 패치 — v3.0 킬러기능.
|
|
1498
1529
|
*
|
|
@@ -1572,17 +1603,26 @@ declare function validateHwpx(buffer: ArrayBuffer | Uint8Array): Promise<Validat
|
|
|
1572
1603
|
/**
|
|
1573
1604
|
* 한국 공문서 PII(개인정보) 탐지·마스킹 순수 로직.
|
|
1574
1605
|
*
|
|
1575
|
-
* 텍스트 in → 마스킹된 텍스트 + 히트 리포트 out. 문서
|
|
1576
|
-
*
|
|
1606
|
+
* 텍스트 in → 마스킹된 텍스트 + 히트 리포트 out. 문서 파일 단위 마스킹(머리말·각주·미리보기·메타데이터
|
|
1607
|
+
* 포함)은 redact-doc.ts 가 이 엔진을 불러 쓴다.
|
|
1577
1608
|
*
|
|
1578
1609
|
* 원칙:
|
|
1579
|
-
* - 서식 보존 마스킹 — 자릿수·구분자를 유지해 마스킹 전후
|
|
1610
|
+
* - 서식 보존 마스킹 — 자릿수·구분자를 유지해 마스킹 전후 길이(UTF-16 단위)가 동일
|
|
1580
1611
|
* - 히트 리포트에 원본 PII를 절대 담지 않는다 (`masked` 필드만 존재)
|
|
1581
|
-
* -
|
|
1582
|
-
*
|
|
1612
|
+
* - 탐지는 같은 길이로 정규화한 그림자 문자열에서 한다 — 전각 숫자·영문·@, 유니코드 대시(‐‑–—−-·─·ㅡ),
|
|
1613
|
+
* NBSP·전각 공백을 ASCII 로 1:1 치환하므로 오프셋이 그대로이고, 마스킹은 원문 글자에 적용한다
|
|
1614
|
+
* - 번호 모양만으로 모호한 형태(구분자 없는 13자리·10~14자리, 여권 구형 등)는 바로 앞 라벨
|
|
1615
|
+
* ("주민등록번호", "계좌", "여권" …) 이나 표 열 머리글이 해당 유형일 때만 잡는다. 가장 가까운
|
|
1616
|
+
* 라벨이 이긴다 — "법인등록번호" 옆 6-7 번호는 주민번호로 보지 않는다
|
|
1617
|
+
* - 체크섬: 카드 Luhn, 사업자·법인등록번호 가중합. 주민·외국인등록번호는 2020-10 이후 뒷자리가
|
|
1618
|
+
* 임의 번호라 체크섬으로 거르지 않고 생년월일(세기 포함)·성별 자리만 검증한다
|
|
1619
|
+
* - 룰 우선순위 겹침 처리 — 우선순위순으로 매치를 수집하고, 이미 점유된 구간과 겹치는 하위 룰
|
|
1620
|
+
* 매치는 스킵 (RULE_PRIORITY 참조)
|
|
1583
1621
|
* - 정규식은 모듈 로드 시 1회 컴파일 (matchAll은 내부 클론이라 lastIndex 안전)
|
|
1622
|
+
*
|
|
1623
|
+
* 룰별 근거·오탐 실측은 bench/redact-bench.mjs (합성 정답 셋 + 실코퍼스) 참조.
|
|
1584
1624
|
*/
|
|
1585
|
-
type RedactRule = "rrn" | "phone" | "email" | "card" | "account" | "passport" | "driver";
|
|
1625
|
+
type RedactRule = "rrn" | "phone" | "email" | "card" | "account" | "passport" | "driver" | "brn" | "crn" | "ip";
|
|
1586
1626
|
interface RedactHit {
|
|
1587
1627
|
rule: RedactRule;
|
|
1588
1628
|
/** 마스킹 후 문자열 — 원본 PII는 리포트에 담지 않는다 */
|
|
@@ -1597,25 +1637,32 @@ interface RedactTextResult {
|
|
|
1597
1637
|
hits: RedactHit[];
|
|
1598
1638
|
}
|
|
1599
1639
|
interface RedactOptions {
|
|
1600
|
-
/** 적용할 룰 (기본: DEFAULT_REDACT_RULES —
|
|
1601
|
-
rules?: RedactRule[];
|
|
1602
|
-
/** 마스크 문자 — 1글자(UTF-16 1단위)
|
|
1640
|
+
/** 적용할 룰 (기본: DEFAULT_REDACT_RULES — crn·ip는 기본 OFF) */
|
|
1641
|
+
rules?: readonly RedactRule[];
|
|
1642
|
+
/** 마스크 문자 — 1글자(UTF-16 1단위). 영숫자·공백·제어문자·마크다운/XML 특수문자(|\<>&"')는 금지. 기본 "●" */
|
|
1603
1643
|
maskChar?: string;
|
|
1604
1644
|
}
|
|
1605
|
-
/**
|
|
1645
|
+
/**
|
|
1646
|
+
* 기본 적용 룰. 실코퍼스 2,303문서 오탐 실측 근거(bench/redact-bench.mjs --corpus):
|
|
1647
|
+
* - brn(사업자등록번호)은 종전 account 가 잡던 것을 체크섬으로 분리 — 기본 마스킹 범위 그대로
|
|
1648
|
+
* - passport 는 신형(M123A4567)만 무문맥, 구형(M12345678)은 "여권" 라벨이 있을 때만 → 기본 ON
|
|
1649
|
+
* - driver 는 지역코드(11~28)·지역명 검증으로 좁혔고 종전에도 account 로 가려지던 모양 → 기본 ON
|
|
1650
|
+
* - crn(법인등록번호)은 개인정보가 아니고, ip 는 "1.2.3.4" 절 번호·버전과 겹쳐 opt-in
|
|
1651
|
+
*/
|
|
1606
1652
|
declare const DEFAULT_REDACT_RULES: readonly RedactRule[];
|
|
1607
1653
|
/**
|
|
1608
1654
|
* 텍스트에서 PII를 탐지해 서식 보존 마스킹.
|
|
1609
1655
|
*
|
|
1610
1656
|
* @param text - 대상 텍스트 (마크다운 포함)
|
|
1611
|
-
* @param options - 룰 선택·마스크 문자 (기본:
|
|
1657
|
+
* @param options - 룰 선택·마스크 문자 (기본: DEFAULT_REDACT_RULES, "●")
|
|
1612
1658
|
* @returns 마스킹된 텍스트 + 히트 리포트 (index 오름차순, 원본 PII 미포함)
|
|
1613
1659
|
*/
|
|
1614
1660
|
declare function redactText(text: string, options?: RedactOptions): RedactTextResult;
|
|
1615
1661
|
/**
|
|
1616
1662
|
* 마크다운 문서 전용 래퍼 — base64 이미지(data URI) 라인은 마스킹에서 제외한다.
|
|
1617
1663
|
* base64 페이로드의 숫자열이 phone 등에 오탐되면 이미지가 깨지기 때문.
|
|
1618
|
-
*
|
|
1664
|
+
* 표 셀은 열 머리글("주민등록번호"·"계좌번호" …)을 라벨 문맥으로 쓰고, 인라인 서식 표지(**·\\ 이스케이프 등)가
|
|
1665
|
+
* 번호를 갈라도 잡는다. hits의 index는 문서 전체 기준 절대 오프셋으로 환산된다 (masked 에는 표지가 그대로).
|
|
1619
1666
|
*/
|
|
1620
1667
|
declare function redactMarkdown(markdown: string, options?: RedactOptions): RedactTextResult;
|
|
1621
1668
|
|
|
@@ -2094,16 +2141,6 @@ declare function chooseTableRepresentation(table: IRTable, opts?: {
|
|
|
2094
2141
|
smartVisual?: boolean;
|
|
2095
2142
|
}): TableRepresentation;
|
|
2096
2143
|
|
|
2097
|
-
/** 2-pass colSpan/rowSpan 테이블 빌더 및 Markdown 변환 */
|
|
2098
|
-
|
|
2099
|
-
declare function blocksToMarkdown(blocks: IRBlock[]): string;
|
|
2100
|
-
/**
|
|
2101
|
-
* 셀에 GFM 표 문법으로 담을 수 없는 구조 콘텐츠(중첩표·구분선)가 있는가 (#76 Task 4) — hasNestedTables 의 일반화.
|
|
2102
|
-
* 이미지는 GFM 셀에 `` 로 인라인할 수 있어 여기 세지 않는다 — 대신 GFM 경로가 blocks 를 직접 직렬화해
|
|
2103
|
-
* (아래 tableToMarkdown) 병합 없는 단순 표의 셀 이미지가 사라지지 않게 한다. span 문단(왕복 채널)도 GFM 그대로.
|
|
2104
|
-
*/
|
|
2105
|
-
declare function hasStructuredCellContent(table: IRTable): boolean;
|
|
2106
|
-
|
|
2107
2144
|
/**
|
|
2108
2145
|
* 분류된 표 ↔ 렌더 region 조인 (#76 Task 6·7). bbox 는 여기서 계산하지 않는다 — #75 의 RenderRegion.sourceId 로 IRTable.sourceId 를 잇는다
|
|
2109
2146
|
* (HWPX 는 `hp:tbl id`, HWP5 는 table-ids.ts 의 문서 순번 `t{N}` — 파서·렌더 어댑터가 같은 프리패스를 쓴다).
|
|
@@ -2260,4 +2297,4 @@ interface FillFormOutput {
|
|
|
2260
2297
|
*/
|
|
2261
2298
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
2262
2299
|
|
|
2263
|
-
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 ClassifyContext, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractRegionOptions, type ExtractTableVisualOptions, type ExtractedImage, type ExtractedTable, type ExtractedTableCrop, 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 MuncheLineKind, type MuncheLintFinding, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageBBox, 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 RegionAsset, type RenderAsset, type RenderDocumentOptions, type RenderDocumentResult, type RenderFormat, type RenderObjectType, type RenderRegion, type RenderScene, type RenderSourceFormat, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type ScenePage, type SceneRenderOptions, type SceneRenderResult, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, type TableRepresentation, type TableVisualPolicy, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hasStructuredCellContent, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, lintMuncheText, markdownToHwpx, markdownToPdf, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, usesGaejosikMunche, validateHwpx };
|
|
2300
|
+
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 ClassifyContext, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractRegionOptions, type ExtractTableVisualOptions, type ExtractedImage, type ExtractedTable, type ExtractedTableCrop, 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 MuncheLineKind, type MuncheLintFinding, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageBBox, 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 RegionAsset, type RenderAsset, type RenderDocumentOptions, type RenderDocumentResult, type RenderFormat, type RenderObjectType, type RenderRegion, type RenderScene, type RenderSourceFormat, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type ScenePage, type SceneRenderOptions, type SceneRenderResult, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, type TableRepresentation, type TableVisualPolicy, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, flattenLayoutTables, formatFillValue, gongmunLintWarnings, hasStructuredCellContent, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, lintMuncheText, markdownToHwpx, markdownToPdf, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, usesGaejosikMunche, validateHwpx };
|