kordoc 3.18.1 → 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.
- package/README.md +768 -752
- package/dist/{-V66QW3WA.js → -URVKBXYK.js} +12 -8
- package/dist/{chunk-MEPHGCPQ.js → chunk-5CJGKKMZ.js} +1 -1
- package/dist/chunk-5CJGKKMZ.js.map +1 -0
- package/dist/{chunk-2IBFK5ZO.js → chunk-7ETIIYGI.js} +2 -2
- package/dist/chunk-7ETIIYGI.js.map +1 -0
- package/dist/chunk-DCZVOIEO.cjs.map +1 -1
- package/dist/{chunk-4RGDFDQ2.js → chunk-DVUNWK6W.js} +8 -2
- package/dist/chunk-DVUNWK6W.js.map +1 -0
- package/dist/{chunk-R2H34FY5.cjs → chunk-EBSCV3JC.cjs} +2 -2
- package/dist/chunk-EBSCV3JC.cjs.map +1 -0
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-UHYPUIRH.js → chunk-IA5UZZKV.js} +2 -2
- package/dist/chunk-IA5UZZKV.js.map +1 -0
- package/dist/{chunk-QMJJI6TD.js → chunk-JUJEKFUF.js} +6 -4
- package/dist/chunk-JUJEKFUF.js.map +1 -0
- package/dist/chunk-MOL7MDBG.js +0 -0
- package/dist/{chunk-7K5P4RNT.js → chunk-PGWAF755.js} +1489 -585
- package/dist/chunk-PGWAF755.js.map +1 -0
- package/dist/{chunk-NZJAXMN7.js → chunk-THZVBYHE.js} +3 -3
- package/dist/chunk-THZVBYHE.js.map +1 -0
- package/dist/{chunk-UNV7F3FK.js → chunk-ZKG6SBHV.js} +2 -2
- package/dist/chunk-ZKG6SBHV.js.map +1 -0
- package/dist/cli.js +40 -16
- package/dist/cli.js.map +1 -1
- package/dist/{detect-RI2MQ33K.js → detect-PJZMUL2Z.js} +2 -2
- package/dist/formula-5NKVS2LR.cjs.map +1 -1
- package/dist/formula-JCNF43NE.js +0 -0
- package/dist/index.cjs +1876 -966
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -9
- package/dist/index.d.ts +76 -9
- package/dist/index.js +1648 -738
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +55 -16
- 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-XEY5MRGV.cjs → parser-6TV6JKHF.cjs} +15 -15
- package/dist/parser-6TV6JKHF.cjs.map +1 -0
- package/dist/{parser-DOBK652H.js → parser-LHUO6UUA.js} +4 -4
- package/dist/parser-LHUO6UUA.js.map +1 -0
- package/dist/{parser-JBBA5A5E.js → parser-NXHY37WH.js} +3 -3
- package/dist/parser-NXHY37WH.js.map +1 -0
- package/dist/{provider-G4C2V2PD.cjs → provider-5K7O3Z2O.cjs} +1 -1
- package/dist/provider-5K7O3Z2O.cjs.map +1 -0
- package/dist/{provider-AKROB7WQ.js → provider-7H4CPZYS.js} +1 -1
- package/dist/provider-7H4CPZYS.js.map +1 -0
- package/dist/{provider-4ZJKV3DC.js → provider-H4WWSPOV.js} +1 -1
- package/dist/provider-H4WWSPOV.js.map +1 -0
- package/dist/render-T5O6QHBJ.js +10 -0
- package/dist/seal-7KNR5WFH.js +10 -0
- package/dist/setup-57FB3LSP.js +0 -0
- package/dist/{watch-2MNRQWGV.js → watch-PNXTAWDR.js} +8 -8
- package/dist/watch-PNXTAWDR.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-2IBFK5ZO.js.map +0 -1
- package/dist/chunk-4RGDFDQ2.js.map +0 -1
- package/dist/chunk-7K5P4RNT.js.map +0 -1
- package/dist/chunk-MEPHGCPQ.js.map +0 -1
- package/dist/chunk-NZJAXMN7.js.map +0 -1
- package/dist/chunk-QMJJI6TD.js.map +0 -1
- package/dist/chunk-R2H34FY5.cjs.map +0 -1
- package/dist/chunk-UHYPUIRH.js.map +0 -1
- package/dist/chunk-UNV7F3FK.js.map +0 -1
- package/dist/parser-DOBK652H.js.map +0 -1
- package/dist/parser-JBBA5A5E.js.map +0 -1
- package/dist/parser-XEY5MRGV.cjs.map +0 -1
- package/dist/provider-4ZJKV3DC.js.map +0 -1
- package/dist/provider-AKROB7WQ.js.map +0 -1
- package/dist/provider-G4C2V2PD.cjs.map +0 -1
- package/dist/render-VX4H2S4F.js +0 -10
- package/dist/seal-6Z6H4YXN.js +0 -10
- package/dist/watch-2MNRQWGV.js.map +0 -1
- /package/dist/{-V66QW3WA.js.map → -URVKBXYK.js.map} +0 -0
- /package/dist/{detect-RI2MQ33K.js.map → detect-PJZMUL2Z.js.map} +0 -0
- /package/dist/{render-VX4H2S4F.js.map → render-T5O6QHBJ.js.map} +0 -0
- /package/dist/{seal-6Z6H4YXN.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
|
-
|
|
593
|
-
type
|
|
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>;
|
|
@@ -744,7 +790,9 @@ interface FormatProfile {
|
|
|
744
790
|
* gen-header.ts — container/manifest/head.xml 생성
|
|
745
791
|
* gen-gongmun-fit.ts — 공문 자동장평 계획 + 리스트 항목부호 선계산
|
|
746
792
|
* gen-table.ts — GFM/HTML(병합) 표 XML
|
|
793
|
+
* gen-table-bf.ts — 표 셀 위치별 borderFill 동적 레지스트리 (실측 테두리 위계)
|
|
747
794
|
* gen-section.ts — secPr + 본문 section0.xml 조립
|
|
795
|
+
* gen-profile.ts — 서식 프로필(#41) id 리맵·표 매칭
|
|
748
796
|
*/
|
|
749
797
|
|
|
750
798
|
/** markdownToHwpx 옵션 */
|
|
@@ -760,7 +808,7 @@ interface MarkdownToHwpxOptions {
|
|
|
760
808
|
* 서식 프로필 — 표의 borderFill(테두리·음영)·열 너비·셀 글꼴을 원본 문서 없이
|
|
761
809
|
* 재현한다(이슈 #41). `hwpxToProfile()`로 추출하거나 직접 작성한 프로필을 넘기면,
|
|
762
810
|
* 문서 내 표 등장 순서(table_index)로 매칭해 셀 좌표별 서식을 적용한다.
|
|
763
|
-
* 미지정 시
|
|
811
|
+
* 미지정 시 기본 서식 — 공문서 모드는 실측 정부 표 문법, 그 외 단일 SOLID 테두리.
|
|
764
812
|
*/
|
|
765
813
|
profile?: FormatProfile;
|
|
766
814
|
}
|
|
@@ -787,6 +835,23 @@ declare function markdownToHwpx(markdown: string, options?: MarkdownToHwpxOption
|
|
|
787
835
|
*/
|
|
788
836
|
declare function hwpxToProfile(input: ArrayBuffer | Buffer): Promise<FormatProfile>;
|
|
789
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
|
+
|
|
790
855
|
/**
|
|
791
856
|
* 한글 조판 텍스트 폭 계산 — 함초롬바탕(HCR Batang) 실측 advance 테이블
|
|
792
857
|
*
|
|
@@ -832,8 +897,8 @@ interface WrapResult {
|
|
|
832
897
|
}
|
|
833
898
|
/**
|
|
834
899
|
* 문단 줄바꿈 시뮬레이션.
|
|
835
|
-
* mode 'keep' = breakNonLatinWord=
|
|
836
|
-
* mode 'charAll' = 글자 단위(
|
|
900
|
+
* mode 'keep' = 어절 단위(공문서 모드 — 저장 속성 breakNonLatinWord="BREAK_WORD", 이름 역전 주의),
|
|
901
|
+
* mode 'charAll' = 글자 단위(breakNonLatinWord="KEEP_WORD" — 한글 기본값·전자결재 변환기).
|
|
837
902
|
* 한 어절이 줄보다 길면 keep에서도 글자 단위로 강제 분해(한컴 동일).
|
|
838
903
|
*
|
|
839
904
|
* @param text 문단 전체 텍스트(항목 부호 포함)
|
|
@@ -1224,7 +1289,9 @@ interface RenderSvgOptions {
|
|
|
1224
1289
|
/** Tier-2 reflow — 조판 캐시(linesegarray) 없는 파일도 순수 TS 조판으로 렌더.
|
|
1225
1290
|
* 캐시가 있으면 무시(한컴본은 캐시 재생). 기본 false(캐시 없으면 KordocError). */
|
|
1226
1291
|
reflow?: boolean;
|
|
1227
|
-
/** reflow 줄바꿈 모드 — 'keep'(
|
|
1292
|
+
/** reflow 줄바꿈 폴백 모드 — 'keep'(어절) / 'charAll'(글자). 문단 paraPr에
|
|
1293
|
+
* breakSetting 선언이 있으면 그 값이 우선하며(BREAK_WORD=어절, KEEP_WORD=글자 —
|
|
1294
|
+
* 이름 역전 주의), 이 옵션은 선언 없는 문단에만 적용된다. */
|
|
1228
1295
|
reflowMode?: WrapMode;
|
|
1229
1296
|
}
|
|
1230
1297
|
interface RenderSvgResult {
|
|
@@ -1349,4 +1416,4 @@ interface FillFormOutput {
|
|
|
1349
1416
|
*/
|
|
1350
1417
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
1351
1418
|
|
|
1352
|
-
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
|
-
|
|
593
|
-
type
|
|
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>;
|
|
@@ -744,7 +790,9 @@ interface FormatProfile {
|
|
|
744
790
|
* gen-header.ts — container/manifest/head.xml 생성
|
|
745
791
|
* gen-gongmun-fit.ts — 공문 자동장평 계획 + 리스트 항목부호 선계산
|
|
746
792
|
* gen-table.ts — GFM/HTML(병합) 표 XML
|
|
793
|
+
* gen-table-bf.ts — 표 셀 위치별 borderFill 동적 레지스트리 (실측 테두리 위계)
|
|
747
794
|
* gen-section.ts — secPr + 본문 section0.xml 조립
|
|
795
|
+
* gen-profile.ts — 서식 프로필(#41) id 리맵·표 매칭
|
|
748
796
|
*/
|
|
749
797
|
|
|
750
798
|
/** markdownToHwpx 옵션 */
|
|
@@ -760,7 +808,7 @@ interface MarkdownToHwpxOptions {
|
|
|
760
808
|
* 서식 프로필 — 표의 borderFill(테두리·음영)·열 너비·셀 글꼴을 원본 문서 없이
|
|
761
809
|
* 재현한다(이슈 #41). `hwpxToProfile()`로 추출하거나 직접 작성한 프로필을 넘기면,
|
|
762
810
|
* 문서 내 표 등장 순서(table_index)로 매칭해 셀 좌표별 서식을 적용한다.
|
|
763
|
-
* 미지정 시
|
|
811
|
+
* 미지정 시 기본 서식 — 공문서 모드는 실측 정부 표 문법, 그 외 단일 SOLID 테두리.
|
|
764
812
|
*/
|
|
765
813
|
profile?: FormatProfile;
|
|
766
814
|
}
|
|
@@ -787,6 +835,23 @@ declare function markdownToHwpx(markdown: string, options?: MarkdownToHwpxOption
|
|
|
787
835
|
*/
|
|
788
836
|
declare function hwpxToProfile(input: ArrayBuffer | Buffer): Promise<FormatProfile>;
|
|
789
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
|
+
|
|
790
855
|
/**
|
|
791
856
|
* 한글 조판 텍스트 폭 계산 — 함초롬바탕(HCR Batang) 실측 advance 테이블
|
|
792
857
|
*
|
|
@@ -832,8 +897,8 @@ interface WrapResult {
|
|
|
832
897
|
}
|
|
833
898
|
/**
|
|
834
899
|
* 문단 줄바꿈 시뮬레이션.
|
|
835
|
-
* mode 'keep' = breakNonLatinWord=
|
|
836
|
-
* mode 'charAll' = 글자 단위(
|
|
900
|
+
* mode 'keep' = 어절 단위(공문서 모드 — 저장 속성 breakNonLatinWord="BREAK_WORD", 이름 역전 주의),
|
|
901
|
+
* mode 'charAll' = 글자 단위(breakNonLatinWord="KEEP_WORD" — 한글 기본값·전자결재 변환기).
|
|
837
902
|
* 한 어절이 줄보다 길면 keep에서도 글자 단위로 강제 분해(한컴 동일).
|
|
838
903
|
*
|
|
839
904
|
* @param text 문단 전체 텍스트(항목 부호 포함)
|
|
@@ -1224,7 +1289,9 @@ interface RenderSvgOptions {
|
|
|
1224
1289
|
/** Tier-2 reflow — 조판 캐시(linesegarray) 없는 파일도 순수 TS 조판으로 렌더.
|
|
1225
1290
|
* 캐시가 있으면 무시(한컴본은 캐시 재생). 기본 false(캐시 없으면 KordocError). */
|
|
1226
1291
|
reflow?: boolean;
|
|
1227
|
-
/** reflow 줄바꿈 모드 — 'keep'(
|
|
1292
|
+
/** reflow 줄바꿈 폴백 모드 — 'keep'(어절) / 'charAll'(글자). 문단 paraPr에
|
|
1293
|
+
* breakSetting 선언이 있으면 그 값이 우선하며(BREAK_WORD=어절, KEEP_WORD=글자 —
|
|
1294
|
+
* 이름 역전 주의), 이 옵션은 선언 없는 문단에만 적용된다. */
|
|
1228
1295
|
reflowMode?: WrapMode;
|
|
1229
1296
|
}
|
|
1230
1297
|
interface RenderSvgResult {
|
|
@@ -1349,4 +1416,4 @@ interface FillFormOutput {
|
|
|
1349
1416
|
*/
|
|
1350
1417
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
1351
1418
|
|
|
1352
|
-
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 };
|