kordoc 4.0.2 → 4.0.4
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 +800 -768
- package/dist/{-XMKVL3NX.js → -Q4ZCVQFI.js} +10 -8
- package/dist/chunk-2RIOXYGA.js +92 -0
- package/dist/chunk-2RIOXYGA.js.map +1 -0
- package/dist/chunk-5RPYBC2Q.js +88 -0
- package/dist/chunk-5RPYBC2Q.js.map +1 -0
- package/dist/chunk-DCZVOIEO.cjs.map +1 -1
- package/dist/{chunk-IKBIIEVJ.js → chunk-DKMKJMR6.js} +5 -4
- package/dist/chunk-DKMKJMR6.js.map +1 -0
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-STMLZDKR.js → chunk-KA5AN73R.js} +2 -2
- package/dist/chunk-KA5AN73R.js.map +1 -0
- package/dist/{chunk-3IYQYBUF.js → chunk-KSVLQ5BC.js} +33 -4
- package/dist/chunk-KSVLQ5BC.js.map +1 -0
- package/dist/{chunk-5CJGKKMZ.js → chunk-MEPHGCPQ.js} +1 -1
- package/dist/chunk-MEPHGCPQ.js.map +1 -0
- package/dist/{chunk-AHWRAGXN.js → chunk-MLNHZN32.js} +1876 -965
- package/dist/chunk-MLNHZN32.js.map +1 -0
- package/dist/chunk-MOL7MDBG.js +0 -0
- package/dist/{chunk-WN7LZHII.cjs → chunk-NIW7CZYX.cjs} +37 -8
- package/dist/chunk-NIW7CZYX.cjs.map +1 -0
- package/dist/{chunk-6SD4X5PT.js → chunk-S3KGEEBQ.js} +76 -25
- package/dist/chunk-S3KGEEBQ.js.map +1 -0
- package/dist/{chunk-67RANGFQ.js → chunk-TXNRIVWA.js} +3 -3
- package/dist/chunk-TXNRIVWA.js.map +1 -0
- package/dist/{chunk-6YIYFWO2.js → chunk-ZJXR4PWY.js} +33 -4
- package/dist/chunk-ZJXR4PWY.js.map +1 -0
- package/dist/cli.js +120 -73
- package/dist/cli.js.map +1 -1
- package/dist/{detect-PJZMUL2Z.js → detect-RI2MQ33K.js} +2 -2
- package/dist/formula-5NKVS2LR.cjs.map +1 -1
- package/dist/formula-JCNF43NE.js +0 -0
- package/dist/index.cjs +21139 -20176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -5
- package/dist/index.d.ts +52 -5
- package/dist/index.js +20969 -20006
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +113 -90
- package/dist/mcp.js.map +1 -1
- package/dist/page-range-737B4EZW.js +0 -0
- package/dist/page-range-P7SDW6LR.cjs.map +1 -1
- package/dist/{parser-6AYYGX6J.cjs → parser-2ZUTCU2G.cjs} +108 -19
- package/dist/parser-2ZUTCU2G.cjs.map +1 -0
- package/dist/{parser-3HM2VYKK.js → parser-46JGSTPR.js} +97 -8
- package/dist/parser-46JGSTPR.js.map +1 -0
- package/dist/{parser-2Q2YKEJG.js → parser-TLCC67W6.js} +96 -7
- package/dist/parser-TLCC67W6.js.map +1 -0
- package/dist/profile-io-MRVIJ5T4.js +11 -0
- package/dist/{provider-H4WWSPOV.js → provider-4ZJKV3DC.js} +1 -1
- package/dist/provider-4ZJKV3DC.js.map +1 -0
- package/dist/{provider-7H4CPZYS.js → provider-AKROB7WQ.js} +1 -1
- package/dist/provider-AKROB7WQ.js.map +1 -0
- package/dist/{provider-5K7O3Z2O.cjs → provider-G4C2V2PD.cjs} +1 -1
- package/dist/provider-G4C2V2PD.cjs.map +1 -0
- package/dist/render-TTOG6CHW.js +10 -0
- package/dist/seal-NMLZ3M3K.js +10 -0
- package/dist/seal-NMLZ3M3K.js.map +1 -0
- package/dist/setup-57FB3LSP.js +0 -0
- package/dist/{watch-6OHF727O.js → watch-NZNVJ4YD.js} +8 -8
- package/dist/watch-NZNVJ4YD.js.map +1 -0
- package/package.json +4 -4
- package/dist/chunk-3IYQYBUF.js.map +0 -1
- package/dist/chunk-5CJGKKMZ.js.map +0 -1
- package/dist/chunk-67RANGFQ.js.map +0 -1
- package/dist/chunk-6SD4X5PT.js.map +0 -1
- package/dist/chunk-6YIYFWO2.js.map +0 -1
- package/dist/chunk-AHWRAGXN.js.map +0 -1
- package/dist/chunk-IKBIIEVJ.js.map +0 -1
- package/dist/chunk-STMLZDKR.js.map +0 -1
- package/dist/chunk-WN7LZHII.cjs.map +0 -1
- package/dist/parser-2Q2YKEJG.js.map +0 -1
- package/dist/parser-3HM2VYKK.js.map +0 -1
- package/dist/parser-6AYYGX6J.cjs.map +0 -1
- package/dist/provider-5K7O3Z2O.cjs.map +0 -1
- package/dist/provider-7H4CPZYS.js.map +0 -1
- package/dist/provider-H4WWSPOV.js.map +0 -1
- package/dist/render-W4VCJE6N.js +0 -10
- package/dist/seal-DRPTNHOP.js +0 -10
- package/dist/watch-6OHF727O.js.map +0 -1
- /package/dist/{-XMKVL3NX.js.map → -Q4ZCVQFI.js.map} +0 -0
- /package/dist/{detect-PJZMUL2Z.js.map → detect-RI2MQ33K.js.map} +0 -0
- /package/dist/{render-W4VCJE6N.js.map → profile-io-MRVIJ5T4.js.map} +0 -0
- /package/dist/{seal-DRPTNHOP.js.map → render-TTOG6CHW.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,13 @@ interface CellContext {
|
|
|
10
10
|
}
|
|
11
11
|
/** 블록 타입 — v2.0에서 heading, list, image, separator 추가 */
|
|
12
12
|
type IRBlockType = "paragraph" | "table" | "heading" | "list" | "image" | "separator";
|
|
13
|
+
/** 인라인 강조 run-span — 문단 텍스트를 서식 단위로 쪼갠 조각 (텍스트 연결 = block.text) */
|
|
14
|
+
interface IRSpan {
|
|
15
|
+
text: string;
|
|
16
|
+
bold?: boolean;
|
|
17
|
+
italic?: boolean;
|
|
18
|
+
code?: boolean;
|
|
19
|
+
}
|
|
13
20
|
interface IRBlock {
|
|
14
21
|
type: IRBlockType;
|
|
15
22
|
text?: string;
|
|
@@ -32,6 +39,17 @@ interface IRBlock {
|
|
|
32
39
|
footnoteText?: string;
|
|
33
40
|
/** 이미지 데이터 (type="image"일 때) */
|
|
34
41
|
imageData?: ImageData;
|
|
42
|
+
/** 인라인 강조 run-span (선택 — 현재 kordoc 생성 hwpx 왕복 채널만 채움).
|
|
43
|
+
* 존재하면 마크다운 변환이 **·*·` 마커를 재방출한다 */
|
|
44
|
+
spans?: IRSpan[];
|
|
45
|
+
/** 인용문 문단 (선택 — kordoc 생성 hwpx 왕복 채널) — 마크다운 변환이 "> " 접두 재방출 */
|
|
46
|
+
quote?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 문단 들여쓰기(HWPUNIT, 선택) — HWPX paraPr `<hh:margin>` 자식요소형 hc:left
|
|
49
|
+
* (+양수 hc:intent 첫줄분). 마크다운 방출엔 쓰지 않는 관찰 슬롯 — gongmun 리스트
|
|
50
|
+
* depth 재유도·양식 분석 등 소비자 몫 (v4.0.4)
|
|
51
|
+
*/
|
|
52
|
+
indent?: number;
|
|
35
53
|
}
|
|
36
54
|
/** 추출된 이미지 바이너리 데이터 */
|
|
37
55
|
interface ImageData {
|
|
@@ -162,7 +180,7 @@ interface ParseWarning {
|
|
|
162
180
|
/** 구조화된 경고 코드 */
|
|
163
181
|
code: WarningCode;
|
|
164
182
|
}
|
|
165
|
-
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";
|
|
183
|
+
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" | "COM_EMPTY" | "DRM_COM_FALLBACK";
|
|
166
184
|
/** 문서 구조 (헤딩 트리) */
|
|
167
185
|
interface OutlineItem {
|
|
168
186
|
level: number;
|
|
@@ -615,7 +633,7 @@ interface GongmunOptions {
|
|
|
615
633
|
preset?: GongmunPresetInput;
|
|
616
634
|
/** 본문 글꼴. 'myeongjo'=함초롬바탕(명조, 보고서·대외공문 관행) / 'gothic'=맑은 고딕(전자결재 기본) */
|
|
617
635
|
bodyFont?: GongmunFont;
|
|
618
|
-
/** 본문 글자 크기(pt).
|
|
636
|
+
/** 본문 글자 크기(pt). 기본: 기안문 12, 보고서·계획서·통지 15 */
|
|
619
637
|
bodyPt?: number;
|
|
620
638
|
/** 본문 줄간격(%). 기본 160 (회의록 130) */
|
|
621
639
|
lineSpacing?: number;
|
|
@@ -684,7 +702,8 @@ interface GongmunOptions {
|
|
|
684
702
|
/**
|
|
685
703
|
* 단일 형제 항목 부호 생략(편람 규정: 항목이 하나면 부호 미부여). 기본 false —
|
|
686
704
|
* 부호 없는 계단 들여쓰기가 실무 눈에 더 어색하다(실무자 QA, v4.0.2).
|
|
687
|
-
* 규정 엄수가 필요하면 true.
|
|
705
|
+
* 규정 엄수가 필요하면 true. 법정 번호(standard) 전용 — 불릿 체계(report·gaejosik)엔
|
|
706
|
+
* 적용되지 않으므로, 기본 numbering이 report인 plan 프리셋은 numbering:'standard' 병기 필요.
|
|
688
707
|
*/
|
|
689
708
|
suppressSingle?: boolean;
|
|
690
709
|
/** 기안문 두문 — 행정기관명·수신·경유·제목 (별지 제1호서식, official 전용) */
|
|
@@ -734,6 +753,12 @@ interface GongmunOptions {
|
|
|
734
753
|
declare const PRESET_ALIAS: Record<string, GongmunPreset>;
|
|
735
754
|
/** 프리셋 입력(영문 키 또는 한글 별칭)을 내부 GongmunPreset로 정규화. 미상은 'official' */
|
|
736
755
|
declare function normalizeGongmunPreset(preset?: string): GongmunPreset;
|
|
756
|
+
/**
|
|
757
|
+
* 프리셋과 비호환이라 resolveGongmun이 조용히 폐기/무시하는 옵션의 경고 목록 (v4.0.6).
|
|
758
|
+
* 순수 함수 — 배선은 호출자 몫 (CLI stderr / MCP 응답 병기, unknownFontWarnings 관례).
|
|
759
|
+
* 게이팅 조건은 resolveGongmun 본문과 1:1 — 여기 조건을 바꾸면 본문도 함께.
|
|
760
|
+
*/
|
|
761
|
+
declare function incompatibleGongmunWarnings(opts: GongmunOptions): string[];
|
|
737
762
|
|
|
738
763
|
/** HWPX 생성 시 적용할 시각 테마 (모두 선택) */
|
|
739
764
|
interface HwpxTheme {
|
|
@@ -798,6 +823,12 @@ interface CharPrDef {
|
|
|
798
823
|
underline?: boolean;
|
|
799
824
|
/** fontfaces HANGUL 순번. render는 이름표로 손실하므로 원본 순번 보존용 */
|
|
800
825
|
fontRef_hangul?: string;
|
|
826
|
+
/**
|
|
827
|
+
* HANGUL 글꼴 이름 (스키마 0.3.0) — 순번(fontRef_hangul)은 원본 fontfaces에서만
|
|
828
|
+
* 유효하므로, 이름을 실어 생성 문서 header에 fontface를 append + 리맵해 재현한다.
|
|
829
|
+
* 없으면(구버전 프로필) 생성 header 범위 내 순번만 존중, 밖이면 기본(0) 폴딩.
|
|
830
|
+
*/
|
|
831
|
+
fontName_hangul?: string;
|
|
801
832
|
}
|
|
802
833
|
/** 셀 하나의 서식 참조 (좌표 = 병합 셀 좌상단 앵커) */
|
|
803
834
|
interface CellProfile {
|
|
@@ -824,6 +855,12 @@ interface TableProfile {
|
|
|
824
855
|
* 어긋나도, 앵커+치수가 맞는 프로필만 골라 적용해 남의 서식 오적용을 막는다(v3.18.1).
|
|
825
856
|
*/
|
|
826
857
|
anchor_text?: string;
|
|
858
|
+
/**
|
|
859
|
+
* 첫 행 전체 텍스트의 정규화 지문(normalizeRowAnchor) — 다중 지문 2순위 키 (0.3.0).
|
|
860
|
+
* (0,0)이 빈 셀인 크로스탭은 anchor_text가 비어 순번 폴백뿐이었는데, 첫 행 전체를
|
|
861
|
+
* 이어붙인 지문으로 동형 쌍둥이 표를 가른다.
|
|
862
|
+
*/
|
|
863
|
+
anchor_row?: string;
|
|
827
864
|
width_hwpunit?: string;
|
|
828
865
|
col_widths_hwpunit?: string[];
|
|
829
866
|
cells: CellProfile[];
|
|
@@ -860,7 +897,7 @@ interface MarkdownToHwpxOptions {
|
|
|
860
897
|
theme?: HwpxTheme;
|
|
861
898
|
/**
|
|
862
899
|
* 공문서 모드 — 지정 시 한국 행정 공문서 표준 서식으로 렌더링한다.
|
|
863
|
-
* (공식 여백,
|
|
900
|
+
* (공식 여백, 프리셋별 본문 크기, 항목부호 체계, 행갈굼 정렬, 줄간격 등)
|
|
864
901
|
* 미지정 시 기존 범용 마크다운 변환 동작 그대로 유지.
|
|
865
902
|
*/
|
|
866
903
|
gongmun?: GongmunOptions;
|
|
@@ -962,11 +999,21 @@ declare function charWidthEm1000(cp: number): number;
|
|
|
962
999
|
/** HWP 공백 폭(em×1000) — useFontSpace=0(기본): 반각 고정 500 / =1: 글꼴값 300 */
|
|
963
1000
|
declare const SPACE_EM_FIXED = 500;
|
|
964
1001
|
declare const SPACE_EM_FONT = 300;
|
|
1002
|
+
/**
|
|
1003
|
+
* 폭 테이블 클래스 — 'hcr'(함초롬 실측, 기본) / 'fixedPitch'(고정폭 글꼴:
|
|
1004
|
+
* ASCII 0.5em·그 외 1.0em). 굴림체·돋움체·바탕체·궁서체('체' 접미 = 고정폭)가
|
|
1005
|
+
* 대상 — 전자결재 변환기 산출물의 지배 본문 글꼴. 한글이 HCR(0.97em)보다 3%
|
|
1006
|
+
* 넓어 함초롬 테이블로 재면 줄당 1~2자 과대적재로 wrap 지점이 어긋난다
|
|
1007
|
+
* (bench/verify-linebreak.mjs seoul 코퍼스 실측: fixedPitch 테이블로 74/75 일치).
|
|
1008
|
+
*/
|
|
1009
|
+
type FaceClass = "hcr" | "fixedPitch";
|
|
965
1010
|
interface MeasureOptions {
|
|
966
1011
|
/** 공백 폭(em×1000). 기본 SPACE_EM_FIXED(500) = useFontSpace 0 */
|
|
967
1012
|
spaceEm?: number;
|
|
968
1013
|
/** 자간(charPr spacing %) — 글자폭의 %가 문자마다 추가 */
|
|
969
1014
|
spacingPct?: number;
|
|
1015
|
+
/** 폭 테이블 클래스 — 기본 'hcr' (함초롬 실측 테이블) */
|
|
1016
|
+
faceClass?: FaceClass;
|
|
970
1017
|
}
|
|
971
1018
|
/**
|
|
972
1019
|
* 텍스트 폭(HWPUNIT). height=charPr height(pt×100), ratioPct=장평 %.
|
|
@@ -1503,4 +1550,4 @@ interface FillFormOutput {
|
|
|
1503
1550
|
*/
|
|
1504
1551
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
1505
1552
|
|
|
1506
|
-
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 DiffChangeType, type DiffResult, 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 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, blocksToMarkdown, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|
|
1553
|
+
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 DiffChangeType, type DiffResult, 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 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, 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, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ interface CellContext {
|
|
|
10
10
|
}
|
|
11
11
|
/** 블록 타입 — v2.0에서 heading, list, image, separator 추가 */
|
|
12
12
|
type IRBlockType = "paragraph" | "table" | "heading" | "list" | "image" | "separator";
|
|
13
|
+
/** 인라인 강조 run-span — 문단 텍스트를 서식 단위로 쪼갠 조각 (텍스트 연결 = block.text) */
|
|
14
|
+
interface IRSpan {
|
|
15
|
+
text: string;
|
|
16
|
+
bold?: boolean;
|
|
17
|
+
italic?: boolean;
|
|
18
|
+
code?: boolean;
|
|
19
|
+
}
|
|
13
20
|
interface IRBlock {
|
|
14
21
|
type: IRBlockType;
|
|
15
22
|
text?: string;
|
|
@@ -32,6 +39,17 @@ interface IRBlock {
|
|
|
32
39
|
footnoteText?: string;
|
|
33
40
|
/** 이미지 데이터 (type="image"일 때) */
|
|
34
41
|
imageData?: ImageData;
|
|
42
|
+
/** 인라인 강조 run-span (선택 — 현재 kordoc 생성 hwpx 왕복 채널만 채움).
|
|
43
|
+
* 존재하면 마크다운 변환이 **·*·` 마커를 재방출한다 */
|
|
44
|
+
spans?: IRSpan[];
|
|
45
|
+
/** 인용문 문단 (선택 — kordoc 생성 hwpx 왕복 채널) — 마크다운 변환이 "> " 접두 재방출 */
|
|
46
|
+
quote?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 문단 들여쓰기(HWPUNIT, 선택) — HWPX paraPr `<hh:margin>` 자식요소형 hc:left
|
|
49
|
+
* (+양수 hc:intent 첫줄분). 마크다운 방출엔 쓰지 않는 관찰 슬롯 — gongmun 리스트
|
|
50
|
+
* depth 재유도·양식 분석 등 소비자 몫 (v4.0.4)
|
|
51
|
+
*/
|
|
52
|
+
indent?: number;
|
|
35
53
|
}
|
|
36
54
|
/** 추출된 이미지 바이너리 데이터 */
|
|
37
55
|
interface ImageData {
|
|
@@ -162,7 +180,7 @@ interface ParseWarning {
|
|
|
162
180
|
/** 구조화된 경고 코드 */
|
|
163
181
|
code: WarningCode;
|
|
164
182
|
}
|
|
165
|
-
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";
|
|
183
|
+
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" | "COM_EMPTY" | "DRM_COM_FALLBACK";
|
|
166
184
|
/** 문서 구조 (헤딩 트리) */
|
|
167
185
|
interface OutlineItem {
|
|
168
186
|
level: number;
|
|
@@ -615,7 +633,7 @@ interface GongmunOptions {
|
|
|
615
633
|
preset?: GongmunPresetInput;
|
|
616
634
|
/** 본문 글꼴. 'myeongjo'=함초롬바탕(명조, 보고서·대외공문 관행) / 'gothic'=맑은 고딕(전자결재 기본) */
|
|
617
635
|
bodyFont?: GongmunFont;
|
|
618
|
-
/** 본문 글자 크기(pt).
|
|
636
|
+
/** 본문 글자 크기(pt). 기본: 기안문 12, 보고서·계획서·통지 15 */
|
|
619
637
|
bodyPt?: number;
|
|
620
638
|
/** 본문 줄간격(%). 기본 160 (회의록 130) */
|
|
621
639
|
lineSpacing?: number;
|
|
@@ -684,7 +702,8 @@ interface GongmunOptions {
|
|
|
684
702
|
/**
|
|
685
703
|
* 단일 형제 항목 부호 생략(편람 규정: 항목이 하나면 부호 미부여). 기본 false —
|
|
686
704
|
* 부호 없는 계단 들여쓰기가 실무 눈에 더 어색하다(실무자 QA, v4.0.2).
|
|
687
|
-
* 규정 엄수가 필요하면 true.
|
|
705
|
+
* 규정 엄수가 필요하면 true. 법정 번호(standard) 전용 — 불릿 체계(report·gaejosik)엔
|
|
706
|
+
* 적용되지 않으므로, 기본 numbering이 report인 plan 프리셋은 numbering:'standard' 병기 필요.
|
|
688
707
|
*/
|
|
689
708
|
suppressSingle?: boolean;
|
|
690
709
|
/** 기안문 두문 — 행정기관명·수신·경유·제목 (별지 제1호서식, official 전용) */
|
|
@@ -734,6 +753,12 @@ interface GongmunOptions {
|
|
|
734
753
|
declare const PRESET_ALIAS: Record<string, GongmunPreset>;
|
|
735
754
|
/** 프리셋 입력(영문 키 또는 한글 별칭)을 내부 GongmunPreset로 정규화. 미상은 'official' */
|
|
736
755
|
declare function normalizeGongmunPreset(preset?: string): GongmunPreset;
|
|
756
|
+
/**
|
|
757
|
+
* 프리셋과 비호환이라 resolveGongmun이 조용히 폐기/무시하는 옵션의 경고 목록 (v4.0.6).
|
|
758
|
+
* 순수 함수 — 배선은 호출자 몫 (CLI stderr / MCP 응답 병기, unknownFontWarnings 관례).
|
|
759
|
+
* 게이팅 조건은 resolveGongmun 본문과 1:1 — 여기 조건을 바꾸면 본문도 함께.
|
|
760
|
+
*/
|
|
761
|
+
declare function incompatibleGongmunWarnings(opts: GongmunOptions): string[];
|
|
737
762
|
|
|
738
763
|
/** HWPX 생성 시 적용할 시각 테마 (모두 선택) */
|
|
739
764
|
interface HwpxTheme {
|
|
@@ -798,6 +823,12 @@ interface CharPrDef {
|
|
|
798
823
|
underline?: boolean;
|
|
799
824
|
/** fontfaces HANGUL 순번. render는 이름표로 손실하므로 원본 순번 보존용 */
|
|
800
825
|
fontRef_hangul?: string;
|
|
826
|
+
/**
|
|
827
|
+
* HANGUL 글꼴 이름 (스키마 0.3.0) — 순번(fontRef_hangul)은 원본 fontfaces에서만
|
|
828
|
+
* 유효하므로, 이름을 실어 생성 문서 header에 fontface를 append + 리맵해 재현한다.
|
|
829
|
+
* 없으면(구버전 프로필) 생성 header 범위 내 순번만 존중, 밖이면 기본(0) 폴딩.
|
|
830
|
+
*/
|
|
831
|
+
fontName_hangul?: string;
|
|
801
832
|
}
|
|
802
833
|
/** 셀 하나의 서식 참조 (좌표 = 병합 셀 좌상단 앵커) */
|
|
803
834
|
interface CellProfile {
|
|
@@ -824,6 +855,12 @@ interface TableProfile {
|
|
|
824
855
|
* 어긋나도, 앵커+치수가 맞는 프로필만 골라 적용해 남의 서식 오적용을 막는다(v3.18.1).
|
|
825
856
|
*/
|
|
826
857
|
anchor_text?: string;
|
|
858
|
+
/**
|
|
859
|
+
* 첫 행 전체 텍스트의 정규화 지문(normalizeRowAnchor) — 다중 지문 2순위 키 (0.3.0).
|
|
860
|
+
* (0,0)이 빈 셀인 크로스탭은 anchor_text가 비어 순번 폴백뿐이었는데, 첫 행 전체를
|
|
861
|
+
* 이어붙인 지문으로 동형 쌍둥이 표를 가른다.
|
|
862
|
+
*/
|
|
863
|
+
anchor_row?: string;
|
|
827
864
|
width_hwpunit?: string;
|
|
828
865
|
col_widths_hwpunit?: string[];
|
|
829
866
|
cells: CellProfile[];
|
|
@@ -860,7 +897,7 @@ interface MarkdownToHwpxOptions {
|
|
|
860
897
|
theme?: HwpxTheme;
|
|
861
898
|
/**
|
|
862
899
|
* 공문서 모드 — 지정 시 한국 행정 공문서 표준 서식으로 렌더링한다.
|
|
863
|
-
* (공식 여백,
|
|
900
|
+
* (공식 여백, 프리셋별 본문 크기, 항목부호 체계, 행갈굼 정렬, 줄간격 등)
|
|
864
901
|
* 미지정 시 기존 범용 마크다운 변환 동작 그대로 유지.
|
|
865
902
|
*/
|
|
866
903
|
gongmun?: GongmunOptions;
|
|
@@ -962,11 +999,21 @@ declare function charWidthEm1000(cp: number): number;
|
|
|
962
999
|
/** HWP 공백 폭(em×1000) — useFontSpace=0(기본): 반각 고정 500 / =1: 글꼴값 300 */
|
|
963
1000
|
declare const SPACE_EM_FIXED = 500;
|
|
964
1001
|
declare const SPACE_EM_FONT = 300;
|
|
1002
|
+
/**
|
|
1003
|
+
* 폭 테이블 클래스 — 'hcr'(함초롬 실측, 기본) / 'fixedPitch'(고정폭 글꼴:
|
|
1004
|
+
* ASCII 0.5em·그 외 1.0em). 굴림체·돋움체·바탕체·궁서체('체' 접미 = 고정폭)가
|
|
1005
|
+
* 대상 — 전자결재 변환기 산출물의 지배 본문 글꼴. 한글이 HCR(0.97em)보다 3%
|
|
1006
|
+
* 넓어 함초롬 테이블로 재면 줄당 1~2자 과대적재로 wrap 지점이 어긋난다
|
|
1007
|
+
* (bench/verify-linebreak.mjs seoul 코퍼스 실측: fixedPitch 테이블로 74/75 일치).
|
|
1008
|
+
*/
|
|
1009
|
+
type FaceClass = "hcr" | "fixedPitch";
|
|
965
1010
|
interface MeasureOptions {
|
|
966
1011
|
/** 공백 폭(em×1000). 기본 SPACE_EM_FIXED(500) = useFontSpace 0 */
|
|
967
1012
|
spaceEm?: number;
|
|
968
1013
|
/** 자간(charPr spacing %) — 글자폭의 %가 문자마다 추가 */
|
|
969
1014
|
spacingPct?: number;
|
|
1015
|
+
/** 폭 테이블 클래스 — 기본 'hcr' (함초롬 실측 테이블) */
|
|
1016
|
+
faceClass?: FaceClass;
|
|
970
1017
|
}
|
|
971
1018
|
/**
|
|
972
1019
|
* 텍스트 폭(HWPUNIT). height=charPr height(pt×100), ratioPct=장평 %.
|
|
@@ -1503,4 +1550,4 @@ interface FillFormOutput {
|
|
|
1503
1550
|
*/
|
|
1504
1551
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
1505
1552
|
|
|
1506
|
-
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 DiffChangeType, type DiffResult, 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 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, blocksToMarkdown, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|
|
1553
|
+
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 DiffChangeType, type DiffResult, 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 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, 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, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
|