kordoc 3.18.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +768 -752
  2. package/dist/{-OUCPI6B3.js → -URVKBXYK.js} +12 -8
  3. package/dist/{chunk-MEPHGCPQ.js → chunk-5CJGKKMZ.js} +1 -1
  4. package/dist/chunk-5CJGKKMZ.js.map +1 -0
  5. package/dist/{chunk-YWIYGXLI.js → chunk-7ETIIYGI.js} +2 -2
  6. package/dist/chunk-7ETIIYGI.js.map +1 -0
  7. package/dist/chunk-DCZVOIEO.cjs.map +1 -1
  8. package/dist/{chunk-4YEZTZAR.js → chunk-DVUNWK6W.js} +8 -2
  9. package/dist/chunk-DVUNWK6W.js.map +1 -0
  10. package/dist/{chunk-5HDBLRVP.cjs → chunk-EBSCV3JC.cjs} +2 -2
  11. package/dist/chunk-EBSCV3JC.cjs.map +1 -0
  12. package/dist/chunk-GS7T56RP.cjs.map +1 -1
  13. package/dist/{chunk-GIXXV52X.js → chunk-IA5UZZKV.js} +2 -2
  14. package/dist/chunk-IA5UZZKV.js.map +1 -0
  15. package/dist/{chunk-ZTUQYITH.js → chunk-JUJEKFUF.js} +6 -4
  16. package/dist/chunk-JUJEKFUF.js.map +1 -0
  17. package/dist/chunk-MOL7MDBG.js +0 -0
  18. package/dist/{chunk-PWHM3KAA.js → chunk-PGWAF755.js} +1613 -673
  19. package/dist/chunk-PGWAF755.js.map +1 -0
  20. package/dist/{chunk-VP34RO24.js → chunk-THZVBYHE.js} +3 -3
  21. package/dist/chunk-THZVBYHE.js.map +1 -0
  22. package/dist/{chunk-6Y4KKPC3.js → chunk-ZKG6SBHV.js} +2 -2
  23. package/dist/chunk-ZKG6SBHV.js.map +1 -0
  24. package/dist/cli.js +42 -18
  25. package/dist/cli.js.map +1 -1
  26. package/dist/{detect-RI2MQ33K.js → detect-PJZMUL2Z.js} +2 -2
  27. package/dist/formula-5NKVS2LR.cjs.map +1 -1
  28. package/dist/formula-JCNF43NE.js +0 -0
  29. package/dist/index.cjs +1999 -1052
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +82 -9
  32. package/dist/index.d.ts +82 -9
  33. package/dist/index.js +1772 -825
  34. package/dist/index.js.map +1 -1
  35. package/dist/mcp.js +57 -29
  36. package/dist/mcp.js.map +1 -1
  37. package/dist/page-range-737B4EZW.js +0 -0
  38. package/dist/page-range-P7SDW6LR.cjs.map +1 -1
  39. package/dist/{parser-S34YR2SH.cjs → parser-6TV6JKHF.cjs} +15 -15
  40. package/dist/parser-6TV6JKHF.cjs.map +1 -0
  41. package/dist/{parser-NZAE7PBE.js → parser-LHUO6UUA.js} +4 -4
  42. package/dist/parser-LHUO6UUA.js.map +1 -0
  43. package/dist/{parser-5D6BQYTX.js → parser-NXHY37WH.js} +3 -3
  44. package/dist/parser-NXHY37WH.js.map +1 -0
  45. package/dist/{provider-G4C2V2PD.cjs → provider-5K7O3Z2O.cjs} +1 -1
  46. package/dist/provider-5K7O3Z2O.cjs.map +1 -0
  47. package/dist/{provider-AKROB7WQ.js → provider-7H4CPZYS.js} +1 -1
  48. package/dist/provider-7H4CPZYS.js.map +1 -0
  49. package/dist/{provider-4ZJKV3DC.js → provider-H4WWSPOV.js} +1 -1
  50. package/dist/provider-H4WWSPOV.js.map +1 -0
  51. package/dist/render-T5O6QHBJ.js +10 -0
  52. package/dist/seal-7KNR5WFH.js +10 -0
  53. package/dist/setup-57FB3LSP.js +0 -0
  54. package/dist/{watch-2EFXBRYK.js → watch-PNXTAWDR.js} +8 -8
  55. package/dist/watch-PNXTAWDR.js.map +1 -0
  56. package/package.json +1 -1
  57. package/dist/chunk-4YEZTZAR.js.map +0 -1
  58. package/dist/chunk-5HDBLRVP.cjs.map +0 -1
  59. package/dist/chunk-6Y4KKPC3.js.map +0 -1
  60. package/dist/chunk-GIXXV52X.js.map +0 -1
  61. package/dist/chunk-MEPHGCPQ.js.map +0 -1
  62. package/dist/chunk-PWHM3KAA.js.map +0 -1
  63. package/dist/chunk-VP34RO24.js.map +0 -1
  64. package/dist/chunk-YWIYGXLI.js.map +0 -1
  65. package/dist/chunk-ZTUQYITH.js.map +0 -1
  66. package/dist/parser-5D6BQYTX.js.map +0 -1
  67. package/dist/parser-NZAE7PBE.js.map +0 -1
  68. package/dist/parser-S34YR2SH.cjs.map +0 -1
  69. package/dist/provider-4ZJKV3DC.js.map +0 -1
  70. package/dist/provider-AKROB7WQ.js.map +0 -1
  71. package/dist/provider-G4C2V2PD.cjs.map +0 -1
  72. package/dist/render-HRAW7ASR.js +0 -10
  73. package/dist/seal-CK64CXWO.js +0 -10
  74. package/dist/watch-2EFXBRYK.js.map +0 -1
  75. /package/dist/{-OUCPI6B3.js.map → -URVKBXYK.js.map} +0 -0
  76. /package/dist/{detect-RI2MQ33K.js.map → detect-PJZMUL2Z.js.map} +0 -0
  77. /package/dist/{render-HRAW7ASR.js.map → render-T5O6QHBJ.js.map} +0 -0
  78. /package/dist/{seal-CK64CXWO.js.map → seal-7KNR5WFH.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -579,6 +579,20 @@ interface PlaceSealResult {
579
579
  */
580
580
  declare function placeSealHwpx(hwpxBuffer: ArrayBuffer, ops: SealOp[]): Promise<PlaceSealResult>;
581
581
 
582
+ /** 요소별 글자 크기(pt) 오버라이드 — 미지정 요소는 bodyHeight 비례 기본값 */
583
+ type GaejosikSizeOverrides = Partial<{
584
+ dae: number;
585
+ cham: number;
586
+ chapter: number;
587
+ coverTitle: number;
588
+ coverSub: number;
589
+ tocLabel: number;
590
+ tocRoman: number;
591
+ tocItem: number;
592
+ table: number;
593
+ bodyTitle: number;
594
+ }>;
595
+
582
596
  /**
583
597
  * 공문서(公文書) 모드 — 한국 행정 공문서 표준 서식 렌더링 로직
584
598
  *
@@ -589,11 +603,12 @@ declare function placeSealHwpx(hwpxBuffer: ArrayBuffer, ops: SealOp[]): Promise<
589
603
  * 이 모듈은 **순수 로직**만 담는다(항목부호 시퀀스 생성, 단계별 들여쓰기 계산,
590
604
  * 프리셋 해석). 실제 XML 조립은 generator.ts가 한다.
591
605
  */
592
- type GongmunPreset = "official" | "report" | "plan" | "notice" | "minutes";
593
- type GongmunNumbering = "standard" | "report";
606
+
607
+ type GongmunPreset = "official" | "report" | "plan" | "notice" | "minutes" | "gaejosik";
608
+ type GongmunNumbering = "standard" | "report" | "gaejosik";
594
609
  type GongmunFont = "myeongjo" | "gothic";
595
610
  /** 프리셋 입력값 — 영문 키 또는 한글 별칭(기안문·보고서·계획서·통지·회의록 등) */
596
- type GongmunPresetInput = GongmunPreset | "기안문" | "시행문" | "공문" | "공문서" | "보고서" | "계획서" | "계획" | "통지" | "알림" | "안내" | "회의록";
611
+ type GongmunPresetInput = GongmunPreset | "기안문" | "시행문" | "공문" | "공문서" | "보고서" | "계획서" | "계획" | "통지" | "알림" | "안내" | "회의록" | "개조식" | "개조식보고서" | "정부보고서" | "정부표준개조식보고서";
597
612
  /** 공문서 모드 옵션 (전부 선택 — 프리셋 기본값을 개별 override) */
598
613
  interface GongmunOptions {
599
614
  /** 문서 종류 프리셋(영문 키 또는 한글 별칭). 기본 'official'(일반 기안문) */
@@ -604,8 +619,18 @@ interface GongmunOptions {
604
619
  bodyPt?: number;
605
620
  /** 본문 줄간격(%). 기본 160 (회의록 130) */
606
621
  lineSpacing?: number;
607
- /** 항목부호 체계. 'standard'=법정 8단계(1. 가. 1) …) / 'report'=보고서 불릿(□ ○ - ㆍ) */
622
+ /** 항목부호 체계. 'standard'=법정 8단계(1. 가. 1) …) / 'report'=보고서 불릿(□ ○ - ㆍ) / 'gaejosik'=개조식(□ ○ ― ㆍ + 부호별 폰트) */
608
623
  numbering?: GongmunNumbering;
624
+ /**
625
+ * 표지 페이지(개조식 프리셋 기본 켜짐) — 첫 h1을 제목으로, 파랑 장식 바 + 날짜 + 기관명.
626
+ * false로 끄거나 {date, org}로 날짜(기본 오늘, 'YYYY. M. D.')·기관명(기본 생략) 지정.
627
+ */
628
+ cover?: boolean | {
629
+ date?: string;
630
+ org?: string;
631
+ };
632
+ /** 목차 페이지(개조식 프리셋 기본 켜짐) — h2 목록을 Ⅰ Ⅱ Ⅲ…로 자동 생성. false로 끔 */
633
+ toc?: boolean;
609
634
  /** 용지 여백(mm). 기본 공식값 위20/아래10/좌20/우20 */
610
635
  margins?: {
611
636
  top: number;
@@ -623,6 +648,27 @@ interface GongmunOptions {
623
648
  autoFit?: boolean | {
624
649
  minRatio?: number;
625
650
  };
651
+ /**
652
+ * 요소별 글꼴 오버라이드 — 기관 표준 폰트 적용이나 미설치 폰트 대체용.
653
+ * body=본문(개조식 ○·―) / heading=제목 계열(□·장헤더·표지·목차) / ref=※ 참고 / table=표 셀.
654
+ * 개조식 외 프리셋은 body만 적용된다 (bodyFont보다 우선).
655
+ */
656
+ fonts?: {
657
+ body?: string;
658
+ heading?: string;
659
+ ref?: string;
660
+ table?: string;
661
+ };
662
+ /** 개조식 요소별 글자 크기(pt) 오버라이드 — 미지정 요소는 bodyPt 비례 기본값 */
663
+ sizes?: GaejosikSizeOverrides;
664
+ /** 쪽번호(하단 중앙 "- 1 -", 표지·목차는 카운트 제외). 기본: 개조식·보고서·계획서 켜짐 */
665
+ pageNumbers?: boolean;
666
+ /** 본문 끝 2타+"끝." 표시(행정업무규정). 기본: 기안문(official)만 켜짐 */
667
+ endMark?: boolean;
668
+ /** 결재란 — 직위 라벨 배열(예: ["담당","팀장","과장"]). 문서 최상단 우측 배치 */
669
+ approval?: string[];
670
+ /** 본문 첫 페이지 제목 박스(개조식) — 목차 뒤 본문 시작에 제목 반복(실측 관행). 기본: 표지 있으면 켜짐 */
671
+ bodyTitleBox?: boolean;
626
672
  }
627
673
  /** 프리셋 별칭(한글/영문) → 내부 preset 키. CLI·라이브러리 공용 */
628
674
  declare const PRESET_ALIAS: Record<string, GongmunPreset>;
@@ -712,6 +758,12 @@ interface TableProfile {
712
758
  table_index: number;
713
759
  rows: number;
714
760
  cols: number;
761
+ /**
762
+ * 첫 셀(0,0) 텍스트의 정규화 앵커(normalizeAnchor) — 소비 시 표 대응의 보조 키.
763
+ * parse 가 마크다운으로 방출하지 않는 표(1×1 제목박스·머리말 표 등) 때문에 순번이
764
+ * 어긋나도, 앵커+치수가 맞는 프로필만 골라 적용해 남의 서식 오적용을 막는다(v3.18.1).
765
+ */
766
+ anchor_text?: string;
715
767
  width_hwpunit?: string;
716
768
  col_widths_hwpunit?: string[];
717
769
  cells: CellProfile[];
@@ -738,7 +790,9 @@ interface FormatProfile {
738
790
  * gen-header.ts — container/manifest/head.xml 생성
739
791
  * gen-gongmun-fit.ts — 공문 자동장평 계획 + 리스트 항목부호 선계산
740
792
  * gen-table.ts — GFM/HTML(병합) 표 XML
793
+ * gen-table-bf.ts — 표 셀 위치별 borderFill 동적 레지스트리 (실측 테두리 위계)
741
794
  * gen-section.ts — secPr + 본문 section0.xml 조립
795
+ * gen-profile.ts — 서식 프로필(#41) id 리맵·표 매칭
742
796
  */
743
797
 
744
798
  /** markdownToHwpx 옵션 */
@@ -754,7 +808,7 @@ interface MarkdownToHwpxOptions {
754
808
  * 서식 프로필 — 표의 borderFill(테두리·음영)·열 너비·셀 글꼴을 원본 문서 없이
755
809
  * 재현한다(이슈 #41). `hwpxToProfile()`로 추출하거나 직접 작성한 프로필을 넘기면,
756
810
  * 문서 내 표 등장 순서(table_index)로 매칭해 셀 좌표별 서식을 적용한다.
757
- * 미지정 시 기존 기본 서식(단일 SOLID 테두리·균등 열폭) 그대로.
811
+ * 미지정 시 기본 서식 — 공문서 모드는 실측 정부 표 문법, 그 외 단일 SOLID 테두리.
758
812
  */
759
813
  profile?: FormatProfile;
760
814
  }
@@ -781,6 +835,23 @@ declare function markdownToHwpx(markdown: string, options?: MarkdownToHwpxOption
781
835
  */
782
836
  declare function hwpxToProfile(input: ArrayBuffer | Buffer): Promise<FormatProfile>;
783
837
 
838
+ /**
839
+ * 폰트 카탈로그 — fonts 오버라이드 오타·미설치 경고용 (A2).
840
+ *
841
+ * 생성은 항상 진행하고 경고만 낸다: HWPX는 폰트명을 문자열로 참조하므로
842
+ * 미설치 폰트를 지정해도 파일은 유효하지만, 한컴이 무경고로 기본 폰트로
843
+ * 대체 렌더해 "지정한 폰트가 안 먹는" 원인 파악이 어렵다.
844
+ * 여기 목록은 한컴오피스 번들 + Windows 한글판 기본 + 통상 설치 무료 폰트.
845
+ * 목록에 없다고 오류는 아니다 — 경고 문구도 그렇게 안내한다.
846
+ */
847
+ /** 카탈로그에 있는 폰트인가 */
848
+ declare function isKnownFont(name: string): boolean;
849
+ /**
850
+ * fonts 오버라이드 경고 목록 — 카탈로그에 없는 폰트명마다 경고 1건.
851
+ * 빈 배열이면 전부 알려진 폰트. 경고는 생성을 막지 않는다.
852
+ */
853
+ declare function unknownFontWarnings(fonts: Record<string, string | undefined>): string[];
854
+
784
855
  /**
785
856
  * 한글 조판 텍스트 폭 계산 — 함초롬바탕(HCR Batang) 실측 advance 테이블
786
857
  *
@@ -826,8 +897,8 @@ interface WrapResult {
826
897
  }
827
898
  /**
828
899
  * 문단 줄바꿈 시뮬레이션.
829
- * mode 'keep' = breakNonLatinWord=KEEP_WORD(어절 단위, 공문서 모드·Windows 한글),
830
- * mode 'charAll' = 글자 단위(BREAK_WORD·macOS 한글·전자결재 변환기의 실동작).
900
+ * mode 'keep' = 어절 단위(공문서 모드 — 저장 속성 breakNonLatinWord="BREAK_WORD", 이름 역전 주의),
901
+ * mode 'charAll' = 글자 단위(breakNonLatinWord="KEEP_WORD" 한글 기본값·전자결재 변환기).
831
902
  * 한 어절이 줄보다 길면 keep에서도 글자 단위로 강제 분해(한컴 동일).
832
903
  *
833
904
  * @param text 문단 전체 텍스트(항목 부호 포함)
@@ -1218,7 +1289,9 @@ interface RenderSvgOptions {
1218
1289
  /** Tier-2 reflow — 조판 캐시(linesegarray) 없는 파일도 순수 TS 조판으로 렌더.
1219
1290
  * 캐시가 있으면 무시(한컴본은 캐시 재생). 기본 false(캐시 없으면 KordocError). */
1220
1291
  reflow?: boolean;
1221
- /** reflow 줄바꿈 모드 — 'keep'(어절, Windows 한글·공문서) / 'charAll'(글자, macOS·전자결재) */
1292
+ /** reflow 줄바꿈 폴백 모드 — 'keep'(어절) / 'charAll'(글자). 문단 paraPr에
1293
+ * breakSetting 선언이 있으면 그 값이 우선하며(BREAK_WORD=어절, KEEP_WORD=글자 —
1294
+ * 이름 역전 주의), 이 옵션은 선언 없는 문단에만 적용된다. */
1222
1295
  reflowMode?: WrapMode;
1223
1296
  }
1224
1297
  interface RenderSvgResult {
@@ -1343,4 +1416,4 @@ interface FillFormOutput {
1343
1416
  */
1344
1417
  declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
1345
1418
 
1346
- 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 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, hwpxToProfile, inferFieldType, isHwpxFile, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, validateHwpx };
1419
+ 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 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, hwpxToProfile, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, 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
@@ -579,6 +579,20 @@ interface PlaceSealResult {
579
579
  */
580
580
  declare function placeSealHwpx(hwpxBuffer: ArrayBuffer, ops: SealOp[]): Promise<PlaceSealResult>;
581
581
 
582
+ /** 요소별 글자 크기(pt) 오버라이드 — 미지정 요소는 bodyHeight 비례 기본값 */
583
+ type GaejosikSizeOverrides = Partial<{
584
+ dae: number;
585
+ cham: number;
586
+ chapter: number;
587
+ coverTitle: number;
588
+ coverSub: number;
589
+ tocLabel: number;
590
+ tocRoman: number;
591
+ tocItem: number;
592
+ table: number;
593
+ bodyTitle: number;
594
+ }>;
595
+
582
596
  /**
583
597
  * 공문서(公文書) 모드 — 한국 행정 공문서 표준 서식 렌더링 로직
584
598
  *
@@ -589,11 +603,12 @@ declare function placeSealHwpx(hwpxBuffer: ArrayBuffer, ops: SealOp[]): Promise<
589
603
  * 이 모듈은 **순수 로직**만 담는다(항목부호 시퀀스 생성, 단계별 들여쓰기 계산,
590
604
  * 프리셋 해석). 실제 XML 조립은 generator.ts가 한다.
591
605
  */
592
- type GongmunPreset = "official" | "report" | "plan" | "notice" | "minutes";
593
- type GongmunNumbering = "standard" | "report";
606
+
607
+ type GongmunPreset = "official" | "report" | "plan" | "notice" | "minutes" | "gaejosik";
608
+ type GongmunNumbering = "standard" | "report" | "gaejosik";
594
609
  type GongmunFont = "myeongjo" | "gothic";
595
610
  /** 프리셋 입력값 — 영문 키 또는 한글 별칭(기안문·보고서·계획서·통지·회의록 등) */
596
- type GongmunPresetInput = GongmunPreset | "기안문" | "시행문" | "공문" | "공문서" | "보고서" | "계획서" | "계획" | "통지" | "알림" | "안내" | "회의록";
611
+ type GongmunPresetInput = GongmunPreset | "기안문" | "시행문" | "공문" | "공문서" | "보고서" | "계획서" | "계획" | "통지" | "알림" | "안내" | "회의록" | "개조식" | "개조식보고서" | "정부보고서" | "정부표준개조식보고서";
597
612
  /** 공문서 모드 옵션 (전부 선택 — 프리셋 기본값을 개별 override) */
598
613
  interface GongmunOptions {
599
614
  /** 문서 종류 프리셋(영문 키 또는 한글 별칭). 기본 'official'(일반 기안문) */
@@ -604,8 +619,18 @@ interface GongmunOptions {
604
619
  bodyPt?: number;
605
620
  /** 본문 줄간격(%). 기본 160 (회의록 130) */
606
621
  lineSpacing?: number;
607
- /** 항목부호 체계. 'standard'=법정 8단계(1. 가. 1) …) / 'report'=보고서 불릿(□ ○ - ㆍ) */
622
+ /** 항목부호 체계. 'standard'=법정 8단계(1. 가. 1) …) / 'report'=보고서 불릿(□ ○ - ㆍ) / 'gaejosik'=개조식(□ ○ ― ㆍ + 부호별 폰트) */
608
623
  numbering?: GongmunNumbering;
624
+ /**
625
+ * 표지 페이지(개조식 프리셋 기본 켜짐) — 첫 h1을 제목으로, 파랑 장식 바 + 날짜 + 기관명.
626
+ * false로 끄거나 {date, org}로 날짜(기본 오늘, 'YYYY. M. D.')·기관명(기본 생략) 지정.
627
+ */
628
+ cover?: boolean | {
629
+ date?: string;
630
+ org?: string;
631
+ };
632
+ /** 목차 페이지(개조식 프리셋 기본 켜짐) — h2 목록을 Ⅰ Ⅱ Ⅲ…로 자동 생성. false로 끔 */
633
+ toc?: boolean;
609
634
  /** 용지 여백(mm). 기본 공식값 위20/아래10/좌20/우20 */
610
635
  margins?: {
611
636
  top: number;
@@ -623,6 +648,27 @@ interface GongmunOptions {
623
648
  autoFit?: boolean | {
624
649
  minRatio?: number;
625
650
  };
651
+ /**
652
+ * 요소별 글꼴 오버라이드 — 기관 표준 폰트 적용이나 미설치 폰트 대체용.
653
+ * body=본문(개조식 ○·―) / heading=제목 계열(□·장헤더·표지·목차) / ref=※ 참고 / table=표 셀.
654
+ * 개조식 외 프리셋은 body만 적용된다 (bodyFont보다 우선).
655
+ */
656
+ fonts?: {
657
+ body?: string;
658
+ heading?: string;
659
+ ref?: string;
660
+ table?: string;
661
+ };
662
+ /** 개조식 요소별 글자 크기(pt) 오버라이드 — 미지정 요소는 bodyPt 비례 기본값 */
663
+ sizes?: GaejosikSizeOverrides;
664
+ /** 쪽번호(하단 중앙 "- 1 -", 표지·목차는 카운트 제외). 기본: 개조식·보고서·계획서 켜짐 */
665
+ pageNumbers?: boolean;
666
+ /** 본문 끝 2타+"끝." 표시(행정업무규정). 기본: 기안문(official)만 켜짐 */
667
+ endMark?: boolean;
668
+ /** 결재란 — 직위 라벨 배열(예: ["담당","팀장","과장"]). 문서 최상단 우측 배치 */
669
+ approval?: string[];
670
+ /** 본문 첫 페이지 제목 박스(개조식) — 목차 뒤 본문 시작에 제목 반복(실측 관행). 기본: 표지 있으면 켜짐 */
671
+ bodyTitleBox?: boolean;
626
672
  }
627
673
  /** 프리셋 별칭(한글/영문) → 내부 preset 키. CLI·라이브러리 공용 */
628
674
  declare const PRESET_ALIAS: Record<string, GongmunPreset>;
@@ -712,6 +758,12 @@ interface TableProfile {
712
758
  table_index: number;
713
759
  rows: number;
714
760
  cols: number;
761
+ /**
762
+ * 첫 셀(0,0) 텍스트의 정규화 앵커(normalizeAnchor) — 소비 시 표 대응의 보조 키.
763
+ * parse 가 마크다운으로 방출하지 않는 표(1×1 제목박스·머리말 표 등) 때문에 순번이
764
+ * 어긋나도, 앵커+치수가 맞는 프로필만 골라 적용해 남의 서식 오적용을 막는다(v3.18.1).
765
+ */
766
+ anchor_text?: string;
715
767
  width_hwpunit?: string;
716
768
  col_widths_hwpunit?: string[];
717
769
  cells: CellProfile[];
@@ -738,7 +790,9 @@ interface FormatProfile {
738
790
  * gen-header.ts — container/manifest/head.xml 생성
739
791
  * gen-gongmun-fit.ts — 공문 자동장평 계획 + 리스트 항목부호 선계산
740
792
  * gen-table.ts — GFM/HTML(병합) 표 XML
793
+ * gen-table-bf.ts — 표 셀 위치별 borderFill 동적 레지스트리 (실측 테두리 위계)
741
794
  * gen-section.ts — secPr + 본문 section0.xml 조립
795
+ * gen-profile.ts — 서식 프로필(#41) id 리맵·표 매칭
742
796
  */
743
797
 
744
798
  /** markdownToHwpx 옵션 */
@@ -754,7 +808,7 @@ interface MarkdownToHwpxOptions {
754
808
  * 서식 프로필 — 표의 borderFill(테두리·음영)·열 너비·셀 글꼴을 원본 문서 없이
755
809
  * 재현한다(이슈 #41). `hwpxToProfile()`로 추출하거나 직접 작성한 프로필을 넘기면,
756
810
  * 문서 내 표 등장 순서(table_index)로 매칭해 셀 좌표별 서식을 적용한다.
757
- * 미지정 시 기존 기본 서식(단일 SOLID 테두리·균등 열폭) 그대로.
811
+ * 미지정 시 기본 서식 — 공문서 모드는 실측 정부 표 문법, 그 외 단일 SOLID 테두리.
758
812
  */
759
813
  profile?: FormatProfile;
760
814
  }
@@ -781,6 +835,23 @@ declare function markdownToHwpx(markdown: string, options?: MarkdownToHwpxOption
781
835
  */
782
836
  declare function hwpxToProfile(input: ArrayBuffer | Buffer): Promise<FormatProfile>;
783
837
 
838
+ /**
839
+ * 폰트 카탈로그 — fonts 오버라이드 오타·미설치 경고용 (A2).
840
+ *
841
+ * 생성은 항상 진행하고 경고만 낸다: HWPX는 폰트명을 문자열로 참조하므로
842
+ * 미설치 폰트를 지정해도 파일은 유효하지만, 한컴이 무경고로 기본 폰트로
843
+ * 대체 렌더해 "지정한 폰트가 안 먹는" 원인 파악이 어렵다.
844
+ * 여기 목록은 한컴오피스 번들 + Windows 한글판 기본 + 통상 설치 무료 폰트.
845
+ * 목록에 없다고 오류는 아니다 — 경고 문구도 그렇게 안내한다.
846
+ */
847
+ /** 카탈로그에 있는 폰트인가 */
848
+ declare function isKnownFont(name: string): boolean;
849
+ /**
850
+ * fonts 오버라이드 경고 목록 — 카탈로그에 없는 폰트명마다 경고 1건.
851
+ * 빈 배열이면 전부 알려진 폰트. 경고는 생성을 막지 않는다.
852
+ */
853
+ declare function unknownFontWarnings(fonts: Record<string, string | undefined>): string[];
854
+
784
855
  /**
785
856
  * 한글 조판 텍스트 폭 계산 — 함초롬바탕(HCR Batang) 실측 advance 테이블
786
857
  *
@@ -826,8 +897,8 @@ interface WrapResult {
826
897
  }
827
898
  /**
828
899
  * 문단 줄바꿈 시뮬레이션.
829
- * mode 'keep' = breakNonLatinWord=KEEP_WORD(어절 단위, 공문서 모드·Windows 한글),
830
- * mode 'charAll' = 글자 단위(BREAK_WORD·macOS 한글·전자결재 변환기의 실동작).
900
+ * mode 'keep' = 어절 단위(공문서 모드 — 저장 속성 breakNonLatinWord="BREAK_WORD", 이름 역전 주의),
901
+ * mode 'charAll' = 글자 단위(breakNonLatinWord="KEEP_WORD" 한글 기본값·전자결재 변환기).
831
902
  * 한 어절이 줄보다 길면 keep에서도 글자 단위로 강제 분해(한컴 동일).
832
903
  *
833
904
  * @param text 문단 전체 텍스트(항목 부호 포함)
@@ -1218,7 +1289,9 @@ interface RenderSvgOptions {
1218
1289
  /** Tier-2 reflow — 조판 캐시(linesegarray) 없는 파일도 순수 TS 조판으로 렌더.
1219
1290
  * 캐시가 있으면 무시(한컴본은 캐시 재생). 기본 false(캐시 없으면 KordocError). */
1220
1291
  reflow?: boolean;
1221
- /** reflow 줄바꿈 모드 — 'keep'(어절, Windows 한글·공문서) / 'charAll'(글자, macOS·전자결재) */
1292
+ /** reflow 줄바꿈 폴백 모드 — 'keep'(어절) / 'charAll'(글자). 문단 paraPr에
1293
+ * breakSetting 선언이 있으면 그 값이 우선하며(BREAK_WORD=어절, KEEP_WORD=글자 —
1294
+ * 이름 역전 주의), 이 옵션은 선언 없는 문단에만 적용된다. */
1222
1295
  reflowMode?: WrapMode;
1223
1296
  }
1224
1297
  interface RenderSvgResult {
@@ -1343,4 +1416,4 @@ interface FillFormOutput {
1343
1416
  */
1344
1417
  declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
1345
1418
 
1346
- 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 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, hwpxToProfile, inferFieldType, isHwpxFile, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, validateHwpx };
1419
+ 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 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, hwpxToProfile, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, 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 };