@rhwp/core 0.7.18 → 0.8.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/package.json +6 -2
- package/rhwp.d.ts +123 -13
- package/rhwp.js +648 -62
- package/rhwp_bg.wasm +0 -0
- package/rhwp_bg.wasm.d.ts +28 -5
package/rhwp.js
CHANGED
|
@@ -140,6 +140,37 @@ export class HwpDocument {
|
|
|
140
140
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* @param {number} section_idx
|
|
145
|
+
* @param {number} parent_para_idx
|
|
146
|
+
* @param {string} path_json
|
|
147
|
+
* @param {number} start_offset
|
|
148
|
+
* @param {number} end_offset
|
|
149
|
+
* @param {string} props_json
|
|
150
|
+
* @returns {string}
|
|
151
|
+
*/
|
|
152
|
+
applyCharFormatInCellByPath(section_idx, parent_para_idx, path_json, start_offset, end_offset, props_json) {
|
|
153
|
+
let deferred4_0;
|
|
154
|
+
let deferred4_1;
|
|
155
|
+
try {
|
|
156
|
+
const ptr0 = passStringToWasm0(path_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
157
|
+
const len0 = WASM_VECTOR_LEN;
|
|
158
|
+
const ptr1 = passStringToWasm0(props_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
159
|
+
const len1 = WASM_VECTOR_LEN;
|
|
160
|
+
const ret = wasm.hwpdocument_applyCharFormatInCellByPath(this.__wbg_ptr, section_idx, parent_para_idx, ptr0, len0, start_offset, end_offset, ptr1, len1);
|
|
161
|
+
var ptr3 = ret[0];
|
|
162
|
+
var len3 = ret[1];
|
|
163
|
+
if (ret[3]) {
|
|
164
|
+
ptr3 = 0; len3 = 0;
|
|
165
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
166
|
+
}
|
|
167
|
+
deferred4_0 = ptr3;
|
|
168
|
+
deferred4_1 = len3;
|
|
169
|
+
return getStringFromWasm0(ptr3, len3);
|
|
170
|
+
} finally {
|
|
171
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
143
174
|
/**
|
|
144
175
|
* `applyCharFormatInCell` 의 options object 변형 (#1413).
|
|
145
176
|
*
|
|
@@ -360,6 +391,50 @@ export class HwpDocument {
|
|
|
360
391
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
361
392
|
}
|
|
362
393
|
}
|
|
394
|
+
/**
|
|
395
|
+
* [Task #2230] 기존 Picture 컨트롤에 이미지를 지정한다 — 그림 미지정
|
|
396
|
+
* placeholder(missing image 컨트롤)의 편집 뷰 그림 삽입.
|
|
397
|
+
*
|
|
398
|
+
* `cell_path_json` 이 빈 문자열 또는 `"[]"` 면 본문 문단의 컨트롤,
|
|
399
|
+
* 그 외에는 셀/글상자 안 문단의 컨트롤을 대상으로 한다. 개체 틀 크기는
|
|
400
|
+
* 유지되고(한컴 placeholder 는 틀에 그림을 맞춤) BinData 등록 규칙은
|
|
401
|
+
* insertPicture 와 공유한다.
|
|
402
|
+
*
|
|
403
|
+
* 반환: `{"ok":true,"binDataId":<N>}`
|
|
404
|
+
* @param {number} section_idx
|
|
405
|
+
* @param {number} parent_para_idx
|
|
406
|
+
* @param {string} cell_path_json
|
|
407
|
+
* @param {number} control_idx
|
|
408
|
+
* @param {Uint8Array} image_data
|
|
409
|
+
* @param {number} natural_width_px
|
|
410
|
+
* @param {number} natural_height_px
|
|
411
|
+
* @param {string} extension
|
|
412
|
+
* @returns {string}
|
|
413
|
+
*/
|
|
414
|
+
assignPictureImage(section_idx, parent_para_idx, cell_path_json, control_idx, image_data, natural_width_px, natural_height_px, extension) {
|
|
415
|
+
let deferred5_0;
|
|
416
|
+
let deferred5_1;
|
|
417
|
+
try {
|
|
418
|
+
const ptr0 = passStringToWasm0(cell_path_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
419
|
+
const len0 = WASM_VECTOR_LEN;
|
|
420
|
+
const ptr1 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
421
|
+
const len1 = WASM_VECTOR_LEN;
|
|
422
|
+
const ptr2 = passStringToWasm0(extension, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
423
|
+
const len2 = WASM_VECTOR_LEN;
|
|
424
|
+
const ret = wasm.hwpdocument_assignPictureImage(this.__wbg_ptr, section_idx, parent_para_idx, ptr0, len0, control_idx, ptr1, len1, natural_width_px, natural_height_px, ptr2, len2);
|
|
425
|
+
var ptr4 = ret[0];
|
|
426
|
+
var len4 = ret[1];
|
|
427
|
+
if (ret[3]) {
|
|
428
|
+
ptr4 = 0; len4 = 0;
|
|
429
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
430
|
+
}
|
|
431
|
+
deferred5_0 = ptr4;
|
|
432
|
+
deferred5_1 = len4;
|
|
433
|
+
return getStringFromWasm0(ptr4, len4);
|
|
434
|
+
} finally {
|
|
435
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
363
438
|
/**
|
|
364
439
|
* Batch 모드를 시작한다. 이후 Command 호출 시 paginate()를 건너뛴다.
|
|
365
440
|
* @returns {string}
|
|
@@ -382,6 +457,36 @@ export class HwpDocument {
|
|
|
382
457
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
383
458
|
}
|
|
384
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* 대형 표 continuation shadow job을 시작한다. 공개 페이지는 완료 전까지 유지된다.
|
|
462
|
+
* @param {number} fragment_budget
|
|
463
|
+
* @returns {string}
|
|
464
|
+
*/
|
|
465
|
+
beginDeferredPagination(fragment_budget) {
|
|
466
|
+
let deferred2_0;
|
|
467
|
+
let deferred2_1;
|
|
468
|
+
try {
|
|
469
|
+
const ret = wasm.hwpdocument_beginDeferredPagination(this.__wbg_ptr, fragment_budget);
|
|
470
|
+
var ptr1 = ret[0];
|
|
471
|
+
var len1 = ret[1];
|
|
472
|
+
if (ret[3]) {
|
|
473
|
+
ptr1 = 0; len1 = 0;
|
|
474
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
475
|
+
}
|
|
476
|
+
deferred2_0 = ptr1;
|
|
477
|
+
deferred2_1 = len1;
|
|
478
|
+
return getStringFromWasm0(ptr1, len1);
|
|
479
|
+
} finally {
|
|
480
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* @returns {boolean}
|
|
485
|
+
*/
|
|
486
|
+
cancelDeferredPagination() {
|
|
487
|
+
const ret = wasm.hwpdocument_cancelDeferredPagination(this.__wbg_ptr);
|
|
488
|
+
return ret !== 0;
|
|
489
|
+
}
|
|
385
490
|
/**
|
|
386
491
|
* Shape z-order 변경
|
|
387
492
|
* operation: "front" | "back" | "forward" | "backward"
|
|
@@ -1023,6 +1128,36 @@ export class HwpDocument {
|
|
|
1023
1128
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1024
1129
|
}
|
|
1025
1130
|
}
|
|
1131
|
+
/**
|
|
1132
|
+
* @param {number} section_idx
|
|
1133
|
+
* @param {number} parent_para_idx
|
|
1134
|
+
* @param {string} path_json
|
|
1135
|
+
* @param {number} start_para
|
|
1136
|
+
* @param {number} start_offset
|
|
1137
|
+
* @param {number} end_para
|
|
1138
|
+
* @param {number} end_offset
|
|
1139
|
+
* @returns {string}
|
|
1140
|
+
*/
|
|
1141
|
+
deleteRangeInCellByPath(section_idx, parent_para_idx, path_json, start_para, start_offset, end_para, end_offset) {
|
|
1142
|
+
let deferred3_0;
|
|
1143
|
+
let deferred3_1;
|
|
1144
|
+
try {
|
|
1145
|
+
const ptr0 = passStringToWasm0(path_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1146
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1147
|
+
const ret = wasm.hwpdocument_deleteRangeInCellByPath(this.__wbg_ptr, section_idx, parent_para_idx, ptr0, len0, start_para, start_offset, end_para, end_offset);
|
|
1148
|
+
var ptr2 = ret[0];
|
|
1149
|
+
var len2 = ret[1];
|
|
1150
|
+
if (ret[3]) {
|
|
1151
|
+
ptr2 = 0; len2 = 0;
|
|
1152
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1153
|
+
}
|
|
1154
|
+
deferred3_0 = ptr2;
|
|
1155
|
+
deferred3_1 = len2;
|
|
1156
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1157
|
+
} finally {
|
|
1158
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1026
1161
|
/**
|
|
1027
1162
|
* `deleteRangeInCell` 의 options object 변형 (#1413).
|
|
1028
1163
|
*
|
|
@@ -1261,6 +1396,37 @@ export class HwpDocument {
|
|
|
1261
1396
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1262
1397
|
}
|
|
1263
1398
|
}
|
|
1399
|
+
/**
|
|
1400
|
+
* 표 셀 내부 문단에서 텍스트를 삭제하되 전체 페이지네이션은 호출자가 지연한다.
|
|
1401
|
+
*
|
|
1402
|
+
* 결과 JSON은 `charOffset`과 상대 cell-flow 변화 신호 `cellFlowChanged`를 포함한다.
|
|
1403
|
+
* @param {number} section_idx
|
|
1404
|
+
* @param {number} parent_para_idx
|
|
1405
|
+
* @param {number} control_idx
|
|
1406
|
+
* @param {number} cell_idx
|
|
1407
|
+
* @param {number} cell_para_idx
|
|
1408
|
+
* @param {number} char_offset
|
|
1409
|
+
* @param {number} count
|
|
1410
|
+
* @returns {string}
|
|
1411
|
+
*/
|
|
1412
|
+
deleteTextInCellDeferredPagination(section_idx, parent_para_idx, control_idx, cell_idx, cell_para_idx, char_offset, count) {
|
|
1413
|
+
let deferred2_0;
|
|
1414
|
+
let deferred2_1;
|
|
1415
|
+
try {
|
|
1416
|
+
const ret = wasm.hwpdocument_deleteTextInCellDeferredPagination(this.__wbg_ptr, section_idx, parent_para_idx, control_idx, cell_idx, cell_para_idx, char_offset, count);
|
|
1417
|
+
var ptr1 = ret[0];
|
|
1418
|
+
var len1 = ret[1];
|
|
1419
|
+
if (ret[3]) {
|
|
1420
|
+
ptr1 = 0; len1 = 0;
|
|
1421
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1422
|
+
}
|
|
1423
|
+
deferred2_0 = ptr1;
|
|
1424
|
+
deferred2_1 = len1;
|
|
1425
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1426
|
+
} finally {
|
|
1427
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1264
1430
|
/**
|
|
1265
1431
|
* `deleteTextInCell` 의 options object 변형 (#1413).
|
|
1266
1432
|
*
|
|
@@ -1489,6 +1655,19 @@ export class HwpDocument {
|
|
|
1489
1655
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1490
1656
|
}
|
|
1491
1657
|
}
|
|
1658
|
+
/**
|
|
1659
|
+
* HML 원본의 공통 IR을 HWPML 2.91 XML로 직렬화하여 반환한다.
|
|
1660
|
+
* @returns {Uint8Array}
|
|
1661
|
+
*/
|
|
1662
|
+
exportHml() {
|
|
1663
|
+
const ret = wasm.hwpdocument_exportHml(this.__wbg_ptr);
|
|
1664
|
+
if (ret[3]) {
|
|
1665
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1666
|
+
}
|
|
1667
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1668
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1669
|
+
return v1;
|
|
1670
|
+
}
|
|
1492
1671
|
/**
|
|
1493
1672
|
* 문서를 HWP 바이너리로 내보낸다.
|
|
1494
1673
|
*
|
|
@@ -1726,7 +1905,7 @@ export class HwpDocument {
|
|
|
1726
1905
|
return ret;
|
|
1727
1906
|
}
|
|
1728
1907
|
/**
|
|
1729
|
-
* 지연된 페이지네이션을
|
|
1908
|
+
* 지연된 페이지네이션을 동기 barrier로 flush하고 최신 페이지 수를 반환한다.
|
|
1730
1909
|
* @returns {string}
|
|
1731
1910
|
*/
|
|
1732
1911
|
flushDeferredPagination() {
|
|
@@ -1788,6 +1967,34 @@ export class HwpDocument {
|
|
|
1788
1967
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1789
1968
|
}
|
|
1790
1969
|
}
|
|
1970
|
+
/**
|
|
1971
|
+
* 문서 전체의 bounded CanvasKit direct replay capability를 compact JSON으로 반환한다.
|
|
1972
|
+
* @param {string} mode
|
|
1973
|
+
* @param {string} profile
|
|
1974
|
+
* @returns {string}
|
|
1975
|
+
*/
|
|
1976
|
+
getCanvasKitDocumentPreflight(mode, profile) {
|
|
1977
|
+
let deferred4_0;
|
|
1978
|
+
let deferred4_1;
|
|
1979
|
+
try {
|
|
1980
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1981
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1982
|
+
const ptr1 = passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1983
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1984
|
+
const ret = wasm.hwpdocument_getCanvasKitDocumentPreflight(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1985
|
+
var ptr3 = ret[0];
|
|
1986
|
+
var len3 = ret[1];
|
|
1987
|
+
if (ret[3]) {
|
|
1988
|
+
ptr3 = 0; len3 = 0;
|
|
1989
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1990
|
+
}
|
|
1991
|
+
deferred4_0 = ptr3;
|
|
1992
|
+
deferred4_1 = len3;
|
|
1993
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1994
|
+
} finally {
|
|
1995
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1791
1998
|
/**
|
|
1792
1999
|
* CanvasKit direct replay 정책 진단을 JSON 문자열로 반환한다.
|
|
1793
2000
|
*
|
|
@@ -1818,6 +2025,34 @@ export class HwpDocument {
|
|
|
1818
2025
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1819
2026
|
}
|
|
1820
2027
|
}
|
|
2028
|
+
/**
|
|
2029
|
+
* @param {number} page_num
|
|
2030
|
+
* @param {string} mode
|
|
2031
|
+
* @param {string} profile
|
|
2032
|
+
* @returns {string}
|
|
2033
|
+
*/
|
|
2034
|
+
getCanvasKitReplayPlanWithProfile(page_num, mode, profile) {
|
|
2035
|
+
let deferred4_0;
|
|
2036
|
+
let deferred4_1;
|
|
2037
|
+
try {
|
|
2038
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2039
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2040
|
+
const ptr1 = passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2041
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2042
|
+
const ret = wasm.hwpdocument_getCanvasKitReplayPlanWithProfile(this.__wbg_ptr, page_num, ptr0, len0, ptr1, len1);
|
|
2043
|
+
var ptr3 = ret[0];
|
|
2044
|
+
var len3 = ret[1];
|
|
2045
|
+
if (ret[3]) {
|
|
2046
|
+
ptr3 = 0; len3 = 0;
|
|
2047
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2048
|
+
}
|
|
2049
|
+
deferred4_0 = ptr3;
|
|
2050
|
+
deferred4_1 = len3;
|
|
2051
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2052
|
+
} finally {
|
|
2053
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
1821
2056
|
/**
|
|
1822
2057
|
* 문서에 저장된 캐럿 위치를 반환한다 (문서 로딩 시 캐럿 자동 배치용).
|
|
1823
2058
|
*
|
|
@@ -1870,6 +2105,33 @@ export class HwpDocument {
|
|
|
1870
2105
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1871
2106
|
}
|
|
1872
2107
|
}
|
|
2108
|
+
/**
|
|
2109
|
+
* @param {number} section_idx
|
|
2110
|
+
* @param {number} parent_para_idx
|
|
2111
|
+
* @param {string} path_json
|
|
2112
|
+
* @param {number} char_offset
|
|
2113
|
+
* @returns {string}
|
|
2114
|
+
*/
|
|
2115
|
+
getCellCharPropertiesAtByPath(section_idx, parent_para_idx, path_json, char_offset) {
|
|
2116
|
+
let deferred3_0;
|
|
2117
|
+
let deferred3_1;
|
|
2118
|
+
try {
|
|
2119
|
+
const ptr0 = passStringToWasm0(path_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2120
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2121
|
+
const ret = wasm.hwpdocument_getCellCharPropertiesAtByPath(this.__wbg_ptr, section_idx, parent_para_idx, ptr0, len0, char_offset);
|
|
2122
|
+
var ptr2 = ret[0];
|
|
2123
|
+
var len2 = ret[1];
|
|
2124
|
+
if (ret[3]) {
|
|
2125
|
+
ptr2 = 0; len2 = 0;
|
|
2126
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2127
|
+
}
|
|
2128
|
+
deferred3_0 = ptr2;
|
|
2129
|
+
deferred3_1 = len2;
|
|
2130
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2131
|
+
} finally {
|
|
2132
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
1873
2135
|
/**
|
|
1874
2136
|
* 표 셀의 행/열/병합 정보를 반환한다.
|
|
1875
2137
|
*
|
|
@@ -3021,6 +3283,33 @@ export class HwpDocument {
|
|
|
3021
3283
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3022
3284
|
}
|
|
3023
3285
|
}
|
|
3286
|
+
/**
|
|
3287
|
+
* 이 쪽에서 머리말/꼬리말을 편집할 때 대상이 되는 (구역, applyTo) 를 반환한다.
|
|
3288
|
+
*
|
|
3289
|
+
* 좌표 없이 쪽만으로 묻는 경로(툴바 `머리말`/`꼬리말`)용 — 히트테스트와 같은 답을 쓴다.
|
|
3290
|
+
* 반환: JSON `{"ok":true,"sectionIndex":N,"applyTo":N}`
|
|
3291
|
+
* @param {number} page_num
|
|
3292
|
+
* @param {boolean} is_header
|
|
3293
|
+
* @returns {string}
|
|
3294
|
+
*/
|
|
3295
|
+
getHeaderFooterEditTarget(page_num, is_header) {
|
|
3296
|
+
let deferred2_0;
|
|
3297
|
+
let deferred2_1;
|
|
3298
|
+
try {
|
|
3299
|
+
const ret = wasm.hwpdocument_getHeaderFooterEditTarget(this.__wbg_ptr, page_num, is_header);
|
|
3300
|
+
var ptr1 = ret[0];
|
|
3301
|
+
var len1 = ret[1];
|
|
3302
|
+
if (ret[3]) {
|
|
3303
|
+
ptr1 = 0; len1 = 0;
|
|
3304
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3305
|
+
}
|
|
3306
|
+
deferred2_0 = ptr1;
|
|
3307
|
+
deferred2_1 = len1;
|
|
3308
|
+
return getStringFromWasm0(ptr1, len1);
|
|
3309
|
+
} finally {
|
|
3310
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3311
|
+
}
|
|
3312
|
+
}
|
|
3024
3313
|
/**
|
|
3025
3314
|
* 문서 전체의 머리말/꼬리말 목록을 반환한다.
|
|
3026
3315
|
* @param {number} current_section_idx
|
|
@@ -3103,6 +3392,39 @@ export class HwpDocument {
|
|
|
3103
3392
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3104
3393
|
}
|
|
3105
3394
|
}
|
|
3395
|
+
/**
|
|
3396
|
+
* HML 열기 메타데이터와 손실 진단을 JSON으로 반환한다.
|
|
3397
|
+
* 다른 입력 포맷에서는 `null`을 반환한다.
|
|
3398
|
+
* @returns {string}
|
|
3399
|
+
*/
|
|
3400
|
+
getHmlOpenMetadata() {
|
|
3401
|
+
let deferred1_0;
|
|
3402
|
+
let deferred1_1;
|
|
3403
|
+
try {
|
|
3404
|
+
const ret = wasm.hwpdocument_getHmlOpenMetadata(this.__wbg_ptr);
|
|
3405
|
+
deferred1_0 = ret[0];
|
|
3406
|
+
deferred1_1 = ret[1];
|
|
3407
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3408
|
+
} finally {
|
|
3409
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
/**
|
|
3413
|
+
* HML 저장 가능 여부와 모든 차단 진단을 canonical JSON DTO로 반환한다.
|
|
3414
|
+
* @returns {string}
|
|
3415
|
+
*/
|
|
3416
|
+
getHmlSaveState() {
|
|
3417
|
+
let deferred1_0;
|
|
3418
|
+
let deferred1_1;
|
|
3419
|
+
try {
|
|
3420
|
+
const ret = wasm.hwpdocument_getHmlSaveState(this.__wbg_ptr);
|
|
3421
|
+
deferred1_0 = ret[0];
|
|
3422
|
+
deferred1_1 = ret[1];
|
|
3423
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3424
|
+
} finally {
|
|
3425
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3426
|
+
}
|
|
3427
|
+
}
|
|
3106
3428
|
/**
|
|
3107
3429
|
* 문단 내 줄 정보를 반환한다 (커서 수직 이동/Home/End용).
|
|
3108
3430
|
*
|
|
@@ -3410,6 +3732,31 @@ export class HwpDocument {
|
|
|
3410
3732
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3411
3733
|
}
|
|
3412
3734
|
}
|
|
3735
|
+
/**
|
|
3736
|
+
* @param {number} page_num
|
|
3737
|
+
* @param {string} profile
|
|
3738
|
+
* @returns {string}
|
|
3739
|
+
*/
|
|
3740
|
+
getPageLayerTreeWithProfile(page_num, profile) {
|
|
3741
|
+
let deferred3_0;
|
|
3742
|
+
let deferred3_1;
|
|
3743
|
+
try {
|
|
3744
|
+
const ptr0 = passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3745
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3746
|
+
const ret = wasm.hwpdocument_getPageLayerTreeWithProfile(this.__wbg_ptr, page_num, ptr0, len0);
|
|
3747
|
+
var ptr2 = ret[0];
|
|
3748
|
+
var len2 = ret[1];
|
|
3749
|
+
if (ret[3]) {
|
|
3750
|
+
ptr2 = 0; len2 = 0;
|
|
3751
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3752
|
+
}
|
|
3753
|
+
deferred3_0 = ptr2;
|
|
3754
|
+
deferred3_1 = len2;
|
|
3755
|
+
return getStringFromWasm0(ptr2, len2);
|
|
3756
|
+
} finally {
|
|
3757
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
3758
|
+
}
|
|
3759
|
+
}
|
|
3413
3760
|
/**
|
|
3414
3761
|
* 위치에 해당하는 글로벌 쪽 번호 반환
|
|
3415
3762
|
* @param {number} section_idx
|
|
@@ -3754,7 +4101,8 @@ export class HwpDocument {
|
|
|
3754
4101
|
* `getSelectionRectsInCell` 의 options object 변형 (#1413).
|
|
3755
4102
|
*
|
|
3756
4103
|
* options JSON 키: `{ sectionIdx, parentParaIdx, controlIdx, cellIdx, startCellParaIdx,
|
|
3757
|
-
* startCharOffset, endCellParaIdx, endCharOffset }`.
|
|
4104
|
+
* startCharOffset, endCellParaIdx, endCharOffset, startPageHint?, endPageHint? }`.
|
|
4105
|
+
* page hint가 누락되거나 유효하지 않으면 positional 과 동일한 전체 탐색을 사용한다.
|
|
3758
4106
|
* @param {string} options_json
|
|
3759
4107
|
* @returns {string}
|
|
3760
4108
|
*/
|
|
@@ -3886,7 +4234,7 @@ export class HwpDocument {
|
|
|
3886
4234
|
return ret !== 0;
|
|
3887
4235
|
}
|
|
3888
4236
|
/**
|
|
3889
|
-
* 원본 파일 형식을 반환한다 ("hwp" 또는 "
|
|
4237
|
+
* 원본 파일 형식을 반환한다 ("hwp", "hwpx", 또는 "hml").
|
|
3890
4238
|
* @returns {string}
|
|
3891
4239
|
*/
|
|
3892
4240
|
getSourceFormat() {
|
|
@@ -3982,23 +4330,51 @@ export class HwpDocument {
|
|
|
3982
4330
|
deferred1_1 = ret[1];
|
|
3983
4331
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
3984
4332
|
} finally {
|
|
3985
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4333
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4334
|
+
}
|
|
4335
|
+
}
|
|
4336
|
+
/**
|
|
4337
|
+
* 표 전체의 바운딩박스를 반환한다.
|
|
4338
|
+
*
|
|
4339
|
+
* 반환: JSON `{"pageIndex":<N>,"x":<f>,"y":<f>,"width":<f>,"height":<f>}`
|
|
4340
|
+
* @param {number} section_idx
|
|
4341
|
+
* @param {number} parent_para_idx
|
|
4342
|
+
* @param {number} control_idx
|
|
4343
|
+
* @returns {string}
|
|
4344
|
+
*/
|
|
4345
|
+
getTableBBox(section_idx, parent_para_idx, control_idx) {
|
|
4346
|
+
let deferred2_0;
|
|
4347
|
+
let deferred2_1;
|
|
4348
|
+
try {
|
|
4349
|
+
const ret = wasm.hwpdocument_getTableBBox(this.__wbg_ptr, section_idx, parent_para_idx, control_idx);
|
|
4350
|
+
var ptr1 = ret[0];
|
|
4351
|
+
var len1 = ret[1];
|
|
4352
|
+
if (ret[3]) {
|
|
4353
|
+
ptr1 = 0; len1 = 0;
|
|
4354
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4355
|
+
}
|
|
4356
|
+
deferred2_0 = ptr1;
|
|
4357
|
+
deferred2_1 = len1;
|
|
4358
|
+
return getStringFromWasm0(ptr1, len1);
|
|
4359
|
+
} finally {
|
|
4360
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3986
4361
|
}
|
|
3987
4362
|
}
|
|
3988
4363
|
/**
|
|
3989
|
-
* 표
|
|
4364
|
+
* 지정 page 에 배치된 표 fragment 의 바운딩박스를 반환한다 (#2400).
|
|
3990
4365
|
*
|
|
3991
4366
|
* 반환: JSON `{"pageIndex":<N>,"x":<f>,"y":<f>,"width":<f>,"height":<f>}`
|
|
3992
4367
|
* @param {number} section_idx
|
|
3993
4368
|
* @param {number} parent_para_idx
|
|
3994
4369
|
* @param {number} control_idx
|
|
4370
|
+
* @param {number} page_idx
|
|
3995
4371
|
* @returns {string}
|
|
3996
4372
|
*/
|
|
3997
|
-
|
|
4373
|
+
getTableBBoxAtPage(section_idx, parent_para_idx, control_idx, page_idx) {
|
|
3998
4374
|
let deferred2_0;
|
|
3999
4375
|
let deferred2_1;
|
|
4000
4376
|
try {
|
|
4001
|
-
const ret = wasm.
|
|
4377
|
+
const ret = wasm.hwpdocument_getTableBBoxAtPage(this.__wbg_ptr, section_idx, parent_para_idx, control_idx, page_idx);
|
|
4002
4378
|
var ptr1 = ret[0];
|
|
4003
4379
|
var len1 = ret[1];
|
|
4004
4380
|
if (ret[3]) {
|
|
@@ -5221,6 +5597,7 @@ export class HwpDocument {
|
|
|
5221
5597
|
*
|
|
5222
5598
|
* Studio의 page-local 단일 입력처럼 현재 페이지를 먼저 갱신하고 idle 시점에
|
|
5223
5599
|
* 전체 페이지네이션을 한 번만 수행하는 경로에서 사용한다.
|
|
5600
|
+
* 결과 JSON은 `charOffset`과 상대 cell-flow 변화 신호 `cellFlowChanged`를 포함한다.
|
|
5224
5601
|
* @param {number} section_idx
|
|
5225
5602
|
* @param {number} parent_para_idx
|
|
5226
5603
|
* @param {number} control_idx
|
|
@@ -5865,6 +6242,16 @@ export class HwpDocument {
|
|
|
5865
6242
|
const ret = wasm.hwpdocument_pageCount(this.__wbg_ptr);
|
|
5866
6243
|
return ret >>> 0;
|
|
5867
6244
|
}
|
|
6245
|
+
/**
|
|
6246
|
+
* 페이지에 각주 영역이 있는지 빠르게 확인 (hitTestFootnote fast-reject).
|
|
6247
|
+
* 페이지네이션 메타데이터만 조회하므로 render tree build가 필요 없다 (#2428).
|
|
6248
|
+
* @param {number} page_num
|
|
6249
|
+
* @returns {boolean}
|
|
6250
|
+
*/
|
|
6251
|
+
pageHasFootnoteFootholds(page_num) {
|
|
6252
|
+
const ret = wasm.hwpdocument_pageHasFootnoteFootholds(this.__wbg_ptr, page_num);
|
|
6253
|
+
return ret !== 0;
|
|
6254
|
+
}
|
|
5868
6255
|
/**
|
|
5869
6256
|
* 내부 클립보드의 컨트롤 객체를 캐럿 위치에 붙여넣는다.
|
|
5870
6257
|
*
|
|
@@ -6356,6 +6743,32 @@ export class HwpDocument {
|
|
|
6356
6743
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
6357
6744
|
}
|
|
6358
6745
|
}
|
|
6746
|
+
/**
|
|
6747
|
+
* 명시적인 출력 profile로 특정 페이지를 SVG 문자열로 렌더링한다.
|
|
6748
|
+
* @param {number} page_num
|
|
6749
|
+
* @param {string} profile
|
|
6750
|
+
* @returns {string}
|
|
6751
|
+
*/
|
|
6752
|
+
renderPageSvgWithProfile(page_num, profile) {
|
|
6753
|
+
let deferred3_0;
|
|
6754
|
+
let deferred3_1;
|
|
6755
|
+
try {
|
|
6756
|
+
const ptr0 = passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6757
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6758
|
+
const ret = wasm.hwpdocument_renderPageSvgWithProfile(this.__wbg_ptr, page_num, ptr0, len0);
|
|
6759
|
+
var ptr2 = ret[0];
|
|
6760
|
+
var len2 = ret[1];
|
|
6761
|
+
if (ret[3]) {
|
|
6762
|
+
ptr2 = 0; len2 = 0;
|
|
6763
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
6764
|
+
}
|
|
6765
|
+
deferred3_0 = ptr2;
|
|
6766
|
+
deferred3_1 = len2;
|
|
6767
|
+
return getStringFromWasm0(ptr2, len2);
|
|
6768
|
+
} finally {
|
|
6769
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
6770
|
+
}
|
|
6771
|
+
}
|
|
6359
6772
|
/**
|
|
6360
6773
|
* 특정 페이지를 Canvas 2D에 직접 렌더링한다.
|
|
6361
6774
|
*
|
|
@@ -6397,6 +6810,23 @@ export class HwpDocument {
|
|
|
6397
6810
|
throw takeFromExternrefTable0(ret[0]);
|
|
6398
6811
|
}
|
|
6399
6812
|
}
|
|
6813
|
+
/**
|
|
6814
|
+
* @param {number} page_num
|
|
6815
|
+
* @param {HTMLCanvasElement} canvas
|
|
6816
|
+
* @param {number} scale
|
|
6817
|
+
* @param {string} layer_kind
|
|
6818
|
+
* @param {string} profile
|
|
6819
|
+
*/
|
|
6820
|
+
renderPageToCanvasFilteredWithProfile(page_num, canvas, scale, layer_kind, profile) {
|
|
6821
|
+
const ptr0 = passStringToWasm0(layer_kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6822
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6823
|
+
const ptr1 = passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6824
|
+
const len1 = WASM_VECTOR_LEN;
|
|
6825
|
+
const ret = wasm.hwpdocument_renderPageToCanvasFilteredWithProfile(this.__wbg_ptr, page_num, canvas, scale, ptr0, len0, ptr1, len1);
|
|
6826
|
+
if (ret[1]) {
|
|
6827
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
6828
|
+
}
|
|
6829
|
+
}
|
|
6400
6830
|
/**
|
|
6401
6831
|
* 특정 페이지를 기존 PageRenderTree 경로로 Canvas 2D에 직접 렌더링한다.
|
|
6402
6832
|
* @param {number} page_num
|
|
@@ -6438,6 +6868,34 @@ export class HwpDocument {
|
|
|
6438
6868
|
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
6439
6869
|
}
|
|
6440
6870
|
}
|
|
6871
|
+
/**
|
|
6872
|
+
* @param {number} section_idx
|
|
6873
|
+
* @param {number} para_idx
|
|
6874
|
+
* @param {number} char_offset
|
|
6875
|
+
* @param {number} delete_count
|
|
6876
|
+
* @param {string} text
|
|
6877
|
+
* @returns {string}
|
|
6878
|
+
*/
|
|
6879
|
+
replaceBodyTextLocal(section_idx, para_idx, char_offset, delete_count, text) {
|
|
6880
|
+
let deferred3_0;
|
|
6881
|
+
let deferred3_1;
|
|
6882
|
+
try {
|
|
6883
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6884
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6885
|
+
const ret = wasm.hwpdocument_replaceBodyTextLocal(this.__wbg_ptr, section_idx, para_idx, char_offset, delete_count, ptr0, len0);
|
|
6886
|
+
var ptr2 = ret[0];
|
|
6887
|
+
var len2 = ret[1];
|
|
6888
|
+
if (ret[3]) {
|
|
6889
|
+
ptr2 = 0; len2 = 0;
|
|
6890
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
6891
|
+
}
|
|
6892
|
+
deferred3_0 = ptr2;
|
|
6893
|
+
deferred3_1 = len2;
|
|
6894
|
+
return getStringFromWasm0(ptr2, len2);
|
|
6895
|
+
} finally {
|
|
6896
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
6897
|
+
}
|
|
6898
|
+
}
|
|
6441
6899
|
/**
|
|
6442
6900
|
* 단일 치환 (검색어 기반) — 첫 번째 매치만 교체
|
|
6443
6901
|
* @param {string} query
|
|
@@ -6496,6 +6954,38 @@ export class HwpDocument {
|
|
|
6496
6954
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
6497
6955
|
}
|
|
6498
6956
|
}
|
|
6957
|
+
/**
|
|
6958
|
+
* 표 셀 내부의 짧은 IME 조합 문자열을 원자적으로 교체하고 전체 페이지네이션은 지연한다.
|
|
6959
|
+
* @param {number} section_idx
|
|
6960
|
+
* @param {number} parent_para_idx
|
|
6961
|
+
* @param {number} control_idx
|
|
6962
|
+
* @param {number} cell_idx
|
|
6963
|
+
* @param {number} cell_para_idx
|
|
6964
|
+
* @param {number} char_offset
|
|
6965
|
+
* @param {number} delete_count
|
|
6966
|
+
* @param {string} text
|
|
6967
|
+
* @returns {string}
|
|
6968
|
+
*/
|
|
6969
|
+
replaceTextInCellDeferredPagination(section_idx, parent_para_idx, control_idx, cell_idx, cell_para_idx, char_offset, delete_count, text) {
|
|
6970
|
+
let deferred3_0;
|
|
6971
|
+
let deferred3_1;
|
|
6972
|
+
try {
|
|
6973
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6974
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6975
|
+
const ret = wasm.hwpdocument_replaceTextInCellDeferredPagination(this.__wbg_ptr, section_idx, parent_para_idx, control_idx, cell_idx, cell_para_idx, char_offset, delete_count, ptr0, len0);
|
|
6976
|
+
var ptr2 = ret[0];
|
|
6977
|
+
var len2 = ret[1];
|
|
6978
|
+
if (ret[3]) {
|
|
6979
|
+
ptr2 = 0; len2 = 0;
|
|
6980
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
6981
|
+
}
|
|
6982
|
+
deferred3_0 = ptr2;
|
|
6983
|
+
deferred3_1 = len2;
|
|
6984
|
+
return getStringFromWasm0(ptr2, len2);
|
|
6985
|
+
} finally {
|
|
6986
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
6987
|
+
}
|
|
6988
|
+
}
|
|
6499
6989
|
/**
|
|
6500
6990
|
* 여러 셀의 width/height를 한 번에 조절한다 (배치).
|
|
6501
6991
|
*
|
|
@@ -6882,6 +7372,35 @@ export class HwpDocument {
|
|
|
6882
7372
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
6883
7373
|
}
|
|
6884
7374
|
}
|
|
7375
|
+
/**
|
|
7376
|
+
* @param {number} section_idx
|
|
7377
|
+
* @param {number} parent_para_idx
|
|
7378
|
+
* @param {string} path_json
|
|
7379
|
+
* @param {number} start_offset
|
|
7380
|
+
* @param {number} end_offset
|
|
7381
|
+
* @param {number} char_shape_id
|
|
7382
|
+
* @returns {string}
|
|
7383
|
+
*/
|
|
7384
|
+
setCharShapeIdInCellByPath(section_idx, parent_para_idx, path_json, start_offset, end_offset, char_shape_id) {
|
|
7385
|
+
let deferred3_0;
|
|
7386
|
+
let deferred3_1;
|
|
7387
|
+
try {
|
|
7388
|
+
const ptr0 = passStringToWasm0(path_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7389
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7390
|
+
const ret = wasm.hwpdocument_setCharShapeIdInCellByPath(this.__wbg_ptr, section_idx, parent_para_idx, ptr0, len0, start_offset, end_offset, char_shape_id);
|
|
7391
|
+
var ptr2 = ret[0];
|
|
7392
|
+
var len2 = ret[1];
|
|
7393
|
+
if (ret[3]) {
|
|
7394
|
+
ptr2 = 0; len2 = 0;
|
|
7395
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7396
|
+
}
|
|
7397
|
+
deferred3_0 = ptr2;
|
|
7398
|
+
deferred3_1 = len2;
|
|
7399
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7400
|
+
} finally {
|
|
7401
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7402
|
+
}
|
|
7403
|
+
}
|
|
6885
7404
|
/**
|
|
6886
7405
|
* `setCharShapeIdInCell` 의 options object 변형 (#1413).
|
|
6887
7406
|
*
|
|
@@ -7596,54 +8115,63 @@ export class HwpDocument {
|
|
|
7596
8115
|
* @param {number} section_idx
|
|
7597
8116
|
* @param {number} para_idx
|
|
7598
8117
|
* @param {number} char_offset
|
|
8118
|
+
* @param {string | null} [removed_para_meta]
|
|
7599
8119
|
* @returns {string}
|
|
7600
8120
|
*/
|
|
7601
|
-
splitParagraph(section_idx, para_idx, char_offset) {
|
|
7602
|
-
let
|
|
7603
|
-
let
|
|
8121
|
+
splitParagraph(section_idx, para_idx, char_offset, removed_para_meta) {
|
|
8122
|
+
let deferred3_0;
|
|
8123
|
+
let deferred3_1;
|
|
7604
8124
|
try {
|
|
7605
|
-
|
|
7606
|
-
var
|
|
7607
|
-
|
|
8125
|
+
var ptr0 = isLikeNone(removed_para_meta) ? 0 : passStringToWasm0(removed_para_meta, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8126
|
+
var len0 = WASM_VECTOR_LEN;
|
|
8127
|
+
const ret = wasm.hwpdocument_splitParagraph(this.__wbg_ptr, section_idx, para_idx, char_offset, ptr0, len0);
|
|
8128
|
+
var ptr2 = ret[0];
|
|
8129
|
+
var len2 = ret[1];
|
|
7608
8130
|
if (ret[3]) {
|
|
7609
|
-
|
|
8131
|
+
ptr2 = 0; len2 = 0;
|
|
7610
8132
|
throw takeFromExternrefTable0(ret[2]);
|
|
7611
8133
|
}
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
return getStringFromWasm0(
|
|
8134
|
+
deferred3_0 = ptr2;
|
|
8135
|
+
deferred3_1 = len2;
|
|
8136
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7615
8137
|
} finally {
|
|
7616
|
-
wasm.__wbindgen_free(
|
|
8138
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7617
8139
|
}
|
|
7618
8140
|
}
|
|
7619
8141
|
/**
|
|
7620
8142
|
* 셀 내부 문단을 분할한다 (셀 내 Enter 키).
|
|
7621
8143
|
*
|
|
7622
8144
|
* 반환값: JSON `{"ok":true,"cellParaIndex":<new_idx>,"charOffset":0}`
|
|
8145
|
+
*
|
|
8146
|
+
* `removed_para_meta` 는 병합 undo 가 되돌려주는 값이다 — 본문 `splitParagraph`
|
|
8147
|
+
* 와 같은 규약이다 (Task #2342).
|
|
7623
8148
|
* @param {number} section_idx
|
|
7624
8149
|
* @param {number} parent_para_idx
|
|
7625
8150
|
* @param {number} control_idx
|
|
7626
8151
|
* @param {number} cell_idx
|
|
7627
8152
|
* @param {number} cell_para_idx
|
|
7628
8153
|
* @param {number} char_offset
|
|
8154
|
+
* @param {string | null} [removed_para_meta]
|
|
7629
8155
|
* @returns {string}
|
|
7630
8156
|
*/
|
|
7631
|
-
splitParagraphInCell(section_idx, parent_para_idx, control_idx, cell_idx, cell_para_idx, char_offset) {
|
|
7632
|
-
let
|
|
7633
|
-
let
|
|
8157
|
+
splitParagraphInCell(section_idx, parent_para_idx, control_idx, cell_idx, cell_para_idx, char_offset, removed_para_meta) {
|
|
8158
|
+
let deferred3_0;
|
|
8159
|
+
let deferred3_1;
|
|
7634
8160
|
try {
|
|
7635
|
-
|
|
7636
|
-
var
|
|
7637
|
-
|
|
8161
|
+
var ptr0 = isLikeNone(removed_para_meta) ? 0 : passStringToWasm0(removed_para_meta, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8162
|
+
var len0 = WASM_VECTOR_LEN;
|
|
8163
|
+
const ret = wasm.hwpdocument_splitParagraphInCell(this.__wbg_ptr, section_idx, parent_para_idx, control_idx, cell_idx, cell_para_idx, char_offset, ptr0, len0);
|
|
8164
|
+
var ptr2 = ret[0];
|
|
8165
|
+
var len2 = ret[1];
|
|
7638
8166
|
if (ret[3]) {
|
|
7639
|
-
|
|
8167
|
+
ptr2 = 0; len2 = 0;
|
|
7640
8168
|
throw takeFromExternrefTable0(ret[2]);
|
|
7641
8169
|
}
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
return getStringFromWasm0(
|
|
8170
|
+
deferred3_0 = ptr2;
|
|
8171
|
+
deferred3_1 = len2;
|
|
8172
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7645
8173
|
} finally {
|
|
7646
|
-
wasm.__wbindgen_free(
|
|
8174
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7647
8175
|
}
|
|
7648
8176
|
}
|
|
7649
8177
|
/**
|
|
@@ -7651,26 +8179,29 @@ export class HwpDocument {
|
|
|
7651
8179
|
* @param {number} parent_para_idx
|
|
7652
8180
|
* @param {string} path_json
|
|
7653
8181
|
* @param {number} char_offset
|
|
8182
|
+
* @param {string | null} [removed_para_meta]
|
|
7654
8183
|
* @returns {string}
|
|
7655
8184
|
*/
|
|
7656
|
-
splitParagraphInCellByPath(section_idx, parent_para_idx, path_json, char_offset) {
|
|
7657
|
-
let
|
|
7658
|
-
let
|
|
8185
|
+
splitParagraphInCellByPath(section_idx, parent_para_idx, path_json, char_offset, removed_para_meta) {
|
|
8186
|
+
let deferred4_0;
|
|
8187
|
+
let deferred4_1;
|
|
7659
8188
|
try {
|
|
7660
8189
|
const ptr0 = passStringToWasm0(path_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7661
8190
|
const len0 = WASM_VECTOR_LEN;
|
|
7662
|
-
|
|
7663
|
-
var
|
|
7664
|
-
|
|
8191
|
+
var ptr1 = isLikeNone(removed_para_meta) ? 0 : passStringToWasm0(removed_para_meta, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8192
|
+
var len1 = WASM_VECTOR_LEN;
|
|
8193
|
+
const ret = wasm.hwpdocument_splitParagraphInCellByPath(this.__wbg_ptr, section_idx, parent_para_idx, ptr0, len0, char_offset, ptr1, len1);
|
|
8194
|
+
var ptr3 = ret[0];
|
|
8195
|
+
var len3 = ret[1];
|
|
7665
8196
|
if (ret[3]) {
|
|
7666
|
-
|
|
8197
|
+
ptr3 = 0; len3 = 0;
|
|
7667
8198
|
throw takeFromExternrefTable0(ret[2]);
|
|
7668
8199
|
}
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
return getStringFromWasm0(
|
|
8200
|
+
deferred4_0 = ptr3;
|
|
8201
|
+
deferred4_1 = len3;
|
|
8202
|
+
return getStringFromWasm0(ptr3, len3);
|
|
7672
8203
|
} finally {
|
|
7673
|
-
wasm.__wbindgen_free(
|
|
8204
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
7674
8205
|
}
|
|
7675
8206
|
}
|
|
7676
8207
|
/**
|
|
@@ -7680,24 +8211,27 @@ export class HwpDocument {
|
|
|
7680
8211
|
* @param {number} control_idx
|
|
7681
8212
|
* @param {number} fn_para_idx
|
|
7682
8213
|
* @param {number} char_offset
|
|
8214
|
+
* @param {string | null} [removed_para_meta]
|
|
7683
8215
|
* @returns {string}
|
|
7684
8216
|
*/
|
|
7685
|
-
splitParagraphInFootnote(section_idx, para_idx, control_idx, fn_para_idx, char_offset) {
|
|
7686
|
-
let
|
|
7687
|
-
let
|
|
8217
|
+
splitParagraphInFootnote(section_idx, para_idx, control_idx, fn_para_idx, char_offset, removed_para_meta) {
|
|
8218
|
+
let deferred3_0;
|
|
8219
|
+
let deferred3_1;
|
|
7688
8220
|
try {
|
|
7689
|
-
|
|
7690
|
-
var
|
|
7691
|
-
|
|
8221
|
+
var ptr0 = isLikeNone(removed_para_meta) ? 0 : passStringToWasm0(removed_para_meta, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8222
|
+
var len0 = WASM_VECTOR_LEN;
|
|
8223
|
+
const ret = wasm.hwpdocument_splitParagraphInFootnote(this.__wbg_ptr, section_idx, para_idx, control_idx, fn_para_idx, char_offset, ptr0, len0);
|
|
8224
|
+
var ptr2 = ret[0];
|
|
8225
|
+
var len2 = ret[1];
|
|
7692
8226
|
if (ret[3]) {
|
|
7693
|
-
|
|
8227
|
+
ptr2 = 0; len2 = 0;
|
|
7694
8228
|
throw takeFromExternrefTable0(ret[2]);
|
|
7695
8229
|
}
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
return getStringFromWasm0(
|
|
8230
|
+
deferred3_0 = ptr2;
|
|
8231
|
+
deferred3_1 = len2;
|
|
8232
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7699
8233
|
} finally {
|
|
7700
|
-
wasm.__wbindgen_free(
|
|
8234
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7701
8235
|
}
|
|
7702
8236
|
}
|
|
7703
8237
|
/**
|
|
@@ -7709,24 +8243,27 @@ export class HwpDocument {
|
|
|
7709
8243
|
* @param {number} apply_to
|
|
7710
8244
|
* @param {number} hf_para_idx
|
|
7711
8245
|
* @param {number} char_offset
|
|
8246
|
+
* @param {string | null} [removed_para_meta]
|
|
7712
8247
|
* @returns {string}
|
|
7713
8248
|
*/
|
|
7714
|
-
splitParagraphInHeaderFooter(section_idx, is_header, apply_to, hf_para_idx, char_offset) {
|
|
7715
|
-
let
|
|
7716
|
-
let
|
|
8249
|
+
splitParagraphInHeaderFooter(section_idx, is_header, apply_to, hf_para_idx, char_offset, removed_para_meta) {
|
|
8250
|
+
let deferred3_0;
|
|
8251
|
+
let deferred3_1;
|
|
7717
8252
|
try {
|
|
7718
|
-
|
|
7719
|
-
var
|
|
7720
|
-
|
|
8253
|
+
var ptr0 = isLikeNone(removed_para_meta) ? 0 : passStringToWasm0(removed_para_meta, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8254
|
+
var len0 = WASM_VECTOR_LEN;
|
|
8255
|
+
const ret = wasm.hwpdocument_splitParagraphInHeaderFooter(this.__wbg_ptr, section_idx, is_header, apply_to, hf_para_idx, char_offset, ptr0, len0);
|
|
8256
|
+
var ptr2 = ret[0];
|
|
8257
|
+
var len2 = ret[1];
|
|
7721
8258
|
if (ret[3]) {
|
|
7722
|
-
|
|
8259
|
+
ptr2 = 0; len2 = 0;
|
|
7723
8260
|
throw takeFromExternrefTable0(ret[2]);
|
|
7724
8261
|
}
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
return getStringFromWasm0(
|
|
8262
|
+
deferred3_0 = ptr2;
|
|
8263
|
+
deferred3_1 = len2;
|
|
8264
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7728
8265
|
} finally {
|
|
7729
|
-
wasm.__wbindgen_free(
|
|
8266
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7730
8267
|
}
|
|
7731
8268
|
}
|
|
7732
8269
|
/**
|
|
@@ -7881,6 +8418,29 @@ export class HwpDocument {
|
|
|
7881
8418
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7882
8419
|
}
|
|
7883
8420
|
}
|
|
8421
|
+
/**
|
|
8422
|
+
* 대형 표 continuation을 fragment budget만큼 전진한다.
|
|
8423
|
+
* @param {number} fragment_budget
|
|
8424
|
+
* @returns {string}
|
|
8425
|
+
*/
|
|
8426
|
+
stepDeferredPagination(fragment_budget) {
|
|
8427
|
+
let deferred2_0;
|
|
8428
|
+
let deferred2_1;
|
|
8429
|
+
try {
|
|
8430
|
+
const ret = wasm.hwpdocument_stepDeferredPagination(this.__wbg_ptr, fragment_budget);
|
|
8431
|
+
var ptr1 = ret[0];
|
|
8432
|
+
var len1 = ret[1];
|
|
8433
|
+
if (ret[3]) {
|
|
8434
|
+
ptr1 = 0; len1 = 0;
|
|
8435
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
8436
|
+
}
|
|
8437
|
+
deferred2_0 = ptr1;
|
|
8438
|
+
deferred2_1 = len1;
|
|
8439
|
+
return getStringFromWasm0(ptr1, len1);
|
|
8440
|
+
} finally {
|
|
8441
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
8442
|
+
}
|
|
8443
|
+
}
|
|
7884
8444
|
/**
|
|
7885
8445
|
* 텍스트 오프셋 → 논리적 오프셋 변환.
|
|
7886
8446
|
* @param {number} section_idx
|
|
@@ -8131,6 +8691,32 @@ export class HwpViewer {
|
|
|
8131
8691
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
8132
8692
|
}
|
|
8133
8693
|
}
|
|
8694
|
+
/**
|
|
8695
|
+
* 명시적인 출력 profile로 특정 페이지 SVG 렌더링
|
|
8696
|
+
* @param {number} page_num
|
|
8697
|
+
* @param {string} profile
|
|
8698
|
+
* @returns {string}
|
|
8699
|
+
*/
|
|
8700
|
+
renderPageSvgWithProfile(page_num, profile) {
|
|
8701
|
+
let deferred3_0;
|
|
8702
|
+
let deferred3_1;
|
|
8703
|
+
try {
|
|
8704
|
+
const ptr0 = passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8705
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8706
|
+
const ret = wasm.hwpviewer_renderPageSvgWithProfile(this.__wbg_ptr, page_num, ptr0, len0);
|
|
8707
|
+
var ptr2 = ret[0];
|
|
8708
|
+
var len2 = ret[1];
|
|
8709
|
+
if (ret[3]) {
|
|
8710
|
+
ptr2 = 0; len2 = 0;
|
|
8711
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
8712
|
+
}
|
|
8713
|
+
deferred3_0 = ptr2;
|
|
8714
|
+
deferred3_1 = len2;
|
|
8715
|
+
return getStringFromWasm0(ptr2, len2);
|
|
8716
|
+
} finally {
|
|
8717
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
8718
|
+
}
|
|
8719
|
+
}
|
|
8134
8720
|
/**
|
|
8135
8721
|
* 줌 변경
|
|
8136
8722
|
* @param {number} zoom
|