@hailin-zheng/editor-core 1.0.7 → 1.0.10

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 (237) hide show
  1. package/package.json +3 -4
  2. package/{lib/doc-ruler.js → src/med_editor/doc-ruler.ts} +101 -74
  3. package/src/med_editor/framework/common-util.ts +200 -0
  4. package/{lib/framework/document-change.js → src/med_editor/framework/document-change.ts} +308 -259
  5. package/{lib/framework/document-combine.js → src/med_editor/framework/document-combine.ts} +15 -11
  6. package/{lib/framework/document-comment.js → src/med_editor/framework/document-comment.ts} +52 -37
  7. package/{lib/framework/document-context.js → src/med_editor/framework/document-context.ts} +181 -101
  8. package/{lib/framework/document-eval-func.js → src/med_editor/framework/document-eval-func.ts} +16 -11
  9. package/{lib/framework/document-event.js → src/med_editor/framework/document-event.ts} +244 -216
  10. package/{lib/framework/document-history.js → src/med_editor/framework/document-history.ts} +25 -14
  11. package/{lib/framework/document-images-loader.js → src/med_editor/framework/document-images-loader.ts} +25 -17
  12. package/{lib/framework/document-input-cursor.js → src/med_editor/framework/document-input-cursor.ts} +76 -71
  13. package/{lib/framework/document-paint.js → src/med_editor/framework/document-paint.ts} +35 -28
  14. package/{lib/framework/document-print-offscreen.js → src/med_editor/framework/document-print-offscreen.ts} +25 -19
  15. package/{lib/framework/document-print.js → src/med_editor/framework/document-print.ts} +57 -41
  16. package/src/med_editor/framework/document-segmenter.ts +211 -0
  17. package/{lib/framework/document-selection.js → src/med_editor/framework/document-selection.ts} +116 -85
  18. package/{lib/framework/document-template.js → src/med_editor/framework/document-template.ts} +3 -3
  19. package/src/med_editor/framework/document-textline-mode.ts +34 -0
  20. package/{lib/framework/element-define.js → src/med_editor/framework/element-define.ts} +301 -206
  21. package/src/med_editor/framework/element-event-define.ts +141 -0
  22. package/{lib/framework/element-measure.js → src/med_editor/framework/element-measure.ts} +143 -121
  23. package/{lib/framework/element-paint.js → src/med_editor/framework/element-paint.ts} +44 -38
  24. package/{lib/framework/element-props.js → src/med_editor/framework/element-props.ts} +331 -202
  25. package/{lib/framework/element-reader.js → src/med_editor/framework/element-reader.ts} +39 -31
  26. package/{lib/framework/element-render-cut.js → src/med_editor/framework/element-render-cut.ts} +113 -106
  27. package/{lib/framework/element-serialize.js → src/med_editor/framework/element-serialize.ts} +37 -24
  28. package/{lib/framework/element-util.js → src/med_editor/framework/element-util.ts} +317 -216
  29. package/{lib/framework/impl/checkbox/checkbox-impl.js → src/med_editor/framework/impl/checkbox/checkbox-impl.ts} +27 -20
  30. package/{lib/framework/impl/comments/comment-content-impl.js → src/med_editor/framework/impl/comments/comment-content-impl.ts} +45 -31
  31. package/{lib/framework/impl/comments/comment-element-impl.js → src/med_editor/framework/impl/comments/comment-element-impl.ts} +23 -20
  32. package/{lib/framework/impl/comments/comments-container-impl.js → src/med_editor/framework/impl/comments/comments-container-impl.ts} +22 -16
  33. package/{lib/framework/impl/comments/comments-util.js → src/med_editor/framework/impl/comments/comments-util.ts} +34 -17
  34. package/{lib/framework/impl/comments/validate-msg-impl.js → src/med_editor/framework/impl/comments/validate-msg-impl.ts} +28 -17
  35. package/{lib/framework/impl/data-element/data-decorate-impl.js → src/med_editor/framework/impl/data-element/data-decorate-impl.ts} +26 -22
  36. package/{lib/framework/impl/data-element/data-element-barcode.js → src/med_editor/framework/impl/data-element/data-element-barcode.ts} +41 -29
  37. package/{lib/framework/impl/data-element/data-element-base-impl.js → src/med_editor/framework/impl/data-element/data-element-base-impl.ts} +73 -44
  38. package/{lib/framework/impl/data-element/data-element-check-impl.js → src/med_editor/framework/impl/data-element/data-element-check-impl.ts} +48 -35
  39. package/{lib/framework/impl/data-element/data-element-date-impl.js → src/med_editor/framework/impl/data-element/data-element-date-impl.ts} +41 -24
  40. package/{lib/framework/impl/data-element/data-element-group-impl.js → src/med_editor/framework/impl/data-element/data-element-group-impl.ts} +52 -32
  41. package/{lib/framework/impl/data-element/data-element-image-impl.js → src/med_editor/framework/impl/data-element/data-element-image-impl.ts} +38 -28
  42. package/{lib/framework/impl/data-element/data-element-list-impl.js → src/med_editor/framework/impl/data-element/data-element-list-impl.ts} +42 -31
  43. package/{lib/framework/impl/data-element/data-element-text-impl.js → src/med_editor/framework/impl/data-element/data-element-text-impl.ts} +36 -22
  44. package/{lib/framework/impl/decorate/fill-null-space-imple.js → src/med_editor/framework/impl/decorate/fill-null-space-imple.ts} +15 -10
  45. package/{lib/framework/impl/document/doc-body-impl.js → src/med_editor/framework/impl/document/doc-body-impl.ts} +32 -16
  46. package/{lib/framework/impl/document/doc-body-part-impl.js → src/med_editor/framework/impl/document/doc-body-part-impl.ts} +27 -17
  47. package/src/med_editor/framework/impl/document/doc-container-impl.ts +24 -0
  48. package/{lib/framework/impl/document/doc-footer-impl.js → src/med_editor/framework/impl/document/doc-footer-impl.ts} +30 -19
  49. package/{lib/framework/impl/document/doc-header-impl.js → src/med_editor/framework/impl/document/doc-header-impl.ts} +34 -17
  50. package/{lib/framework/impl/document/doc-impl.js → src/med_editor/framework/impl/document/doc-impl.ts} +62 -45
  51. package/{lib/framework/impl/media-formula/menstrual-history.js → src/med_editor/framework/impl/media-formula/menstrual-history.ts} +58 -36
  52. package/{lib/framework/impl/paragraph/p-impl.js → src/med_editor/framework/impl/paragraph/p-impl.ts} +64 -30
  53. package/{lib/framework/impl/picture/image-impl.js → src/med_editor/framework/impl/picture/image-impl.ts} +37 -25
  54. package/{lib/framework/impl/radio/radio-impl.js → src/med_editor/framework/impl/radio/radio-impl.ts} +28 -21
  55. package/{lib/framework/impl/symbol/br-symbol-impl.js → src/med_editor/framework/impl/symbol/br-symbol-impl.ts} +21 -15
  56. package/{lib/framework/impl/symbol/p-symbol-impl.js → src/med_editor/framework/impl/symbol/p-symbol-impl.ts} +15 -12
  57. package/{lib/framework/impl/table/table-cell-impl.js → src/med_editor/framework/impl/table/table-cell-impl.ts} +41 -30
  58. package/{lib/framework/impl/table/table-impl.js → src/med_editor/framework/impl/table/table-impl.ts} +122 -84
  59. package/{lib/framework/impl/table/table-row-impl.js → src/med_editor/framework/impl/table/table-row-impl.ts} +26 -18
  60. package/{lib/framework/impl/table/table-split-cell-patch.js → src/med_editor/framework/impl/table/table-split-cell-patch.ts} +31 -22
  61. package/{lib/framework/impl/table/table-split-cell.js → src/med_editor/framework/impl/table/table-split-cell.ts} +105 -94
  62. package/{lib/framework/impl/table/table-util.js → src/med_editor/framework/impl/table/table-util.ts} +197 -159
  63. package/{lib/framework/impl/text/text-impl.js → src/med_editor/framework/impl/text/text-impl.ts} +49 -35
  64. package/{lib/framework/impl/text/track-run-impl.js → src/med_editor/framework/impl/text/track-run-impl.ts} +53 -30
  65. package/{lib/framework/notify.js → src/med_editor/framework/notify.ts} +50 -36
  66. package/{lib/framework/range-util.js → src/med_editor/framework/range-util.ts} +80 -71
  67. package/{lib/framework/render-context.js → src/med_editor/framework/render-context.ts} +111 -64
  68. package/{lib/framework/render-define.js → src/med_editor/framework/render-define.ts} +90 -61
  69. package/{lib/framework/selection-overlays.js → src/med_editor/framework/selection-overlays.ts} +25 -16
  70. package/{lib/texteditor.js → src/med_editor/texteditor.ts} +288 -191
  71. package/src/med_editor/util/subject.ts +118 -0
  72. package/{lib/util/table-bind.js → src/med_editor/util/table-bind.ts} +2 -2
  73. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225.json +3573 -0
  74. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225.json +3573 -0
  75. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225bug.json +315 -0
  76. 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 +122 -0
  77. 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 +3599 -0
  78. 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 +24586 -0
  79. package/src/med_editor//345/220/210/345/271/266/347/227/205/347/250/213/345/275/225.json +2874 -0
  80. package/src/med_editor//346/211/213/346/234/257/350/256/260/345/275/225.json +341 -0
  81. package/src/med_editor//346/231/256/351/200/232doc/347/261/273/346/226/207/346/241/243.json +2201 -0
  82. package/src/med_editor//346/243/200/351/252/214/347/224/263/350/257/267/345/215/225.json +1069 -0
  83. 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 +125 -0
  84. 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 +86 -0
  85. 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 +115 -0
  86. 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 +108 -0
  87. 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 +272 -0
  88. package/src/med_editor//351/225/277/346/234/237/345/214/273/345/230/261/345/215/225.json +1070 -0
  89. package/lib/doc-ruler.d.ts +0 -51
  90. package/lib/doc-ruler.js.map +0 -1
  91. package/lib/framework/common-util.d.ts +0 -63
  92. package/lib/framework/common-util.js +0 -178
  93. package/lib/framework/common-util.js.map +0 -1
  94. package/lib/framework/document-change.d.ts +0 -265
  95. package/lib/framework/document-change.js.map +0 -1
  96. package/lib/framework/document-combine.d.ts +0 -24
  97. package/lib/framework/document-combine.js.map +0 -1
  98. package/lib/framework/document-comment.d.ts +0 -46
  99. package/lib/framework/document-comment.js.map +0 -1
  100. package/lib/framework/document-context.d.ts +0 -149
  101. package/lib/framework/document-context.js.map +0 -1
  102. package/lib/framework/document-eval-func.d.ts +0 -18
  103. package/lib/framework/document-eval-func.js.map +0 -1
  104. package/lib/framework/document-event.d.ts +0 -213
  105. package/lib/framework/document-event.js.map +0 -1
  106. package/lib/framework/document-history.d.ts +0 -26
  107. package/lib/framework/document-history.js.map +0 -1
  108. package/lib/framework/document-images-loader.d.ts +0 -16
  109. package/lib/framework/document-images-loader.js.map +0 -1
  110. package/lib/framework/document-input-cursor.d.ts +0 -78
  111. package/lib/framework/document-input-cursor.js.map +0 -1
  112. package/lib/framework/document-paint.d.ts +0 -34
  113. package/lib/framework/document-paint.js.map +0 -1
  114. package/lib/framework/document-print-offscreen.d.ts +0 -38
  115. package/lib/framework/document-print-offscreen.js.map +0 -1
  116. package/lib/framework/document-print.d.ts +0 -60
  117. package/lib/framework/document-print.js.map +0 -1
  118. package/lib/framework/document-segmenter.d.ts +0 -2
  119. package/lib/framework/document-segmenter.js +0 -106
  120. package/lib/framework/document-segmenter.js.map +0 -1
  121. package/lib/framework/document-selection.d.ts +0 -89
  122. package/lib/framework/document-selection.js.map +0 -1
  123. package/lib/framework/document-template.d.ts +0 -4
  124. package/lib/framework/document-template.js.map +0 -1
  125. package/lib/framework/document-textline-mode.d.ts +0 -7
  126. package/lib/framework/document-textline-mode.js +0 -30
  127. package/lib/framework/document-textline-mode.js.map +0 -1
  128. package/lib/framework/element-define.d.ts +0 -319
  129. package/lib/framework/element-define.js.map +0 -1
  130. package/lib/framework/element-event-define.d.ts +0 -99
  131. package/lib/framework/element-event-define.js +0 -108
  132. package/lib/framework/element-event-define.js.map +0 -1
  133. package/lib/framework/element-measure.d.ts +0 -97
  134. package/lib/framework/element-measure.js.map +0 -1
  135. package/lib/framework/element-paint.d.ts +0 -42
  136. package/lib/framework/element-paint.js.map +0 -1
  137. package/lib/framework/element-props.d.ts +0 -301
  138. package/lib/framework/element-props.js.map +0 -1
  139. package/lib/framework/element-reader.d.ts +0 -19
  140. package/lib/framework/element-reader.js.map +0 -1
  141. package/lib/framework/element-render-cut.d.ts +0 -55
  142. package/lib/framework/element-render-cut.js.map +0 -1
  143. package/lib/framework/element-serialize.d.ts +0 -30
  144. package/lib/framework/element-serialize.js.map +0 -1
  145. package/lib/framework/element-util.d.ts +0 -369
  146. package/lib/framework/element-util.js.map +0 -1
  147. package/lib/framework/impl/checkbox/checkbox-impl.d.ts +0 -24
  148. package/lib/framework/impl/checkbox/checkbox-impl.js.map +0 -1
  149. package/lib/framework/impl/comments/comment-content-impl.d.ts +0 -40
  150. package/lib/framework/impl/comments/comment-content-impl.js.map +0 -1
  151. package/lib/framework/impl/comments/comment-element-impl.d.ts +0 -21
  152. package/lib/framework/impl/comments/comment-element-impl.js.map +0 -1
  153. package/lib/framework/impl/comments/comments-container-impl.d.ts +0 -22
  154. package/lib/framework/impl/comments/comments-container-impl.js.map +0 -1
  155. package/lib/framework/impl/comments/comments-util.d.ts +0 -12
  156. package/lib/framework/impl/comments/comments-util.js.map +0 -1
  157. package/lib/framework/impl/comments/validate-msg-impl.d.ts +0 -21
  158. package/lib/framework/impl/comments/validate-msg-impl.js.map +0 -1
  159. package/lib/framework/impl/data-element/data-decorate-impl.d.ts +0 -30
  160. package/lib/framework/impl/data-element/data-decorate-impl.js.map +0 -1
  161. package/lib/framework/impl/data-element/data-element-barcode.d.ts +0 -31
  162. package/lib/framework/impl/data-element/data-element-barcode.js.map +0 -1
  163. package/lib/framework/impl/data-element/data-element-base-impl.d.ts +0 -68
  164. package/lib/framework/impl/data-element/data-element-base-impl.js.map +0 -1
  165. package/lib/framework/impl/data-element/data-element-check-impl.d.ts +0 -35
  166. package/lib/framework/impl/data-element/data-element-check-impl.js.map +0 -1
  167. package/lib/framework/impl/data-element/data-element-date-impl.d.ts +0 -23
  168. package/lib/framework/impl/data-element/data-element-date-impl.js.map +0 -1
  169. package/lib/framework/impl/data-element/data-element-group-impl.d.ts +0 -23
  170. package/lib/framework/impl/data-element/data-element-group-impl.js.map +0 -1
  171. package/lib/framework/impl/data-element/data-element-image-impl.d.ts +0 -30
  172. package/lib/framework/impl/data-element/data-element-image-impl.js.map +0 -1
  173. package/lib/framework/impl/data-element/data-element-list-impl.d.ts +0 -22
  174. package/lib/framework/impl/data-element/data-element-list-impl.js.map +0 -1
  175. package/lib/framework/impl/data-element/data-element-text-impl.d.ts +0 -23
  176. package/lib/framework/impl/data-element/data-element-text-impl.js.map +0 -1
  177. package/lib/framework/impl/decorate/fill-null-space-imple.d.ts +0 -21
  178. package/lib/framework/impl/decorate/fill-null-space-imple.js.map +0 -1
  179. package/lib/framework/impl/document/doc-body-impl.d.ts +0 -27
  180. package/lib/framework/impl/document/doc-body-impl.js.map +0 -1
  181. package/lib/framework/impl/document/doc-body-part-impl.d.ts +0 -30
  182. package/lib/framework/impl/document/doc-body-part-impl.js.map +0 -1
  183. package/lib/framework/impl/document/doc-container-impl.d.ts +0 -16
  184. package/lib/framework/impl/document/doc-container-impl.js +0 -21
  185. package/lib/framework/impl/document/doc-container-impl.js.map +0 -1
  186. package/lib/framework/impl/document/doc-footer-impl.d.ts +0 -26
  187. package/lib/framework/impl/document/doc-footer-impl.js.map +0 -1
  188. package/lib/framework/impl/document/doc-header-impl.d.ts +0 -26
  189. package/lib/framework/impl/document/doc-header-impl.js.map +0 -1
  190. package/lib/framework/impl/document/doc-impl.d.ts +0 -61
  191. package/lib/framework/impl/document/doc-impl.js.map +0 -1
  192. package/lib/framework/impl/media-formula/menstrual-history.d.ts +0 -35
  193. package/lib/framework/impl/media-formula/menstrual-history.js.map +0 -1
  194. package/lib/framework/impl/paragraph/p-impl.d.ts +0 -45
  195. package/lib/framework/impl/paragraph/p-impl.js.map +0 -1
  196. package/lib/framework/impl/picture/image-impl.d.ts +0 -31
  197. package/lib/framework/impl/picture/image-impl.js.map +0 -1
  198. package/lib/framework/impl/radio/radio-impl.d.ts +0 -22
  199. package/lib/framework/impl/radio/radio-impl.js.map +0 -1
  200. package/lib/framework/impl/symbol/br-symbol-impl.d.ts +0 -22
  201. package/lib/framework/impl/symbol/br-symbol-impl.js.map +0 -1
  202. package/lib/framework/impl/symbol/p-symbol-impl.d.ts +0 -19
  203. package/lib/framework/impl/symbol/p-symbol-impl.js.map +0 -1
  204. package/lib/framework/impl/table/table-cell-impl.d.ts +0 -37
  205. package/lib/framework/impl/table/table-cell-impl.js.map +0 -1
  206. package/lib/framework/impl/table/table-impl.d.ts +0 -55
  207. package/lib/framework/impl/table/table-impl.js.map +0 -1
  208. package/lib/framework/impl/table/table-row-impl.d.ts +0 -26
  209. package/lib/framework/impl/table/table-row-impl.js.map +0 -1
  210. package/lib/framework/impl/table/table-split-cell-patch.d.ts +0 -20
  211. package/lib/framework/impl/table/table-split-cell-patch.js.map +0 -1
  212. package/lib/framework/impl/table/table-split-cell.d.ts +0 -90
  213. package/lib/framework/impl/table/table-split-cell.js.map +0 -1
  214. package/lib/framework/impl/table/table-util.d.ts +0 -150
  215. package/lib/framework/impl/table/table-util.js.map +0 -1
  216. package/lib/framework/impl/text/text-impl.d.ts +0 -32
  217. package/lib/framework/impl/text/text-impl.js.map +0 -1
  218. package/lib/framework/impl/text/track-run-impl.d.ts +0 -27
  219. package/lib/framework/impl/text/track-run-impl.js.map +0 -1
  220. package/lib/framework/notify.d.ts +0 -13
  221. package/lib/framework/notify.js.map +0 -1
  222. package/lib/framework/range-util.d.ts +0 -40
  223. package/lib/framework/range-util.js.map +0 -1
  224. package/lib/framework/render-context.d.ts +0 -91
  225. package/lib/framework/render-context.js.map +0 -1
  226. package/lib/framework/render-define.d.ts +0 -109
  227. package/lib/framework/render-define.js.map +0 -1
  228. package/lib/framework/selection-overlays.d.ts +0 -30
  229. package/lib/framework/selection-overlays.js.map +0 -1
  230. package/lib/texteditor.d.ts +0 -318
  231. package/lib/texteditor.js.map +0 -1
  232. package/lib/util/subject.d.ts +0 -34
  233. package/lib/util/subject.js +0 -88
  234. package/lib/util/subject.js.map +0 -1
  235. package/lib/util/table-bind.d.ts +0 -5
  236. package/lib/util/table-bind.js.map +0 -1
  237. package/tsconfig.json +0 -25
@@ -1,27 +1,46 @@
1
+ import { EditorContext } from "./document-context";
2
+ import { Position, ViewOptions } from "./element-define";
3
+ import { TextProps } from "./element-props";
1
4
  import { ElementUtil } from "./element-util";
5
+ import { DocumentRenderObject } from "./impl/document/doc-impl";
2
6
  import { ParagraphElement } from "./impl/paragraph/p-impl";
7
+ import { TextGroupElement, TextGroupRenderObject } from "./impl/text/text-impl";
8
+
9
+ export interface TextUnits {
10
+ sourceSize: number,
11
+ actualSize: number,
12
+ char: string
13
+ }
14
+
15
+ export type RenderContenxtType = {
16
+ contentContext: PaintContent;
17
+ overlaysContext: PaintContent;
18
+ drawMode: 'view' | 'print';
19
+ clear(): void;
20
+ viewOptions: ViewOptions;
21
+ docCtx: EditorContext;
22
+ commit(pageSetting: { width: number, height: number } | null): void
23
+ };
24
+
3
25
  export class RenderContenxt {
4
- mainCtx;
5
- viewOptions;
6
- docCtx;
7
- contentContext;
8
- overlaysContext;
9
- drawMode = 'view';
10
- contentOffCanvas;
11
- overlayOffCanvas;
12
- constructor(mainCtx, viewOptions, docCtx) {
13
- this.mainCtx = mainCtx;
14
- this.viewOptions = viewOptions;
15
- this.docCtx = docCtx;
26
+ contentContext!: PaintContent;
27
+ overlaysContext!: PaintContent;
28
+ drawMode: 'view' | 'print' = 'view';
29
+ private contentOffCanvas!: HTMLCanvasElement;
30
+ private overlayOffCanvas!: HTMLCanvasElement;
31
+
32
+ constructor(public mainCtx: CanvasRenderingContext2D, public viewOptions: ViewOptions, public docCtx: EditorContext) {
16
33
  this.createNativeCanvas();
17
34
  }
18
- createNativeCanvas() {
35
+
36
+ private createNativeCanvas() {
19
37
  this.contentOffCanvas = document.createElement('canvas');
20
38
  this.overlayOffCanvas = document.createElement('canvas');
21
- this.contentContext = new PaintContent(this.contentOffCanvas.getContext('2d'), this.viewOptions);
22
- this.overlaysContext = new PaintContent(this.overlayOffCanvas.getContext('2d'), this.viewOptions);
39
+ this.contentContext = new PaintContent(this.contentOffCanvas.getContext('2d') as CanvasRenderingContext2D, this.viewOptions);
40
+ this.overlaysContext = new PaintContent(this.overlayOffCanvas.getContext('2d') as CanvasRenderingContext2D, this.viewOptions);
23
41
  this.setCanvasProps();
24
42
  }
43
+
25
44
  // private createOffscreenCanvas() {
26
45
  // this.contentOffCanvas = new OffscreenCanvas(250, 250);
27
46
  // this.overlayOffCanvas = new OffscreenCanvas(250, 250);
@@ -29,9 +48,10 @@ export class RenderContenxt {
29
48
  // this.overlaysContext = new PaintContent(this.overlayOffCanvas.getContext('2d') as OffscreenCanvasRenderingContext2D, this.viewOptions);
30
49
  // this.setCanvasProps();
31
50
  // }
32
- setCanvasProps(pageSetting = null) {
51
+
52
+ setCanvasProps(pageSetting: { width: number, height: number } | null = null): void {
33
53
  if (!pageSetting) {
34
- pageSetting = { width: this.viewOptions.viewSettings.width, height: this.viewOptions.viewPaintHeight };
54
+ pageSetting = { width: this.viewOptions.viewSettings.width, height: this.viewOptions.viewPaintHeight }
35
55
  if (this.viewOptions.showReviewWindow) {
36
56
  pageSetting.width += this.viewOptions.reviewWindowWidth;
37
57
  }
@@ -40,19 +60,21 @@ export class RenderContenxt {
40
60
  width: this.viewOptions.viewSettings.width,
41
61
  height: this.viewOptions.viewPaintHeight
42
62
  };
43
- ElementUtil.setCanvasProps(this.contentOffCanvas, this.contentContext.ctx, pageSetting, this.viewOptions.scale);
44
- ElementUtil.setCanvasProps(this.overlayOffCanvas, this.overlaysContext.ctx, pageSetting, this.viewOptions.scale);
45
- ElementUtil.setCanvasProps(this.mainCtx.canvas, this.mainCtx, pageSetting, this.viewOptions.scale);
63
+ ElementUtil.setCanvasProps(this.contentOffCanvas, this.contentContext.ctx, pageSetting, this.viewOptions.scale)
64
+ ElementUtil.setCanvasProps(this.overlayOffCanvas, this.overlaysContext.ctx, pageSetting, this.viewOptions.scale)
65
+ ElementUtil.setCanvasProps(this.mainCtx.canvas, this.mainCtx, pageSetting, this.viewOptions.scale)
46
66
  }
47
- clear() {
67
+
68
+ clear(): void {
48
69
  this.contentContext.clear();
49
70
  this.overlaysContext.clear();
50
71
  this.mainCtx.clearRect(0, 0, this.mainCtx.canvas.width, this.mainCtx.canvas.height);
51
72
  }
52
- commit(pageSetting = null) {
73
+
74
+ commit(pageSetting: { width: number, height: number } | null = null): void {
53
75
  //pageSetting = pageSetting || { width: this.viewOptions.viewSettings.width, height: this.viewOptions.viewPaintHeight };
54
76
  if (!pageSetting) {
55
- pageSetting = { width: this.viewOptions.viewSettings.width, height: this.viewOptions.viewPaintHeight };
77
+ pageSetting = { width: this.viewOptions.viewSettings.width, height: this.viewOptions.viewPaintHeight }
56
78
  if (this.viewOptions.showReviewWindow) {
57
79
  pageSetting.width += this.viewOptions.reviewWindowWidth;
58
80
  }
@@ -62,34 +84,38 @@ export class RenderContenxt {
62
84
  if (!this.overlayOffCanvas.width || !this.overlayOffCanvas.height) {
63
85
  return;
64
86
  }
87
+
65
88
  this.mainCtx.drawImage(this.overlayOffCanvas, 0, 0, ElementUtil.getDprNumber(width, this.viewOptions.scale), ElementUtil.getDprNumber(height));
66
89
  //console.time('drawImage');
67
90
  this.mainCtx.drawImage(this.contentOffCanvas, 0, 0, ElementUtil.getDprNumber(width, this.viewOptions.scale), ElementUtil.getDprNumber(height));
68
91
  //console.timeEnd('drawImage');
69
92
  }
93
+
70
94
  }
95
+
71
96
  export class PaintContent {
72
- ctx;
73
- viewOptions;
74
- constructor(ctx, viewOptions) {
75
- this.ctx = ctx;
76
- this.viewOptions = viewOptions;
97
+ constructor(public ctx: CanvasRenderingContext2D, private viewOptions: ViewOptions) {
77
98
  this.init();
78
99
  }
79
- init() {
100
+
101
+ init(): void {
80
102
  this.ctx.textBaseline = 'alphabetic';
81
103
  }
82
- setGlobalAlpha(alpha) {
104
+
105
+ setGlobalAlpha(alpha: number): void {
83
106
  this.ctx.globalAlpha = alpha;
84
107
  }
85
- getGlobalAlpha() {
108
+
109
+ getGlobalAlpha(): number {
86
110
  return this.ctx.globalAlpha;
87
111
  }
88
- clear() {
112
+
113
+ clear(): void {
89
114
  this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);
90
115
  this.init();
91
116
  }
92
- drawText(text, textProps, x, y, width, height) {
117
+
118
+ drawText(text: string, textProps: TextProps, x: number, y: number, width: number, height: number): void {
93
119
  if (textProps.background) {
94
120
  this.fillRect(x, y, width, height, textProps.background);
95
121
  }
@@ -109,7 +135,8 @@ export class PaintContent {
109
135
  this.drawLine(x, y, width, textProps.color, 1);
110
136
  }
111
137
  }
112
- fillCircular(x, y, r, color = 'black') {
138
+
139
+ fillCircular(x: number, y: number, r: number, color: string = 'black'): void {
113
140
  this.ctx.save();
114
141
  this.ctx.beginPath();
115
142
  this.ctx.fillStyle = color;
@@ -117,8 +144,9 @@ export class PaintContent {
117
144
  this.ctx.fill();
118
145
  this.ctx.restore();
119
146
  }
120
- drawTextUnits(textGroupRender, x, y) {
121
- const textEle = textGroupRender.element;
147
+
148
+ drawTextUnits(textGroupRender: TextGroupRenderObject, x: number, y: number): void {
149
+ const textEle = textGroupRender.element as TextGroupElement;
122
150
  const textProps = textEle.props;
123
151
  const { width, height } = textGroupRender.rect;
124
152
  this.ctx.save();
@@ -151,20 +179,24 @@ export class PaintContent {
151
179
  }
152
180
  this.ctx.restore();
153
181
  }
154
- getParaLineHeight(textEle) {
182
+
183
+ getParaLineHeight(textEle: TextGroupElement): number {
155
184
  const para = ElementUtil.getParentByType(textEle, ParagraphElement);
156
185
  if (!para) {
157
- throw new Error('未能找到父级段落元素');
186
+ throw new Error('未能找到父级段落元素')
158
187
  }
159
188
  return para.props.lineHeight;
160
189
  }
161
- measureText(text, textProps) {
190
+
191
+ measureText(text: string, textProps: TextProps): { width: number, height: number } {
162
192
  this.ctx.fillStyle = textProps.color;
163
193
  this.ctx.font = textProps.getFont();
164
194
  const textMeasure = this.ctx.measureText(text);
165
195
  return { width: textMeasure.width, height: textProps.fontSize };
166
196
  }
167
- measureTextUnits(units, textProps) {
197
+
198
+
199
+ measureTextUnits(units: Array<TextUnits>, textProps: TextProps): void {
168
200
  this.ctx.font = textProps.getFont();
169
201
  const letterSpace = textProps.letterSpace ?? 0;
170
202
  for (let i = 0; i < units.length; i++) {
@@ -174,16 +206,21 @@ export class PaintContent {
174
206
  char.sourceSize = textMeasure.width;
175
207
  }
176
208
  }
177
- clearRect(x, y, width, height) {
209
+
210
+ clearRect(x: number, y: number, width: number, height: number): void {
178
211
  this.ctx.clearRect(x, y, width, height);
179
212
  }
180
- save() {
213
+
214
+ save(): void {
181
215
  this.ctx.save();
182
216
  }
183
- restore() {
217
+
218
+ restore(): void {
184
219
  this.ctx.restore();
185
220
  }
186
- strokeRect(x, y, width, height, strokeColor = 'black', strokeWidth = 1) {
221
+
222
+
223
+ strokeRect(x: number, y: number, width: number, height: number, strokeColor = 'black', strokeWidth = 1): void {
187
224
  x = Math.ceil(x);
188
225
  y = Math.ceil(y);
189
226
  x += 0.5;
@@ -195,8 +232,10 @@ export class PaintContent {
195
232
  this.ctx.restore();
196
233
  //this.strokeLines([{ x, y }, { x: x + width, y }, { x: x + width, y: y + height }, { x, y: y + height }, { x, y }], strokeWidth, strokeColor);
197
234
  }
235
+
198
236
  //strokeRectImageData(x:number)
199
- drawLine(x, y, width, lineColor = 'black', lineWidth = 1) {
237
+
238
+ drawLine(x: number, y: number, width: number, lineColor = 'black', lineWidth = 1): void {
200
239
  x = Math.ceil(x);
201
240
  y = Math.ceil(y);
202
241
  x += 0.5;
@@ -211,7 +250,8 @@ export class PaintContent {
211
250
  this.ctx.closePath();
212
251
  this.ctx.restore();
213
252
  }
214
- fillRect(x, y, width, height, fillColor = 'white', shadowBlur = 0, shadowColor = 'black') {
253
+
254
+ fillRect(x: number, y: number, width: number, height: number, fillColor = 'white', shadowBlur = 0, shadowColor = 'black'): void {
215
255
  x = Math.ceil(x);
216
256
  y = Math.ceil(y);
217
257
  x += 0.5;
@@ -230,7 +270,8 @@ export class PaintContent {
230
270
  this.ctx.closePath();
231
271
  this.ctx.restore();
232
272
  }
233
- strokeLines(lines, width = 1, strokeColor = 'black') {
273
+
274
+ strokeLines(lines: Array<Position>, width = 1, strokeColor = 'black'): void {
234
275
  this.ctx.save();
235
276
  this.ctx.strokeStyle = strokeColor;
236
277
  this.ctx.lineWidth = width;
@@ -244,8 +285,7 @@ export class PaintContent {
244
285
  y += 0.5;
245
286
  if (i === 0) {
246
287
  this.ctx.moveTo(x, y);
247
- }
248
- else {
288
+ } else {
249
289
  this.ctx.lineTo(x, y);
250
290
  }
251
291
  }
@@ -253,7 +293,8 @@ export class PaintContent {
253
293
  this.ctx.closePath();
254
294
  this.ctx.restore();
255
295
  }
256
- fillLines(lines, width = 1, fillColor = 'black') {
296
+
297
+ fillLines(lines: Array<Position>, width = 1, fillColor = 'black'): void {
257
298
  this.ctx.save();
258
299
  this.ctx.beginPath();
259
300
  this.ctx.fillStyle = fillColor;
@@ -266,8 +307,7 @@ export class PaintContent {
266
307
  y += 0.5;
267
308
  if (i === 0) {
268
309
  this.ctx.moveTo(x, y);
269
- }
270
- else {
310
+ } else {
271
311
  this.ctx.lineTo(x, y);
272
312
  }
273
313
  }
@@ -275,17 +315,20 @@ export class PaintContent {
275
315
  this.ctx.closePath();
276
316
  this.ctx.restore();
277
317
  }
278
- drawCheckBox(x, y, width, height, isChecked) {
318
+
319
+
320
+ drawCheckBox(x: number, y: number, width: number, height: number, isChecked: boolean): void {
279
321
  this.strokeRect(x, y, width, height, 'black', 1);
280
322
  if (isChecked) {
281
- const lines = [];
323
+ const lines: Array<Position> = [];
282
324
  lines.push({ x: x + (Math.ceil(width / 4)), y: y + (Math.ceil(height / 2)) });
283
325
  lines.push({ x: x + (Math.ceil(width / 2)), y: y + (Math.floor(height * 3 / 4)) });
284
326
  lines.push({ x: x + (Math.ceil(width * 3 / 4)), y: y + (Math.ceil(height / 4)) });
285
327
  this.strokeLines(lines, 2, 'red');
286
328
  }
287
329
  }
288
- drawRadioBox(x, y, width, height, isChecked) {
330
+
331
+ drawRadioBox(x: number, y: number, width: number, height: number, isChecked: boolean): void {
289
332
  x = x + Math.floor(width / 2);
290
333
  y = y + Math.floor(height / 2);
291
334
  width = Math.floor(width / 2);
@@ -304,6 +347,8 @@ export class PaintContent {
304
347
  }
305
348
  this.ctx.restore();
306
349
  }
350
+
351
+
307
352
  /**
308
353
  * 绘制图片
309
354
  * @param image
@@ -316,10 +361,11 @@ export class PaintContent {
316
361
  * @param dWidth image在目标canvas上绘制的宽度
317
362
  * @param dHeight image在目标canvas上绘制的高度
318
363
  */
319
- drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {
364
+ drawImage(image: HTMLImageElement, sx: number, sy: number, sWidth: number, sHeight: number, dx: number, dy: number, dWidth: number, dHeight: number): void {
320
365
  this.ctx.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
321
366
  }
322
- drawDashLine(points, lineDash, lineColor = 'black', lineWidth = 1) {
367
+
368
+ drawDashLine(points: Array<Position>, lineDash: Array<number>, lineColor = 'black', lineWidth = 1): void {
323
369
  this.ctx.save();
324
370
  this.ctx.setLineDash(lineDash);
325
371
  this.ctx.strokeStyle = lineColor;
@@ -331,8 +377,7 @@ export class PaintContent {
331
377
  y += 0.5;
332
378
  if (i === 0) {
333
379
  this.ctx.moveTo(x, y);
334
- }
335
- else {
380
+ } else {
336
381
  this.ctx.lineTo(x, y);
337
382
  }
338
383
  }
@@ -340,7 +385,8 @@ export class PaintContent {
340
385
  this.ctx.closePath();
341
386
  this.ctx.restore();
342
387
  }
343
- roundRect(x, y, width, height, radius, fill, stroke) {
388
+
389
+ roundRect(x: number, y: number, width: number, height: number, radius: number | { tl: number, tr: number, br: number, bl: number }, fill: boolean, stroke: boolean) {
344
390
  x += 0.5;
345
391
  y += 0.5;
346
392
  if (typeof stroke === 'undefined') {
@@ -348,8 +394,7 @@ export class PaintContent {
348
394
  }
349
395
  if (typeof radius === 'number') {
350
396
  radius = { tl: radius, tr: radius, br: radius, bl: radius };
351
- }
352
- else {
397
+ } else {
353
398
  var defaultRadius = { tl: 0, tr: 0, br: 0, bl: 0 };
354
399
  for (var side in defaultRadius) {
355
400
  radius[side] = radius[side] || defaultRadius[side];
@@ -373,12 +418,14 @@ export class PaintContent {
373
418
  if (stroke) {
374
419
  this.ctx.stroke();
375
420
  }
421
+
376
422
  }
377
- clip(x, y, width, height) {
423
+
424
+ clip(x: number, y: number, width: number, height: number): void {
378
425
  this.ctx.save();
379
426
  this.ctx.beginPath();
380
427
  this.ctx.rect(x, y, width, height);
381
428
  this.ctx.clip();
382
429
  }
430
+
383
431
  }
384
- //# sourceMappingURL=render-context.js.map
@@ -1,36 +1,37 @@
1
- import { Rect, MarginProps, PaddingProps } from './element-define';
1
+ import { Rect, Element, MarginProps, PaddingProps, Position } from './element-define'
2
+ import { RenderContenxtType } from './render-context';
2
3
  /**
3
4
  * 定义组件的UI形式的渲染
4
5
  */
5
- export class RenderObject {
6
- element;
7
- margin;
8
- padding;
9
- rect = new Rect();
10
- parent;
6
+ export abstract class RenderObject<T extends Element = Element> {
7
+ margin!: MarginProps;
8
+ padding!: PaddingProps;
9
+ rect: Rect = new Rect();
10
+ parent!: BranchRenderObject;
11
11
  /**
12
12
  * 可点击性,例如:null-text 占位符元素不具备可点击能力
13
13
  */
14
- disableClick;
15
- constructor(element) {
16
- this.element = element;
14
+ disableClick!: boolean;
15
+ constructor(public element: T) {
17
16
  this.margin = new MarginProps();
18
17
  this.padding = new PaddingProps();
19
18
  }
20
- pagePaintCompleted(ctx, position) { }
21
- destroy() {
19
+ abstract clone(): RenderObject;
20
+ pagePaintCompleted(ctx: RenderContenxtType, position: Position): void { }
21
+ destroy(): void {
22
22
  //this.parent = null;
23
23
  //this.margin = null;
24
24
  //this.padding = null;
25
25
  //this.rect = null;
26
26
  //this.element = null;
27
27
  }
28
+
28
29
  /**
29
30
  * 获取内容区域框体
30
- * @param render
31
- * @returns
31
+ * @param render
32
+ * @returns
32
33
  */
33
- getInnnerRect() {
34
+ getInnnerRect(): Rect {
34
35
  const { padding } = this;
35
36
  const rect = new Rect();
36
37
  rect.x = padding.left;
@@ -41,64 +42,73 @@ export class RenderObject {
41
42
  }
42
43
  return rect;
43
44
  }
44
- getInnerMaxWidth() {
45
+
46
+ getInnerMaxWidth(): number {
45
47
  if (!this.rect.maxWidth) {
46
- throw new Error('this.rect.maxWidth is null');
48
+ throw new Error('this.rect.maxWidth is null')
47
49
  }
48
50
  const { padding, margin } = this;
49
51
  return this.rect.maxWidth - padding.left - padding.right - margin.left - margin.bottom;
50
52
  }
53
+
51
54
  /**
52
55
  * 根据内框内容高度,更新外框框体高度
53
- * @param render
54
- * @param innerRect
56
+ * @param render
57
+ * @param innerRect
55
58
  */
56
- updateRenderHeight(innerRect) {
57
- const innnerHeight = typeof innerRect === 'number' ? innerRect : innerRect.height;
59
+ updateRenderHeight(innerRect: Rect | number): void {
60
+ const innnerHeight = typeof innerRect === 'number' ? innerRect : (<Rect>innerRect).height;
58
61
  const { padding, margin } = this;
59
62
  //外层容器高度等于内容高度+外边距+内边距
60
63
  this.rect.height = innnerHeight + padding.top + padding.bottom;
61
64
  }
62
- getIndex() {
65
+
66
+ getIndex(): number {
63
67
  if (this.parent) {
64
68
  return this.parent.getChildIndex(this);
65
- }
66
- else {
69
+ } else {
67
70
  return 0;
68
71
  }
69
72
  }
70
73
  }
74
+
71
75
  /**
72
76
  * 叶子节点渲染元素
73
77
  */
74
- export class LeafRenderObject extends RenderObject {
75
- constructor(element) {
76
- super(element);
78
+ export abstract class LeafRenderObject<T extends Element = Element> extends RenderObject<T> {
79
+ constructor(element: T | null) {
80
+ super(element as T);
77
81
  }
82
+ abstract render(ctx: RenderContenxtType, position: { x: number, y: number }): void;
83
+
78
84
  }
85
+
79
86
  /**
80
87
  * 枝干节点渲染元素
81
88
  */
82
- export class BranchRenderObject extends RenderObject {
83
- constructor(element) {
84
- super(element);
89
+ export abstract class BranchRenderObject<T extends Element = Element> extends RenderObject<T> {
90
+ constructor(element: T | null) {
91
+ super(element as T);
85
92
  }
86
- chilren = [];
87
- getItems() {
93
+ private chilren: Array<RenderObject> = [];
94
+ getItems(): Array<RenderObject> {
88
95
  return this.chilren;
89
96
  }
90
- addChild(...items) {
97
+
98
+ addChild(...items: Array<RenderObject>): void {
91
99
  for (let i = 0; i < items.length; i++) {
92
100
  const item = items[i];
93
101
  item.parent = this;
94
102
  this.chilren.push(item);
95
103
  }
96
104
  }
97
- insertChild(item, index) {
105
+
106
+ insertChild(item: RenderObject, index: number): void {
98
107
  this.chilren.splice(index, 0, item);
99
108
  item.parent = this;
100
109
  }
101
- removeChild(child) {
110
+
111
+ removeChild(child: RenderObject): void {
102
112
  const index = this.chilren.indexOf(child);
103
113
  if (index < 0) {
104
114
  throw new Error('为查找到当前元素');
@@ -108,17 +118,18 @@ export class BranchRenderObject extends RenderObject {
108
118
  }
109
119
  this.chilren.splice(index, 1);
110
120
  }
111
- removeChildByIndex(index) {
121
+
122
+ removeChildByIndex(index: number): void {
112
123
  const child = this.chilren[index];
113
124
  if (child) {
114
125
  this.chilren.splice(index, 1);
115
126
  //child.parent = null;
116
- }
117
- else {
127
+ } else {
118
128
  throw new Error('为查找到当前元素');
119
129
  }
120
130
  }
121
- clear() {
131
+
132
+ clear(): void {
122
133
  const items = [...this.chilren];
123
134
  for (let i = items.length - 1; i >= 0; i--) {
124
135
  this.removeChildByIndex(i);
@@ -127,13 +138,20 @@ export class BranchRenderObject extends RenderObject {
127
138
  get length() {
128
139
  return this.chilren.length;
129
140
  }
130
- getChild(index) {
131
- return this.chilren[index];
141
+
142
+
143
+ getChild<T extends RenderObject = RenderObject>(index: number): T {
144
+ return this.chilren[index] as T;
132
145
  }
133
- getChildIndex(child) {
146
+
147
+ getChildIndex(child: RenderObject): number {
134
148
  return this.chilren.indexOf(child);
135
149
  }
136
- destroy() {
150
+
151
+ abstract beginRender(ctx: RenderContenxtType, position: Position): void;
152
+ abstract endRender(ctx: RenderContenxtType, position: Position): void;
153
+
154
+ destroy(): void {
137
155
  super.destroy();
138
156
  const len = this.length;
139
157
  for (let i = len - 1; i >= 0; i--) {
@@ -145,51 +163,62 @@ export class BranchRenderObject extends RenderObject {
145
163
  //this.chilren = null;
146
164
  }
147
165
  }
166
+
167
+
148
168
  /**
149
169
  * 块级渲染元素
150
170
  */
151
- export class BlockContentRenderObject extends BranchRenderObject {
152
- setRenderWidth(maxWidth) {
171
+ export abstract class BlockContentRenderObject<T extends Element = Element> extends BranchRenderObject<T> {
172
+ setRenderWidth(maxWidth: number): void {
153
173
  this.rect.maxWidth = maxWidth;
154
174
  this.rect.width = maxWidth;
155
175
  }
156
176
  }
157
- export class InlineGroupRenderObject extends BranchRenderObject {
177
+
178
+ export abstract class InlineGroupRenderObject<T extends Element = Element> extends BranchRenderObject<T> {
158
179
  }
180
+
159
181
  /**
160
182
  * 包含块级渲染元素的容器元素,例如body、table-cell等
161
183
  */
162
- export class BlockContainerRenderObject extends BranchRenderObject {
163
- setRenderWidth(maxWidth) {
184
+ export abstract class BlockContainerRenderObject<T extends Element = Element> extends BranchRenderObject<T> {
185
+ setRenderWidth(maxWidth: number): void {
164
186
  this.rect.maxWidth = maxWidth;
165
187
  this.rect.width = maxWidth;
166
188
  }
167
189
  }
190
+
168
191
  /**
169
192
  * 多级 ‘BlockLineRectRenderObject’ 包裹元素,例如 p、table
170
193
  */
171
- export class MuiltBlockLineRenderObject extends BlockContentRenderObject {
172
- }
194
+ export abstract class MuiltBlockLineRenderObject<T extends Element = Element> extends BlockContentRenderObject<T> { }
195
+
173
196
  /**
174
197
  * 容器-子内容为多个行内块级元素,例如table-row
175
198
  */
176
- export class InlineBlockContainer extends MuiltBlockLineRenderObject {
177
- }
199
+ export abstract class InlineBlockContainer extends MuiltBlockLineRenderObject { }
200
+
178
201
  /**
179
202
  * 服务于table-cell
180
203
  * 可被多级拆分的元素
181
204
  */
182
- export class InlineMuiltBlockLineRenderObject extends MuiltBlockLineRenderObject {
183
- }
205
+ export abstract class InlineMuiltBlockLineRenderObject extends MuiltBlockLineRenderObject { }
206
+
184
207
  /**
185
208
  * 最小不可分割单位的块级行框,例如 p-line
186
209
  * 一行不可存在于两个页面中,块级行框不能分布在两个页面中
187
210
  */
188
- export class BlockLineRectRenderObject extends BlockContentRenderObject {
211
+ export abstract class BlockLineRectRenderObject extends BlockContentRenderObject { }
212
+
213
+
214
+ export type BorderType = 'left' | 'right' | 'top' | 'bottom' | 'left-middle' | 'right-middle' | 'top-middle' | 'bottom-middle' | 'none' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom';
215
+ export type CursorType = 'text' | 'row-resize' | 'col-resize' | 'none' | 'default' | 'move' | 'pointer' | 'w-resize' | 's-resize' | 'se-resize' | 'ne-resize';
216
+ export enum RenderObjectType {
217
+ Branch = 0,
218
+ Leaf = 1
219
+ }
220
+
221
+ export interface IMeasureRenderStruct<T> {
222
+ rect: Rect,
223
+ render: T
189
224
  }
190
- export var RenderObjectType;
191
- (function (RenderObjectType) {
192
- RenderObjectType[RenderObjectType["Branch"] = 0] = "Branch";
193
- RenderObjectType[RenderObjectType["Leaf"] = 1] = "Leaf";
194
- })(RenderObjectType || (RenderObjectType = {}));
195
- //# sourceMappingURL=render-define.js.map