chrome-devtools-frontend 1.0.1030946 → 1.0.1032245

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 (319) hide show
  1. package/config/gni/devtools_grd_files.gni +5 -0
  2. package/front_end/core/host/UserMetrics.ts +2 -1
  3. package/front_end/core/i18n/locales/af.json +301 -31
  4. package/front_end/core/i18n/locales/am.json +307 -37
  5. package/front_end/core/i18n/locales/ar.json +299 -29
  6. package/front_end/core/i18n/locales/as.json +294 -24
  7. package/front_end/core/i18n/locales/az.json +302 -32
  8. package/front_end/core/i18n/locales/be.json +303 -33
  9. package/front_end/core/i18n/locales/bg.json +296 -26
  10. package/front_end/core/i18n/locales/bn.json +294 -24
  11. package/front_end/core/i18n/locales/bs.json +298 -28
  12. package/front_end/core/i18n/locales/ca.json +302 -32
  13. package/front_end/core/i18n/locales/cs.json +295 -25
  14. package/front_end/core/i18n/locales/cy.json +294 -24
  15. package/front_end/core/i18n/locales/da.json +299 -29
  16. package/front_end/core/i18n/locales/de.json +301 -31
  17. package/front_end/core/i18n/locales/el.json +301 -31
  18. package/front_end/core/i18n/locales/en-GB.json +294 -24
  19. package/front_end/core/i18n/locales/en-US.json +22 -7
  20. package/front_end/core/i18n/locales/en-XL.json +22 -7
  21. package/front_end/core/i18n/locales/es-419.json +298 -28
  22. package/front_end/core/i18n/locales/es.json +306 -36
  23. package/front_end/core/i18n/locales/et.json +299 -29
  24. package/front_end/core/i18n/locales/eu.json +301 -31
  25. package/front_end/core/i18n/locales/fa.json +301 -31
  26. package/front_end/core/i18n/locales/fi.json +295 -25
  27. package/front_end/core/i18n/locales/fil.json +295 -25
  28. package/front_end/core/i18n/locales/fr-CA.json +296 -26
  29. package/front_end/core/i18n/locales/fr.json +296 -26
  30. package/front_end/core/i18n/locales/gl.json +296 -26
  31. package/front_end/core/i18n/locales/gu.json +295 -25
  32. package/front_end/core/i18n/locales/he.json +300 -30
  33. package/front_end/core/i18n/locales/hi.json +306 -36
  34. package/front_end/core/i18n/locales/hr.json +298 -28
  35. package/front_end/core/i18n/locales/hu.json +301 -31
  36. package/front_end/core/i18n/locales/hy.json +296 -26
  37. package/front_end/core/i18n/locales/id.json +295 -25
  38. package/front_end/core/i18n/locales/is.json +294 -24
  39. package/front_end/core/i18n/locales/it.json +298 -28
  40. package/front_end/core/i18n/locales/ja.json +300 -30
  41. package/front_end/core/i18n/locales/ka.json +294 -24
  42. package/front_end/core/i18n/locales/kk.json +305 -35
  43. package/front_end/core/i18n/locales/km.json +300 -30
  44. package/front_end/core/i18n/locales/kn.json +302 -32
  45. package/front_end/core/i18n/locales/ko.json +297 -27
  46. package/front_end/core/i18n/locales/ky.json +297 -27
  47. package/front_end/core/i18n/locales/lo.json +297 -27
  48. package/front_end/core/i18n/locales/lt.json +295 -25
  49. package/front_end/core/i18n/locales/lv.json +301 -31
  50. package/front_end/core/i18n/locales/mk.json +294 -24
  51. package/front_end/core/i18n/locales/ml.json +297 -27
  52. package/front_end/core/i18n/locales/mn.json +296 -26
  53. package/front_end/core/i18n/locales/mr.json +298 -28
  54. package/front_end/core/i18n/locales/ms.json +296 -26
  55. package/front_end/core/i18n/locales/my.json +301 -31
  56. package/front_end/core/i18n/locales/ne.json +302 -32
  57. package/front_end/core/i18n/locales/nl.json +304 -34
  58. package/front_end/core/i18n/locales/no.json +294 -24
  59. package/front_end/core/i18n/locales/or.json +303 -33
  60. package/front_end/core/i18n/locales/pa.json +301 -31
  61. package/front_end/core/i18n/locales/pl.json +298 -28
  62. package/front_end/core/i18n/locales/pt-PT.json +299 -29
  63. package/front_end/core/i18n/locales/pt.json +298 -28
  64. package/front_end/core/i18n/locales/ro.json +297 -27
  65. package/front_end/core/i18n/locales/ru.json +296 -26
  66. package/front_end/core/i18n/locales/si.json +299 -29
  67. package/front_end/core/i18n/locales/sk.json +301 -31
  68. package/front_end/core/i18n/locales/sl.json +301 -31
  69. package/front_end/core/i18n/locales/sq.json +304 -34
  70. package/front_end/core/i18n/locales/sr-Latn.json +296 -26
  71. package/front_end/core/i18n/locales/sr.json +296 -26
  72. package/front_end/core/i18n/locales/sv.json +295 -25
  73. package/front_end/core/i18n/locales/sw.json +298 -28
  74. package/front_end/core/i18n/locales/ta.json +301 -31
  75. package/front_end/core/i18n/locales/te.json +333 -63
  76. package/front_end/core/i18n/locales/th.json +294 -24
  77. package/front_end/core/i18n/locales/tr.json +294 -24
  78. package/front_end/core/i18n/locales/uk.json +296 -26
  79. package/front_end/core/i18n/locales/ur.json +295 -25
  80. package/front_end/core/i18n/locales/uz.json +298 -28
  81. package/front_end/core/i18n/locales/vi.json +303 -33
  82. package/front_end/core/i18n/locales/zh-HK.json +294 -24
  83. package/front_end/core/i18n/locales/zh-TW.json +300 -30
  84. package/front_end/core/i18n/locales/zh.json +299 -29
  85. package/front_end/core/i18n/locales/zu.json +302 -32
  86. package/front_end/core/platform/string-utilities.ts +2 -5
  87. package/front_end/core/root/Runtime.ts +1 -0
  88. package/front_end/core/sdk/Target.ts +4 -0
  89. package/front_end/entrypoints/inspector_main/InspectorMain.ts +4 -1
  90. package/front_end/entrypoints/main/MainImpl.ts +3 -0
  91. package/front_end/generated/InspectorBackendCommands.js +3 -3
  92. package/front_end/generated/SupportedCSSProperties.js +2 -4
  93. package/front_end/generated/protocol.ts +2 -1
  94. package/front_end/models/issues_manager/DeprecationIssue.ts +12 -1
  95. package/front_end/models/text_utils/CodeMirrorUtils.ts +1 -2
  96. package/front_end/models/timeline_model/TimelineModel.ts +52 -0
  97. package/front_end/panels/application/components/StackTrace.ts +2 -2
  98. package/front_end/panels/elements/AccessibilityTreeView.ts +8 -2
  99. package/front_end/panels/elements/CSSRuleValidator.ts +12 -13
  100. package/front_end/panels/elements/ElementsTreeOutline.ts +23 -7
  101. package/front_end/panels/elements/TopLayerContainer.ts +17 -28
  102. package/front_end/panels/elements/accessibilityTreeView.css +10 -0
  103. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +4 -5
  104. package/front_end/panels/elements/components/accessibilityTreeNode.css +9 -0
  105. package/front_end/panels/elements/components/cssHintDetailsView.css +6 -2
  106. package/front_end/panels/elements/stylesSectionTree.css +1 -1
  107. package/front_end/panels/network/NetworkItemView.ts +15 -2
  108. package/front_end/panels/network/components/RequestHeadersView.css +13 -0
  109. package/front_end/panels/network/components/RequestHeadersView.ts +59 -57
  110. package/front_end/panels/sources/BreakpointsSidebarPane.ts +37 -0
  111. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +7 -0
  112. package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -3
  113. package/front_end/panels/sources/sources-meta.ts +3 -0
  114. package/front_end/panels/sources/sources.ts +2 -0
  115. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +21 -2
  116. package/front_end/panels/timeline/TimelineUIUtils.ts +16 -0
  117. package/front_end/services/puppeteer/PuppeteerConnection.ts +7 -1
  118. package/front_end/third_party/codemirror.next/bundle.ts +1 -1
  119. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  120. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
  121. package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
  122. package/front_end/third_party/codemirror.next/chunk/json.js +1 -1
  123. package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
  124. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
  125. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  126. package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
  127. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
  128. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
  129. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +342 -1314
  130. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  131. package/front_end/third_party/codemirror.next/package.json +21 -21
  132. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +15 -2
  133. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -1
  134. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js +95 -76
  135. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js.map +1 -1
  136. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +7 -1
  138. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.d.ts +37 -0
  140. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.d.ts.map +1 -0
  141. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.js +297 -0
  142. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.js.map +1 -0
  143. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +4 -0
  144. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js +10 -2
  146. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +2 -2
  149. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.d.ts +4 -0
  151. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.d.ts.map +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.js +16 -2
  153. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.js.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.d.ts.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.js +36 -36
  156. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.js.map +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.d.ts +45 -0
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.d.ts.map +1 -0
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.js +196 -0
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.js.map +1 -0
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +8 -1
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +105 -72
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +4 -0
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +6 -0
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js +5 -5
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +4 -0
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +29 -8
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts.map +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js +43 -68
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +0 -2
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.js.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts +10 -1
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.js +21 -5
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.js.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/TargetManager.d.ts +55 -0
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/TargetManager.d.ts.map +1 -0
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/TargetManager.js +18 -0
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/TargetManager.js.map +1 -0
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts +21 -0
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts.map +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js +47 -2
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js.map +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  196. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +3 -2
  199. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.d.ts.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.js +1 -1
  202. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.js.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js +2 -1
  205. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  206. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js +0 -3
  208. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer.d.ts +1 -0
  210. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer.d.ts.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer.js.map +1 -1
  212. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.d.ts +3 -0
  215. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.d.ts.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.js +3 -0
  217. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.js.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +15 -2
  219. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +95 -76
  221. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js.map +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +7 -1
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.d.ts +37 -0
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.d.ts.map +1 -0
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.js +293 -0
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.js.map +1 -0
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +4 -0
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +10 -2
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js.map +1 -1
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +3 -3
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts +4 -0
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts.map +1 -1
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js +14 -1
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js.map +1 -1
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.d.ts.map +1 -1
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.js +36 -36
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.js.map +1 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.d.ts +45 -0
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.d.ts.map +1 -0
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.js +192 -0
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.js.map +1 -0
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +8 -1
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +106 -73
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +4 -0
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +6 -0
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +5 -5
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -1
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +4 -0
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +30 -9
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +1 -1
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -1
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +45 -47
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js.map +1 -1
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +0 -2
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -1
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +10 -1
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js +21 -5
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js.map +1 -1
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/TargetManager.d.ts +55 -0
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/TargetManager.d.ts.map +1 -0
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/TargetManager.js +17 -0
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/TargetManager.js.map +1 -0
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts +21 -0
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts.map +1 -1
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js +44 -1
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js.map +1 -1
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +3 -2
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  286. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.d.ts.map +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.js +1 -1
  288. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.js.map +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  290. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js +1 -0
  291. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  292. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -1
  293. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +0 -3
  294. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js.map +1 -1
  295. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer.d.ts +1 -0
  296. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer.d.ts.map +1 -1
  297. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer.js.map +1 -1
  298. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +1 -1
  299. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
  300. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.d.ts +3 -0
  301. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.d.ts.map +1 -1
  302. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.js +3 -0
  303. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.js.map +1 -1
  304. package/front_end/third_party/puppeteer/package/lib/types.d.ts +37 -2
  305. package/front_end/third_party/puppeteer/package/package.json +7 -6
  306. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +2 -3
  307. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +97 -17
  308. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -1
  309. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewerUtils.ts +4 -0
  310. package/front_end/ui/legacy/Icon.ts +1 -1
  311. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +9 -7
  312. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +18 -17
  313. package/package.json +1 -1
  314. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/tsconfig.cjs.tsbuildinfo +0 -1
  315. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/tsconfig.tsbuildinfo +0 -1
  316. package/front_end/third_party/puppeteer/package/lib/cjs/vendor/tsconfig.cjs.tsbuildinfo +0 -1
  317. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/tsconfig.esm.tsbuildinfo +0 -1
  318. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/tsconfig.tsbuildinfo +0 -1
  319. package/front_end/third_party/puppeteer/package/lib/esm/vendor/tsconfig.esm.tsbuildinfo +0 -1
@@ -168,6 +168,7 @@ interface SyntaxNodeRef {
168
168
  readonly name: string;
169
169
  readonly tree: Tree | null;
170
170
  readonly node: SyntaxNode;
171
+ matchContext(context: readonly string[]): boolean;
171
172
  }
172
173
  interface SyntaxNode extends SyntaxNodeRef {
173
174
  parent: SyntaxNode | null;
@@ -234,7 +235,6 @@ declare class InputStream {
234
235
  pos: number;
235
236
  private rangeIndex;
236
237
  private range;
237
- resolveOffset(offset: number, assoc: -1 | 1): number;
238
238
  peek(offset: number): any;
239
239
  acceptToken(token: number, endOffset?: number): void;
240
240
  private getChunk;
@@ -242,14 +242,12 @@ declare class InputStream {
242
242
  advance(n?: number): number;
243
243
  private setDone;
244
244
  }
245
- interface Tokenizer {
246
- }
247
245
  interface ExternalOptions {
248
246
  contextual?: boolean;
249
247
  fallback?: boolean;
250
248
  extend?: boolean;
251
249
  }
252
- declare class ExternalTokenizer implements Tokenizer {
250
+ declare class ExternalTokenizer {
253
251
  constructor(token: (input: InputStream, stack: Stack) => void, options?: ExternalOptions);
254
252
  }
255
253
 
@@ -271,6 +269,10 @@ interface ParserConfig {
271
269
  from: ExternalTokenizer;
272
270
  to: ExternalTokenizer;
273
271
  }[];
272
+ specializers?: {
273
+ from: (value: string, stack: Stack) => number;
274
+ to: (value: string, stack: Stack) => number;
275
+ }[];
274
276
  contextTracker?: ContextTracker<any>;
275
277
  strict?: boolean;
276
278
  wrap?: ParseWrapper;
@@ -286,6 +288,7 @@ declare class LRParser extends Parser {
286
288
  hasWrappers(): boolean;
287
289
  getName(term: number): string;
288
290
  get topNode(): NodeType;
291
+ static deserialize(spec: any): LRParser;
289
292
  }
290
293
 
291
294
  /**
@@ -553,6 +556,7 @@ stores the document length, and can only be applied to documents
553
556
  with exactly that length.
554
557
  */
555
558
  declare class ChangeSet extends ChangeDesc {
559
+ private constructor();
556
560
  /**
557
561
  Apply the changes to a document, returning the modified
558
562
  document.
@@ -638,6 +642,7 @@ declare class SelectionRange {
638
642
  */
639
643
  readonly to: number;
640
644
  private flags;
645
+ private constructor();
641
646
  /**
642
647
  The anchor of the range—the side that doesn't move when you
643
648
  extend it.
@@ -708,6 +713,7 @@ declare class EditorSelection {
708
713
  usually the range that was added last).
709
714
  */
710
715
  readonly mainIndex: number;
716
+ private constructor();
711
717
  /**
712
718
  Map a selection through a change. Used to adjust the selection
713
719
  position for changes.
@@ -792,13 +798,14 @@ declare type FacetConfig<Input, Output> = {
792
798
  */
793
799
  static?: boolean;
794
800
  /**
795
- If given, these extension(s) will be added to any state where
796
- this facet is provided. (Note that, while a facet's default
797
- value can be read from a state even if the facet wasn't present
798
- in the state at all, these extensions won't be added in that
801
+ If given, these extension(s) (or the result of calling the given
802
+ function with the facet) will be added to any state where this
803
+ facet is provided. (Note that, while a facet's default value can
804
+ be read from a state even if the facet wasn't present in the
805
+ state at all, these extensions won't be added in that
799
806
  situation.)
800
807
  */
801
- enables?: Extension;
808
+ enables?: Extension | ((self: Facet<Input, Output>) => Extension);
802
809
  };
803
810
  /**
804
811
  A facet is a labeled value that is associated with an editor
@@ -1175,6 +1182,7 @@ declare class Transaction {
1175
1182
  transaction is dispatched.
1176
1183
  */
1177
1184
  readonly scrollIntoView: boolean;
1185
+ private constructor();
1178
1186
  /**
1179
1187
  The new document produced by the transaction. Contrary to
1180
1188
  [`.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state)`.doc`, accessing this won't
@@ -1332,6 +1340,7 @@ declare class EditorState {
1332
1340
  The current selection.
1333
1341
  */
1334
1342
  readonly selection: EditorSelection;
1343
+ private constructor();
1335
1344
  /**
1336
1345
  Retrieve the value of a [state field](https://codemirror.net/6/docs/ref/#state.StateField). Throws
1337
1346
  an error when the state doesn't have that field, unless you pass
@@ -1493,8 +1502,13 @@ declare class EditorState {
1493
1502
  Look up a translation for the given phrase (via the
1494
1503
  [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the
1495
1504
  original string if no translation is found.
1505
+
1506
+ If additional arguments are passed, they will be inserted in
1507
+ place of markers like `$1` (for the first value) and `$2`, etc.
1508
+ A single `$` is equivalent to `$1`, and `$$` will produce a
1509
+ literal dollar sign.
1496
1510
  */
1497
- phrase(phrase: string): string;
1511
+ phrase(phrase: string, ...insert: any[]): string;
1498
1512
  /**
1499
1513
  A facet used to register [language
1500
1514
  data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) providers.
@@ -1647,6 +1661,7 @@ declare class Range<T extends RangeValue> {
1647
1661
  The value associated with this range.
1648
1662
  */
1649
1663
  readonly value: T;
1664
+ private constructor();
1650
1665
  }
1651
1666
  /**
1652
1667
  Collection of methods used when comparing range sets.
@@ -1747,6 +1762,7 @@ way that makes them efficient to [map](https://codemirror.net/6/docs/ref/#state.
1747
1762
  structure.
1748
1763
  */
1749
1764
  declare class RangeSet<T extends RangeValue> {
1765
+ private constructor();
1750
1766
  /**
1751
1767
  The number of ranges in the set.
1752
1768
  */
@@ -1877,11 +1893,11 @@ type StyleSpec = {
1877
1893
  [propOrSelector: string]: string | number | StyleSpec | null
1878
1894
  }
1879
1895
 
1880
- declare type Attrs$1 = {
1896
+ declare type Attrs = {
1881
1897
  [name: string]: string;
1882
1898
  };
1883
1899
 
1884
- interface MarkDecorationSpec$1 {
1900
+ interface MarkDecorationSpec {
1885
1901
  /**
1886
1902
  Whether the mark covers its start and end position or not. This
1887
1903
  influences whether content inserted at those positions becomes
@@ -1923,11 +1939,11 @@ interface MarkDecorationSpec$1 {
1923
1939
  */
1924
1940
  [other: string]: any;
1925
1941
  }
1926
- interface WidgetDecorationSpec$1 {
1942
+ interface WidgetDecorationSpec {
1927
1943
  /**
1928
1944
  The type of widget to draw here.
1929
1945
  */
1930
- widget: WidgetType$1;
1946
+ widget: WidgetType;
1931
1947
  /**
1932
1948
  Which side of the given position the widget is on. When this is
1933
1949
  positive, the widget will be drawn after the cursor if the
@@ -1954,12 +1970,12 @@ interface WidgetDecorationSpec$1 {
1954
1970
  */
1955
1971
  [other: string]: any;
1956
1972
  }
1957
- interface ReplaceDecorationSpec$1 {
1973
+ interface ReplaceDecorationSpec {
1958
1974
  /**
1959
1975
  An optional widget to drawn in the place of the replaced
1960
1976
  content.
1961
1977
  */
1962
- widget?: WidgetType$1;
1978
+ widget?: WidgetType;
1963
1979
  /**
1964
1980
  Whether this range covers the positions on its sides. This
1965
1981
  influences whether new content becomes part of the range and
@@ -1984,7 +2000,7 @@ interface ReplaceDecorationSpec$1 {
1984
2000
  */
1985
2001
  [other: string]: any;
1986
2002
  }
1987
- interface LineDecorationSpec$1 {
2003
+ interface LineDecorationSpec {
1988
2004
  /**
1989
2005
  DOM attributes to add to the element wrapping the line.
1990
2006
  */
@@ -2007,11 +2023,11 @@ delay creating of the DOM structure for a widget until it is
2007
2023
  needed, and to avoid redrawing widgets even if the decorations
2008
2024
  that define them are recreated.
2009
2025
  */
2010
- declare abstract class WidgetType$1 {
2026
+ declare abstract class WidgetType {
2011
2027
  /**
2012
2028
  Build the DOM structure for this widget instance.
2013
2029
  */
2014
- abstract toDOM(view: EditorView$1): HTMLElement;
2030
+ abstract toDOM(view: EditorView): HTMLElement;
2015
2031
  /**
2016
2032
  Compare this instance to another instance of the same type.
2017
2033
  (TypeScript can't express this, but only instances of the same
@@ -2021,7 +2037,7 @@ declare abstract class WidgetType$1 {
2021
2037
  returns `false`, which will cause new instances of the widget to
2022
2038
  always be redrawn.
2023
2039
  */
2024
- eq(widget: WidgetType$1): boolean;
2040
+ eq(widget: WidgetType): boolean;
2025
2041
  /**
2026
2042
  Update a DOM element created by a widget of the same type (but
2027
2043
  different, non-`eq` content) to reflect this widget. May return
@@ -2054,11 +2070,11 @@ A decoration set represents a collection of decorated ranges,
2054
2070
  organized for efficient access and mapping. See
2055
2071
  [`RangeSet`](https://codemirror.net/6/docs/ref/#state.RangeSet) for its methods.
2056
2072
  */
2057
- declare type DecorationSet$1 = RangeSet<Decoration$1>;
2073
+ declare type DecorationSet = RangeSet<Decoration>;
2058
2074
  /**
2059
2075
  The different types of blocks that can occur in an editor view.
2060
2076
  */
2061
- declare enum BlockType$1 {
2077
+ declare enum BlockType {
2062
2078
  /**
2063
2079
  A line of text.
2064
2080
  */
@@ -2082,14 +2098,33 @@ of content. You'll usually use it wrapped in a
2082
2098
  [`Range`](https://codemirror.net/6/docs/ref/#state.Range), which adds a start and end position.
2083
2099
  @nonabstract
2084
2100
  */
2085
- declare abstract class Decoration$1 extends RangeValue {
2101
+ declare abstract class Decoration extends RangeValue {
2086
2102
  /**
2087
2103
  The config object used to create this decoration. You can
2088
2104
  include additional properties in there to store metadata about
2089
2105
  your decoration.
2090
2106
  */
2091
2107
  readonly spec: any;
2092
- abstract eq(other: Decoration$1): boolean;
2108
+ protected constructor(
2109
+ /**
2110
+ @internal
2111
+ */
2112
+ startSide: number,
2113
+ /**
2114
+ @internal
2115
+ */
2116
+ endSide: number,
2117
+ /**
2118
+ @internal
2119
+ */
2120
+ widget: WidgetType | null,
2121
+ /**
2122
+ The config object used to create this decoration. You can
2123
+ include additional properties in there to store metadata about
2124
+ your decoration.
2125
+ */
2126
+ spec: any);
2127
+ abstract eq(other: Decoration): boolean;
2093
2128
  /**
2094
2129
  Create a mark decoration, which influences the styling of the
2095
2130
  content in its range. Nested mark decorations will cause nested
@@ -2099,44 +2134,44 @@ declare abstract class Decoration$1 extends RangeValue {
2099
2134
  Such elements are split on line boundaries and on the boundaries
2100
2135
  of lower-precedence decorations.
2101
2136
  */
2102
- static mark(spec: MarkDecorationSpec$1): Decoration$1;
2137
+ static mark(spec: MarkDecorationSpec): Decoration;
2103
2138
  /**
2104
2139
  Create a widget decoration, which displays a DOM element at the
2105
2140
  given position.
2106
2141
  */
2107
- static widget(spec: WidgetDecorationSpec$1): Decoration$1;
2142
+ static widget(spec: WidgetDecorationSpec): Decoration;
2108
2143
  /**
2109
2144
  Create a replace decoration which replaces the given range with
2110
2145
  a widget, or simply hides it.
2111
2146
  */
2112
- static replace(spec: ReplaceDecorationSpec$1): Decoration$1;
2147
+ static replace(spec: ReplaceDecorationSpec): Decoration;
2113
2148
  /**
2114
2149
  Create a line decoration, which can add DOM attributes to the
2115
2150
  line starting at the given position.
2116
2151
  */
2117
- static line(spec: LineDecorationSpec$1): Decoration$1;
2152
+ static line(spec: LineDecorationSpec): Decoration;
2118
2153
  /**
2119
2154
  Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given
2120
2155
  decorated range or ranges. If the ranges aren't already sorted,
2121
2156
  pass `true` for `sort` to make the library sort them for you.
2122
2157
  */
2123
- static set(of: Range<Decoration$1> | readonly Range<Decoration$1>[], sort?: boolean): DecorationSet$1;
2158
+ static set(of: Range<Decoration> | readonly Range<Decoration>[], sort?: boolean): DecorationSet;
2124
2159
  /**
2125
2160
  The empty set of decorations.
2126
2161
  */
2127
- static none: DecorationSet$1;
2162
+ static none: DecorationSet;
2128
2163
  }
2129
2164
 
2130
2165
  /**
2131
2166
  Basic rectangle type.
2132
2167
  */
2133
- interface Rect$1 {
2168
+ interface Rect {
2134
2169
  readonly left: number;
2135
2170
  readonly right: number;
2136
2171
  readonly top: number;
2137
2172
  readonly bottom: number;
2138
2173
  }
2139
- declare type ScrollStrategy$1 = "nearest" | "start" | "end" | "center";
2174
+ declare type ScrollStrategy = "nearest" | "start" | "end" | "center";
2140
2175
 
2141
2176
  /**
2142
2177
  Command functions are used in key bindings and other types of user
@@ -2145,11 +2180,11 @@ apply to the editor, and if it can, perform it as a side effect
2145
2180
  (which usually means [dispatching](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) a
2146
2181
  transaction) and return `true`.
2147
2182
  */
2148
- declare type Command = (target: EditorView$1) => boolean;
2183
+ declare type Command = (target: EditorView) => boolean;
2149
2184
  /**
2150
2185
  This is the interface plugin objects conform to.
2151
2186
  */
2152
- interface PluginValue$1 extends Object {
2187
+ interface PluginValue extends Object {
2153
2188
  /**
2154
2189
  Notifies the plugin of an update that happened in the view. This
2155
2190
  is called _before_ the view updates its own DOM. It is
@@ -2160,7 +2195,7 @@ interface PluginValue$1 extends Object {
2160
2195
  [`requestMeasure`](https://codemirror.net/6/docs/ref/#view.EditorView.requestMeasure) to schedule
2161
2196
  your code in a DOM reading phase if you need to.
2162
2197
  */
2163
- update?(update: ViewUpdate$1): void;
2198
+ update?(update: ViewUpdate): void;
2164
2199
  /**
2165
2200
  Called when the plugin is no longer going to be used. Should
2166
2201
  revert any changes the plugin made to the DOM.
@@ -2171,34 +2206,34 @@ interface PluginValue$1 extends Object {
2171
2206
  Provides additional information when defining a [view
2172
2207
  plugin](https://codemirror.net/6/docs/ref/#view.ViewPlugin).
2173
2208
  */
2174
- interface PluginSpec$1<V extends PluginValue$1> {
2209
+ interface PluginSpec<V extends PluginValue> {
2175
2210
  /**
2176
2211
  Register the given [event
2177
2212
  handlers](https://codemirror.net/6/docs/ref/#view.EditorView^domEventHandlers) for the plugin.
2178
2213
  When called, these will have their `this` bound to the plugin
2179
2214
  value.
2180
2215
  */
2181
- eventHandlers?: DOMEventHandlers$1<V>;
2216
+ eventHandlers?: DOMEventHandlers<V>;
2182
2217
  /**
2183
2218
  Specify that the plugin provides additional extensions when
2184
2219
  added to an editor configuration.
2185
2220
  */
2186
- provide?: (plugin: ViewPlugin$1<V>) => Extension;
2221
+ provide?: (plugin: ViewPlugin<V>) => Extension;
2187
2222
  /**
2188
2223
  Allow the plugin to provide decorations. When given, this should
2189
- a function that take the plugin value and return a [decoration
2190
- set](https://codemirror.net/6/docs/ref/#view.DecorationSet). See also the caveat about
2191
- [layout-changing decorations](https://codemirror.net/6/docs/ref/#view.EditorView^decorations)
2192
- that depend on the view.
2224
+ be a function that take the plugin value and return a
2225
+ [decoration set](https://codemirror.net/6/docs/ref/#view.DecorationSet). See also the caveat about
2226
+ [layout-changing decorations](https://codemirror.net/6/docs/ref/#view.EditorView^decorations) that
2227
+ depend on the view.
2193
2228
  */
2194
- decorations?: (value: V) => DecorationSet$1;
2229
+ decorations?: (value: V) => DecorationSet;
2195
2230
  }
2196
2231
  /**
2197
2232
  View plugins associate stateful values with a view. They can
2198
2233
  influence the way the content is drawn, and are notified of things
2199
2234
  that happen in the view.
2200
2235
  */
2201
- declare class ViewPlugin$1<V extends PluginValue$1> {
2236
+ declare class ViewPlugin<V extends PluginValue> {
2202
2237
  /**
2203
2238
  Instances of this class act as extensions.
2204
2239
  */
@@ -2208,42 +2243,42 @@ declare class ViewPlugin$1<V extends PluginValue$1> {
2208
2243
  Define a plugin from a constructor function that creates the
2209
2244
  plugin's value, given an editor view.
2210
2245
  */
2211
- static define<V extends PluginValue$1>(create: (view: EditorView$1) => V, spec?: PluginSpec$1<V>): ViewPlugin$1<V>;
2246
+ static define<V extends PluginValue>(create: (view: EditorView) => V, spec?: PluginSpec<V>): ViewPlugin<V>;
2212
2247
  /**
2213
2248
  Create a plugin for a class whose constructor takes a single
2214
2249
  editor view as argument.
2215
2250
  */
2216
- static fromClass<V extends PluginValue$1>(cls: {
2217
- new (view: EditorView$1): V;
2218
- }, spec?: PluginSpec$1<V>): ViewPlugin$1<V>;
2251
+ static fromClass<V extends PluginValue>(cls: {
2252
+ new (view: EditorView): V;
2253
+ }, spec?: PluginSpec<V>): ViewPlugin<V>;
2219
2254
  }
2220
- interface MeasureRequest$1<T> {
2255
+ interface MeasureRequest<T> {
2221
2256
  /**
2222
2257
  Called in a DOM read phase to gather information that requires
2223
2258
  DOM layout. Should _not_ mutate the document.
2224
2259
  */
2225
- read(view: EditorView$1): T;
2260
+ read(view: EditorView): T;
2226
2261
  /**
2227
2262
  Called in a DOM write phase to update the document. Should _not_
2228
2263
  do anything that triggers DOM layout.
2229
2264
  */
2230
- write?(measure: T, view: EditorView$1): void;
2265
+ write?(measure: T, view: EditorView): void;
2231
2266
  /**
2232
2267
  When multiple requests with the same key are scheduled, only the
2233
2268
  last one will actually be ran.
2234
2269
  */
2235
2270
  key?: any;
2236
2271
  }
2237
- declare type AttrSource$1 = Attrs$1 | ((view: EditorView$1) => Attrs$1 | null);
2272
+ declare type AttrSource = Attrs | ((view: EditorView) => Attrs | null);
2238
2273
  /**
2239
2274
  View [plugins](https://codemirror.net/6/docs/ref/#view.ViewPlugin) are given instances of this
2240
2275
  class, which describe what happened, whenever the view is updated.
2241
2276
  */
2242
- declare class ViewUpdate$1 {
2277
+ declare class ViewUpdate {
2243
2278
  /**
2244
2279
  The editor view that the update is associated with.
2245
2280
  */
2246
- readonly view: EditorView$1;
2281
+ readonly view: EditorView;
2247
2282
  /**
2248
2283
  The new editor state.
2249
2284
  */
@@ -2260,6 +2295,7 @@ declare class ViewUpdate$1 {
2260
2295
  The previous editor state.
2261
2296
  */
2262
2297
  readonly startState: EditorState;
2298
+ private constructor();
2263
2299
  /**
2264
2300
  Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or
2265
2301
  [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this
@@ -2295,7 +2331,7 @@ Interface that objects registered with
2295
2331
  [`EditorView.mouseSelectionStyle`](https://codemirror.net/6/docs/ref/#view.EditorView^mouseSelectionStyle)
2296
2332
  must conform to.
2297
2333
  */
2298
- interface MouseSelectionStyle$1 {
2334
+ interface MouseSelectionStyle {
2299
2335
  /**
2300
2336
  Return a new selection for the mouse gesture that starts with
2301
2337
  the event that was originally given to the constructor, and ends
@@ -2320,15 +2356,15 @@ interface MouseSelectionStyle$1 {
2320
2356
  using this (where `get` returns a new selection, which will
2321
2357
  trigger `update`, which schedules another `get` in response).
2322
2358
  */
2323
- update: (update: ViewUpdate$1) => boolean | void;
2359
+ update: (update: ViewUpdate) => boolean | void;
2324
2360
  }
2325
- declare type MakeSelectionStyle$1 = (view: EditorView$1, event: MouseEvent) => MouseSelectionStyle$1 | null;
2361
+ declare type MakeSelectionStyle = (view: EditorView, event: MouseEvent) => MouseSelectionStyle | null;
2326
2362
 
2327
2363
  /**
2328
2364
  Record used to represent information about a block-level element
2329
2365
  in the editor view.
2330
2366
  */
2331
- declare class BlockInfo$1 {
2367
+ declare class BlockInfo {
2332
2368
  /**
2333
2369
  The start of the element in the document.
2334
2370
  */
@@ -2350,7 +2386,7 @@ declare class BlockInfo$1 {
2350
2386
  The type of element this is. When querying lines, this may be
2351
2387
  an array of all the blocks that make up the line.
2352
2388
  */
2353
- readonly type: BlockType$1 | readonly BlockInfo$1[];
2389
+ readonly type: BlockType | readonly BlockInfo[];
2354
2390
  /**
2355
2391
  The end of the element as a document position.
2356
2392
  */
@@ -2364,7 +2400,7 @@ declare class BlockInfo$1 {
2364
2400
  /**
2365
2401
  Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
2366
2402
  */
2367
- declare enum Direction$1 {
2403
+ declare enum Direction {
2368
2404
  /**
2369
2405
  Left-to-right.
2370
2406
  */
@@ -2378,7 +2414,7 @@ declare enum Direction$1 {
2378
2414
  Represents a contiguous range of text that has a single direction
2379
2415
  (as in left-to-right or right-to-left).
2380
2416
  */
2381
- declare class BidiSpan$1 {
2417
+ declare class BidiSpan {
2382
2418
  /**
2383
2419
  The start of the span (relative to the start of the line).
2384
2420
  */
@@ -2398,13 +2434,19 @@ declare class BidiSpan$1 {
2398
2434
  /**
2399
2435
  The direction of this span.
2400
2436
  */
2401
- get dir(): Direction$1;
2437
+ get dir(): Direction;
2402
2438
  }
2403
2439
 
2404
- interface EditorConfig$1 {
2440
+ /**
2441
+ The type of object given to the [`EditorView`](https://codemirror.net/6/docs/ref/#view.EditorView)
2442
+ constructor.
2443
+ */
2444
+ interface EditorViewConfig extends EditorStateConfig {
2405
2445
  /**
2406
- The view's initial state. Defaults to an extension-less state
2407
- with an empty document.
2446
+ The view's initial state. If not given, a new state is created
2447
+ by passing this configuration object to
2448
+ [`EditorState.create`](https://codemirror.net/6/docs/ref/#state.EditorState^create), using its
2449
+ `doc`, `selection`, and `extensions` field (if provided).
2408
2450
  */
2409
2451
  state?: EditorState;
2410
2452
  /**
@@ -2436,7 +2478,7 @@ the editable DOM surface, and possibly other elements such as the
2436
2478
  line number gutter. It handles events and dispatches state
2437
2479
  transactions for editing actions.
2438
2480
  */
2439
- declare class EditorView$1 {
2481
+ declare class EditorView {
2440
2482
  /**
2441
2483
  The current editor state.
2442
2484
  */
@@ -2518,11 +2560,7 @@ declare class EditorView$1 {
2518
2560
  option, or put `view.dom` into your document after creating a
2519
2561
  view, so that the user can see the editor.
2520
2562
  */
2521
- constructor(
2522
- /**
2523
- Initialization options.
2524
- */
2525
- config?: EditorConfig$1);
2563
+ constructor(config?: EditorViewConfig);
2526
2564
  /**
2527
2565
  All regular editor state updates should go through this. It
2528
2566
  takes a transaction or transaction spec and updates the view to
@@ -2568,14 +2606,14 @@ declare class EditorView$1 {
2568
2606
  drawing done by other components is synchronized, avoiding
2569
2607
  unnecessary DOM layout computations.
2570
2608
  */
2571
- requestMeasure<T>(request?: MeasureRequest$1<T>): void;
2609
+ requestMeasure<T>(request?: MeasureRequest<T>): void;
2572
2610
  /**
2573
2611
  Get the value of a specific plugin, if present. Note that
2574
2612
  plugins that crash can be dropped from a view, so even when you
2575
2613
  know you registered a given plugin, it is recommended to check
2576
2614
  the return value of this method.
2577
2615
  */
2578
- plugin<T>(plugin: ViewPlugin$1<T>): T | null;
2616
+ plugin<T>(plugin: ViewPlugin<T>): T | null;
2579
2617
  /**
2580
2618
  The top position of the document, in screen coordinates. This
2581
2619
  may be negative when the editor is scrolled down. Points
@@ -2594,20 +2632,20 @@ declare class EditorView$1 {
2594
2632
  position (which is interpreted as relative to the [top of the
2595
2633
  document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop)
2596
2634
  */
2597
- elementAtHeight(height: number): BlockInfo$1;
2635
+ elementAtHeight(height: number): BlockInfo;
2598
2636
  /**
2599
2637
  Find the line block (see
2600
2638
  [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) at the given
2601
2639
  height.
2602
2640
  */
2603
- lineBlockAtHeight(height: number): BlockInfo$1;
2641
+ lineBlockAtHeight(height: number): BlockInfo;
2604
2642
  /**
2605
2643
  Get the extent and vertical position of all [line
2606
2644
  blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions
2607
2645
  are relative to the [top of the
2608
2646
  document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop);
2609
2647
  */
2610
- get viewportLineBlocks(): BlockInfo$1[];
2648
+ get viewportLineBlocks(): BlockInfo[];
2611
2649
  /**
2612
2650
  Find the line block around the given document position. A line
2613
2651
  block is a range delimited on both sides by either a
@@ -2616,7 +2654,7 @@ declare class EditorView$1 {
2616
2654
  text, but may be broken into multiple textblocks by block
2617
2655
  widgets.
2618
2656
  */
2619
- lineBlockAt(pos: number): BlockInfo$1;
2657
+ lineBlockAt(pos: number): BlockInfo;
2620
2658
  /**
2621
2659
  The editor's total content height.
2622
2660
  */
@@ -2708,7 +2746,7 @@ declare class EditorView$1 {
2708
2746
  available on the given side, the method will transparently use
2709
2747
  another strategy to get reasonable coordinates).
2710
2748
  */
2711
- coordsAtPos(pos: number, side?: -1 | 1): Rect$1 | null;
2749
+ coordsAtPos(pos: number, side?: -1 | 1): Rect | null;
2712
2750
  /**
2713
2751
  The default width of a character in the editor. May not
2714
2752
  accurately reflect the width of all characters (given variable
@@ -2725,7 +2763,7 @@ declare class EditorView$1 {
2725
2763
  ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction)
2726
2764
  CSS property) of the editor's content element.
2727
2765
  */
2728
- get textDirection(): Direction$1;
2766
+ get textDirection(): Direction;
2729
2767
  /**
2730
2768
  Find the text direction of the block at the given position, as
2731
2769
  assigned by CSS. If
@@ -2735,7 +2773,7 @@ declare class EditorView$1 {
2735
2773
  [`textDirection`](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). Note that
2736
2774
  this may trigger a DOM layout.
2737
2775
  */
2738
- textDirectionAt(pos: number): Direction$1;
2776
+ textDirectionAt(pos: number): Direction;
2739
2777
  /**
2740
2778
  Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping)
2741
2779
  (as determined by the
@@ -2751,7 +2789,7 @@ declare class EditorView$1 {
2751
2789
  left-to-right, the leftmost spans come first, otherwise the
2752
2790
  rightmost spans come first.
2753
2791
  */
2754
- bidiSpans(line: Line$1): readonly BidiSpan$1[];
2792
+ bidiSpans(line: Line$1): readonly BidiSpan[];
2755
2793
  /**
2756
2794
  Check whether the editor has focus.
2757
2795
  */
@@ -2780,13 +2818,13 @@ declare class EditorView$1 {
2780
2818
  to the top of the view, `"end"` to move it to the bottom, or
2781
2819
  `"center"` to move it to the center.
2782
2820
  */
2783
- y?: ScrollStrategy$1;
2821
+ y?: ScrollStrategy;
2784
2822
  /**
2785
2823
  Effect similar to
2786
2824
  [`y`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView^options.y), but for the
2787
2825
  horizontal scroll position.
2788
2826
  */
2789
- x?: ScrollStrategy$1;
2827
+ x?: ScrollStrategy;
2790
2828
  /**
2791
2829
  Extra vertical distance to add when moving something into
2792
2830
  view. Not used with the `"center"` strategy. Defaults to 5.
@@ -2818,7 +2856,7 @@ declare class EditorView$1 {
2818
2856
  editor's [scroll element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of
2819
2857
  its parent nodes is scrolled.
2820
2858
  */
2821
- static domEventHandlers(handlers: DOMEventHandlers$1<any>): Extension;
2859
+ static domEventHandlers(handlers: DOMEventHandlers<any>): Extension;
2822
2860
  /**
2823
2861
  An input handler can override the way changes to the editable
2824
2862
  DOM content are handled. Handlers are passed the document
@@ -2826,12 +2864,12 @@ declare class EditorView$1 {
2826
2864
  content. When one returns true, no further input handlers are
2827
2865
  called and the default behavior is prevented.
2828
2866
  */
2829
- static inputHandler: Facet<(view: EditorView$1, from: number, to: number, text: string) => boolean, readonly ((view: EditorView$1, from: number, to: number, text: string) => boolean)[]>;
2867
+ static inputHandler: Facet<(view: EditorView, from: number, to: number, text: string) => boolean, readonly ((view: EditorView, from: number, to: number, text: string) => boolean)[]>;
2830
2868
  /**
2831
2869
  By default, the editor assumes all its content has the same
2832
2870
  [text direction](https://codemirror.net/6/docs/ref/#view.Direction). Configure this with a `true`
2833
- value to make it read and store the text direction of every
2834
- (rendered) line separately.
2871
+ value to make it read the text direction of every (rendered)
2872
+ line separately.
2835
2873
  */
2836
2874
  static perLineTextDirection: Facet<boolean, boolean>;
2837
2875
  /**
@@ -2846,7 +2884,7 @@ declare class EditorView$1 {
2846
2884
  A facet that can be used to register a function to be called
2847
2885
  every time the view updates.
2848
2886
  */
2849
- static updateListener: Facet<(update: ViewUpdate$1) => void, readonly ((update: ViewUpdate$1) => void)[]>;
2887
+ static updateListener: Facet<(update: ViewUpdate) => void, readonly ((update: ViewUpdate) => void)[]>;
2850
2888
  /**
2851
2889
  Facet that controls whether the editor content DOM is editable.
2852
2890
  When its highest-precedence value is `false`, the element will
@@ -2862,7 +2900,7 @@ declare class EditorView$1 {
2862
2900
  on the editor, and can return an object that overrides the way a
2863
2901
  selection is computed from that mouse click or drag.
2864
2902
  */
2865
- static mouseSelectionStyle: Facet<MakeSelectionStyle$1, readonly MakeSelectionStyle$1[]>;
2903
+ static mouseSelectionStyle: Facet<MakeSelectionStyle, readonly MakeSelectionStyle[]>;
2866
2904
  /**
2867
2905
  Facet used to configure whether a given selection drag event
2868
2906
  should move or copy the selection. The given predicate will be
@@ -2888,7 +2926,7 @@ declare class EditorView$1 {
2888
2926
  and thus **must not** introduce block widgets or replacing
2889
2927
  decorations that cover line breaks.
2890
2928
  */
2891
- static decorations: Facet<DecorationSet$1 | ((view: EditorView$1) => DecorationSet$1), readonly (DecorationSet$1 | ((view: EditorView$1) => DecorationSet$1))[]>;
2929
+ static decorations: Facet<DecorationSet | ((view: EditorView) => DecorationSet), readonly (DecorationSet | ((view: EditorView) => DecorationSet))[]>;
2892
2930
  /**
2893
2931
  Used to provide ranges that should be treated as atoms as far as
2894
2932
  cursor motion is concerned. This causes methods like
@@ -2900,7 +2938,7 @@ declare class EditorView$1 {
2900
2938
  updates](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) from moving into such
2901
2939
  regions.
2902
2940
  */
2903
- static atomicRanges: Facet<(view: EditorView$1) => RangeSet<any>, readonly ((view: EditorView$1) => RangeSet<any>)[]>;
2941
+ static atomicRanges: Facet<(view: EditorView) => RangeSet<any>, readonly ((view: EditorView) => RangeSet<any>)[]>;
2904
2942
  /**
2905
2943
  Facet that allows extensions to provide additional scroll
2906
2944
  margins (space around the sides of the scrolling element that
@@ -2908,7 +2946,7 @@ declare class EditorView$1 {
2908
2946
  plugin introduces elements that cover part of that element (for
2909
2947
  example a horizontally fixed gutter).
2910
2948
  */
2911
- static scrollMargins: Facet<(view: EditorView$1) => Partial<Rect$1> | null, readonly ((view: EditorView$1) => Partial<Rect$1> | null)[]>;
2949
+ static scrollMargins: Facet<(view: EditorView) => Partial<Rect> | null, readonly ((view: EditorView) => Partial<Rect> | null)[]>;
2912
2950
  /**
2913
2951
  Create a theme extension. The first argument can be a
2914
2952
  [`style-mod`](https://github.com/marijnh/style-mod#documentation)
@@ -2953,12 +2991,12 @@ declare class EditorView$1 {
2953
2991
  Facet that provides additional DOM attributes for the editor's
2954
2992
  editable DOM element.
2955
2993
  */
2956
- static contentAttributes: Facet<AttrSource$1, readonly AttrSource$1[]>;
2994
+ static contentAttributes: Facet<AttrSource, readonly AttrSource[]>;
2957
2995
  /**
2958
2996
  Facet that provides DOM attributes for the editor's outer
2959
2997
  element.
2960
2998
  */
2961
- static editorAttributes: Facet<AttrSource$1, readonly AttrSource$1[]>;
2999
+ static editorAttributes: Facet<AttrSource, readonly AttrSource[]>;
2962
3000
  /**
2963
3001
  An extension that enables line wrapping in the editor (by
2964
3002
  setting CSS `white-space` to `pre-wrap` in the content).
@@ -2973,12 +3011,17 @@ declare class EditorView$1 {
2973
3011
  search match).
2974
3012
  */
2975
3013
  static announce: StateEffectType<string>;
3014
+ /**
3015
+ Retrieve an editor view instance from the view's DOM
3016
+ representation.
3017
+ */
3018
+ static findFromDOM(dom: HTMLElement): EditorView | null;
2976
3019
  }
2977
3020
  /**
2978
3021
  Helper type that maps event names to event object types, or the
2979
3022
  `any` type for unknown events.
2980
3023
  */
2981
- interface DOMEventMap$1 extends HTMLElementEventMap {
3024
+ interface DOMEventMap extends HTMLElementEventMap {
2982
3025
  [other: string]: any;
2983
3026
  }
2984
3027
  /**
@@ -2988,8 +3031,8 @@ to hold the appropriate event object type. For unknown events, it
2988
3031
  is inferred to `any`, and should be explicitly set if you want type
2989
3032
  checking.
2990
3033
  */
2991
- declare type DOMEventHandlers$1<This> = {
2992
- [event in keyof DOMEventMap$1]?: (this: This, event: DOMEventMap$1[event], view: EditorView$1) => boolean | void;
3034
+ declare type DOMEventHandlers<This> = {
3035
+ [event in keyof DOMEventMap]?: (this: This, event: DOMEventMap[event], view: EditorView) => boolean | void;
2993
3036
  };
2994
3037
 
2995
3038
  /**
@@ -3174,7 +3217,7 @@ represent a matching configuration.
3174
3217
  */
3175
3218
  declare class MatchDecorator {
3176
3219
  private regexp;
3177
- private getDeco;
3220
+ private addMatch;
3178
3221
  private boundary;
3179
3222
  private maxLength;
3180
3223
  /**
@@ -3191,7 +3234,18 @@ declare class MatchDecorator {
3191
3234
  The decoration to apply to matches, either directly or as a
3192
3235
  function of the match.
3193
3236
  */
3194
- decoration: Decoration$1 | ((match: RegExpExecArray, view: EditorView$1, pos: number) => Decoration$1);
3237
+ decoration?: Decoration | ((match: RegExpExecArray, view: EditorView, pos: number) => Decoration);
3238
+ /**
3239
+ Customize the way decorations are added for matches. This
3240
+ function, when given, will be called for matches and should
3241
+ call `add` to create decorations for them. Note that the
3242
+ decorations should appear *in* the given range, and the
3243
+ function should have no side effects beyond calling `add`.
3244
+
3245
+ The `decoration` option is ignored when `decorate` is
3246
+ provided.
3247
+ */
3248
+ decorate?: (add: (from: number, to: number, decoration: Decoration) => void, from: number, to: number, match: RegExpExecArray, view: EditorView) => void;
3195
3249
  /**
3196
3250
  By default, changed lines are re-matched entirely. You can
3197
3251
  provide a boundary expression, which should match single
@@ -3213,13 +3267,13 @@ declare class MatchDecorator {
3213
3267
  view's viewport. You'll want to call this when initializing your
3214
3268
  plugin.
3215
3269
  */
3216
- createDeco(view: EditorView$1): RangeSet<Decoration$1>;
3270
+ createDeco(view: EditorView): RangeSet<Decoration>;
3217
3271
  /**
3218
3272
  Update a set of decorations for a view update. `deco` _must_ be
3219
3273
  the set of decorations produced by _this_ `MatchDecorator` for
3220
3274
  the view state before the update.
3221
3275
  */
3222
- updateDeco(update: ViewUpdate$1, deco: DecorationSet$1): DecorationSet$1;
3276
+ updateDeco(update: ViewUpdate, deco: DecorationSet): DecorationSet;
3223
3277
  private updateRange;
3224
3278
  }
3225
3279
 
@@ -3255,7 +3309,7 @@ declare function tooltips(config?: {
3255
3309
  for showing tooltips. You can provide a function here that
3256
3310
  returns an alternative rectangle.
3257
3311
  */
3258
- tooltipSpace?: (view: EditorView$1) => {
3312
+ tooltipSpace?: (view: EditorView) => {
3259
3313
  top: number;
3260
3314
  left: number;
3261
3315
  bottom: number;
@@ -3281,7 +3335,7 @@ interface Tooltip {
3281
3335
  A constructor function that creates the tooltip's [DOM
3282
3336
  representation](https://codemirror.net/6/docs/ref/#view.TooltipView).
3283
3337
  */
3284
- create(view: EditorView$1): TooltipView;
3338
+ create(view: EditorView): TooltipView;
3285
3339
  /**
3286
3340
  Whether the tooltip should be shown above or below the target
3287
3341
  position. Not guaranteed to be respected for hover tooltips
@@ -3327,7 +3381,7 @@ interface TooltipView {
3327
3381
  to make the tooltip view itself responsible for finding its
3328
3382
  screen position.
3329
3383
  */
3330
- getCoords?: (pos: number) => Rect$1;
3384
+ getCoords?: (pos: number) => Rect;
3331
3385
  /**
3332
3386
  By default, tooltips are moved when they overlap with other
3333
3387
  tooltips. Set this to `true` to disable that behavior for this
@@ -3337,11 +3391,11 @@ interface TooltipView {
3337
3391
  /**
3338
3392
  Called after the tooltip is added to the DOM for the first time.
3339
3393
  */
3340
- mount?(view: EditorView$1): void;
3394
+ mount?(view: EditorView): void;
3341
3395
  /**
3342
3396
  Update the DOM element for a change in the view's state.
3343
3397
  */
3344
- update?(update: ViewUpdate$1): void;
3398
+ update?(update: ViewUpdate): void;
3345
3399
  /**
3346
3400
  Called when the tooltip has been (re)positioned.
3347
3401
  */
@@ -3357,7 +3411,7 @@ tooltips. This can be useful when something happens (such as a
3357
3411
  re-positioning or CSS change affecting the editor) that could
3358
3412
  invalidate the existing tooltip positions.
3359
3413
  */
3360
- declare function repositionTooltips(view: EditorView$1): void;
3414
+ declare function repositionTooltips(view: EditorView): void;
3361
3415
  /**
3362
3416
  Object that describes an active panel.
3363
3417
  */
@@ -3374,7 +3428,7 @@ interface Panel {
3374
3428
  /**
3375
3429
  Update the DOM for a given view update.
3376
3430
  */
3377
- update?(update: ViewUpdate$1): void;
3431
+ update?(update: ViewUpdate): void;
3378
3432
  /**
3379
3433
  Called when the panel is removed from the editor or the editor
3380
3434
  is destroyed.
@@ -3390,7 +3444,7 @@ interface Panel {
3390
3444
  A function that initializes a panel. Used in
3391
3445
  [`showPanel`](https://codemirror.net/6/docs/ref/#view.showPanel).
3392
3446
  */
3393
- declare type PanelConstructor = (view: EditorView$1) => Panel;
3447
+ declare type PanelConstructor = (view: EditorView) => Panel;
3394
3448
  /**
3395
3449
  Opening a panel is done by providing a constructor function for
3396
3450
  the panel through this facet. (The panel is closed again when its
@@ -3411,7 +3465,7 @@ declare abstract class GutterMarker extends RangeValue {
3411
3465
  /**
3412
3466
  Render the DOM node for this marker, if any.
3413
3467
  */
3414
- toDOM?(view: EditorView$1): Node;
3468
+ toDOM?(view: EditorView): Node;
3415
3469
  /**
3416
3470
  This property can be used to add CSS classes to the gutter
3417
3471
  element that contains this marker.
@@ -3424,7 +3478,7 @@ declare abstract class GutterMarker extends RangeValue {
3424
3478
  destroy(dom: Node): void;
3425
3479
  }
3426
3480
  declare type Handlers$1 = {
3427
- [event: string]: (view: EditorView$1, line: BlockInfo$1, event: Event) => boolean;
3481
+ [event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean;
3428
3482
  };
3429
3483
  interface GutterConfig {
3430
3484
  /**
@@ -3440,26 +3494,26 @@ interface GutterConfig {
3440
3494
  /**
3441
3495
  Retrieve a set of markers to use in this gutter.
3442
3496
  */
3443
- markers?: (view: EditorView$1) => (RangeSet<GutterMarker> | readonly RangeSet<GutterMarker>[]);
3497
+ markers?: (view: EditorView) => (RangeSet<GutterMarker> | readonly RangeSet<GutterMarker>[]);
3444
3498
  /**
3445
3499
  Can be used to optionally add a single marker to every line.
3446
3500
  */
3447
- lineMarker?: (view: EditorView$1, line: BlockInfo$1, otherMarkers: readonly GutterMarker[]) => GutterMarker | null;
3501
+ lineMarker?: (view: EditorView, line: BlockInfo, otherMarkers: readonly GutterMarker[]) => GutterMarker | null;
3448
3502
  /**
3449
3503
  If line markers depend on additional state, and should be
3450
3504
  updated when that changes, pass a predicate here that checks
3451
3505
  whether a given view update might change the line markers.
3452
3506
  */
3453
- lineMarkerChange?: null | ((update: ViewUpdate$1) => boolean);
3507
+ lineMarkerChange?: null | ((update: ViewUpdate) => boolean);
3454
3508
  /**
3455
3509
  Add a hidden spacer element that gives the gutter its base
3456
3510
  width.
3457
3511
  */
3458
- initialSpacer?: null | ((view: EditorView$1) => GutterMarker);
3512
+ initialSpacer?: null | ((view: EditorView) => GutterMarker);
3459
3513
  /**
3460
3514
  Update the spacer element when the view is updated.
3461
3515
  */
3462
- updateSpacer?: null | ((spacer: GutterMarker, update: ViewUpdate$1) => GutterMarker);
3516
+ updateSpacer?: null | ((spacer: GutterMarker, update: ViewUpdate) => GutterMarker);
3463
3517
  /**
3464
3518
  Supply event handlers for DOM events on this gutter.
3465
3519
  */
@@ -3959,7 +4013,7 @@ interface FoldConfig {
3959
4013
  When this option isn't given, the `placeholderText` option will
3960
4014
  be used to create the placeholder element.
3961
4015
  */
3962
- placeholderDOM?: ((view: EditorView$1, onclick: (event: Event) => void) => HTMLElement) | null;
4016
+ placeholderDOM?: ((view: EditorView, onclick: (event: Event) => void) => HTMLElement) | null;
3963
4017
  /**
3964
4018
  Text to use as placeholder for folded text. Defaults to `"…"`.
3965
4019
  Will be styled with the `"cm-foldPlaceholder"` class.
@@ -3971,7 +4025,7 @@ Create an extension that configures code folding.
3971
4025
  */
3972
4026
  declare function codeFolding(config?: FoldConfig): Extension;
3973
4027
  declare type Handlers = {
3974
- [event: string]: (view: EditorView$1, line: BlockInfo$1, event: Event) => boolean;
4028
+ [event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean;
3975
4029
  };
3976
4030
  interface FoldGutterConfig {
3977
4031
  /**
@@ -3994,6 +4048,11 @@ interface FoldGutterConfig {
3994
4048
  Supply event handlers for DOM events on this gutter.
3995
4049
  */
3996
4050
  domEventHandlers?: Handlers;
4051
+ /**
4052
+ When given, if this returns true for a given view update,
4053
+ recompute the fold markers.
4054
+ */
4055
+ foldingChanged?: (update: ViewUpdate) => boolean;
3997
4056
  }
3998
4057
  /**
3999
4058
  Create an extension that registers a fold gutter, which shows a
@@ -4120,7 +4179,7 @@ interface Config {
4120
4179
  `cm-matchingBracket` class for matching pairs, and
4121
4180
  `cm-nonmatchingBracket` for mismatched pairs or single brackets.
4122
4181
  */
4123
- renderMatch?: (match: MatchResult, state: EditorState) => readonly Range<Decoration$1>[];
4182
+ renderMatch?: (match: MatchResult, state: EditorState) => readonly Range<Decoration>[];
4124
4183
  }
4125
4184
  /**
4126
4185
  Create an extension that enables bracket matching. Whenever the
@@ -4179,6 +4238,18 @@ declare class StringStream {
4179
4238
  private lastColumnPos;
4180
4239
  private lastColumnValue;
4181
4240
  /**
4241
+ Create a stream.
4242
+ */
4243
+ constructor(
4244
+ /**
4245
+ The line.
4246
+ */
4247
+ string: string, tabSize: number,
4248
+ /**
4249
+ The current indent unit size.
4250
+ */
4251
+ indentUnit: number);
4252
+ /**
4182
4253
  True if we are at the end of the line.
4183
4254
  */
4184
4255
  eol(): boolean;
@@ -4328,6 +4399,15 @@ interface CompletionConfig {
4328
4399
  */
4329
4400
  activateOnTyping?: boolean;
4330
4401
  /**
4402
+ By default, when completion opens, the first option is selected
4403
+ and can be confirmed with
4404
+ [`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion). When this
4405
+ is set to false, the completion widget starts with no completion
4406
+ selected, and the user has to explicitly move to a completion
4407
+ before you can confirm one.
4408
+ */
4409
+ selectOnOpen?: boolean;
4410
+ /**
4331
4411
  Override the completion sources used. By default, they will be
4332
4412
  taken from the `"autocomplete"` [language
4333
4413
  data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) (which should hold
@@ -4336,6 +4416,11 @@ interface CompletionConfig {
4336
4416
  */
4337
4417
  override?: readonly CompletionSource[] | null;
4338
4418
  /**
4419
+ Determines whether the completion tooltip is closed when the
4420
+ editor loses focus. Defaults to true.
4421
+ */
4422
+ closeOnBlur?: boolean;
4423
+ /**
4339
4424
  The maximum number of options to render to the DOM.
4340
4425
  */
4341
4426
  maxRenderedOptions?: number;
@@ -4376,6 +4461,12 @@ interface CompletionConfig {
4376
4461
  render: (completion: Completion, state: EditorState) => Node | null;
4377
4462
  position: number;
4378
4463
  }[];
4464
+ /**
4465
+ The comparison function to use when sorting completions with the same
4466
+ match score. Defaults to using
4467
+ [`localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare).
4468
+ */
4469
+ compareCompletions?: (a: Completion, b: Completion) => number;
4379
4470
  }
4380
4471
 
4381
4472
  /**
@@ -4408,7 +4499,7 @@ interface Completion {
4408
4499
  adding the [`pickedCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.pickedCompletion)
4409
4500
  annotation to it.
4410
4501
  */
4411
- apply?: string | ((view: EditorView$1, completion: Completion, from: number, to: number) => void);
4502
+ apply?: string | ((view: EditorView, completion: Completion, from: number, to: number) => void);
4412
4503
  /**
4413
4504
  The type of the completion. This is used to pick an icon to show
4414
4505
  for the completion. Icons are styled with a CSS class created by
@@ -4551,6 +4642,14 @@ interface CompletionResult {
4551
4642
  */
4552
4643
  filter?: boolean;
4553
4644
  /**
4645
+ When [`filter`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.filter) is set to
4646
+ `false`, this may be provided to compute the ranges on the label
4647
+ that match the input. Should return an array of numbers where
4648
+ each pair of adjacent numbers provide the start and end of a
4649
+ range.
4650
+ */
4651
+ getMatch?: (completion: Completion) => readonly number[];
4652
+ /**
4554
4653
  Synchronously update the completion result after typing or
4555
4654
  deletion. If given, this should not do any expensive work, since
4556
4655
  it will be called during editor state updates. The function
@@ -4667,6 +4766,9 @@ interface AttrSpec {
4667
4766
  */
4668
4767
  completion?: Partial<Completion>;
4669
4768
  }
4769
+ /**
4770
+ Create a completion source for the given schema.
4771
+ */
4670
4772
  declare function completeFromSchema(eltSpecs: readonly ElementSpec[], attrSpecs: readonly AttrSpec[]): CompletionSource;
4671
4773
 
4672
4774
  /**
@@ -4935,12 +5037,14 @@ declare function markdown$1(config?: {
4935
5037
  */
4936
5038
  defaultCodeLanguage?: Language | LanguageSupport;
4937
5039
  /**
4938
- A collection of language descriptions to search through for a
4939
- matching language (with
4940
- [`LanguageDescription.matchLanguageName`](https://codemirror.net/6/docs/ref/#language.LanguageDescription^matchLanguageName))
4941
- when a fenced code block has an info string.
5040
+ A source of language support for highlighting fenced code
5041
+ blocks. When it is an array, the parser will use
5042
+ [`LanguageDescription.matchLanguageName`](https://codemirror.net/6/docs/ref/#language.LanguageDescription^matchLanguageName)
5043
+ with the fenced code info to find a matching language. When it
5044
+ is a function, will be called with the info string and may
5045
+ return a language or `LanguageDescription` object.
4942
5046
  */
4943
- codeLanguages?: readonly LanguageDescription[];
5047
+ codeLanguages?: readonly LanguageDescription[] | ((info: string) => Language | LanguageDescription | null);
4944
5048
  /**
4945
5049
  Set this to false to disable installation of the Markdown
4946
5050
  [keymap](https://codemirror.net/6/docs/ref/#lang-markdown.markdownKeymap).
@@ -4975,1212 +5079,86 @@ declare namespace _codemirror_lang_markdown {
4975
5079
  };
4976
5080
  }
4977
5081
 
4978
- declare type Attrs = {
4979
- [name: string]: string;
4980
- };
4981
-
4982
- interface MarkDecorationSpec {
5082
+ /**
5083
+ Describes a problem or hint for a piece of code.
5084
+ */
5085
+ interface Diagnostic {
4983
5086
  /**
4984
- Whether the mark covers its start and end position or not. This
4985
- influences whether content inserted at those positions becomes
4986
- part of the mark. Defaults to false.
5087
+ The start position of the relevant text.
4987
5088
  */
4988
- inclusive?: boolean;
5089
+ from: number;
4989
5090
  /**
4990
- Specify whether the start position of the marked range should be
4991
- inclusive. Overrides `inclusive`, when both are present.
5091
+ The end position. May be equal to `from`, though actually
5092
+ covering text is preferable.
4992
5093
  */
4993
- inclusiveStart?: boolean;
5094
+ to: number;
4994
5095
  /**
4995
- Whether the end should be inclusive.
5096
+ The severity of the problem. This will influence how it is
5097
+ displayed.
4996
5098
  */
4997
- inclusiveEnd?: boolean;
5099
+ severity: "info" | "warning" | "error";
4998
5100
  /**
4999
- Add attributes to the DOM elements that hold the text in the
5000
- marked range.
5101
+ An optional source string indicating where the diagnostic is
5102
+ coming from. You can put the name of your linter here, if
5103
+ applicable.
5001
5104
  */
5002
- attributes?: {
5003
- [key: string]: string;
5004
- };
5105
+ source?: string;
5005
5106
  /**
5006
- Shorthand for `{attributes: {class: value}}`.
5107
+ The message associated with this diagnostic.
5007
5108
  */
5008
- class?: string;
5109
+ message: string;
5009
5110
  /**
5010
- Add a wrapping element around the text in the marked range. Note
5011
- that there will not necessarily be a single element covering the
5012
- entire range—other decorations with lower precedence might split
5013
- this one if they partially overlap it, and line breaks always
5014
- end decoration elements.
5111
+ An optional custom rendering function that displays the message
5112
+ as a DOM node.
5015
5113
  */
5016
- tagName?: string;
5114
+ renderMessage?: () => Node;
5017
5115
  /**
5018
- Decoration specs allow extra properties, which can be retrieved
5019
- through the decoration's [`spec`](https://codemirror.net/6/docs/ref/#view.Decoration.spec)
5020
- property.
5116
+ An optional array of actions that can be taken on this
5117
+ diagnostic.
5021
5118
  */
5022
- [other: string]: any;
5119
+ actions?: readonly Action[];
5023
5120
  }
5024
- interface WidgetDecorationSpec {
5121
+ /**
5122
+ An action associated with a diagnostic.
5123
+ */
5124
+ interface Action {
5025
5125
  /**
5026
- The type of widget to draw here.
5126
+ The label to show to the user. Should be relatively short.
5027
5127
  */
5028
- widget: WidgetType;
5128
+ name: string;
5029
5129
  /**
5030
- Which side of the given position the widget is on. When this is
5031
- positive, the widget will be drawn after the cursor if the
5032
- cursor is on the same position. Otherwise, it'll be drawn before
5033
- it. When multiple widgets sit at the same position, their `side`
5034
- values will determine their ordering—those with a lower value
5035
- come first. Defaults to 0.
5130
+ The function to call when the user activates this action. Is
5131
+ given the diagnostic's _current_ position, which may have
5132
+ changed since the creation of the diagnostic, due to editing.
5036
5133
  */
5037
- side?: number;
5038
- /**
5039
- Determines whether this is a block widgets, which will be drawn
5040
- between lines, or an inline widget (the default) which is drawn
5041
- between the surrounding text.
5134
+ apply: (view: EditorView, from: number, to: number) => void;
5135
+ }
5042
5136
 
5043
- Note that block-level decorations should not have vertical
5044
- margins, and if you dynamically change their height, you should
5045
- make sure to call
5046
- [`requestMeasure`](https://codemirror.net/6/docs/ref/#view.EditorView.requestMeasure), so that the
5047
- editor can update its information about its vertical layout.
5048
- */
5049
- block?: boolean;
5050
- /**
5051
- Other properties are allowed.
5052
- */
5053
- [other: string]: any;
5054
- }
5055
- interface ReplaceDecorationSpec {
5056
- /**
5057
- An optional widget to drawn in the place of the replaced
5058
- content.
5059
- */
5060
- widget?: WidgetType;
5061
- /**
5062
- Whether this range covers the positions on its sides. This
5063
- influences whether new content becomes part of the range and
5064
- whether the cursor can be drawn on its sides. Defaults to false
5065
- for inline replacements, and true for block replacements.
5066
- */
5067
- inclusive?: boolean;
5068
- /**
5069
- Set inclusivity at the start.
5070
- */
5071
- inclusiveStart?: boolean;
5072
- /**
5073
- Set inclusivity at the end.
5074
- */
5075
- inclusiveEnd?: boolean;
5076
- /**
5077
- Whether this is a block-level decoration. Defaults to false.
5078
- */
5079
- block?: boolean;
5080
- /**
5081
- Other properties are allowed.
5082
- */
5083
- [other: string]: any;
5084
- }
5085
- interface LineDecorationSpec {
5086
- /**
5087
- DOM attributes to add to the element wrapping the line.
5088
- */
5089
- attributes?: {
5090
- [key: string]: string;
5091
- };
5092
- /**
5093
- Shorthand for `{attributes: {class: value}}`.
5094
- */
5095
- class?: string;
5096
- /**
5097
- Other properties are allowed.
5098
- */
5099
- [other: string]: any;
5100
- }
5101
- /**
5102
- Widgets added to the content are described by subclasses of this
5103
- class. Using a description object like that makes it possible to
5104
- delay creating of the DOM structure for a widget until it is
5105
- needed, and to avoid redrawing widgets even if the decorations
5106
- that define them are recreated.
5107
- */
5108
- declare abstract class WidgetType {
5109
- /**
5110
- Build the DOM structure for this widget instance.
5111
- */
5112
- abstract toDOM(view: EditorView): HTMLElement;
5113
- /**
5114
- Compare this instance to another instance of the same type.
5115
- (TypeScript can't express this, but only instances of the same
5116
- specific class will be passed to this method.) This is used to
5117
- avoid redrawing widgets when they are replaced by a new
5118
- decoration of the same type. The default implementation just
5119
- returns `false`, which will cause new instances of the widget to
5120
- always be redrawn.
5121
- */
5122
- eq(widget: WidgetType): boolean;
5123
- /**
5124
- Update a DOM element created by a widget of the same type (but
5125
- different, non-`eq` content) to reflect this widget. May return
5126
- true to indicate that it could update, false to indicate it
5127
- couldn't (in which case the widget will be redrawn). The default
5128
- implementation just returns false.
5129
- */
5130
- updateDOM(dom: HTMLElement): boolean;
5131
- /**
5132
- The estimated height this widget will have, to be used when
5133
- estimating the height of content that hasn't been drawn. May
5134
- return -1 to indicate you don't know. The default implementation
5135
- returns -1.
5136
- */
5137
- get estimatedHeight(): number;
5138
- /**
5139
- Can be used to configure which kinds of events inside the widget
5140
- should be ignored by the editor. The default is to ignore all
5141
- events.
5142
- */
5143
- ignoreEvent(event: Event): boolean;
5144
- /**
5145
- This is called when the an instance of the widget is removed
5146
- from the editor view.
5147
- */
5148
- destroy(dom: HTMLElement): void;
5149
- }
5150
- /**
5151
- A decoration set represents a collection of decorated ranges,
5152
- organized for efficient access and mapping. See
5153
- [`RangeSet`](https://codemirror.net/6/docs/ref/#state.RangeSet) for its methods.
5154
- */
5155
- declare type DecorationSet = RangeSet<Decoration>;
5156
- /**
5157
- The different types of blocks that can occur in an editor view.
5158
- */
5159
- declare enum BlockType {
5160
- /**
5161
- A line of text.
5162
- */
5163
- Text = 0,
5164
- /**
5165
- A block widget associated with the position after it.
5166
- */
5167
- WidgetBefore = 1,
5168
- /**
5169
- A block widget associated with the position before it.
5170
- */
5171
- WidgetAfter = 2,
5172
- /**
5173
- A block widget [replacing](https://codemirror.net/6/docs/ref/#view.Decoration^replace) a range of content.
5174
- */
5175
- WidgetRange = 3
5176
- }
5177
- /**
5178
- A decoration provides information on how to draw or style a piece
5179
- of content. You'll usually use it wrapped in a
5180
- [`Range`](https://codemirror.net/6/docs/ref/#state.Range), which adds a start and end position.
5181
- @nonabstract
5182
- */
5183
- declare abstract class Decoration extends RangeValue {
5184
- /**
5185
- The config object used to create this decoration. You can
5186
- include additional properties in there to store metadata about
5187
- your decoration.
5188
- */
5189
- readonly spec: any;
5190
- protected constructor(
5191
- /**
5192
- @internal
5193
- */
5194
- startSide: number,
5195
- /**
5196
- @internal
5197
- */
5198
- endSide: number,
5199
- /**
5200
- @internal
5201
- */
5202
- widget: WidgetType | null,
5203
- /**
5204
- The config object used to create this decoration. You can
5205
- include additional properties in there to store metadata about
5206
- your decoration.
5207
- */
5208
- spec: any);
5209
- abstract eq(other: Decoration): boolean;
5210
- /**
5211
- Create a mark decoration, which influences the styling of the
5212
- content in its range. Nested mark decorations will cause nested
5213
- DOM elements to be created. Nesting order is determined by
5214
- precedence of the [facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), with
5215
- the higher-precedence decorations creating the inner DOM nodes.
5216
- Such elements are split on line boundaries and on the boundaries
5217
- of lower-precedence decorations.
5218
- */
5219
- static mark(spec: MarkDecorationSpec): Decoration;
5220
- /**
5221
- Create a widget decoration, which displays a DOM element at the
5222
- given position.
5223
- */
5224
- static widget(spec: WidgetDecorationSpec): Decoration;
5225
- /**
5226
- Create a replace decoration which replaces the given range with
5227
- a widget, or simply hides it.
5228
- */
5229
- static replace(spec: ReplaceDecorationSpec): Decoration;
5230
- /**
5231
- Create a line decoration, which can add DOM attributes to the
5232
- line starting at the given position.
5233
- */
5234
- static line(spec: LineDecorationSpec): Decoration;
5235
- /**
5236
- Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given
5237
- decorated range or ranges. If the ranges aren't already sorted,
5238
- pass `true` for `sort` to make the library sort them for you.
5239
- */
5240
- static set(of: Range<Decoration> | readonly Range<Decoration>[], sort?: boolean): DecorationSet;
5241
- /**
5242
- The empty set of decorations.
5243
- */
5244
- static none: DecorationSet;
5245
- }
5246
-
5247
- /**
5248
- Basic rectangle type.
5249
- */
5250
- interface Rect {
5251
- readonly left: number;
5252
- readonly right: number;
5253
- readonly top: number;
5254
- readonly bottom: number;
5255
- }
5256
- declare type ScrollStrategy = "nearest" | "start" | "end" | "center";
5257
- /**
5258
- This is the interface plugin objects conform to.
5259
- */
5260
- interface PluginValue extends Object {
5261
- /**
5262
- Notifies the plugin of an update that happened in the view. This
5263
- is called _before_ the view updates its own DOM. It is
5264
- responsible for updating the plugin's internal state (including
5265
- any state that may be read by plugin fields) and _writing_ to
5266
- the DOM for the changes in the update. To avoid unnecessary
5267
- layout recomputations, it should _not_ read the DOM layout—use
5268
- [`requestMeasure`](https://codemirror.net/6/docs/ref/#view.EditorView.requestMeasure) to schedule
5269
- your code in a DOM reading phase if you need to.
5270
- */
5271
- update?(update: ViewUpdate): void;
5272
- /**
5273
- Called when the plugin is no longer going to be used. Should
5274
- revert any changes the plugin made to the DOM.
5275
- */
5276
- destroy?(): void;
5277
- }
5278
- /**
5279
- Provides additional information when defining a [view
5280
- plugin](https://codemirror.net/6/docs/ref/#view.ViewPlugin).
5281
- */
5282
- interface PluginSpec<V extends PluginValue> {
5283
- /**
5284
- Register the given [event
5285
- handlers](https://codemirror.net/6/docs/ref/#view.EditorView^domEventHandlers) for the plugin.
5286
- When called, these will have their `this` bound to the plugin
5287
- value.
5288
- */
5289
- eventHandlers?: DOMEventHandlers<V>;
5290
- /**
5291
- Specify that the plugin provides additional extensions when
5292
- added to an editor configuration.
5293
- */
5294
- provide?: (plugin: ViewPlugin<V>) => Extension;
5295
- /**
5296
- Allow the plugin to provide decorations. When given, this should
5297
- be a function that take the plugin value and return a
5298
- [decoration set](https://codemirror.net/6/docs/ref/#view.DecorationSet). See also the caveat about
5299
- [layout-changing decorations](https://codemirror.net/6/docs/ref/#view.EditorView^decorations) that
5300
- depend on the view.
5301
- */
5302
- decorations?: (value: V) => DecorationSet;
5303
- }
5304
- /**
5305
- View plugins associate stateful values with a view. They can
5306
- influence the way the content is drawn, and are notified of things
5307
- that happen in the view.
5308
- */
5309
- declare class ViewPlugin<V extends PluginValue> {
5310
- /**
5311
- Instances of this class act as extensions.
5312
- */
5313
- extension: Extension;
5314
- private constructor();
5315
- /**
5316
- Define a plugin from a constructor function that creates the
5317
- plugin's value, given an editor view.
5318
- */
5319
- static define<V extends PluginValue>(create: (view: EditorView) => V, spec?: PluginSpec<V>): ViewPlugin<V>;
5320
- /**
5321
- Create a plugin for a class whose constructor takes a single
5322
- editor view as argument.
5323
- */
5324
- static fromClass<V extends PluginValue>(cls: {
5325
- new (view: EditorView): V;
5326
- }, spec?: PluginSpec<V>): ViewPlugin<V>;
5327
- }
5328
- interface MeasureRequest<T> {
5329
- /**
5330
- Called in a DOM read phase to gather information that requires
5331
- DOM layout. Should _not_ mutate the document.
5332
- */
5333
- read(view: EditorView): T;
5334
- /**
5335
- Called in a DOM write phase to update the document. Should _not_
5336
- do anything that triggers DOM layout.
5337
- */
5338
- write?(measure: T, view: EditorView): void;
5339
- /**
5340
- When multiple requests with the same key are scheduled, only the
5341
- last one will actually be ran.
5342
- */
5343
- key?: any;
5344
- }
5345
- declare type AttrSource = Attrs | ((view: EditorView) => Attrs | null);
5346
- /**
5347
- View [plugins](https://codemirror.net/6/docs/ref/#view.ViewPlugin) are given instances of this
5348
- class, which describe what happened, whenever the view is updated.
5349
- */
5350
- declare class ViewUpdate {
5351
- /**
5352
- The editor view that the update is associated with.
5353
- */
5354
- readonly view: EditorView;
5355
- /**
5356
- The new editor state.
5357
- */
5358
- readonly state: EditorState;
5359
- /**
5360
- The transactions involved in the update. May be empty.
5361
- */
5362
- readonly transactions: readonly Transaction[];
5363
- /**
5364
- The changes made to the document by this update.
5365
- */
5366
- readonly changes: ChangeSet;
5367
- /**
5368
- The previous editor state.
5369
- */
5370
- readonly startState: EditorState;
5371
- private constructor();
5372
- /**
5373
- Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or
5374
- [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this
5375
- update.
5376
- */
5377
- get viewportChanged(): boolean;
5378
- /**
5379
- Indicates whether the height of a block element in the editor
5380
- changed in this update.
5381
- */
5382
- get heightChanged(): boolean;
5383
- /**
5384
- Returns true when the document was modified or the size of the
5385
- editor, or elements within the editor, changed.
5386
- */
5387
- get geometryChanged(): boolean;
5388
- /**
5389
- True when this update indicates a focus change.
5390
- */
5391
- get focusChanged(): boolean;
5392
- /**
5393
- Whether the document changed in this update.
5394
- */
5395
- get docChanged(): boolean;
5396
- /**
5397
- Whether the selection was explicitly set in this update.
5398
- */
5399
- get selectionSet(): boolean;
5400
- }
5401
-
5402
- /**
5403
- Interface that objects registered with
5404
- [`EditorView.mouseSelectionStyle`](https://codemirror.net/6/docs/ref/#view.EditorView^mouseSelectionStyle)
5405
- must conform to.
5406
- */
5407
- interface MouseSelectionStyle {
5408
- /**
5409
- Return a new selection for the mouse gesture that starts with
5410
- the event that was originally given to the constructor, and ends
5411
- with the event passed here. In case of a plain click, those may
5412
- both be the `mousedown` event, in case of a drag gesture, the
5413
- latest `mousemove` event will be passed.
5414
-
5415
- When `extend` is true, that means the new selection should, if
5416
- possible, extend the start selection. If `multiple` is true, the
5417
- new selection should be added to the original selection.
5418
- */
5419
- get: (curEvent: MouseEvent, extend: boolean, multiple: boolean) => EditorSelection;
5420
- /**
5421
- Called when the view is updated while the gesture is in
5422
- progress. When the document changes, it may be necessary to map
5423
- some data (like the original selection or start position)
5424
- through the changes.
5425
-
5426
- This may return `true` to indicate that the `get` method should
5427
- get queried again after the update, because something in the
5428
- update could change its result. Be wary of infinite loops when
5429
- using this (where `get` returns a new selection, which will
5430
- trigger `update`, which schedules another `get` in response).
5431
- */
5432
- update: (update: ViewUpdate) => boolean | void;
5433
- }
5434
- declare type MakeSelectionStyle = (view: EditorView, event: MouseEvent) => MouseSelectionStyle | null;
5435
-
5436
- /**
5437
- Record used to represent information about a block-level element
5438
- in the editor view.
5439
- */
5440
- declare class BlockInfo {
5441
- /**
5442
- The start of the element in the document.
5443
- */
5444
- readonly from: number;
5445
- /**
5446
- The length of the element.
5447
- */
5448
- readonly length: number;
5449
- /**
5450
- The top position of the element (relative to the top of the
5451
- document).
5452
- */
5453
- readonly top: number;
5454
- /**
5455
- Its height.
5456
- */
5457
- readonly height: number;
5458
- /**
5459
- The type of element this is. When querying lines, this may be
5460
- an array of all the blocks that make up the line.
5461
- */
5462
- readonly type: BlockType | readonly BlockInfo[];
5463
- /**
5464
- The end of the element as a document position.
5465
- */
5466
- get to(): number;
5467
- /**
5468
- The bottom position of the element.
5469
- */
5470
- get bottom(): number;
5471
- }
5472
-
5473
- /**
5474
- Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
5475
- */
5476
- declare enum Direction {
5477
- /**
5478
- Left-to-right.
5479
- */
5480
- LTR = 0,
5481
- /**
5482
- Right-to-left.
5483
- */
5484
- RTL = 1
5485
- }
5486
- /**
5487
- Represents a contiguous range of text that has a single direction
5488
- (as in left-to-right or right-to-left).
5489
- */
5490
- declare class BidiSpan {
5491
- /**
5492
- The start of the span (relative to the start of the line).
5493
- */
5494
- readonly from: number;
5495
- /**
5496
- The end of the span.
5497
- */
5498
- readonly to: number;
5499
- /**
5500
- The ["bidi
5501
- level"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm)
5502
- of the span (in this context, 0 means
5503
- left-to-right, 1 means right-to-left, 2 means left-to-right
5504
- number inside right-to-left text).
5505
- */
5506
- readonly level: number;
5507
- /**
5508
- The direction of this span.
5509
- */
5510
- get dir(): Direction;
5511
- }
5512
-
5513
- interface EditorConfig {
5514
- /**
5515
- The view's initial state. Defaults to an extension-less state
5516
- with an empty document.
5517
- */
5518
- state?: EditorState;
5519
- /**
5520
- When given, the editor is immediately appended to the given
5521
- element on creation. (Otherwise, you'll have to place the view's
5522
- [`dom`](https://codemirror.net/6/docs/ref/#view.EditorView.dom) element in the document yourself.)
5523
- */
5524
- parent?: Element | DocumentFragment;
5525
- /**
5526
- If the view is going to be mounted in a shadow root or document
5527
- other than the one held by the global variable `document` (the
5528
- default), you should pass it here. If you provide `parent`, but
5529
- not this option, the editor will automatically look up a root
5530
- from the parent.
5531
- */
5532
- root?: Document | ShadowRoot;
5533
- /**
5534
- Override the transaction [dispatch
5535
- function](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) for this editor view, which
5536
- is the way updates get routed to the view. Your implementation,
5537
- if provided, should probably call the view's [`update`
5538
- method](https://codemirror.net/6/docs/ref/#view.EditorView.update).
5539
- */
5540
- dispatch?: (tr: Transaction) => void;
5541
- }
5542
- /**
5543
- An editor view represents the editor's user interface. It holds
5544
- the editable DOM surface, and possibly other elements such as the
5545
- line number gutter. It handles events and dispatches state
5546
- transactions for editing actions.
5547
- */
5548
- declare class EditorView {
5549
- /**
5550
- The current editor state.
5551
- */
5552
- get state(): EditorState;
5553
- /**
5554
- To be able to display large documents without consuming too much
5555
- memory or overloading the browser, CodeMirror only draws the
5556
- code that is visible (plus a margin around it) to the DOM. This
5557
- property tells you the extent of the current drawn viewport, in
5558
- document positions.
5559
- */
5560
- get viewport(): {
5561
- from: number;
5562
- to: number;
5563
- };
5564
- /**
5565
- When there are, for example, large collapsed ranges in the
5566
- viewport, its size can be a lot bigger than the actual visible
5567
- content. Thus, if you are doing something like styling the
5568
- content in the viewport, it is preferable to only do so for
5569
- these ranges, which are the subset of the viewport that is
5570
- actually drawn.
5571
- */
5572
- get visibleRanges(): readonly {
5573
- from: number;
5574
- to: number;
5575
- }[];
5576
- /**
5577
- Returns false when the editor is entirely scrolled out of view
5578
- or otherwise hidden.
5579
- */
5580
- get inView(): boolean;
5581
- /**
5582
- Indicates whether the user is currently composing text via
5583
- [IME](https://en.wikipedia.org/wiki/Input_method), and at least
5584
- one change has been made in the current composition.
5585
- */
5586
- get composing(): boolean;
5587
- /**
5588
- Indicates whether the user is currently in composing state. Note
5589
- that on some platforms, like Android, this will be the case a
5590
- lot, since just putting the cursor on a word starts a
5591
- composition there.
5592
- */
5593
- get compositionStarted(): boolean;
5594
- private _dispatch;
5595
- /**
5596
- The document or shadow root that the view lives in.
5597
- */
5598
- readonly root: DocumentOrShadowRoot;
5599
- /**
5600
- The DOM element that wraps the entire editor view.
5601
- */
5602
- readonly dom: HTMLElement;
5603
- /**
5604
- The DOM element that can be styled to scroll. (Note that it may
5605
- not have been, so you can't assume this is scrollable.)
5606
- */
5607
- readonly scrollDOM: HTMLElement;
5608
- /**
5609
- The editable DOM element holding the editor content. You should
5610
- not, usually, interact with this content directly though the
5611
- DOM, since the editor will immediately undo most of the changes
5612
- you make. Instead, [dispatch](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch)
5613
- [transactions](https://codemirror.net/6/docs/ref/#state.Transaction) to modify content, and
5614
- [decorations](https://codemirror.net/6/docs/ref/#view.Decoration) to style it.
5615
- */
5616
- readonly contentDOM: HTMLElement;
5617
- private announceDOM;
5618
- private plugins;
5619
- private pluginMap;
5620
- private editorAttrs;
5621
- private contentAttrs;
5622
- private styleModules;
5623
- private bidiCache;
5624
- private destroyed;
5625
- /**
5626
- Construct a new view. You'll want to either provide a `parent`
5627
- option, or put `view.dom` into your document after creating a
5628
- view, so that the user can see the editor.
5629
- */
5630
- constructor(
5631
- /**
5632
- Initialization options.
5633
- */
5634
- config?: EditorConfig);
5635
- /**
5636
- All regular editor state updates should go through this. It
5637
- takes a transaction or transaction spec and updates the view to
5638
- show the new state produced by that transaction. Its
5639
- implementation can be overridden with an
5640
- [option](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.dispatch). This
5641
- function is bound to the view instance, so it does not have to
5642
- be called as a method.
5643
- */
5644
- dispatch(tr: Transaction): void;
5645
- dispatch(...specs: TransactionSpec[]): void;
5646
- /**
5647
- Update the view for the given array of transactions. This will
5648
- update the visible document and selection to match the state
5649
- produced by the transactions, and notify view plugins of the
5650
- change. You should usually call
5651
- [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this
5652
- as a primitive.
5653
- */
5654
- update(transactions: readonly Transaction[]): void;
5655
- /**
5656
- Reset the view to the given state. (This will cause the entire
5657
- document to be redrawn and all view plugins to be reinitialized,
5658
- so you should probably only use it when the new state isn't
5659
- derived from the old state. Otherwise, use
5660
- [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.)
5661
- */
5662
- setState(newState: EditorState): void;
5663
- private updatePlugins;
5664
- /**
5665
- Get the CSS classes for the currently active editor themes.
5666
- */
5667
- get themeClasses(): string;
5668
- private updateAttrs;
5669
- private showAnnouncements;
5670
- private mountStyles;
5671
- private readMeasured;
5672
- /**
5673
- Schedule a layout measurement, optionally providing callbacks to
5674
- do custom DOM measuring followed by a DOM write phase. Using
5675
- this is preferable reading DOM layout directly from, for
5676
- example, an event handler, because it'll make sure measuring and
5677
- drawing done by other components is synchronized, avoiding
5678
- unnecessary DOM layout computations.
5679
- */
5680
- requestMeasure<T>(request?: MeasureRequest<T>): void;
5681
- /**
5682
- Get the value of a specific plugin, if present. Note that
5683
- plugins that crash can be dropped from a view, so even when you
5684
- know you registered a given plugin, it is recommended to check
5685
- the return value of this method.
5686
- */
5687
- plugin<T>(plugin: ViewPlugin<T>): T | null;
5688
- /**
5689
- The top position of the document, in screen coordinates. This
5690
- may be negative when the editor is scrolled down. Points
5691
- directly to the top of the first line, not above the padding.
5692
- */
5693
- get documentTop(): number;
5694
- /**
5695
- Reports the padding above and below the document.
5696
- */
5697
- get documentPadding(): {
5698
- top: number;
5699
- bottom: number;
5700
- };
5701
- /**
5702
- Find the text line or block widget at the given vertical
5703
- position (which is interpreted as relative to the [top of the
5704
- document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop)
5705
- */
5706
- elementAtHeight(height: number): BlockInfo;
5707
- /**
5708
- Find the line block (see
5709
- [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) at the given
5710
- height.
5711
- */
5712
- lineBlockAtHeight(height: number): BlockInfo;
5713
- /**
5714
- Get the extent and vertical position of all [line
5715
- blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions
5716
- are relative to the [top of the
5717
- document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop);
5718
- */
5719
- get viewportLineBlocks(): BlockInfo[];
5720
- /**
5721
- Find the line block around the given document position. A line
5722
- block is a range delimited on both sides by either a
5723
- non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^replace) line breaks, or the
5724
- start/end of the document. It will usually just hold a line of
5725
- text, but may be broken into multiple textblocks by block
5726
- widgets.
5727
- */
5728
- lineBlockAt(pos: number): BlockInfo;
5729
- /**
5730
- The editor's total content height.
5731
- */
5732
- get contentHeight(): number;
5733
- /**
5734
- Move a cursor position by [grapheme
5735
- cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak). `forward` determines whether
5736
- the motion is away from the line start, or towards it. In
5737
- bidirectional text, the line is traversed in visual order, using
5738
- the editor's [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
5739
- When the start position was the last one on the line, the
5740
- returned position will be across the line break. If there is no
5741
- further line, the original position is returned.
5742
-
5743
- By default, this method moves over a single cluster. The
5744
- optional `by` argument can be used to move across more. It will
5745
- be called with the first cluster as argument, and should return
5746
- a predicate that determines, for each subsequent cluster,
5747
- whether it should also be moved over.
5748
- */
5749
- moveByChar(start: SelectionRange, forward: boolean, by?: (initial: string) => (next: string) => boolean): SelectionRange;
5750
- /**
5751
- Move a cursor position across the next group of either
5752
- [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter
5753
- non-whitespace characters.
5754
- */
5755
- moveByGroup(start: SelectionRange, forward: boolean): SelectionRange;
5756
- /**
5757
- Move to the next line boundary in the given direction. If
5758
- `includeWrap` is true, line wrapping is on, and there is a
5759
- further wrap point on the current line, the wrap point will be
5760
- returned. Otherwise this function will return the start or end
5761
- of the line.
5762
- */
5763
- moveToLineBoundary(start: SelectionRange, forward: boolean, includeWrap?: boolean): SelectionRange;
5764
- /**
5765
- Move a cursor position vertically. When `distance` isn't given,
5766
- it defaults to moving to the next line (including wrapped
5767
- lines). Otherwise, `distance` should provide a positive distance
5768
- in pixels.
5769
-
5770
- When `start` has a
5771
- [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical
5772
- motion will use that as a target horizontal position. Otherwise,
5773
- the cursor's own horizontal position is used. The returned
5774
- cursor will have its goal column set to whichever column was
5775
- used.
5776
- */
5777
- moveVertically(start: SelectionRange, forward: boolean, distance?: number): SelectionRange;
5778
- /**
5779
- Find the DOM parent node and offset (child offset if `node` is
5780
- an element, character offset when it is a text node) at the
5781
- given document position.
5782
-
5783
- Note that for positions that aren't currently in
5784
- `visibleRanges`, the resulting DOM position isn't necessarily
5785
- meaningful (it may just point before or after a placeholder
5786
- element).
5787
- */
5788
- domAtPos(pos: number): {
5789
- node: Node;
5790
- offset: number;
5791
- };
5792
- /**
5793
- Find the document position at the given DOM node. Can be useful
5794
- for associating positions with DOM events. Will raise an error
5795
- when `node` isn't part of the editor content.
5796
- */
5797
- posAtDOM(node: Node, offset?: number): number;
5798
- /**
5799
- Get the document position at the given screen coordinates. For
5800
- positions not covered by the visible viewport's DOM structure,
5801
- this will return null, unless `false` is passed as second
5802
- argument, in which case it'll return an estimated position that
5803
- would be near the coordinates if it were rendered.
5804
- */
5805
- posAtCoords(coords: {
5806
- x: number;
5807
- y: number;
5808
- }, precise: false): number;
5809
- posAtCoords(coords: {
5810
- x: number;
5811
- y: number;
5812
- }): number | null;
5813
- /**
5814
- Get the screen coordinates at the given document position.
5815
- `side` determines whether the coordinates are based on the
5816
- element before (-1) or after (1) the position (if no element is
5817
- available on the given side, the method will transparently use
5818
- another strategy to get reasonable coordinates).
5819
- */
5820
- coordsAtPos(pos: number, side?: -1 | 1): Rect | null;
5821
- /**
5822
- The default width of a character in the editor. May not
5823
- accurately reflect the width of all characters (given variable
5824
- width fonts or styling of invididual ranges).
5825
- */
5826
- get defaultCharacterWidth(): number;
5827
- /**
5828
- The default height of a line in the editor. May not be accurate
5829
- for all lines.
5830
- */
5831
- get defaultLineHeight(): number;
5832
- /**
5833
- The text direction
5834
- ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction)
5835
- CSS property) of the editor's content element.
5836
- */
5837
- get textDirection(): Direction;
5838
- /**
5839
- Find the text direction of the block at the given position, as
5840
- assigned by CSS. If
5841
- [`perLineTextDirection`](https://codemirror.net/6/docs/ref/#view.EditorView^perLineTextDirection)
5842
- isn't enabled, or the given position is outside of the viewport,
5843
- this will always return the same as
5844
- [`textDirection`](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). Note that
5845
- this may trigger a DOM layout.
5846
- */
5847
- textDirectionAt(pos: number): Direction;
5848
- /**
5849
- Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping)
5850
- (as determined by the
5851
- [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space)
5852
- CSS property of its content element).
5853
- */
5854
- get lineWrapping(): boolean;
5855
- /**
5856
- Returns the bidirectional text structure of the given line
5857
- (which should be in the current document) as an array of span
5858
- objects. The order of these spans matches the [text
5859
- direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)—if that is
5860
- left-to-right, the leftmost spans come first, otherwise the
5861
- rightmost spans come first.
5862
- */
5863
- bidiSpans(line: Line$1): readonly BidiSpan[];
5864
- /**
5865
- Check whether the editor has focus.
5866
- */
5867
- get hasFocus(): boolean;
5868
- /**
5869
- Put focus on the editor.
5870
- */
5871
- focus(): void;
5872
- /**
5873
- Clean up this editor view, removing its element from the
5874
- document, unregistering event handlers, and notifying
5875
- plugins. The view instance can no longer be used after
5876
- calling this.
5877
- */
5878
- destroy(): void;
5879
- /**
5880
- Returns an effect that can be
5881
- [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to
5882
- cause it to scroll the given position or range into view.
5883
- */
5884
- static scrollIntoView(pos: number | SelectionRange, options?: {
5885
- /**
5886
- By default (`"nearest"`) the position will be vertically
5887
- scrolled only the minimal amount required to move the given
5888
- position into view. You can set this to `"start"` to move it
5889
- to the top of the view, `"end"` to move it to the bottom, or
5890
- `"center"` to move it to the center.
5891
- */
5892
- y?: ScrollStrategy;
5893
- /**
5894
- Effect similar to
5895
- [`y`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView^options.y), but for the
5896
- horizontal scroll position.
5897
- */
5898
- x?: ScrollStrategy;
5899
- /**
5900
- Extra vertical distance to add when moving something into
5901
- view. Not used with the `"center"` strategy. Defaults to 5.
5902
- */
5903
- yMargin?: number;
5904
- /**
5905
- Extra horizontal distance to add. Not used with the `"center"`
5906
- strategy. Defaults to 5.
5907
- */
5908
- xMargin?: number;
5909
- }): StateEffect<unknown>;
5910
- /**
5911
- Facet to add a [style
5912
- module](https://github.com/marijnh/style-mod#documentation) to
5913
- an editor view. The view will ensure that the module is
5914
- mounted in its [document
5915
- root](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.root).
5916
- */
5917
- static styleModule: Facet<StyleModule, readonly StyleModule[]>;
5918
- /**
5919
- Returns an extension that can be used to add DOM event handlers.
5920
- The value should be an object mapping event names to handler
5921
- functions. For any given event, such functions are ordered by
5922
- extension precedence, and the first handler to return true will
5923
- be assumed to have handled that event, and no other handlers or
5924
- built-in behavior will be activated for it. These are registered
5925
- on the [content element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except
5926
- for `scroll` handlers, which will be called any time the
5927
- editor's [scroll element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of
5928
- its parent nodes is scrolled.
5929
- */
5930
- static domEventHandlers(handlers: DOMEventHandlers<any>): Extension;
5931
- /**
5932
- An input handler can override the way changes to the editable
5933
- DOM content are handled. Handlers are passed the document
5934
- positions between which the change was found, and the new
5935
- content. When one returns true, no further input handlers are
5936
- called and the default behavior is prevented.
5937
- */
5938
- static inputHandler: Facet<(view: EditorView, from: number, to: number, text: string) => boolean, readonly ((view: EditorView, from: number, to: number, text: string) => boolean)[]>;
5939
- /**
5940
- By default, the editor assumes all its content has the same
5941
- [text direction](https://codemirror.net/6/docs/ref/#view.Direction). Configure this with a `true`
5942
- value to make it read the text direction of every (rendered)
5943
- line separately.
5944
- */
5945
- static perLineTextDirection: Facet<boolean, boolean>;
5946
- /**
5947
- Allows you to provide a function that should be called when the
5948
- library catches an exception from an extension (mostly from view
5949
- plugins, but may be used by other extensions to route exceptions
5950
- from user-code-provided callbacks). This is mostly useful for
5951
- debugging and logging. See [`logException`](https://codemirror.net/6/docs/ref/#view.logException).
5952
- */
5953
- static exceptionSink: Facet<(exception: any) => void, readonly ((exception: any) => void)[]>;
5954
- /**
5955
- A facet that can be used to register a function to be called
5956
- every time the view updates.
5957
- */
5958
- static updateListener: Facet<(update: ViewUpdate) => void, readonly ((update: ViewUpdate) => void)[]>;
5959
- /**
5960
- Facet that controls whether the editor content DOM is editable.
5961
- When its highest-precedence value is `false`, the element will
5962
- not have its `contenteditable` attribute set. (Note that this
5963
- doesn't affect API calls that change the editor content, even
5964
- when those are bound to keys or buttons. See the
5965
- [`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) facet for that.)
5966
- */
5967
- static editable: Facet<boolean, boolean>;
5968
- /**
5969
- Allows you to influence the way mouse selection happens. The
5970
- functions in this facet will be called for a `mousedown` event
5971
- on the editor, and can return an object that overrides the way a
5972
- selection is computed from that mouse click or drag.
5973
- */
5974
- static mouseSelectionStyle: Facet<MakeSelectionStyle, readonly MakeSelectionStyle[]>;
5975
- /**
5976
- Facet used to configure whether a given selection drag event
5977
- should move or copy the selection. The given predicate will be
5978
- called with the `mousedown` event, and can return `true` when
5979
- the drag should move the content.
5980
- */
5981
- static dragMovesSelection: Facet<(event: MouseEvent) => boolean, readonly ((event: MouseEvent) => boolean)[]>;
5982
- /**
5983
- Facet used to configure whether a given selecting click adds a
5984
- new range to the existing selection or replaces it entirely. The
5985
- default behavior is to check `event.metaKey` on macOS, and
5986
- `event.ctrlKey` elsewhere.
5987
- */
5988
- static clickAddsSelectionRange: Facet<(event: MouseEvent) => boolean, readonly ((event: MouseEvent) => boolean)[]>;
5989
- /**
5990
- A facet that determines which [decorations](https://codemirror.net/6/docs/ref/#view.Decoration)
5991
- are shown in the view. Decorations can be provided in two
5992
- ways—directly, or via a function that takes an editor view.
5993
-
5994
- Only decoration sets provided directly are allowed to influence
5995
- the editor's vertical layout structure. The ones provided as
5996
- functions are called _after_ the new viewport has been computed,
5997
- and thus **must not** introduce block widgets or replacing
5998
- decorations that cover line breaks.
5999
- */
6000
- static decorations: Facet<DecorationSet | ((view: EditorView) => DecorationSet), readonly (DecorationSet | ((view: EditorView) => DecorationSet))[]>;
6001
- /**
6002
- Used to provide ranges that should be treated as atoms as far as
6003
- cursor motion is concerned. This causes methods like
6004
- [`moveByChar`](https://codemirror.net/6/docs/ref/#view.EditorView.moveByChar) and
6005
- [`moveVertically`](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) (and the
6006
- commands built on top of them) to skip across such regions when
6007
- a selection endpoint would enter them. This does _not_ prevent
6008
- direct programmatic [selection
6009
- updates](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) from moving into such
6010
- regions.
6011
- */
6012
- static atomicRanges: Facet<(view: EditorView) => RangeSet<any>, readonly ((view: EditorView) => RangeSet<any>)[]>;
6013
- /**
6014
- Facet that allows extensions to provide additional scroll
6015
- margins (space around the sides of the scrolling element that
6016
- should be considered invisible). This can be useful when the
6017
- plugin introduces elements that cover part of that element (for
6018
- example a horizontally fixed gutter).
6019
- */
6020
- static scrollMargins: Facet<(view: EditorView) => Partial<Rect> | null, readonly ((view: EditorView) => Partial<Rect> | null)[]>;
6021
- /**
6022
- Create a theme extension. The first argument can be a
6023
- [`style-mod`](https://github.com/marijnh/style-mod#documentation)
6024
- style spec providing the styles for the theme. These will be
6025
- prefixed with a generated class for the style.
6026
-
6027
- Because the selectors will be prefixed with a scope class, rule
6028
- that directly match the editor's [wrapper
6029
- element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)—to which the scope class will be
6030
- added—need to be explicitly differentiated by adding an `&` to
6031
- the selector for that element—for example
6032
- `&.cm-focused`.
6033
-
6034
- When `dark` is set to true, the theme will be marked as dark,
6035
- which will cause the `&dark` rules from [base
6036
- themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to
6037
- `&light` when a light theme is active).
6038
- */
6039
- static theme(spec: {
6040
- [selector: string]: StyleSpec;
6041
- }, options?: {
6042
- dark?: boolean;
6043
- }): Extension;
6044
- /**
6045
- This facet records whether a dark theme is active. The extension
6046
- returned by [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme) automatically
6047
- includes an instance of this when the `dark` option is set to
6048
- true.
6049
- */
6050
- static darkTheme: Facet<boolean, boolean>;
6051
- /**
6052
- Create an extension that adds styles to the base theme. Like
6053
- with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the
6054
- place of the editor wrapper element when directly targeting
6055
- that. You can also use `&dark` or `&light` instead to only
6056
- target editors with a dark or light theme.
6057
- */
6058
- static baseTheme(spec: {
6059
- [selector: string]: StyleSpec;
6060
- }): Extension;
6061
- /**
6062
- Facet that provides additional DOM attributes for the editor's
6063
- editable DOM element.
6064
- */
6065
- static contentAttributes: Facet<AttrSource, readonly AttrSource[]>;
6066
- /**
6067
- Facet that provides DOM attributes for the editor's outer
6068
- element.
6069
- */
6070
- static editorAttributes: Facet<AttrSource, readonly AttrSource[]>;
6071
- /**
6072
- An extension that enables line wrapping in the editor (by
6073
- setting CSS `white-space` to `pre-wrap` in the content).
6074
- */
6075
- static lineWrapping: Extension;
6076
- /**
6077
- State effect used to include screen reader announcements in a
6078
- transaction. These will be added to the DOM in a visually hidden
6079
- element with `aria-live="polite"` set, and should be used to
6080
- describe effects that are visually obvious but may not be
6081
- noticed by screen reader users (such as moving to the next
6082
- search match).
6083
- */
6084
- static announce: StateEffectType<string>;
6085
- }
6086
- /**
6087
- Helper type that maps event names to event object types, or the
6088
- `any` type for unknown events.
6089
- */
6090
- interface DOMEventMap extends HTMLElementEventMap {
6091
- [other: string]: any;
6092
- }
6093
- /**
6094
- Event handlers are specified with objects like this. For event
6095
- types known by TypeScript, this will infer the event argument type
6096
- to hold the appropriate event object type. For unknown events, it
6097
- is inferred to `any`, and should be explicitly set if you want type
6098
- checking.
6099
- */
6100
- declare type DOMEventHandlers<This> = {
6101
- [event in keyof DOMEventMap]?: (this: This, event: DOMEventMap[event], view: EditorView) => boolean | void;
6102
- };
6103
-
6104
- /**
6105
- Describes a problem or hint for a piece of code.
6106
- */
6107
- interface Diagnostic {
6108
- /**
6109
- The start position of the relevant text.
6110
- */
6111
- from: number;
6112
- /**
6113
- The end position. May be equal to `from`, though actually
6114
- covering text is preferable.
6115
- */
6116
- to: number;
6117
- /**
6118
- The severity of the problem. This will influence how it is
6119
- displayed.
6120
- */
6121
- severity: "info" | "warning" | "error";
6122
- /**
6123
- An optional source string indicating where the diagnostic is
6124
- coming from. You can put the name of your linter here, if
6125
- applicable.
6126
- */
6127
- source?: string;
6128
- /**
6129
- The message associated with this diagnostic.
6130
- */
6131
- message: string;
6132
- /**
6133
- An optional custom rendering function that displays the message
6134
- as a DOM node.
6135
- */
6136
- renderMessage?: () => Node;
6137
- /**
6138
- An optional array of actions that can be taken on this
6139
- diagnostic.
6140
- */
6141
- actions?: readonly Action[];
6142
- }
6143
- /**
6144
- An action associated with a diagnostic.
6145
- */
6146
- interface Action {
6147
- /**
6148
- The label to show to the user. Should be relatively short.
6149
- */
6150
- name: string;
6151
- /**
6152
- The function to call when the user activates this action. Is
6153
- given the diagnostic's _current_ position, which may have
6154
- changed since the creation of the diagnostic, due to editing.
6155
- */
6156
- apply: (view: EditorView, from: number, to: number) => void;
6157
- }
6158
-
6159
- /**
6160
- Calls
6161
- [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
6162
- on the document and, if that throws an error, reports it as a
6163
- single diagnostic.
6164
- */
6165
- declare const jsonParseLinter: () => (view: EditorView$1) => Diagnostic[];
6166
-
6167
- /**
6168
- A language provider that provides JSON parsing.
6169
- */
6170
- declare const jsonLanguage: LRLanguage;
6171
- /**
6172
- JSON language support.
6173
- */
6174
- declare function json$1(): LanguageSupport;
6175
-
6176
- declare const _codemirror_lang_json_jsonLanguage: typeof jsonLanguage;
6177
- declare const _codemirror_lang_json_jsonParseLinter: typeof jsonParseLinter;
6178
- declare namespace _codemirror_lang_json {
6179
- export {
6180
- json$1 as json,
6181
- _codemirror_lang_json_jsonLanguage as jsonLanguage,
6182
- _codemirror_lang_json_jsonParseLinter as jsonParseLinter,
6183
- };
5137
+ /**
5138
+ Calls
5139
+ [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
5140
+ on the document and, if that throws an error, reports it as a
5141
+ single diagnostic.
5142
+ */
5143
+ declare const jsonParseLinter: () => (view: EditorView) => Diagnostic[];
5144
+
5145
+ /**
5146
+ A language provider that provides JSON parsing.
5147
+ */
5148
+ declare const jsonLanguage: LRLanguage;
5149
+ /**
5150
+ JSON language support.
5151
+ */
5152
+ declare function json$1(): LanguageSupport;
5153
+
5154
+ declare const _codemirror_lang_json_jsonLanguage: typeof jsonLanguage;
5155
+ declare const _codemirror_lang_json_jsonParseLinter: typeof jsonParseLinter;
5156
+ declare namespace _codemirror_lang_json {
5157
+ export {
5158
+ json$1 as json,
5159
+ _codemirror_lang_json_jsonLanguage as jsonLanguage,
5160
+ _codemirror_lang_json_jsonParseLinter as jsonParseLinter,
5161
+ };
6184
5162
  }
6185
5163
 
6186
5164
  /**
@@ -6263,7 +5241,7 @@ declare const redoSelection: StateCommand;
6263
5241
  Default key bindings for the undo history.
6264
5242
 
6265
5243
  - Mod-z: [`undo`](https://codemirror.net/6/docs/ref/#commands.undo).
6266
- - Mod-y (Mod-Shift-z on macOS): [`redo`](https://codemirror.net/6/docs/ref/#commands.redo).
5244
+ - Mod-y (Mod-Shift-z on macOS) + Ctrl-Shift-z on Linux: [`redo`](https://codemirror.net/6/docs/ref/#commands.redo).
6267
5245
  - Mod-u: [`undoSelection`](https://codemirror.net/6/docs/ref/#commands.undoSelection).
6268
5246
  - Alt-u (Mod-Shift-u on macOS): [`redoSelection`](https://codemirror.net/6/docs/ref/#commands.redoSelection).
6269
5247
  */
@@ -6374,11 +5352,41 @@ declare namespace index_d$2 {
6374
5352
  };
6375
5353
  }
6376
5354
 
5355
+ /**
5356
+ Type used to specify tags to complete.
5357
+ */
5358
+ interface TagSpec {
5359
+ /**
5360
+ Define tag-specific attributes. Property names are attribute
5361
+ names, and property values can be null to indicate free-form
5362
+ attributes, or a list of strings for suggested attribute values.
5363
+ */
5364
+ attrs?: Record<string, null | readonly string[]>;
5365
+ /**
5366
+ Can be used to specify a list of child tags that are valid
5367
+ inside this tag. The default is to allow any tag.
5368
+ */
5369
+ children?: readonly string[];
5370
+ }
6377
5371
  /**
6378
5372
  HTML tag completion. Opens and closes tags and attributes in a
6379
5373
  context-aware way.
6380
5374
  */
6381
5375
  declare function htmlCompletionSource(context: CompletionContext): CompletionResult | null;
5376
+ /**
5377
+ Create a completion source for HTML extended with additional tags
5378
+ or attributes.
5379
+ */
5380
+ declare function htmlCompletionSourceWith(config: {
5381
+ /**
5382
+ Define extra tag names to complete.
5383
+ */
5384
+ extraTags?: Record<string, TagSpec>;
5385
+ /**
5386
+ Add global attributes that are available on all tags.
5387
+ */
5388
+ extraGlobalAttributes?: Record<string, null | readonly string[]>;
5389
+ }): (context: CompletionContext) => CompletionResult | null;
6382
5390
 
6383
5391
  /**
6384
5392
  A language provider based on the [Lezer HTML
@@ -6405,6 +5413,14 @@ declare function html(config?: {
6405
5413
  is included in the support extensions. Defaults to true.
6406
5414
  */
6407
5415
  autoCloseTags?: boolean;
5416
+ /**
5417
+ Add additional tags that can be completed.
5418
+ */
5419
+ extraTags?: Record<string, TagSpec>;
5420
+ /**
5421
+ Add additional completable attributes to all tags.
5422
+ */
5423
+ extraGlobalAttributes?: Record<string, null | readonly string[]>;
6408
5424
  }): LanguageSupport;
6409
5425
  /**
6410
5426
  Extension that will automatically insert close tags when a `>` or
@@ -6412,14 +5428,18 @@ Extension that will automatically insert close tags when a `>` or
6412
5428
  */
6413
5429
  declare const autoCloseTags$1: Extension;
6414
5430
 
5431
+ type index_d$1_TagSpec = TagSpec;
6415
5432
  declare const index_d$1_html: typeof html;
6416
5433
  declare const index_d$1_htmlCompletionSource: typeof htmlCompletionSource;
5434
+ declare const index_d$1_htmlCompletionSourceWith: typeof htmlCompletionSourceWith;
6417
5435
  declare const index_d$1_htmlLanguage: typeof htmlLanguage;
6418
5436
  declare namespace index_d$1 {
6419
5437
  export {
5438
+ index_d$1_TagSpec as TagSpec,
6420
5439
  autoCloseTags$1 as autoCloseTags,
6421
5440
  index_d$1_html as html,
6422
5441
  index_d$1_htmlCompletionSource as htmlCompletionSource,
5442
+ index_d$1_htmlCompletionSourceWith as htmlCompletionSourceWith,
6423
5443
  index_d$1_htmlLanguage as htmlLanguage,
6424
5444
  };
6425
5445
  }
@@ -6476,13 +5496,20 @@ and
6476
5496
  [eslint4b-prebuilt](https://github.com/marijnh/eslint4b-prebuilt/)
6477
5497
  packages may help with that.
6478
5498
  */
6479
- declare function esLint(eslint: any, config?: any): (view: EditorView$1) => Diagnostic[];
5499
+ declare function esLint(eslint: any, config?: any): (view: EditorView) => Diagnostic[];
5500
+
5501
+ /**
5502
+ Completion source that looks up locally defined names in
5503
+ JavaScript code.
5504
+ */
5505
+ declare function localCompletionSource(context: CompletionContext): CompletionResult | null;
6480
5506
 
6481
5507
  declare const index_d_autoCloseTags: typeof autoCloseTags;
6482
5508
  declare const index_d_esLint: typeof esLint;
6483
5509
  declare const index_d_javascript: typeof javascript;
6484
5510
  declare const index_d_javascriptLanguage: typeof javascriptLanguage;
6485
5511
  declare const index_d_jsxLanguage: typeof jsxLanguage;
5512
+ declare const index_d_localCompletionSource: typeof localCompletionSource;
6486
5513
  declare const index_d_snippets: typeof snippets;
6487
5514
  declare const index_d_tsxLanguage: typeof tsxLanguage;
6488
5515
  declare const index_d_typescriptLanguage: typeof typescriptLanguage;
@@ -6493,6 +5520,7 @@ declare namespace index_d {
6493
5520
  index_d_javascript as javascript,
6494
5521
  index_d_javascriptLanguage as javascriptLanguage,
6495
5522
  index_d_jsxLanguage as jsxLanguage,
5523
+ index_d_localCompletionSource as localCompletionSource,
6496
5524
  index_d_snippets as snippets,
6497
5525
  index_d_tsxLanguage as tsxLanguage,
6498
5526
  index_d_typescriptLanguage as typescriptLanguage,
@@ -6546,4 +5574,4 @@ declare function cssStreamParser(): Promise<any>;
6546
5574
  declare function wast(): Promise<typeof _codemirror_lang_wast>;
6547
5575
  declare function xml(): Promise<typeof _codemirror_lang_xml>;
6548
5576
 
6549
- export { Annotation, AnnotationType, ChangeDesc, ChangeSet, ChangeSpec, Command, Compartment, Completion, CompletionContext, CompletionResult, CompletionSource, Decoration$1 as Decoration, DecorationSet$1 as DecorationSet, EditorSelection, EditorState, EditorStateConfig, EditorView$1 as EditorView, Extension, Facet, GutterMarker, HighlightStyle, KeyBinding, LRParser, Language, LanguageSupport, Line$1 as Line, MapMode, MatchDecorator, NodeProp, NodeSet, NodeType, Panel, Parser, Prec, Range, RangeSet, RangeSetBuilder, SelectionRange, StateEffect, StateEffectType, StateField, StreamLanguage, StreamParser, StringStream, StyleModule, SyntaxNode, Tag, TagStyle, Text, TextIterator, Tooltip, TooltipView, Transaction, TransactionSpec, Tree, TreeCursor, ViewPlugin$1 as ViewPlugin, ViewUpdate$1 as ViewUpdate, WidgetType$1 as WidgetType, acceptCompletion, autocompletion, bracketMatching, clojure, closeBrackets, closeBracketsKeymap, closeCompletion, codeFolding, coffeescript, completeAnyWord, cpp, index_d$2 as css, cssStreamParser, currentCompletions, cursorMatchingBracket, cursorSubwordBackward, cursorSubwordForward, drawSelection, ensureSyntaxTree, foldGutter, foldKeymap, gutter, gutters, highlightSelectionMatches, highlightSpecialChars, highlightTree, history, historyKeymap, index_d$1 as html, ifNotIn, indentLess, indentMore, indentOnInput, indentUnit, insertNewlineAndIndent, java, index_d as javascript, json, keymap, lineNumberMarkers, lineNumbers, markdown, php, placeholder, python, redo, redoSelection, repositionTooltips, scrollPastEnd, selectMatchingBracket, selectNextOccurrence, selectSubwordBackward, selectSubwordForward, selectedCompletion, shell, showPanel, showTooltip, standardKeymap, startCompletion, syntaxHighlighting, syntaxTree, tags, toggleComment, tooltips, undo, undoSelection, wast, xml };
5577
+ export { Annotation, AnnotationType, ChangeDesc, ChangeSet, ChangeSpec, Command, Compartment, Completion, CompletionContext, CompletionResult, CompletionSource, Decoration, DecorationSet, EditorSelection, EditorState, EditorStateConfig, EditorView, Extension, Facet, GutterMarker, HighlightStyle, KeyBinding, LRParser, Language, LanguageSupport, Line$1 as Line, MapMode, MatchDecorator, NodeProp, NodeSet, NodeType, Panel, Parser, Prec, Range, RangeSet, RangeSetBuilder, SelectionRange, StateEffect, StateEffectType, StateField, StreamLanguage, StreamParser, StringStream, StyleModule, SyntaxNode, Tag, TagStyle, Text, TextIterator, Tooltip, TooltipView, Transaction, TransactionSpec, Tree, TreeCursor, ViewPlugin, ViewUpdate, WidgetType, acceptCompletion, autocompletion, bracketMatching, clojure, closeBrackets, closeBracketsKeymap, closeCompletion, codeFolding, coffeescript, completeAnyWord, cpp, index_d$2 as css, cssStreamParser, currentCompletions, cursorMatchingBracket, cursorSubwordBackward, cursorSubwordForward, drawSelection, ensureSyntaxTree, foldGutter, foldKeymap, gutter, gutters, highlightSelectionMatches, highlightSpecialChars, highlightTree, history, historyKeymap, index_d$1 as html, ifNotIn, indentLess, indentMore, indentOnInput, indentUnit, insertNewlineAndIndent, java, index_d as javascript, json, keymap, lineNumberMarkers, lineNumbers, markdown, php, placeholder, python, redo, redoSelection, repositionTooltips, scrollPastEnd, selectMatchingBracket, selectNextOccurrence, selectSubwordBackward, selectSubwordForward, selectedCompletion, shell, showPanel, showTooltip, standardKeymap, startCompletion, syntaxHighlighting, syntaxTree, tags, toggleComment, tooltips, undo, undoSelection, wast, xml };