@krainovsd/markdown-editor 0.0.4 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/lib/cjs/index-Byjf17iv.js +501 -0
  2. package/lib/cjs/index-Byjf17iv.js.map +1 -0
  3. package/lib/cjs/index-lPo-3QDL.js +1374 -0
  4. package/lib/cjs/index-lPo-3QDL.js.map +1 -0
  5. package/lib/cjs/index.js +14 -1
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/esm/extensions/compartments/index.js +8 -0
  8. package/lib/esm/extensions/compartments/index.js.map +1 -0
  9. package/lib/esm/extensions/init-extensions.js +45 -0
  10. package/lib/esm/extensions/init-extensions.js.map +1 -0
  11. package/lib/esm/extensions/keymaps/init-key-map.js +91 -0
  12. package/lib/esm/extensions/keymaps/init-key-map.js.map +1 -0
  13. package/lib/esm/extensions/listeners/get-change-event.js +14 -0
  14. package/lib/esm/extensions/listeners/get-change-event.js.map +1 -0
  15. package/lib/esm/extensions/listeners/get-focus-event.js +16 -0
  16. package/lib/esm/extensions/listeners/get-focus-event.js.map +1 -0
  17. package/lib/esm/extensions/listeners/init-listeners.js +9 -0
  18. package/lib/esm/extensions/listeners/init-listeners.js.map +1 -0
  19. package/lib/esm/extensions/markdown/blockquote/blockquote-constants.js +6 -0
  20. package/lib/esm/extensions/markdown/blockquote/blockquote-constants.js.map +1 -0
  21. package/lib/esm/extensions/markdown/blockquote/blockquote-decoration.js +99 -0
  22. package/lib/esm/extensions/markdown/blockquote/blockquote-decoration.js.map +1 -0
  23. package/lib/esm/extensions/markdown/blockquote/blockquote-widget.js +25 -0
  24. package/lib/esm/extensions/markdown/blockquote/blockquote-widget.js.map +1 -0
  25. package/lib/esm/extensions/markdown/bold/bold-constants.js +5 -0
  26. package/lib/esm/extensions/markdown/bold/bold-constants.js.map +1 -0
  27. package/lib/esm/extensions/markdown/bold/bold-decoration.js +41 -0
  28. package/lib/esm/extensions/markdown/bold/bold-decoration.js.map +1 -0
  29. package/lib/esm/extensions/markdown/code/code-constants.js +6 -0
  30. package/lib/esm/extensions/markdown/code/code-constants.js.map +1 -0
  31. package/lib/esm/extensions/markdown/code/code-decoration.js +109 -0
  32. package/lib/esm/extensions/markdown/code/code-decoration.js.map +1 -0
  33. package/lib/esm/extensions/markdown/code/code-widget.js +83 -0
  34. package/lib/esm/extensions/markdown/code/code-widget.js.map +1 -0
  35. package/lib/esm/extensions/markdown/header/header-constants.js +6 -0
  36. package/lib/esm/extensions/markdown/header/header-constants.js.map +1 -0
  37. package/lib/esm/extensions/markdown/header/header-decoration.js +64 -0
  38. package/lib/esm/extensions/markdown/header/header-decoration.js.map +1 -0
  39. package/lib/esm/extensions/markdown/horizontal/horizontal-constants.js +4 -0
  40. package/lib/esm/extensions/markdown/horizontal/horizontal-constants.js.map +1 -0
  41. package/lib/esm/extensions/markdown/horizontal/horizontal-decoration.js +31 -0
  42. package/lib/esm/extensions/markdown/horizontal/horizontal-decoration.js.map +1 -0
  43. package/lib/esm/extensions/markdown/image/image-constants.js +8 -0
  44. package/lib/esm/extensions/markdown/image/image-constants.js.map +1 -0
  45. package/lib/esm/extensions/markdown/image/image-decoration.js +75 -0
  46. package/lib/esm/extensions/markdown/image/image-decoration.js.map +1 -0
  47. package/lib/esm/extensions/markdown/image/image-widget.js +184 -0
  48. package/lib/esm/extensions/markdown/image/image-widget.js.map +1 -0
  49. package/lib/esm/extensions/markdown/index.js +2 -0
  50. package/lib/esm/extensions/markdown/index.js.map +1 -0
  51. package/lib/esm/extensions/markdown/init-markdown.js +18 -0
  52. package/lib/esm/extensions/markdown/init-markdown.js.map +1 -0
  53. package/lib/esm/extensions/markdown/italic/italic-constants.js +5 -0
  54. package/lib/esm/extensions/markdown/italic/italic-constants.js.map +1 -0
  55. package/lib/esm/extensions/markdown/italic/italic-decoration.js +77 -0
  56. package/lib/esm/extensions/markdown/italic/italic-decoration.js.map +1 -0
  57. package/lib/esm/extensions/markdown/link/auto-link-decoration.js +24 -0
  58. package/lib/esm/extensions/markdown/link/auto-link-decoration.js.map +1 -0
  59. package/lib/esm/extensions/markdown/link/link-constants.js +10 -0
  60. package/lib/esm/extensions/markdown/link/link-constants.js.map +1 -0
  61. package/lib/esm/extensions/markdown/link/link-decoration.js +51 -0
  62. package/lib/esm/extensions/markdown/link/link-decoration.js.map +1 -0
  63. package/lib/esm/extensions/markdown/link/link-label-decoration.js +22 -0
  64. package/lib/esm/extensions/markdown/link/link-label-decoration.js.map +1 -0
  65. package/lib/esm/extensions/markdown/link/link-widget.js +144 -0
  66. package/lib/esm/extensions/markdown/link/link-widget.js.map +1 -0
  67. package/lib/esm/extensions/markdown/list/list-constants.js +7 -0
  68. package/lib/esm/extensions/markdown/list/list-constants.js.map +1 -0
  69. package/lib/esm/extensions/markdown/list/list-decoration.js +38 -0
  70. package/lib/esm/extensions/markdown/list/list-decoration.js.map +1 -0
  71. package/lib/esm/extensions/markdown/list/list-widget.js +33 -0
  72. package/lib/esm/extensions/markdown/list/list-widget.js.map +1 -0
  73. package/lib/esm/extensions/markdown/markdown-decoration.js +105 -0
  74. package/lib/esm/extensions/markdown/markdown-decoration.js.map +1 -0
  75. package/lib/esm/extensions/markdown/markdown-parser.js +6 -0
  76. package/lib/esm/extensions/markdown/markdown-parser.js.map +1 -0
  77. package/lib/esm/extensions/markdown/mention/mention-constants.js +6 -0
  78. package/lib/esm/extensions/markdown/mention/mention-constants.js.map +1 -0
  79. package/lib/esm/extensions/markdown/mention/mention-decoration.js +37 -0
  80. package/lib/esm/extensions/markdown/mention/mention-decoration.js.map +1 -0
  81. package/lib/esm/extensions/markdown/mention/mention-parser.js +25 -0
  82. package/lib/esm/extensions/markdown/mention/mention-parser.js.map +1 -0
  83. package/lib/esm/extensions/markdown/strike-through/strike-through-constants.js +4 -0
  84. package/lib/esm/extensions/markdown/strike-through/strike-through-constants.js.map +1 -0
  85. package/lib/esm/extensions/markdown/strike-through/strike-through-decoration.js +32 -0
  86. package/lib/esm/extensions/markdown/strike-through/strike-through-decoration.js.map +1 -0
  87. package/lib/esm/extensions/markdown/styles.module.scss.js +8 -0
  88. package/lib/esm/extensions/markdown/styles.module.scss.js.map +1 -0
  89. package/lib/esm/extensions/markdown/todo/todo-constants.js +6 -0
  90. package/lib/esm/extensions/markdown/todo/todo-constants.js.map +1 -0
  91. package/lib/esm/extensions/markdown/todo/todo-decoration.js +35 -0
  92. package/lib/esm/extensions/markdown/todo/todo-decoration.js.map +1 -0
  93. package/lib/esm/extensions/markdown/todo/todo-widget.js +51 -0
  94. package/lib/esm/extensions/markdown/todo/todo-widget.js.map +1 -0
  95. package/lib/esm/extensions/settings/init-settings.js +19 -0
  96. package/lib/esm/extensions/settings/init-settings.js.map +1 -0
  97. package/lib/esm/extensions/theme/init-theme.js +15 -0
  98. package/lib/esm/extensions/theme/init-theme.js.map +1 -0
  99. package/lib/esm/extensions/theme/theme-constants.js +17 -0
  100. package/lib/esm/extensions/theme/theme-constants.js.map +1 -0
  101. package/lib/esm/extensions/theme/themes/get-dark-theme.js +40 -0
  102. package/lib/esm/extensions/theme/themes/get-dark-theme.js.map +1 -0
  103. package/lib/esm/extensions/theme/themes/get-highlight-template.js +35 -0
  104. package/lib/esm/extensions/theme/themes/get-highlight-template.js.map +1 -0
  105. package/lib/esm/extensions/theme/themes/get-light-theme.js +40 -0
  106. package/lib/esm/extensions/theme/themes/get-light-theme.js.map +1 -0
  107. package/lib/esm/extensions/theme/themes/get-theme-template.js +69 -0
  108. package/lib/esm/extensions/theme/themes/get-theme-template.js.map +1 -0
  109. package/lib/esm/index.js +1 -1
  110. package/lib/esm/lib/utils/copy-to-clipboard.js +35 -0
  111. package/lib/esm/lib/utils/copy-to-clipboard.js.map +1 -0
  112. package/lib/esm/lib/utils/get-decoration.js +24 -0
  113. package/lib/esm/lib/utils/get-decoration.js.map +1 -0
  114. package/lib/esm/lib/utils/is-in-range.js +8 -0
  115. package/lib/esm/lib/utils/is-in-range.js.map +1 -0
  116. package/lib/esm/lib/utils/is-range-overlap.js +6 -0
  117. package/lib/esm/lib/utils/is-range-overlap.js.map +1 -0
  118. package/lib/esm/lib/utils/tick.js +22 -0
  119. package/lib/esm/lib/utils/tick.js.map +1 -0
  120. package/lib/esm/module/Editor/Editor.js +91 -0
  121. package/lib/esm/module/Editor/Editor.js.map +1 -0
  122. package/lib/esm/module/Editor/lib/init-editor-provider.js +32 -0
  123. package/lib/esm/module/Editor/lib/init-editor-provider.js.map +1 -0
  124. package/lib/esm/module/Editor/lib/init-editor-state.js +18 -0
  125. package/lib/esm/module/Editor/lib/init-editor-state.js.map +1 -0
  126. package/lib/esm/module/Editor/lib/init-editor.js +27 -0
  127. package/lib/esm/module/Editor/lib/init-editor.js.map +1 -0
  128. package/lib/esm/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +29 -0
  129. package/lib/esm/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
  130. package/lib/index.d.ts +137 -0
  131. package/package.json +37 -30
  132. package/lib/cjs/editor-qKPDa91b.js +0 -2
  133. package/lib/cjs/editor-qKPDa91b.js.map +0 -1
  134. package/lib/cjs/markdown_plugin-IXFRDWyN.js +0 -2
  135. package/lib/cjs/markdown_plugin-IXFRDWyN.js.map +0 -1
  136. package/lib/cjs/vendor_vim-BHa51_r7.js +0 -2
  137. package/lib/cjs/vendor_vim-BHa51_r7.js.map +0 -1
  138. package/lib/cjs/vendor_y.next-CVyX1ZQB.js +0 -2
  139. package/lib/cjs/vendor_y.next-CVyX1ZQB.js.map +0 -1
  140. package/lib/cjs/vendor_y.websocket-Dr9ojjFR.js +0 -2
  141. package/lib/cjs/vendor_y.websocket-Dr9ojjFR.js.map +0 -1
  142. package/lib/cjs/vendor_yjs-DXWp84x5.js +0 -2
  143. package/lib/cjs/vendor_yjs-DXWp84x5.js.map +0 -1
  144. package/lib/esm/editor-CLyV23xt.js +0 -2
  145. package/lib/esm/editor-CLyV23xt.js.map +0 -1
  146. package/lib/esm/markdown_plugin-DdBeaig8.js +0 -2
  147. package/lib/esm/markdown_plugin-DdBeaig8.js.map +0 -1
  148. package/lib/esm/vendor_vim-PF2jWG0J.js +0 -2
  149. package/lib/esm/vendor_vim-PF2jWG0J.js.map +0 -1
  150. package/lib/esm/vendor_y.next-B9hhKe5T.js +0 -2
  151. package/lib/esm/vendor_y.next-B9hhKe5T.js.map +0 -1
  152. package/lib/esm/vendor_y.websocket-gIpX3Cmo.js +0 -2
  153. package/lib/esm/vendor_y.websocket-gIpX3Cmo.js.map +0 -1
  154. package/lib/esm/vendor_yjs-otxZW90b.js +0 -2
  155. package/lib/esm/vendor_yjs-otxZW90b.js.map +0 -1
  156. package/tmp/app/helpers/common-test.d.ts +0 -1
  157. package/tmp/app/helpers/full-example.d.ts +0 -1
  158. package/tmp/app/helpers/index.d.ts +0 -5
  159. package/tmp/app/helpers/random-color.d.ts +0 -1
  160. package/tmp/app/helpers/random-string.d.ts +0 -1
  161. package/tmp/app/helpers/stress-test.d.ts +0 -1
  162. package/tmp/app/index.d.ts +0 -1
  163. package/tmp/extensions/compartments/index.d.ts +0 -4
  164. package/tmp/extensions/index.d.ts +0 -8
  165. package/tmp/extensions/init-extensions.d.ts +0 -14
  166. package/tmp/extensions/keymaps/bold-keymap.d.ts +0 -2
  167. package/tmp/extensions/keymaps/index.d.ts +0 -1
  168. package/tmp/extensions/keymaps/init-key-map.d.ts +0 -23
  169. package/tmp/extensions/keymaps/italic-key-map.d.ts +0 -2
  170. package/tmp/extensions/keymaps/line-through-key-map.d.ts +0 -2
  171. package/tmp/extensions/keymaps/underline-key-map.d.ts +0 -2
  172. package/tmp/extensions/listeners/get-change-event.d.ts +0 -6
  173. package/tmp/extensions/listeners/get-focus-event.d.ts +0 -8
  174. package/tmp/extensions/listeners/index.d.ts +0 -3
  175. package/tmp/extensions/listeners/init-listeners.d.ts +0 -4
  176. package/tmp/extensions/markdown/blockquote/blockquote-constants.d.ts +0 -3
  177. package/tmp/extensions/markdown/blockquote/blockquote-decoration.d.ts +0 -2
  178. package/tmp/extensions/markdown/blockquote/blockquote-widget.d.ts +0 -6
  179. package/tmp/extensions/markdown/blockquote/index.d.ts +0 -1
  180. package/tmp/extensions/markdown/bold/bold-constants.d.ts +0 -2
  181. package/tmp/extensions/markdown/bold/bold-decoration.d.ts +0 -2
  182. package/tmp/extensions/markdown/bold/index.d.ts +0 -1
  183. package/tmp/extensions/markdown/code/code-constants.d.ts +0 -3
  184. package/tmp/extensions/markdown/code/code-decoration.d.ts +0 -2
  185. package/tmp/extensions/markdown/code/code-widget.d.ts +0 -13
  186. package/tmp/extensions/markdown/code/index.d.ts +0 -1
  187. package/tmp/extensions/markdown/header/header-constants.d.ts +0 -3
  188. package/tmp/extensions/markdown/header/header-decoration.d.ts +0 -2
  189. package/tmp/extensions/markdown/header/index.d.ts +0 -1
  190. package/tmp/extensions/markdown/horizontal/horizontal-constants.d.ts +0 -1
  191. package/tmp/extensions/markdown/horizontal/horizontal-decoration.d.ts +0 -2
  192. package/tmp/extensions/markdown/horizontal/index.d.ts +0 -1
  193. package/tmp/extensions/markdown/image/image-constants.d.ts +0 -5
  194. package/tmp/extensions/markdown/image/image-decoration.d.ts +0 -2
  195. package/tmp/extensions/markdown/image/image-widget.d.ts +0 -14
  196. package/tmp/extensions/markdown/image/index.d.ts +0 -1
  197. package/tmp/extensions/markdown/index.d.ts +0 -2
  198. package/tmp/extensions/markdown/init-markdown.d.ts +0 -3
  199. package/tmp/extensions/markdown/italic/index.d.ts +0 -1
  200. package/tmp/extensions/markdown/italic/italic-constants.d.ts +0 -2
  201. package/tmp/extensions/markdown/italic/italic-decoration.d.ts +0 -2
  202. package/tmp/extensions/markdown/link/auto-link-decoration.d.ts +0 -2
  203. package/tmp/extensions/markdown/link/index.d.ts +0 -2
  204. package/tmp/extensions/markdown/link/link-constants.d.ts +0 -7
  205. package/tmp/extensions/markdown/link/link-decoration.d.ts +0 -2
  206. package/tmp/extensions/markdown/link/link-label-decoration.d.ts +0 -2
  207. package/tmp/extensions/markdown/link/link-widget.d.ts +0 -17
  208. package/tmp/extensions/markdown/list/index.d.ts +0 -1
  209. package/tmp/extensions/markdown/list/list-constants.d.ts +0 -4
  210. package/tmp/extensions/markdown/list/list-decoration.d.ts +0 -2
  211. package/tmp/extensions/markdown/list/list-widget.d.ts +0 -7
  212. package/tmp/extensions/markdown/markdown-decoration.d.ts +0 -5
  213. package/tmp/extensions/markdown/markdown-parser.d.ts +0 -2
  214. package/tmp/extensions/markdown/markdown-types.d.ts +0 -24
  215. package/tmp/extensions/markdown/mention/index.d.ts +0 -1
  216. package/tmp/extensions/markdown/mention/mention-constants.d.ts +0 -3
  217. package/tmp/extensions/markdown/mention/mention-decoration.d.ts +0 -2
  218. package/tmp/extensions/markdown/mention/mention-parser.d.ts +0 -2
  219. package/tmp/extensions/markdown/strike-through/index.d.ts +0 -1
  220. package/tmp/extensions/markdown/strike-through/strike-through-constants.d.ts +0 -1
  221. package/tmp/extensions/markdown/strike-through/strike-through-decoration.d.ts +0 -2
  222. package/tmp/extensions/markdown/todo/index.d.ts +0 -1
  223. package/tmp/extensions/markdown/todo/todo-constants.d.ts +0 -3
  224. package/tmp/extensions/markdown/todo/todo-decoration.d.ts +0 -2
  225. package/tmp/extensions/markdown/todo/todo-widget.d.ts +0 -11
  226. package/tmp/extensions/settings/index.d.ts +0 -1
  227. package/tmp/extensions/settings/init-settings.d.ts +0 -6
  228. package/tmp/extensions/theme/index.d.ts +0 -4
  229. package/tmp/extensions/theme/init-theme.d.ts +0 -3
  230. package/tmp/extensions/theme/theme-constants.d.ts +0 -14
  231. package/tmp/extensions/theme/theme-types.d.ts +0 -39
  232. package/tmp/extensions/theme/themes/get-dark-theme.d.ts +0 -2
  233. package/tmp/extensions/theme/themes/get-highlight-template.d.ts +0 -6
  234. package/tmp/extensions/theme/themes/get-light-theme.d.ts +0 -2
  235. package/tmp/extensions/theme/themes/get-theme-template.d.ts +0 -2
  236. package/tmp/extensions/theme/themes/index.d.ts +0 -2
  237. package/tmp/index.d.ts +0 -3
  238. package/tmp/lib/index.d.ts +0 -1
  239. package/tmp/lib/utils/copy-to-clipboard.d.ts +0 -1
  240. package/tmp/lib/utils/get-decoration.d.ts +0 -26
  241. package/tmp/lib/utils/index.d.ts +0 -6
  242. package/tmp/lib/utils/is-in-range.d.ts +0 -2
  243. package/tmp/lib/utils/is-range-overlap.d.ts +0 -1
  244. package/tmp/lib/utils/random-string.d.ts +0 -1
  245. package/tmp/lib/utils/tick.d.ts +0 -10
  246. package/tmp/module/Editor/Editor.d.ts +0 -18
  247. package/tmp/module/Editor/Editor.types.d.ts +0 -13
  248. package/tmp/module/Editor/index.d.ts +0 -3
  249. package/tmp/module/Editor/lib/index.d.ts +0 -1
  250. package/tmp/module/Editor/lib/init-editor-provider.d.ts +0 -9
  251. package/tmp/module/Editor/lib/init-editor-state.d.ts +0 -7
  252. package/tmp/module/Editor/lib/init-editor.d.ts +0 -7
  253. package/tmp/module/index.d.ts +0 -1
@@ -1 +0,0 @@
1
- export declare const COMMON_TEST = "\n## Heading level 2\n### Heading level 3\n#### Heading level 4\n##### Heading level 5\n###### Heading level 6\nHeading level 1\n===============\nHeading level 2\n---------------\nI just love **bold text**.\nI just love __bold text__.\nLove**is**bold\n\nItalicized text is the *cat's meow*.\nItalicized text is the _cat's meow_.\nA*cat*meow\n\nThis text is ***really important***.\nThis text is ___really important___.\nThis text is __*really important*__.\nThis text is **_really important_**.\nThis is really***very***important text.\n\n> Dorothy followed her through many of the beautiful rooms in her castle.\n>\n> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.\n\n> Dorothy followed her through many of the beautiful rooms in her castle.\n>\n>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.\n\n> #### The quarterly results look great!\n>\n> - Revenue was off the chart.\n> - Profits were higher than ever.\n>\n> *Everything* is going according to **plan**.\n\n![test](https://mdg.imgix.net/assets/images/san-juan-mountains.jpg?auto=format&fit=clip&q=40&w=300)\n\n\n![test](https://mdg.imgix.net/assets/images/san-juan-mountains.jpg?auto=format&fit=clip&q=40&w=300)\n\n\n\n![test](https://mdg.imgix.net/assets/images/san-juan-mountains.jpg?auto=format&fit=clip&q=40&w=280)\n\n";
@@ -1 +0,0 @@
1
- export declare const FULL_EXAMPLE = "# Heading level 1\n## Heading level 2\n### Heading level 3\n#### Heading level 4\n##### Heading level 5\n###### Heading level 6\nHeading level 1\n===============\nHeading level 2\n---------------\nI just love **bold text**.\nI just love __bold text__.\nLove**is**bold\n\nItalicized text is the *cat's meow*.\nItalicized text is the _cat's meow_.\nA*cat*meow\n\nThis text is ***really important***.\nThis text is ___really important___.\nThis text is __*really important*__.\nThis text is **_really important_**.\nThis is really***very***important text.\n\n> Dorothy followed her through many of the beautiful rooms in her castle.\n>\n> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.\n\n> Dorothy followed her through many of the beautiful rooms in her castle.\n>\n>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.\n\n> #### The quarterly results look great!\n>\n> - Revenue was off the chart.\n> - Profits were higher than ever.\n>\n> *Everything* is going according to **plan**.\n\n1. First item\n2. Second item\n3. Third item\n4. Fourth item\n\n- First item\n- Second item\n- Third item\n - Indented item\n - Indented item\n- Fourth item\n\n+ First item\n+ Second item\n+ Third item\n+ Fourth item\n\n``Use `code` in your Markdown file.``\n``\nuse code\n``\n\n```js\nconst string = \"string\"\nconst bool = true\n```\n---\n***\n____\n\n[Duck Duck Go](https://duckduckgo.com)\n\n<https://www.markdownguide.org>\n**[EFF](https://eff.org)**\n\n![test](https://mdg.imgix.net/assets/images/san-juan-mountains.jpg?auto=format&fit=clip&q=40&w=300)\n\n- [x] task\n- - [x] task\n\n``` JS\nimport { param } from \"module\";\n\nconst btn = document.getElementById('btn');\nlet count: number = 0;\n\nfunction render(){\n btn.innerText = `Count: ${count}`;\n}\n\nbtn.addEventListener(\"click\", (e) => {\n // Count from 1 to 10.\n if (count < 10){\n count += 1;\n render();\n }\n})\n\nconst boolean = true\nconst object = {\n value: boolean\n}\nconst array = [1, \"test\"] \n\n```\n \n";
@@ -1,5 +0,0 @@
1
- export * from "./full-example";
2
- export * from "./random-string";
3
- export * from "./random-color";
4
- export * from "./stress-test";
5
- export * from "./common-test";
@@ -1 +0,0 @@
1
- export declare function randomColor(): string;
@@ -1 +0,0 @@
1
- export declare function randomString(length?: number, allowCharacters?: string): string;
@@ -1 +0,0 @@
1
- export declare const STRESS_TEST: string;
@@ -1 +0,0 @@
1
- import "./global.css";
@@ -1,4 +0,0 @@
1
- import { Compartment } from "@codemirror/state";
2
- export declare const ReadonlyCompartment: Compartment;
3
- export declare const VimModeCompartment: Compartment;
4
- export declare const ThemeCompartment: Compartment;
@@ -1,8 +0,0 @@
1
- export * from "./compartments";
2
- export * from "./init-extensions";
3
- export { getDarkTheme, getLightTheme } from "./theme";
4
- export type { InitKeyMapsOptions, HandleEnterKeyMapEditorFunction, HandleEscapeKeyMapEditorFunction, DefaultKeyMapsOptions, CustomKeyMap, } from "./keymaps";
5
- export type { InitListenersOptions, GetChangeEventOptions, GetFocusEventOptions, HandleBlurEditorFunction, HandleChangeEditorFunction, HandleFocusEditorFunction, } from "./listeners";
6
- export type { DecorationPlugin, GetDecorationFunction, GetDecorationOptions, GetSelectionDecorationFunction, GetSelectionDecorationOptions, InitMarkdownOptions, } from "./markdown";
7
- export type { InitSettingsOptions } from "./settings";
8
- export type { HighlightConfig, InitThemeOptions, ThemeConfig, ThemeOptions, EditorTheme, } from "./theme";
@@ -1,14 +0,0 @@
1
- import type { Extension } from "@codemirror/state";
2
- import type { WebsocketProvider } from "y-websocket";
3
- import type { Text } from "yjs";
4
- import { type InitKeyMapsOptions } from "./keymaps";
5
- import { type InitListenersOptions } from "./listeners";
6
- import { type InitMarkdownOptions } from "./markdown";
7
- import { type InitSettingsOptions } from "./settings";
8
- import { type InitThemeOptions } from "./theme";
9
- export type ExtensionsOptions = InitListenersOptions & InitThemeOptions & InitSettingsOptions & InitMarkdownOptions & InitKeyMapsOptions;
10
- export type InitExtensionsOptions = {
11
- multiCursorText: Text | undefined;
12
- provider: WebsocketProvider | undefined;
13
- } & ExtensionsOptions;
14
- export declare const initExtensions: ({ onBlur, onChange, onFocus, onEnter, onEscape, readonly, vimMode, multiCursorText, provider, theme, dark, light, languages, keyMaps, defaultKeyMaps, }: InitExtensionsOptions) => Promise<Extension[]>;
@@ -1,2 +0,0 @@
1
- import { type KeyBinding } from "@codemirror/view";
2
- export declare const boldKeymap: KeyBinding[];
@@ -1 +0,0 @@
1
- export * from "./init-key-map";
@@ -1,23 +0,0 @@
1
- import type { Extension } from "@codemirror/state";
2
- import { type EditorView, type KeyBinding } from "@codemirror/view";
3
- import { type EditorTheme, type ThemeOptions } from "../theme";
4
- export type InitKeyMapsOptions = {
5
- onEnter?: HandleEnterKeyMapEditorFunction;
6
- onEscape?: HandleEscapeKeyMapEditorFunction;
7
- keyMaps?: CustomKeyMap[];
8
- defaultKeyMaps?: DefaultKeyMapsOptions;
9
- };
10
- export type CustomKeyMap = KeyBinding;
11
- export type HandleEnterKeyMapEditorFunction = (view: EditorView) => boolean;
12
- export type HandleEscapeKeyMapEditorFunction = (view: EditorView) => boolean;
13
- export type DefaultKeyMapsOptions = {
14
- vim?: boolean;
15
- theme?: boolean;
16
- };
17
- export declare const initKeyMaps: ({ onEnter, onEscape, multiCursorMode, keyMaps, defaultKeyMaps, theme: initialTheme, vimMode: initialVimMode, dark, light, }: InitKeyMapsOptions & {
18
- multiCursorMode: boolean;
19
- vimMode: boolean;
20
- theme: EditorTheme;
21
- dark?: ThemeOptions;
22
- light?: ThemeOptions;
23
- }) => Promise<Extension>;
@@ -1,2 +0,0 @@
1
- import type { KeyBinding } from "@codemirror/view";
2
- export declare const italicKeymap: KeyBinding[];
@@ -1,2 +0,0 @@
1
- import type { KeyBinding } from "@codemirror/view";
2
- export declare const lineThroughKeymap: KeyBinding[];
@@ -1,2 +0,0 @@
1
- import type { KeyBinding } from "@codemirror/view";
2
- export declare const underlineKeymap: KeyBinding[];
@@ -1,6 +0,0 @@
1
- import { type ViewUpdate } from "@codemirror/view";
2
- export type GetChangeEventOptions = {
3
- onChange?: HandleChangeEditorFunction;
4
- };
5
- export type HandleChangeEditorFunction = (view: ViewUpdate) => void;
6
- export declare function getChangeEvent({ onChange }: GetChangeEventOptions): import("@codemirror/state").Extension;
@@ -1,8 +0,0 @@
1
- import { type EditorState } from "@codemirror/state";
2
- export type GetFocusEventOptions = {
3
- onFocus?: HandleFocusEditorFunction;
4
- onBlur?: HandleBlurEditorFunction;
5
- };
6
- export type HandleFocusEditorFunction = (state: EditorState) => void;
7
- export type HandleBlurEditorFunction = (state: EditorState) => void;
8
- export declare function getFocusEvent({ onBlur, onFocus }: GetFocusEventOptions): import("@codemirror/state").Extension;
@@ -1,3 +0,0 @@
1
- export * from "./init-listeners";
2
- export type { GetChangeEventOptions, HandleChangeEditorFunction } from "./get-change-event";
3
- export type { GetFocusEventOptions, HandleBlurEditorFunction, HandleFocusEditorFunction, } from "./get-focus-event";
@@ -1,4 +0,0 @@
1
- import { type GetChangeEventOptions } from "./get-change-event";
2
- import { type GetFocusEventOptions } from "./get-focus-event";
3
- export type InitListenersOptions = GetFocusEventOptions & GetChangeEventOptions;
4
- export declare function initListeners({ onBlur, onChange, onFocus }: InitListenersOptions): import("@codemirror/state").Extension[];
@@ -1,3 +0,0 @@
1
- export declare const NAME_OF_BLOCKQUOTE_MARK = "QuoteMark";
2
- export declare const CODE_OF_SPACE = 32;
3
- export declare const CODE_OF_BLOCKQUOTE_MARK = 62;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const blockquoteDecorationPlugin: DecorationPlugin;
@@ -1,6 +0,0 @@
1
- import { WidgetType } from "@codemirror/view";
2
- export declare class BlockquoteWidget extends WidgetType {
3
- private readonly deep;
4
- constructor(deep: boolean);
5
- toDOM(): HTMLElement;
6
- }
@@ -1 +0,0 @@
1
- export * from "./blockquote-decoration";
@@ -1,2 +0,0 @@
1
- export declare const NAME_OF_BOLD = "StrongEmphasis";
2
- export declare const LIST_OF_BOLD_MARKS: Set<number>;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const boldDecorationPlugin: DecorationPlugin;
@@ -1 +0,0 @@
1
- export * from "./bold-decoration";
@@ -1,3 +0,0 @@
1
- export declare const NAME_OF_FENCED_CODE = "FencedCode";
2
- export declare const NAME_OF_INLINE_CODE = "InlineCode";
3
- export declare const CODE_OF_CODE_MARK = 96;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const codeDecorationPlugin: DecorationPlugin;
@@ -1,13 +0,0 @@
1
- import { type EditorView, WidgetType } from "@codemirror/view";
2
- export declare class CodeWidget extends WidgetType {
3
- private readonly language;
4
- private content;
5
- view: EditorView | undefined;
6
- timer: NodeJS.Timeout | undefined;
7
- button: HTMLElement | undefined;
8
- span: HTMLElement | undefined;
9
- constructor(language: string, content: string | undefined);
10
- onClick(): void;
11
- toDOM(view: EditorView): HTMLElement;
12
- destroy(dom: HTMLElement): void;
13
- }
@@ -1 +0,0 @@
1
- export * from "./code-decoration";
@@ -1,3 +0,0 @@
1
- export declare const NAME_OF_HEADER = "ATXHeading";
2
- export declare const NAME_OF_HEADER_UNDER = "SetextHeading";
3
- export declare const NAME_OF_HEADER_MARK = "HeaderMark";
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const headerDecorationPlugin: DecorationPlugin;
@@ -1 +0,0 @@
1
- export * from "./header-decoration";
@@ -1 +0,0 @@
1
- export declare const NAME_OF_HORIZONTAL = "HorizontalRule";
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const horizontalDecorationPlugin: DecorationPlugin;
@@ -1 +0,0 @@
1
- export * from "./horizontal-decoration";
@@ -1,5 +0,0 @@
1
- export declare const NAME_OF_IMAGE = "Image";
2
- export declare const CODE_OF_START_IMAGE_TEXT = 91;
3
- export declare const CODE_OF_END_IMAGE_TEXT = 93;
4
- export declare const CODE_OF_START_IMAGE_URL = 40;
5
- export declare const CODE_OF_END_IMAGE_URL = 41;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const imageDecorationPlugin: DecorationPlugin;
@@ -1,14 +0,0 @@
1
- import { type EditorView, WidgetType } from "@codemirror/view";
2
- export declare class ImageWidget extends WidgetType {
3
- private text;
4
- private link;
5
- private from;
6
- private to;
7
- view: EditorView | undefined;
8
- constructor(text: string, link: string, from: number, to: number);
9
- get key(): string;
10
- eq(widget: ImageWidget): boolean;
11
- updateDOM(): boolean;
12
- toDOM(view: EditorView): HTMLElement;
13
- destroy(): void;
14
- }
@@ -1 +0,0 @@
1
- export * from "./image-decoration";
@@ -1,2 +0,0 @@
1
- export * from "./init-markdown";
2
- export * from "./markdown-types";
@@ -1,3 +0,0 @@
1
- import { type Extension } from "@codemirror/state";
2
- import type { InitMarkdownOptions } from "./markdown-types";
3
- export declare const initMarkdown: ({ languages }: InitMarkdownOptions) => Extension;
@@ -1 +0,0 @@
1
- export * from "./italic-decoration";
@@ -1,2 +0,0 @@
1
- export declare const NAME_OF_ITALIC = "Emphasis";
2
- export declare const LIST_OF_ITALIC_MARKS: Set<number>;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const italicDecorationPlugin: DecorationPlugin;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const autoLinkDecorationPlugin: DecorationPlugin;
@@ -1,2 +0,0 @@
1
- export * from "./link-decoration";
2
- export * from "./auto-link-decoration";
@@ -1,7 +0,0 @@
1
- export declare const NAME_OF_LINK = "Link";
2
- export declare const CODE_OF_START_LINK_TEXT = 91;
3
- export declare const CODE_OF_END_LINK_TEXT = 93;
4
- export declare const CODE_OF_START_LINK_URL = 40;
5
- export declare const CODE_OF_END_LINK_URL = 41;
6
- export declare const NAME_OF_AUTO_LINK = "Autolink";
7
- export declare const CODE_OF_LINK_LABEL_END = 58;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const linkDecorationPlugin: DecorationPlugin;
@@ -1,2 +0,0 @@
1
- import { type GetSelectionDecorationOptions } from "../markdown-types";
2
- export declare function getLinkLabelSelectionDecoration({ decorations, node, view, isReadonly, }: GetSelectionDecorationOptions): void;
@@ -1,17 +0,0 @@
1
- import { type EditorView, WidgetType } from "@codemirror/view";
2
- export declare class LinkWidget extends WidgetType {
3
- private readonly text;
4
- private readonly link;
5
- private readonly type;
6
- view: EditorView | undefined;
7
- constructor(text: string, link: string, type: "link" | "auto");
8
- /** recursively find the link text node in line */
9
- getTextNode(line: ChildNode | Node | null | undefined): ChildNode | null;
10
- getMinLength(): number;
11
- /** check that the text node is correct node */
12
- isCorrectNode(node: ChildNode | Node | null | undefined): node is ChildNode | Node;
13
- selectLink(node: ChildNode | Node, selection: Selection): void;
14
- handleClick(event: MouseEvent): false | undefined;
15
- toDOM(view: EditorView): HTMLElement;
16
- destroy(dom: HTMLElement): void;
17
- }
@@ -1 +0,0 @@
1
- export * from "./list-decoration";
@@ -1,4 +0,0 @@
1
- export declare const NAME_OF_LIST = "ListMark";
2
- export declare const NAME_OF_TODO = "Task";
3
- export declare const LIST_OF_LIST_MARKS: Set<number>;
4
- export declare const CODE_OF_ORDERED_LIST_MARK = 46;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const listDecorationPlugin: DecorationPlugin;
@@ -1,7 +0,0 @@
1
- import { WidgetType } from "@codemirror/view";
2
- export declare class ListPointWidget extends WidgetType {
3
- private readonly mark;
4
- private readonly lastCodePoint;
5
- constructor(mark: string, lastCodePoint: number);
6
- toDOM(): HTMLElement;
7
- }
@@ -1,5 +0,0 @@
1
- import { type DecorationSet, ViewPlugin, type ViewUpdate } from "@codemirror/view";
2
- export declare const markdownDecorationPlugin: ViewPlugin<{
3
- decorations: DecorationSet;
4
- update(update: ViewUpdate): void;
5
- }>;
@@ -1,2 +0,0 @@
1
- import type { MarkdownExtension } from "@lezer/markdown";
2
- export declare const markdownParserPlugin: MarkdownExtension;
@@ -1,24 +0,0 @@
1
- import type { LanguageDescription } from "@codemirror/language";
2
- import type { Range } from "@codemirror/state";
3
- import type { Decoration, EditorView } from "@codemirror/view";
4
- import type { SyntaxNodeRef } from "@lezer/common";
5
- export type InitMarkdownOptions = {
6
- languages?: LanguageDescription[];
7
- };
8
- export type GetDecorationOptions = {
9
- node: SyntaxNodeRef;
10
- decorations: Range<Decoration>[];
11
- view: EditorView;
12
- };
13
- export type GetSelectionDecorationOptions = {
14
- node: SyntaxNodeRef;
15
- decorations: Range<Decoration>[];
16
- view: EditorView;
17
- isReadonly: boolean;
18
- };
19
- export type GetDecorationFunction = (options: GetDecorationOptions) => void;
20
- export type GetSelectionDecorationFunction = (options: GetSelectionDecorationOptions) => void;
21
- export type DecorationPlugin = {
22
- decorations?: GetDecorationFunction[];
23
- selectionDecorations?: GetSelectionDecorationFunction[];
24
- };
@@ -1 +0,0 @@
1
- export * from "./mention-parser";
@@ -1,3 +0,0 @@
1
- export declare const CODE_OF_START_MENTION = 64;
2
- export declare const CODE_OF_SPACE = 32;
3
- export declare const NAME_OF_MENTION = "Mention";
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const mentionDecorationPlugin: DecorationPlugin;
@@ -1,2 +0,0 @@
1
- import type { MarkdownConfig } from "@lezer/markdown";
2
- export declare const mentionParser: MarkdownConfig;
@@ -1 +0,0 @@
1
- export * from "./strike-through-decoration";
@@ -1 +0,0 @@
1
- export declare const NAME_OF_STRIKE_THROUGH = "Strikethrough";
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const strikeThroughDecorationPlugin: DecorationPlugin;
@@ -1 +0,0 @@
1
- export * from "./todo-decoration";
@@ -1,3 +0,0 @@
1
- export declare const NAME_OF_TODO = "Task";
2
- export declare const NAME_OF_LIST_MARK = "ListMark";
3
- export declare const LIST_OF_TODO_MARKS: Set<number>;
@@ -1,2 +0,0 @@
1
- import type { DecorationPlugin } from "../markdown-types";
2
- export declare const todoDecorationPlugin: DecorationPlugin;
@@ -1,11 +0,0 @@
1
- import { type EditorView, WidgetType } from "@codemirror/view";
2
- export declare class TodoWidget extends WidgetType {
3
- checked: boolean;
4
- private readonly position;
5
- view: EditorView | undefined;
6
- constructor(checked: boolean, position: number);
7
- onClick(event: MouseEvent): void;
8
- onBlock(event: MouseEvent): void;
9
- toDOM(view: EditorView): HTMLElement;
10
- destroy(dom: HTMLElement): void;
11
- }
@@ -1 +0,0 @@
1
- export * from "./init-settings";
@@ -1,6 +0,0 @@
1
- import { type Extension } from "@codemirror/state";
2
- export type InitSettingsOptions = {
3
- readonly?: boolean;
4
- vimMode?: boolean;
5
- };
6
- export declare function InitSettings({ readonly, vimMode, }: InitSettingsOptions): Promise<Extension[]>;
@@ -1,4 +0,0 @@
1
- export * from "./init-theme";
2
- export * from "./theme-types";
3
- export { getDarkTheme, getLightTheme } from "./themes";
4
- export { CLASSES } from "./theme-constants";
@@ -1,3 +0,0 @@
1
- import type { Extension } from "@codemirror/state";
2
- import type { InitThemeOptions } from "./theme-types";
3
- export declare const initTheme: (options: InitThemeOptions) => Extension;
@@ -1,14 +0,0 @@
1
- export declare const CLASSES: {
2
- listCommon: string;
3
- code: string;
4
- codeButton: string;
5
- codeButtonSuccess: string;
6
- codeButtonFail: string;
7
- codeButtonPending: string;
8
- codeButtonSpan: string;
9
- horizontal: string;
10
- blockquote: string;
11
- blockquoteInner: string;
12
- link: string;
13
- mention: string;
14
- };
@@ -1,39 +0,0 @@
1
- export type EditorTheme = "dark" | "light";
2
- export type InitThemeOptions = {
3
- dark?: ThemeOptions;
4
- light?: ThemeOptions;
5
- theme?: EditorTheme;
6
- };
7
- export type ThemeOptions = {
8
- themeConfig?: ThemeConfig;
9
- highlightConfig?: HighlightConfig;
10
- };
11
- export type ThemeConfig = {
12
- fontFamily?: string;
13
- color?: string;
14
- background?: string;
15
- codeBackground?: string;
16
- codeColor?: string;
17
- codeButtonColor?: string;
18
- codeButtonBackground?: string;
19
- horizontalColor?: string;
20
- linkColor?: string;
21
- blockquoteColor?: string;
22
- mentionColor?: string;
23
- vimSelectionFocused?: string;
24
- vimSelection?: string;
25
- };
26
- export type HighlightConfig = {
27
- keyword?: string;
28
- variable?: string;
29
- function?: string;
30
- string?: string;
31
- constant?: string;
32
- type?: string;
33
- class?: string;
34
- number?: string;
35
- comment?: string;
36
- heading?: string;
37
- invalid?: string;
38
- regexp?: string;
39
- };
@@ -1,2 +0,0 @@
1
- import { type InitThemeOptions } from "../theme-types";
2
- export declare function getDarkTheme({ dark }: InitThemeOptions): import("@codemirror/state").Extension[];
@@ -1,6 +0,0 @@
1
- import type { HighlightConfig } from "../theme-types";
2
- /**
3
- * t.processingInstruction, t.meta - # () []
4
- * t.url, t.link - links
5
- */
6
- export declare function getHighlightTemplate(config: Required<HighlightConfig>): import("@codemirror/state").Extension;
@@ -1,2 +0,0 @@
1
- import { type InitThemeOptions } from "../theme-types";
2
- export declare function getLightTheme({ light }: InitThemeOptions): import("@codemirror/state").Extension[];
@@ -1,2 +0,0 @@
1
- import type { ThemeConfig } from "../theme-types";
2
- export declare function getThemeTemplate(dark: boolean, config: Required<ThemeConfig>): import("@codemirror/state").Extension;
@@ -1,2 +0,0 @@
1
- export * from "./get-dark-theme";
2
- export * from "./get-light-theme";
package/tmp/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export type { EditorInterface, EditorArguments, MultiCursorOptions } from "./module";
2
- export { Editor } from "./module";
3
- export type { ExtensionsOptions, InitExtensionsOptions, DecorationPlugin, GetDecorationFunction, GetDecorationOptions, GetSelectionDecorationFunction, GetSelectionDecorationOptions, HighlightConfig, InitKeyMapsOptions, InitListenersOptions, InitMarkdownOptions, InitSettingsOptions, InitThemeOptions, ThemeConfig, ThemeOptions, GetChangeEventOptions, GetFocusEventOptions, HandleBlurEditorFunction, HandleChangeEditorFunction, HandleEnterKeyMapEditorFunction, HandleFocusEditorFunction, HandleEscapeKeyMapEditorFunction, DefaultKeyMapsOptions, EditorTheme, CustomKeyMap, } from "./extensions";
@@ -1 +0,0 @@
1
- export * as utils from "./utils";
@@ -1 +0,0 @@
1
- export declare function copyToClipboard(content: string): Promise<void>;
@@ -1,26 +0,0 @@
1
- import { Decoration, type WidgetType } from "@codemirror/view";
2
- type GetLineDecorationOptions = {
3
- style: string;
4
- range: [number, number?];
5
- };
6
- export declare function getLineDecoration({ style, range }: GetLineDecorationOptions): import("@codemirror/state").Range<Decoration>;
7
- type GetMarkDecorationOptions = {
8
- style: string;
9
- range: [number, number];
10
- };
11
- export declare function getMarkDecoration({ range, style }: GetMarkDecorationOptions): import("@codemirror/state").Range<Decoration>;
12
- type GetHideDecorationOptions = {
13
- range: [number, number];
14
- };
15
- export declare function getHideDecoration({ range }: GetHideDecorationOptions): import("@codemirror/state").Range<Decoration>;
16
- type GetReplaceDecorationOptions = {
17
- range: [number, number?];
18
- widget: WidgetType;
19
- };
20
- export declare function getReplaceDecoration({ range, widget }: GetReplaceDecorationOptions): import("@codemirror/state").Range<Decoration>;
21
- type GetWidgetDecorationOptions = {
22
- widget: WidgetType;
23
- range: [number, number?];
24
- };
25
- export declare function getWidgetDecorationOptions({ widget, range }: GetWidgetDecorationOptions): import("@codemirror/state").Range<Decoration>;
26
- export {};
@@ -1,6 +0,0 @@
1
- export * from "./copy-to-clipboard";
2
- export * from "./tick";
3
- export * from "./get-decoration";
4
- export * from "./is-in-range";
5
- export * from "./is-range-overlap";
6
- export * from "./random-string";
@@ -1,2 +0,0 @@
1
- import type { SelectionRange } from "@codemirror/state";
2
- export declare function isInRange(ranges: readonly SelectionRange[], text: [number, number]): boolean;
@@ -1 +0,0 @@
1
- export declare function isRangeOverlap(range: [number, number], text: [number, number]): boolean;
@@ -1 +0,0 @@
1
- export declare function randomString(length?: number): string;