@clazic/kordoc 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -251,6 +251,61 @@ interface WatchOptions {
251
251
  pages?: string;
252
252
  silent?: boolean;
253
253
  }
254
+ /** 포맷 감지 단계 이벤트 */
255
+ interface ConvertDetectEvent {
256
+ type: "detect";
257
+ stage: "reading" | "format_detected" | "size_check";
258
+ message: string;
259
+ fileSize?: number;
260
+ format?: "hwp" | "hwpx";
261
+ }
262
+ /** 환경 검증 단계 이벤트 */
263
+ interface ConvertValidateEvent {
264
+ type: "validate";
265
+ stage: "soffice_check" | "soffice_found" | "soffice_not_found";
266
+ message: string;
267
+ sofficePath?: string;
268
+ }
269
+ /** 설치 단계 이벤트 */
270
+ interface ConvertInstallEvent {
271
+ type: "install";
272
+ stage: "install_start" | "download_progress" | "extract_progress" | "install_complete" | "install_failed";
273
+ message: string;
274
+ percent?: number;
275
+ downloadedBytes?: number;
276
+ totalBytes?: number;
277
+ installedPath?: string;
278
+ error?: string;
279
+ }
280
+ /** 변환 진행 이벤트 */
281
+ interface ConvertProgressEvent {
282
+ type: "convert";
283
+ stage: "convert_start" | "convert_progress" | "convert_done";
284
+ message: string;
285
+ percent: number;
286
+ }
287
+ /** 변환 완료 이벤트 */
288
+ interface ConvertCompleteEvent {
289
+ type: "complete";
290
+ stage: "success";
291
+ message: string;
292
+ result: {
293
+ sourceFormat: "hwp" | "hwpx";
294
+ pdfSize: number;
295
+ pageCount?: number;
296
+ };
297
+ }
298
+ /** 에러 이벤트 */
299
+ interface ConvertErrorEvent {
300
+ type: "error";
301
+ stage: "detect" | "validate" | "install" | "convert";
302
+ message: string;
303
+ code: ErrorCode;
304
+ recoverable: boolean;
305
+ suggestion?: string;
306
+ }
307
+ /** convertToPdf()에서 발생하는 모든 이벤트 */
308
+ type ConvertEvent = ConvertDetectEvent | ConvertValidateEvent | ConvertInstallEvent | ConvertProgressEvent | ConvertCompleteEvent | ConvertErrorEvent;
254
309
  /** HWP/HWPX → PDF 변환 옵션 */
255
310
  interface ConvertToPdfOptions {
256
311
  /** 페이지 범위 ("1-3,5,7-10") — LibreOffice 필터가 지원하는 경우 */
@@ -259,8 +314,15 @@ interface ConvertToPdfOptions {
259
314
  quality?: "low" | "medium" | "high";
260
315
  /** 타임아웃 (ms, 기본 60000) */
261
316
  timeoutMs?: number;
262
- /** 진행 상황 콜백 */
317
+ /**
318
+ * 진행 상황 콜백 (deprecated — onEvent 사용 권장)
319
+ * @deprecated onEvent를 사용하세요
320
+ */
263
321
  onProgress?: (percent: number, stage: string) => void;
322
+ /**
323
+ * 이벤트 콜백 — 모든 진행 상황을 이벤트로 전달
324
+ */
325
+ onEvent?: (event: ConvertEvent) => void;
264
326
  /** LibreOffice 자동 설치 허용 (기본 true) */
265
327
  autoInstallLibreOffice?: boolean;
266
328
  /** LibreOffice 바이너리 직접 지정 */
@@ -362,16 +424,10 @@ declare function markdownToXlsx(markdown: string, options?: MarkdownToXlsxOption
362
424
  declare function convertToPdf(input: string | ArrayBuffer | Buffer, options?: ConvertToPdfOptions): Promise<ConvertToPdfResult>;
363
425
  /**
364
426
  * HWP 5.x 파일을 PDF로 변환 (포맷 감지 생략).
365
- * 내부적으로 convertToPdf와 동일하지만 강제로 "hwp"로 처리.
366
- *
367
- * @deprecated convertToPdf()에 Buffer를 직접 전달하는 것과 동일
368
427
  */
369
428
  declare function convertHwpToPdf(input: string | ArrayBuffer | Buffer, options?: ConvertToPdfOptions): Promise<ConvertToPdfResult>;
370
429
  /**
371
430
  * HWPX 파일을 PDF로 변환 (포맷 감지 생략).
372
- * 내부적으로 convertToPdf와 동일하지만 강제로 "hwpx"로 처리.
373
- *
374
- * @deprecated convertToPdf()에 Buffer를 직접 전달하는 것과 동일
375
431
  */
376
432
  declare function convertHwpxToPdf(input: string | ArrayBuffer | Buffer, options?: ConvertToPdfOptions): Promise<ConvertToPdfResult>;
377
433
 
package/dist/index.d.ts CHANGED
@@ -251,6 +251,61 @@ interface WatchOptions {
251
251
  pages?: string;
252
252
  silent?: boolean;
253
253
  }
254
+ /** 포맷 감지 단계 이벤트 */
255
+ interface ConvertDetectEvent {
256
+ type: "detect";
257
+ stage: "reading" | "format_detected" | "size_check";
258
+ message: string;
259
+ fileSize?: number;
260
+ format?: "hwp" | "hwpx";
261
+ }
262
+ /** 환경 검증 단계 이벤트 */
263
+ interface ConvertValidateEvent {
264
+ type: "validate";
265
+ stage: "soffice_check" | "soffice_found" | "soffice_not_found";
266
+ message: string;
267
+ sofficePath?: string;
268
+ }
269
+ /** 설치 단계 이벤트 */
270
+ interface ConvertInstallEvent {
271
+ type: "install";
272
+ stage: "install_start" | "download_progress" | "extract_progress" | "install_complete" | "install_failed";
273
+ message: string;
274
+ percent?: number;
275
+ downloadedBytes?: number;
276
+ totalBytes?: number;
277
+ installedPath?: string;
278
+ error?: string;
279
+ }
280
+ /** 변환 진행 이벤트 */
281
+ interface ConvertProgressEvent {
282
+ type: "convert";
283
+ stage: "convert_start" | "convert_progress" | "convert_done";
284
+ message: string;
285
+ percent: number;
286
+ }
287
+ /** 변환 완료 이벤트 */
288
+ interface ConvertCompleteEvent {
289
+ type: "complete";
290
+ stage: "success";
291
+ message: string;
292
+ result: {
293
+ sourceFormat: "hwp" | "hwpx";
294
+ pdfSize: number;
295
+ pageCount?: number;
296
+ };
297
+ }
298
+ /** 에러 이벤트 */
299
+ interface ConvertErrorEvent {
300
+ type: "error";
301
+ stage: "detect" | "validate" | "install" | "convert";
302
+ message: string;
303
+ code: ErrorCode;
304
+ recoverable: boolean;
305
+ suggestion?: string;
306
+ }
307
+ /** convertToPdf()에서 발생하는 모든 이벤트 */
308
+ type ConvertEvent = ConvertDetectEvent | ConvertValidateEvent | ConvertInstallEvent | ConvertProgressEvent | ConvertCompleteEvent | ConvertErrorEvent;
254
309
  /** HWP/HWPX → PDF 변환 옵션 */
255
310
  interface ConvertToPdfOptions {
256
311
  /** 페이지 범위 ("1-3,5,7-10") — LibreOffice 필터가 지원하는 경우 */
@@ -259,8 +314,15 @@ interface ConvertToPdfOptions {
259
314
  quality?: "low" | "medium" | "high";
260
315
  /** 타임아웃 (ms, 기본 60000) */
261
316
  timeoutMs?: number;
262
- /** 진행 상황 콜백 */
317
+ /**
318
+ * 진행 상황 콜백 (deprecated — onEvent 사용 권장)
319
+ * @deprecated onEvent를 사용하세요
320
+ */
263
321
  onProgress?: (percent: number, stage: string) => void;
322
+ /**
323
+ * 이벤트 콜백 — 모든 진행 상황을 이벤트로 전달
324
+ */
325
+ onEvent?: (event: ConvertEvent) => void;
264
326
  /** LibreOffice 자동 설치 허용 (기본 true) */
265
327
  autoInstallLibreOffice?: boolean;
266
328
  /** LibreOffice 바이너리 직접 지정 */
@@ -362,16 +424,10 @@ declare function markdownToXlsx(markdown: string, options?: MarkdownToXlsxOption
362
424
  declare function convertToPdf(input: string | ArrayBuffer | Buffer, options?: ConvertToPdfOptions): Promise<ConvertToPdfResult>;
363
425
  /**
364
426
  * HWP 5.x 파일을 PDF로 변환 (포맷 감지 생략).
365
- * 내부적으로 convertToPdf와 동일하지만 강제로 "hwp"로 처리.
366
- *
367
- * @deprecated convertToPdf()에 Buffer를 직접 전달하는 것과 동일
368
427
  */
369
428
  declare function convertHwpToPdf(input: string | ArrayBuffer | Buffer, options?: ConvertToPdfOptions): Promise<ConvertToPdfResult>;
370
429
  /**
371
430
  * HWPX 파일을 PDF로 변환 (포맷 감지 생략).
372
- * 내부적으로 convertToPdf와 동일하지만 강제로 "hwpx"로 처리.
373
- *
374
- * @deprecated convertToPdf()에 Buffer를 직접 전달하는 것과 동일
375
431
  */
376
432
  declare function convertHwpxToPdf(input: string | ArrayBuffer | Buffer, options?: ConvertToPdfOptions): Promise<ConvertToPdfResult>;
377
433