@hailin-zheng/editor-core 1.0.5 → 1.0.6

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 (238) hide show
  1. package/lib/doc-ruler.d.ts +51 -0
  2. package/{src/med_editor/doc-ruler.ts → lib/doc-ruler.js} +73 -100
  3. package/lib/doc-ruler.js.map +1 -0
  4. package/lib/framework/common-util.d.ts +63 -0
  5. package/lib/framework/common-util.js +178 -0
  6. package/lib/framework/common-util.js.map +1 -0
  7. package/lib/framework/document-change.d.ts +265 -0
  8. package/{src/med_editor/framework/document-change.ts → lib/framework/document-change.js} +257 -307
  9. package/lib/framework/document-change.js.map +1 -0
  10. package/lib/framework/document-combine.d.ts +24 -0
  11. package/{src/med_editor/framework/document-combine.ts → lib/framework/document-combine.js} +11 -15
  12. package/lib/framework/document-combine.js.map +1 -0
  13. package/lib/framework/document-comment.d.ts +46 -0
  14. package/{src/med_editor/framework/document-comment.ts → lib/framework/document-comment.js} +37 -57
  15. package/lib/framework/document-comment.js.map +1 -0
  16. package/lib/framework/document-context.d.ts +149 -0
  17. package/{src/med_editor/framework/document-context.ts → lib/framework/document-context.js} +101 -181
  18. package/lib/framework/document-context.js.map +1 -0
  19. package/lib/framework/document-eval-func.d.ts +18 -0
  20. package/{src/med_editor/framework/document-eval-func.ts → lib/framework/document-eval-func.js} +11 -16
  21. package/lib/framework/document-eval-func.js.map +1 -0
  22. package/lib/framework/document-event.d.ts +213 -0
  23. package/{src/med_editor/framework/document-event.ts → lib/framework/document-event.js} +216 -244
  24. package/lib/framework/document-event.js.map +1 -0
  25. package/lib/framework/document-history.d.ts +26 -0
  26. package/{src/med_editor/framework/document-history.ts → lib/framework/document-history.js} +14 -25
  27. package/lib/framework/document-history.js.map +1 -0
  28. package/lib/framework/document-images-loader.d.ts +16 -0
  29. package/{src/med_editor/framework/document-images-loader.ts → lib/framework/document-images-loader.js} +17 -25
  30. package/lib/framework/document-images-loader.js.map +1 -0
  31. package/lib/framework/document-input-cursor.d.ts +78 -0
  32. package/{src/med_editor/framework/document-input-cursor.ts → lib/framework/document-input-cursor.js} +71 -76
  33. package/lib/framework/document-input-cursor.js.map +1 -0
  34. package/lib/framework/document-paint.d.ts +34 -0
  35. package/{src/med_editor/framework/document-paint.ts → lib/framework/document-paint.js} +28 -35
  36. package/lib/framework/document-paint.js.map +1 -0
  37. package/lib/framework/document-print-offscreen.d.ts +38 -0
  38. package/{src/med_editor/framework/document-print-offscreen.ts → lib/framework/document-print-offscreen.js} +19 -25
  39. package/lib/framework/document-print-offscreen.js.map +1 -0
  40. package/lib/framework/document-print.d.ts +60 -0
  41. package/{src/med_editor/framework/document-print.ts → lib/framework/document-print.js} +41 -57
  42. package/lib/framework/document-print.js.map +1 -0
  43. package/lib/framework/document-segmenter.d.ts +2 -0
  44. package/lib/framework/document-segmenter.js +106 -0
  45. package/lib/framework/document-segmenter.js.map +1 -0
  46. package/lib/framework/document-selection.d.ts +89 -0
  47. package/{src/med_editor/framework/document-selection.ts → lib/framework/document-selection.js} +84 -117
  48. package/lib/framework/document-selection.js.map +1 -0
  49. package/lib/framework/document-template.d.ts +4 -0
  50. package/{src/med_editor/framework/document-template.ts → lib/framework/document-template.js} +3 -3
  51. package/lib/framework/document-template.js.map +1 -0
  52. package/lib/framework/document-textline-mode.d.ts +7 -0
  53. package/lib/framework/document-textline-mode.js +30 -0
  54. package/lib/framework/document-textline-mode.js.map +1 -0
  55. package/lib/framework/element-define.d.ts +319 -0
  56. package/{src/med_editor/framework/element-define.ts → lib/framework/element-define.js} +206 -301
  57. package/lib/framework/element-define.js.map +1 -0
  58. package/lib/framework/element-event-define.d.ts +99 -0
  59. package/lib/framework/element-event-define.js +108 -0
  60. package/lib/framework/element-event-define.js.map +1 -0
  61. package/lib/framework/element-measure.d.ts +97 -0
  62. package/{src/med_editor/framework/element-measure.ts → lib/framework/element-measure.js} +121 -143
  63. package/lib/framework/element-measure.js.map +1 -0
  64. package/lib/framework/element-paint.d.ts +42 -0
  65. package/{src/med_editor/framework/element-paint.ts → lib/framework/element-paint.js} +37 -43
  66. package/lib/framework/element-paint.js.map +1 -0
  67. package/lib/framework/element-props.d.ts +301 -0
  68. package/{src/med_editor/framework/element-props.ts → lib/framework/element-props.js} +202 -331
  69. package/lib/framework/element-props.js.map +1 -0
  70. package/lib/framework/element-reader.d.ts +19 -0
  71. package/{src/med_editor/framework/element-reader.ts → lib/framework/element-reader.js} +30 -38
  72. package/lib/framework/element-reader.js.map +1 -0
  73. package/lib/framework/element-render-cut.d.ts +55 -0
  74. package/{src/med_editor/framework/element-render-cut.ts → lib/framework/element-render-cut.js} +106 -113
  75. package/lib/framework/element-render-cut.js.map +1 -0
  76. package/lib/framework/element-serialize.d.ts +30 -0
  77. package/{src/med_editor/framework/element-serialize.ts → lib/framework/element-serialize.js} +25 -40
  78. package/lib/framework/element-serialize.js.map +1 -0
  79. package/lib/framework/element-util.d.ts +369 -0
  80. package/{src/med_editor/framework/element-util.ts → lib/framework/element-util.js} +216 -318
  81. package/lib/framework/element-util.js.map +1 -0
  82. package/lib/framework/impl/checkbox/checkbox-impl.d.ts +24 -0
  83. package/{src/med_editor/framework/impl/checkbox/checkbox-impl.ts → lib/framework/impl/checkbox/checkbox-impl.js} +18 -25
  84. package/lib/framework/impl/checkbox/checkbox-impl.js.map +1 -0
  85. package/lib/framework/impl/comments/comment-content-impl.d.ts +40 -0
  86. package/{src/med_editor/framework/impl/comments/comment-content-impl.ts → lib/framework/impl/comments/comment-content-impl.js} +31 -45
  87. package/lib/framework/impl/comments/comment-content-impl.js.map +1 -0
  88. package/lib/framework/impl/comments/comment-element-impl.d.ts +21 -0
  89. package/{src/med_editor/framework/impl/comments/comment-element-impl.ts → lib/framework/impl/comments/comment-element-impl.js} +18 -21
  90. package/lib/framework/impl/comments/comment-element-impl.js.map +1 -0
  91. package/lib/framework/impl/comments/comments-container-impl.d.ts +22 -0
  92. package/{src/med_editor/framework/impl/comments/comments-container-impl.ts → lib/framework/impl/comments/comments-container-impl.js} +15 -21
  93. package/lib/framework/impl/comments/comments-container-impl.js.map +1 -0
  94. package/lib/framework/impl/comments/comments-util.d.ts +12 -0
  95. package/{src/med_editor/framework/impl/comments/comments-util.ts → lib/framework/impl/comments/comments-util.js} +17 -34
  96. package/lib/framework/impl/comments/comments-util.js.map +1 -0
  97. package/lib/framework/impl/comments/validate-msg-impl.d.ts +21 -0
  98. package/{src/med_editor/framework/impl/comments/validate-msg-impl.ts → lib/framework/impl/comments/validate-msg-impl.js} +15 -26
  99. package/lib/framework/impl/comments/validate-msg-impl.js.map +1 -0
  100. package/lib/framework/impl/data-element/data-decorate-impl.d.ts +30 -0
  101. package/{src/med_editor/framework/impl/data-element/data-decorate-impl.ts → lib/framework/impl/data-element/data-decorate-impl.js} +21 -25
  102. package/lib/framework/impl/data-element/data-decorate-impl.js.map +1 -0
  103. package/lib/framework/impl/data-element/data-element-barcode.d.ts +31 -0
  104. package/{src/med_editor/framework/impl/data-element/data-element-barcode.ts → lib/framework/impl/data-element/data-element-barcode.js} +27 -39
  105. package/lib/framework/impl/data-element/data-element-barcode.js.map +1 -0
  106. package/lib/framework/impl/data-element/data-element-base-impl.d.ts +68 -0
  107. package/{src/med_editor/framework/impl/data-element/data-element-base-impl.ts → lib/framework/impl/data-element/data-element-base-impl.js} +44 -73
  108. package/lib/framework/impl/data-element/data-element-base-impl.js.map +1 -0
  109. package/lib/framework/impl/data-element/data-element-check-impl.d.ts +35 -0
  110. package/{src/med_editor/framework/impl/data-element/data-element-check-impl.ts → lib/framework/impl/data-element/data-element-check-impl.js} +33 -46
  111. package/lib/framework/impl/data-element/data-element-check-impl.js.map +1 -0
  112. package/lib/framework/impl/data-element/data-element-date-impl.d.ts +23 -0
  113. package/{src/med_editor/framework/impl/data-element/data-element-date-impl.ts → lib/framework/impl/data-element/data-element-date-impl.js} +22 -39
  114. package/lib/framework/impl/data-element/data-element-date-impl.js.map +1 -0
  115. package/lib/framework/impl/data-element/data-element-group-impl.d.ts +23 -0
  116. package/{src/med_editor/framework/impl/data-element/data-element-group-impl.ts → lib/framework/impl/data-element/data-element-group-impl.js} +29 -49
  117. package/lib/framework/impl/data-element/data-element-group-impl.js.map +1 -0
  118. package/lib/framework/impl/data-element/data-element-image-impl.d.ts +30 -0
  119. package/{src/med_editor/framework/impl/data-element/data-element-image-impl.ts → lib/framework/impl/data-element/data-element-image-impl.js} +26 -36
  120. package/lib/framework/impl/data-element/data-element-image-impl.js.map +1 -0
  121. package/lib/framework/impl/data-element/data-element-list-impl.d.ts +22 -0
  122. package/{src/med_editor/framework/impl/data-element/data-element-list-impl.ts → lib/framework/impl/data-element/data-element-list-impl.js} +30 -41
  123. package/lib/framework/impl/data-element/data-element-list-impl.js.map +1 -0
  124. package/lib/framework/impl/data-element/data-element-text-impl.d.ts +23 -0
  125. package/{src/med_editor/framework/impl/data-element/data-element-text-impl.ts → lib/framework/impl/data-element/data-element-text-impl.js} +20 -34
  126. package/lib/framework/impl/data-element/data-element-text-impl.js.map +1 -0
  127. package/lib/framework/impl/decorate/fill-null-space-imple.d.ts +21 -0
  128. package/{src/med_editor/framework/impl/decorate/fill-null-space-imple.ts → lib/framework/impl/decorate/fill-null-space-imple.js} +10 -15
  129. package/lib/framework/impl/decorate/fill-null-space-imple.js.map +1 -0
  130. package/lib/framework/impl/document/doc-body-impl.d.ts +27 -0
  131. package/{src/med_editor/framework/impl/document/doc-body-impl.ts → lib/framework/impl/document/doc-body-impl.js} +15 -31
  132. package/lib/framework/impl/document/doc-body-impl.js.map +1 -0
  133. package/lib/framework/impl/document/doc-body-part-impl.d.ts +30 -0
  134. package/{src/med_editor/framework/impl/document/doc-body-part-impl.ts → lib/framework/impl/document/doc-body-part-impl.js} +16 -26
  135. package/lib/framework/impl/document/doc-body-part-impl.js.map +1 -0
  136. package/lib/framework/impl/document/doc-container-impl.d.ts +16 -0
  137. package/lib/framework/impl/document/doc-container-impl.js +21 -0
  138. package/lib/framework/impl/document/doc-container-impl.js.map +1 -0
  139. package/lib/framework/impl/document/doc-footer-impl.d.ts +26 -0
  140. package/{src/med_editor/framework/impl/document/doc-footer-impl.ts → lib/framework/impl/document/doc-footer-impl.js} +18 -29
  141. package/lib/framework/impl/document/doc-footer-impl.js.map +1 -0
  142. package/lib/framework/impl/document/doc-header-impl.d.ts +26 -0
  143. package/{src/med_editor/framework/impl/document/doc-header-impl.ts → lib/framework/impl/document/doc-header-impl.js} +16 -33
  144. package/lib/framework/impl/document/doc-header-impl.js.map +1 -0
  145. package/lib/framework/impl/document/doc-impl.d.ts +61 -0
  146. package/{src/med_editor/framework/impl/document/doc-impl.ts → lib/framework/impl/document/doc-impl.js} +42 -59
  147. package/lib/framework/impl/document/doc-impl.js.map +1 -0
  148. package/lib/framework/impl/media-formula/menstrual-history.d.ts +35 -0
  149. package/{src/med_editor/framework/impl/media-formula/menstrual-history.ts → lib/framework/impl/media-formula/menstrual-history.js} +35 -57
  150. package/lib/framework/impl/media-formula/menstrual-history.js.map +1 -0
  151. package/lib/framework/impl/paragraph/p-impl.d.ts +45 -0
  152. package/{src/med_editor/framework/impl/paragraph/p-impl.ts → lib/framework/impl/paragraph/p-impl.js} +28 -62
  153. package/lib/framework/impl/paragraph/p-impl.js.map +1 -0
  154. package/lib/framework/impl/picture/image-impl.d.ts +31 -0
  155. package/{src/med_editor/framework/impl/picture/image-impl.ts → lib/framework/impl/picture/image-impl.js} +23 -35
  156. package/lib/framework/impl/picture/image-impl.js.map +1 -0
  157. package/lib/framework/impl/radio/radio-impl.d.ts +22 -0
  158. package/{src/med_editor/framework/impl/radio/radio-impl.ts → lib/framework/impl/radio/radio-impl.js} +19 -26
  159. package/lib/framework/impl/radio/radio-impl.js.map +1 -0
  160. package/lib/framework/impl/symbol/br-symbol-impl.d.ts +22 -0
  161. package/{src/med_editor/framework/impl/symbol/br-symbol-impl.ts → lib/framework/impl/symbol/br-symbol-impl.js} +14 -20
  162. package/lib/framework/impl/symbol/br-symbol-impl.js.map +1 -0
  163. package/lib/framework/impl/symbol/p-symbol-impl.d.ts +19 -0
  164. package/{src/med_editor/framework/impl/symbol/p-symbol-impl.ts → lib/framework/impl/symbol/p-symbol-impl.js} +11 -14
  165. package/lib/framework/impl/symbol/p-symbol-impl.js.map +1 -0
  166. package/lib/framework/impl/table/table-cell-impl.d.ts +37 -0
  167. package/{src/med_editor/framework/impl/table/table-cell-impl.ts → lib/framework/impl/table/table-cell-impl.js} +28 -39
  168. package/lib/framework/impl/table/table-cell-impl.js.map +1 -0
  169. package/lib/framework/impl/table/table-impl.d.ts +55 -0
  170. package/{src/med_editor/framework/impl/table/table-impl.ts → lib/framework/impl/table/table-impl.js} +82 -120
  171. package/lib/framework/impl/table/table-impl.js.map +1 -0
  172. package/lib/framework/impl/table/table-row-impl.d.ts +26 -0
  173. package/{src/med_editor/framework/impl/table/table-row-impl.ts → lib/framework/impl/table/table-row-impl.js} +16 -24
  174. package/lib/framework/impl/table/table-row-impl.js.map +1 -0
  175. package/lib/framework/impl/table/table-split-cell-patch.d.ts +20 -0
  176. package/{src/med_editor/framework/impl/table/table-split-cell-patch.ts → lib/framework/impl/table/table-split-cell-patch.js} +22 -31
  177. package/lib/framework/impl/table/table-split-cell-patch.js.map +1 -0
  178. package/lib/framework/impl/table/table-split-cell.d.ts +90 -0
  179. package/{src/med_editor/framework/impl/table/table-split-cell.ts → lib/framework/impl/table/table-split-cell.js} +94 -105
  180. package/lib/framework/impl/table/table-split-cell.js.map +1 -0
  181. package/lib/framework/impl/table/table-util.d.ts +150 -0
  182. package/{src/med_editor/framework/impl/table/table-util.ts → lib/framework/impl/table/table-util.js} +157 -195
  183. package/lib/framework/impl/table/table-util.js.map +1 -0
  184. package/lib/framework/impl/text/text-impl.d.ts +32 -0
  185. package/{src/med_editor/framework/impl/text/text-impl.ts → lib/framework/impl/text/text-impl.js} +32 -47
  186. package/lib/framework/impl/text/text-impl.js.map +1 -0
  187. package/lib/framework/impl/text/track-run-impl.d.ts +27 -0
  188. package/{src/med_editor/framework/impl/text/track-run-impl.ts → lib/framework/impl/text/track-run-impl.js} +28 -51
  189. package/lib/framework/impl/text/track-run-impl.js.map +1 -0
  190. package/lib/framework/notify.d.ts +13 -0
  191. package/{src/med_editor/framework/notify.ts → lib/framework/notify.js} +36 -50
  192. package/lib/framework/notify.js.map +1 -0
  193. package/lib/framework/range-util.d.ts +40 -0
  194. package/{src/med_editor/framework/range-util.ts → lib/framework/range-util.js} +71 -80
  195. package/lib/framework/range-util.js.map +1 -0
  196. package/lib/framework/render-context.d.ts +91 -0
  197. package/{src/med_editor/framework/render-context.ts → lib/framework/render-context.js} +64 -111
  198. package/lib/framework/render-context.js.map +1 -0
  199. package/lib/framework/render-define.d.ts +109 -0
  200. package/{src/med_editor/framework/render-define.ts → lib/framework/render-define.js} +61 -90
  201. package/lib/framework/render-define.js.map +1 -0
  202. package/lib/framework/selection-overlays.d.ts +30 -0
  203. package/{src/med_editor/framework/selection-overlays.ts → lib/framework/selection-overlays.js} +16 -26
  204. package/lib/framework/selection-overlays.js.map +1 -0
  205. package/lib/texteditor.d.ts +318 -0
  206. package/{src/med_editor/texteditor.ts → lib/texteditor.js} +189 -287
  207. package/lib/texteditor.js.map +1 -0
  208. package/lib/util/subject.d.ts +34 -0
  209. package/lib/util/subject.js +88 -0
  210. package/lib/util/subject.js.map +1 -0
  211. package/lib/util/table-bind.d.ts +5 -0
  212. package/{src/med_editor/util/table-bind.ts → lib/util/table-bind.js} +2 -2
  213. package/lib/util/table-bind.js.map +1 -0
  214. package/package.json +6 -2
  215. package/src/med_editor/framework/common-util.ts +0 -200
  216. package/src/med_editor/framework/document-segmenter.ts +0 -211
  217. package/src/med_editor/framework/document-textline-mode.ts +0 -34
  218. package/src/med_editor/framework/element-event-define.ts +0 -142
  219. package/src/med_editor/framework/impl/document/doc-container-impl.ts +0 -24
  220. package/src/med_editor/util/subject.ts +0 -118
  221. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225.json +0 -3573
  222. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225.json +0 -3573
  223. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225bug.json +0 -315
  224. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225/346/211/271/346/263/250.json +0 -122
  225. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225/346/226/207/346/241/243/351/252/214/350/257/201.json +0 -3599
  226. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225/351/225/277/346/226/207/346/234/254.json +0 -24586
  227. package/src/med_editor//345/220/210/345/271/266/347/227/205/347/250/213/345/275/225.json +0 -2874
  228. package/src/med_editor//346/211/213/346/234/257/350/256/260/345/275/225.json +0 -341
  229. package/src/med_editor//346/231/256/351/200/232doc/347/261/273/346/226/207/346/241/243.json +0 -2201
  230. package/src/med_editor//346/243/200/351/252/214/347/224/263/350/257/267/345/215/225.json +0 -1069
  231. package/src/med_editor//347/227/205/347/250/213/345/275/225//345/206/205/351/225/234/344/270/213/346/262/273/347/226/227/350/256/260/345/275/225.json +0 -125
  232. package/src/med_editor//347/227/205/347/250/213/345/275/225//345/220/210/345/271/266/347/227/205/347/250/213/345/275/225/346/250/241/346/235/277.json +0 -86
  233. package/src/med_editor//347/227/205/347/250/213/345/275/225//346/227/245/345/270/270/347/227/205/347/250/213/350/256/260/345/275/225.json +0 -115
  234. package/src/med_editor//347/227/205/347/250/213/345/275/225//346/237/245/346/210/277/350/256/260/345/275/2251.json +0 -108
  235. package/src/med_editor//347/227/205/347/250/213/345/275/225//351/246/226/346/254/241/344/270/212/347/272/247/345/214/273/345/270/210/346/237/245/346/210/277/350/256/260/345/275/225.json +0 -272
  236. package/src/med_editor//351/225/277/346/234/237/345/214/273/345/230/261/345/215/225.json +0 -1070
  237. package/tsconfig.json +0 -25
  238. package/webpack.config.js +0 -46
@@ -0,0 +1,42 @@
1
+ import { RenderContenxtType } from "./render-context";
2
+ import { Element, LeafElement, Position, SelectionContentRange, ViewOptions } from "./element-define";
3
+ import { LeafRenderObject, RenderObject } from "./render-define";
4
+ import { DocumentContainerRender } from "./impl/document/doc-container-impl";
5
+ import { CommentElement } from "./impl/comments/comment-element-impl";
6
+ import { CommsContainerRenderObject } from "./impl/comments/comments-container-impl";
7
+ export interface PrintOptions {
8
+ beforePrintPage: (pageIndex: number, pageCount: number) => void;
9
+ afterPrintPage: (pageIndex: number, pageCount: number) => void;
10
+ }
11
+ export declare class ElementPaint {
12
+ private viewOptions;
13
+ private renderCtx;
14
+ private selectedSets;
15
+ private measureCommContainer;
16
+ private rePaint;
17
+ constructor(viewOptions: ViewOptions, renderCtx: RenderContenxtType);
18
+ paintCommMap: Array<{
19
+ ele: CommentElement;
20
+ render: RenderObject;
21
+ pos: Position;
22
+ }>;
23
+ paintPagePos: Position;
24
+ drawPages(docContainer: DocumentContainerRender, selectedSets: Map<Element, SelectionContentRange>, measureCommContainer: CommsContainerRenderObject, rePaint: boolean): void;
25
+ drawRenderObject(renderObject: RenderObject<any>, parent: {
26
+ x: number;
27
+ y: number;
28
+ }, parentInViewPort?: boolean | undefined): void;
29
+ /**
30
+ * 触发页面绘制结束事件
31
+ */
32
+ invokedPagePaintCompleted(renderObject: RenderObject, parent: {
33
+ x: number;
34
+ y: number;
35
+ }): void;
36
+ static drawPage(renderCtx: RenderContenxtType, renderObject: RenderObject, parent: {
37
+ x: number;
38
+ y: number;
39
+ }): void;
40
+ getLeafElementPaintMap(element: LeafElement, shadowRenderIndex?: number): LeafRenderObject;
41
+ getShadowRenderIndex(element: LeafElement, render: LeafRenderObject): number;
42
+ }
@@ -1,29 +1,26 @@
1
- import { RenderContenxtType } from "./render-context";
2
- import { Element, LeafElement, Position, SelectionContentRange, ViewOptions } from "./element-define";
3
- import { BranchRenderObject, LeafRenderObject, RenderObject } from "./render-define";
4
- import { DocumentContainerRender } from "./impl/document/doc-container-impl";
1
+ import { BranchRenderObject, LeafRenderObject } from "./render-define";
5
2
  import { ElementUtil } from "./element-util";
6
- import { CommentElement } from "./impl/comments/comment-element-impl";
7
3
  import { CommsContainerRenderObject } from "./impl/comments/comments-container-impl";
8
4
  import { CommentsUtil } from "./impl/comments/comments-util";
9
- import { TextGroupElement, TextGroupRenderObject } from "./impl/text/text-impl";
5
+ import { TextGroupElement } from "./impl/text/text-impl";
10
6
  import { RangeUtil } from "./range-util";
11
7
  import { DataElementRenderObject } from "@/med_editor/framework/impl/data-element/data-element-base-impl";
12
- export interface PrintOptions {
13
- beforePrintPage: (pageIndex: number, pageCount: number) => void;
14
- afterPrintPage: (pageIndex: number, pageCount: number) => void;
15
- }
16
8
  export class ElementPaint {
9
+ viewOptions;
10
+ renderCtx;
17
11
  //存储元素和绘制元素的映射关系
18
12
  //paintElementMap: Map<Element, Array<RenderObject>> = new Map();
19
- private selectedSets!: Map<Element, SelectionContentRange>;
20
- private measureCommContainer!: CommsContainerRenderObject;
21
- private rePaint!: boolean;
22
- constructor(private viewOptions: ViewOptions, private renderCtx: RenderContenxtType) { }
13
+ selectedSets;
14
+ measureCommContainer;
15
+ rePaint;
16
+ constructor(viewOptions, renderCtx) {
17
+ this.viewOptions = viewOptions;
18
+ this.renderCtx = renderCtx;
19
+ }
23
20
  //审阅标记的位置对应关系
24
- paintCommMap!: Array<{ ele: CommentElement, render: RenderObject, pos: Position }>;
25
- paintPagePos!: Position;
26
- drawPages(docContainer: DocumentContainerRender, selectedSets: Map<Element, SelectionContentRange>, measureCommContainer: CommsContainerRenderObject, rePaint: boolean): void {
21
+ paintCommMap;
22
+ paintPagePos;
23
+ drawPages(docContainer, selectedSets, measureCommContainer, rePaint) {
27
24
  this.rePaint = rePaint;
28
25
  this.measureCommContainer = measureCommContainer;
29
26
  const { viewSettings, docPageSettings, viewBackcolor } = this.viewOptions;
@@ -37,7 +34,7 @@ export class ElementPaint {
37
34
  const doc = docContainer.getChild(i);
38
35
  const { x: rx, y: ry, width: rw, height: rh } = doc.rect;
39
36
  const currPosition = { x: rx + containerPos.x, y: ry + containerPos.y };
40
- let inViewPort: boolean | undefined = (currPosition.y >= 0 && currPosition.y <= this.viewOptions.viewPaintHeight) || (currPosition.y < 0 && currPosition.y + rh > 0);
37
+ let inViewPort = (currPosition.y >= 0 && currPosition.y <= this.viewOptions.viewPaintHeight) || (currPosition.y < 0 && currPosition.y + rh > 0);
41
38
  if (this.viewOptions.fullPageView) {
42
39
  //inViewPort = undefined;
43
40
  }
@@ -47,13 +44,11 @@ export class ElementPaint {
47
44
  if (inViewPort) {
48
45
  this.invokedPagePaintCompleted(doc, containerPos);
49
46
  }
50
-
51
47
  }
52
- docContainer.endRender(this.renderCtx, containerPos)
48
+ docContainer.endRender(this.renderCtx, containerPos);
53
49
  this.renderCtx.commit(null);
54
50
  }
55
-
56
- drawRenderObject(renderObject: RenderObject<any>, parent: { x: number, y: number }, parentInViewPort: boolean | undefined = false): void {
51
+ drawRenderObject(renderObject, parent, parentInViewPort = false) {
57
52
  const element = renderObject.element;
58
53
  if (this.rePaint && element) {
59
54
  element.paintRenders.push(renderObject);
@@ -61,7 +56,7 @@ export class ElementPaint {
61
56
  const { x: rx, y: ry, width: rw, height: rh } = renderObject.rect;
62
57
  const currPosition = { x: rx + parent.x, y: ry + parent.y };
63
58
  //判断当前绘制元素是否在视窗内
64
- let inViewPort: boolean = parentInViewPort;
59
+ let inViewPort = parentInViewPort;
65
60
  if (parentInViewPort === undefined || this.viewOptions.fullPageView) {
66
61
  inViewPort = (currPosition.y >= 0 && currPosition.y <= this.viewOptions.viewPaintHeight) || (currPosition.y < 0 && currPosition.y + rh > 0);
67
62
  }
@@ -77,17 +72,18 @@ export class ElementPaint {
77
72
  renderObject.beginRender(this.renderCtx, currPosition);
78
73
  for (let i = 0; i < renderObject.length; i++) {
79
74
  const child = renderObject.getChild(i);
80
- this.drawRenderObject(child, currPosition, inViewPort)
75
+ this.drawRenderObject(child, currPosition, inViewPort);
81
76
  }
82
77
  renderObject.endRender(this.renderCtx, currPosition);
83
78
  }
84
- } else if (renderObject instanceof LeafRenderObject) {
79
+ }
80
+ else if (renderObject instanceof LeafRenderObject) {
85
81
  if (inViewPort) {
86
82
  renderObject.render(this.renderCtx, currPosition);
87
83
  }
88
84
  //审阅信息
89
85
  if (this.viewOptions.showReviewWindow && element && element.type === 'comm') {
90
- const commElement = element as CommentElement;
86
+ const commElement = element;
91
87
  if (commElement.props.markType === 'start') {
92
88
  //获取当前绘制元素相对于当前页的坐标
93
89
  this.paintCommMap.push({ ele: commElement, render: renderObject, pos: { x: currPosition.x - this.paintPagePos.x, y: currPosition.y - this.paintPagePos.y } });
@@ -96,27 +92,29 @@ export class ElementPaint {
96
92
  }
97
93
  //处理选中拖蓝
98
94
  if (inViewPort && this.selectedSets.has(element)) {
99
- const range = this.selectedSets.get(element) as SelectionContentRange;
95
+ const range = this.selectedSets.get(element);
100
96
  if (renderObject instanceof LeafRenderObject) {
101
97
  const overlayRect = { x: currPosition.x, y: currPosition.y, width: rw, height: rh };
102
98
  const paraLinePos = ElementUtil.getParaLinePos(renderObject, { x: currPosition.x, y: currPosition.y });
103
99
  if (range.isFullSelected) {
104
100
  this.renderCtx.overlaysContext.fillRect(overlayRect.x, paraLinePos.y, overlayRect.width, paraLinePos.height, this.viewOptions.selectionOverlaysColor);
105
- } else {
101
+ }
102
+ else {
106
103
  if (element instanceof TextGroupElement && range.endOffset > range.startOffset) {
107
- const { startX, endX } = ElementUtil.getTextRenderHorX(<TextGroupRenderObject>renderObject, range.startOffset, range.endOffset);
104
+ const { startX, endX } = ElementUtil.getTextRenderHorX(renderObject, range.startOffset, range.endOffset);
108
105
  overlayRect.width = endX - startX;
109
106
  overlayRect.x += startX;
110
107
  this.renderCtx.overlaysContext.fillRect(overlayRect.x, paraLinePos.y, overlayRect.width, paraLinePos.height, this.viewOptions.selectionOverlaysColor);
111
108
  }
112
109
  }
113
- } else if (range.isFullSelected && element.type === 'tbc') {
110
+ }
111
+ else if (range.isFullSelected && element.type === 'tbc') {
114
112
  this.renderCtx.overlaysContext.fillRect(currPosition.x, currPosition.y, renderObject.rect.width, renderObject.rect.height, this.viewOptions.selectionOverlaysColor);
115
113
  }
116
114
  }
117
115
  if (inViewPort && this.viewOptions.showReviewWindow && this.measureCommContainer.selectedSet.has(element)) {
118
116
  if (renderObject instanceof LeafRenderObject || renderObject instanceof DataElementRenderObject) {
119
- const range = this.measureCommContainer.selectedSet.get(element) as SelectionContentRange;
117
+ const range = this.measureCommContainer.selectedSet.get(element);
120
118
  if (range.isFullSelected) {
121
119
  let commentRangePaintColor = '#ffd591';
122
120
  for (let i = 0; i < this.measureCommContainer.commentRangeStatus.length; i++) {
@@ -132,14 +130,12 @@ export class ElementPaint {
132
130
  this.renderCtx.overlaysContext.fillRect(overlayRect.x, paraLinePos.y, overlayRect.width, paraLinePos.height, commentRangePaintColor);
133
131
  }
134
132
  }
135
-
136
133
  }
137
134
  }
138
-
139
135
  /**
140
136
  * 触发页面绘制结束事件
141
137
  */
142
- invokedPagePaintCompleted(renderObject: RenderObject, parent: { x: number, y: number }): void {
138
+ invokedPagePaintCompleted(renderObject, parent) {
143
139
  const { x: rx, y: ry, width: rw, height: rh } = renderObject.rect;
144
140
  const currPosition = { x: rx + parent.x, y: ry + parent.y };
145
141
  renderObject.pagePaintCompleted(this.renderCtx, currPosition);
@@ -149,8 +145,7 @@ export class ElementPaint {
149
145
  }
150
146
  }
151
147
  }
152
-
153
- static drawPage(renderCtx: RenderContenxtType, renderObject: RenderObject, parent: { x: number, y: number }): void {
148
+ static drawPage(renderCtx, renderObject, parent) {
154
149
  const { x: rx, y: ry } = renderObject.rect;
155
150
  const currPosition = { x: rx + parent.x, y: ry + parent.y };
156
151
  if (renderObject instanceof BranchRenderObject) {
@@ -160,17 +155,16 @@ export class ElementPaint {
160
155
  this.drawPage(renderCtx, child, currPosition);
161
156
  }
162
157
  renderObject.endRender(renderCtx, currPosition);
163
- } else if (renderObject instanceof LeafRenderObject) {
158
+ }
159
+ else if (renderObject instanceof LeafRenderObject) {
164
160
  renderObject.render(renderCtx, currPosition);
165
161
  }
166
162
  }
167
-
168
-
169
- getLeafElementPaintMap(element: LeafElement, shadowRenderIndex = 0): LeafRenderObject {
170
- return element.paintRenders[shadowRenderIndex] as LeafRenderObject;
163
+ getLeafElementPaintMap(element, shadowRenderIndex = 0) {
164
+ return element.paintRenders[shadowRenderIndex];
171
165
  }
172
-
173
- getShadowRenderIndex(element: LeafElement, render: LeafRenderObject): number {
166
+ getShadowRenderIndex(element, render) {
174
167
  return element.paintRenders.indexOf(render);
175
168
  }
176
169
  }
170
+ //# sourceMappingURL=element-paint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-paint.js","sourceRoot":"","sources":["../../src/med_editor/framework/element-paint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAgB,MAAM,iBAAiB,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAK1G,MAAM,OAAO,YAAY;IAMD;IAAkC;IALtD,gBAAgB;IAChB,iEAAiE;IACzD,YAAY,CAAuC;IACnD,oBAAoB,CAA8B;IAClD,OAAO,CAAW;IAC1B,YAAoB,WAAwB,EAAU,SAA6B;QAA/D,gBAAW,GAAX,WAAW,CAAa;QAAU,cAAS,GAAT,SAAS,CAAoB;IAAI,CAAC;IACxF,aAAa;IACb,YAAY,CAAuE;IACnF,YAAY,CAAY;IACxB,SAAS,CAAC,YAAqC,EAAE,YAAiD,EAAE,oBAAgD,EAAE,OAAgB;QAClK,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;Q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,EAAE,iBAAiB,GAAG,CAAC;QAC9D,OAAO,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAqB,CAAC;IACvE,CAAC;IAED,oBAAoB,CAAC,OAAoB,EAAE,MAAwB;QAC/D,OAAO,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;CACJ"}
@@ -0,0 +1,301 @@
1
+ import { NullableType, OrientType, PaddingProps, TextAlign, ViewOptions } from "./element-define";
2
+ import { TrackRunTypeEnum } from "./impl/text/track-run-impl";
3
+ export declare type TextVertAlign = 'superscript' | 'subscript';
4
+ export declare abstract class INotifyPropertyChanged {
5
+ abstract getSerializeProps(viewOptions: ViewOptions): any;
6
+ private __attatchProperty;
7
+ registerProperty<T>(propertyName: string, value: T): void;
8
+ removeProperty(propertyName: string): void;
9
+ getProperty<T>(propertyName: string): T;
10
+ }
11
+ export declare class TextProps extends INotifyPropertyChanged {
12
+ constructor();
13
+ color: string;
14
+ fontName: string;
15
+ fontSize: number;
16
+ fontWeight: 'normal' | 'bold';
17
+ fontStyle: 'normal' | 'italic';
18
+ underline: boolean;
19
+ overline: boolean;
20
+ linethrough: boolean;
21
+ background: string;
22
+ letterSpace: number;
23
+ /**
24
+ * 上标或者下标
25
+ */
26
+ vertAlign: TextVertAlign;
27
+ /**
28
+ * 字符边框
29
+ */
30
+ border: boolean;
31
+ clearCache(): void;
32
+ clone(source: TextProps | null): TextProps;
33
+ setPropsValue(source: TextProps, target: TextProps): void;
34
+ getSerializeProps(viewOptions: ViewOptions): any;
35
+ private __cacheFont;
36
+ getFont(): string;
37
+ equals(props: TextProps): boolean;
38
+ }
39
+ export declare class ParagraphProps extends INotifyPropertyChanged {
40
+ textProps: TextProps;
41
+ indent: number;
42
+ hanging: number;
43
+ lineHeight: number;
44
+ textAlign: TextAlign;
45
+ numberType: number;
46
+ pageBreak: boolean;
47
+ clone(dest?: ParagraphProps | null): ParagraphProps;
48
+ getSerializeProps(viewOptions: ViewOptions): any;
49
+ }
50
+ export declare class DocumentProps extends INotifyPropertyChanged {
51
+ width: number;
52
+ height: number;
53
+ padding: PaddingProps;
54
+ headerLine: number;
55
+ footerLine: number;
56
+ orient: OrientType;
57
+ createUserId: string;
58
+ createUserName: string;
59
+ createDate: string;
60
+ scripts: string;
61
+ clone(dest: DocumentProps): DocumentProps;
62
+ getSerializeProps(): any;
63
+ }
64
+ export declare class CheckBoxProps extends INotifyPropertyChanged {
65
+ size: number;
66
+ isChecked: boolean;
67
+ groupName: string | null;
68
+ clone(dest: CheckBoxProps): CheckBoxProps;
69
+ getSerializeProps(viewOptions: ViewOptions): {
70
+ size: number;
71
+ isChecked: boolean;
72
+ groupName: string;
73
+ };
74
+ }
75
+ export declare class RadioBoxProps extends INotifyPropertyChanged {
76
+ size: number;
77
+ isChecked: boolean;
78
+ clone(dest: RadioBoxProps): RadioBoxProps;
79
+ getSerializeProps(viewOptions: ViewOptions): {
80
+ size: number;
81
+ isCheced: boolean;
82
+ };
83
+ }
84
+ export declare class TableRowProps extends INotifyPropertyChanged {
85
+ minHeight: number;
86
+ headerRow: boolean;
87
+ clone(dest: TableRowProps): TableRowProps;
88
+ getSerializeProps(viewOptions: ViewOptions): any;
89
+ }
90
+ export declare type TableAlignment = 'start' | 'end' | 'center';
91
+ export declare class TableProps extends INotifyPropertyChanged {
92
+ width: number | string;
93
+ cols: Array<{
94
+ width: number | string;
95
+ }>;
96
+ alignment: TableAlignment;
97
+ border: 'all' | 'none';
98
+ allowBreakRow: boolean;
99
+ clone(dest: TableProps): TableProps;
100
+ getSerializeProps(viewOptions: ViewOptions): {
101
+ width: string | number;
102
+ cols: {
103
+ width: string | number;
104
+ }[];
105
+ alignment: TableAlignment;
106
+ border: "all" | "none";
107
+ };
108
+ }
109
+ export declare type CellMergeType = 'col-merge' | 'row-merge';
110
+ export declare type VMergeType = 'restart' | 'continue';
111
+ export declare type HMergeType = 'restart' | 'continue';
112
+ export declare type VerticalAlign = 'top' | 'middle' | 'bottom';
113
+ export declare class TableCellProps extends INotifyPropertyChanged {
114
+ vMerge: VMergeType | null;
115
+ hMerge: HMergeType | null;
116
+ vAlign: VerticalAlign | null;
117
+ backgroundColor: string | null;
118
+ /**
119
+ * 对角线
120
+ */
121
+ diagonal: 'main' | 'sub' | null;
122
+ clone(dest: TableCellProps): TableCellProps;
123
+ getSerializeProps(options: ViewOptions): any;
124
+ }
125
+ export declare class PictureProps extends INotifyPropertyChanged {
126
+ title: string;
127
+ width: number;
128
+ height: number;
129
+ src: string;
130
+ border: 'all' | 'none';
131
+ clone(dest: PictureProps): PictureProps;
132
+ getSerializeProps(viewOptions: ViewOptions): NullableType<PictureProps>;
133
+ }
134
+ export declare class DataDecorateProps extends INotifyPropertyChanged {
135
+ content: string;
136
+ size: number;
137
+ clone(dest: DataDecorateProps): DataDecorateProps;
138
+ getSerializeProps(viewOptions: ViewOptions): {
139
+ size: number;
140
+ content: string;
141
+ };
142
+ }
143
+ export declare type DataEleTypes = 'text' | 'droplist' | 'date' | 'check' | 'img';
144
+ export declare class DataEleBaseProps extends INotifyPropertyChanged {
145
+ id: string;
146
+ name: string;
147
+ fieldName: string;
148
+ caption: string;
149
+ required: boolean;
150
+ printable: boolean;
151
+ secretBrowse: boolean;
152
+ editable: boolean;
153
+ deleteable: boolean;
154
+ minLength: number;
155
+ type: DataEleTypes;
156
+ underline: boolean;
157
+ cloneBaseProps(destProps: DataEleBaseProps): void;
158
+ private setPropValue;
159
+ updateProps(props: DataEleBaseProps): void;
160
+ getBaseProps(props: NullableType<DataEleBaseProps>, options: ViewOptions): NullableType<DataEleBaseProps>;
161
+ getSerializeProps(viewOptions: ViewOptions): void;
162
+ }
163
+ export declare class DataEleBaseTextProps extends DataEleBaseProps {
164
+ constructor();
165
+ valueTextProps: TextProps;
166
+ nullText: string;
167
+ nullTextProps: TextProps;
168
+ dataType: 'text' | 'int' | 'float' | 'email' | 'date' | 'phone' | 'zipcode';
169
+ clone(dest?: DataEleBaseTextProps | null): DataEleBaseTextProps;
170
+ getSerializeProps(options: ViewOptions): any;
171
+ getBaseProps(props: NullableType<DataEleBaseTextProps>, options: ViewOptions): NullableType<DataEleBaseTextProps>;
172
+ updateProps(props: DataEleBaseTextProps): void;
173
+ }
174
+ export interface DataEleListOption {
175
+ code: string;
176
+ value: string;
177
+ }
178
+ export declare class DataEleListProps extends DataEleBaseTextProps {
179
+ constructor();
180
+ options: Array<DataEleListOption>;
181
+ dropDownStyle: 'DropDownList' | 'DropDown';
182
+ /**
183
+ * 是否允许多选
184
+ */
185
+ multiSelect: boolean;
186
+ clone(dest: DataEleListProps | null): DataEleListProps;
187
+ getSerializeProps(options: ViewOptions): any;
188
+ updateProps(props: DataEleListProps): void;
189
+ }
190
+ export declare class CommContentProps extends INotifyPropertyChanged {
191
+ id: string;
192
+ createId: string;
193
+ createName: string;
194
+ createDate: Date;
195
+ clone(dest: CommContentProps): CommContentProps;
196
+ getSerializeProps(viewOptions: ViewOptions): {
197
+ id: string;
198
+ };
199
+ }
200
+ export declare class CommProps extends INotifyPropertyChanged {
201
+ id: string;
202
+ markType: "start" | "end";
203
+ clone(dest: CommProps): CommProps;
204
+ getSerializeProps(viewOptions: ViewOptions): {
205
+ id: string;
206
+ markType: "end" | "start";
207
+ };
208
+ }
209
+ export declare class DataEleCheckProps extends DataEleBaseProps {
210
+ constructor();
211
+ size: number;
212
+ checked: boolean;
213
+ checkedValue: string;
214
+ groupName: string;
215
+ multiSelect: boolean;
216
+ clone(dest: DataEleCheckProps | null): DataEleCheckProps;
217
+ getSerializeProps(options: ViewOptions): any;
218
+ updateProps(props: DataEleCheckProps): void;
219
+ }
220
+ export declare class DataEleImageProps extends DataEleBaseProps {
221
+ constructor();
222
+ width: number;
223
+ height: number;
224
+ src: string;
225
+ border: 'all' | 'none';
226
+ clone(dest: DataEleImageProps | null): DataEleImageProps;
227
+ getSerializeProps(options: ViewOptions): any;
228
+ updateProps(props: DataEleImageProps): void;
229
+ }
230
+ export declare class DataEleDateProps extends DataEleBaseTextProps {
231
+ constructor();
232
+ minValue?: Date;
233
+ maxValue?: Date;
234
+ format?: string;
235
+ clone(dest: DataEleDateProps | null): DataEleDateProps;
236
+ getSerializeProps(options: ViewOptions): any;
237
+ updateProps(props: DataEleDateProps): void;
238
+ }
239
+ export declare class ValidateCondition {
240
+ required: boolean;
241
+ maxLength: number;
242
+ dataType: 'string' | 'date' | 'time' | 'number' | 'float';
243
+ }
244
+ export declare class DataEleMHProps extends DataEleBaseProps {
245
+ age: string;
246
+ days: string;
247
+ cycles: string;
248
+ lastDate: string;
249
+ closeAge: string;
250
+ kind: string;
251
+ clone(dest: DataEleMHProps | null): DataEleMHProps;
252
+ getSerializeProps(options: ViewOptions): NullableType<DataEleMHProps>;
253
+ }
254
+ export declare class TrackRunProps {
255
+ type: TrackRunTypeEnum;
256
+ userId: string;
257
+ userName: string;
258
+ date: string;
259
+ id: string;
260
+ constructor(type: TrackRunTypeEnum);
261
+ clone(dest: TrackRunProps | null): void;
262
+ getSerializeProps(): NullableType<TrackRunProps>;
263
+ }
264
+ declare class FontMapStruct {
265
+ fontMap: Map<string, string>;
266
+ length: number;
267
+ registerFontMap(name: string, keyName: string): void;
268
+ getFontMap(name: string): string;
269
+ }
270
+ export declare const fontMapFunc: FontMapStruct;
271
+ export declare class ValidateProps {
272
+ id: string;
273
+ title: string;
274
+ msg: string;
275
+ }
276
+ export declare class DataElementGroupProps {
277
+ id: string;
278
+ name: string;
279
+ clone(dest: DataElementGroupProps | null): void;
280
+ getSerializeProps(): {
281
+ id: string;
282
+ name: string;
283
+ };
284
+ }
285
+ export declare class DataElementBarcodeProps {
286
+ type: 'ena13' | 'code128' | 'code39' | 'qrcode';
287
+ text: string;
288
+ width: number;
289
+ height: number;
290
+ clone(dest: DataElementBarcodeProps | null): void;
291
+ getSerializeProps(): {
292
+ type: "ena13" | "code128" | "code39" | "qrcode";
293
+ text: string;
294
+ width: number;
295
+ height: number;
296
+ };
297
+ }
298
+ export declare class BodyPartProps {
299
+ partId: string;
300
+ }
301
+ export {};