index.d.ts 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { Extension } from '@codemirror/state';
  2. export { EditorView } from '@codemirror/view';
  3. /**
  4. This is an extension value that just pulls together a number of
  5. extensions that you might want in a basic editor. It is meant as a
  6. convenient helper to quickly set up CodeMirror without installing
  7. and importing a lot of separate packages.
  8. Specifically, it includes...
  9. - [the default command bindings](https://codemirror.net/6/docs/ref/#commands.defaultKeymap)
  10. - [line numbers](https://codemirror.net/6/docs/ref/#view.lineNumbers)
  11. - [special character highlighting](https://codemirror.net/6/docs/ref/#view.highlightSpecialChars)
  12. - [the undo history](https://codemirror.net/6/docs/ref/#commands.history)
  13. - [a fold gutter](https://codemirror.net/6/docs/ref/#language.foldGutter)
  14. - [custom selection drawing](https://codemirror.net/6/docs/ref/#view.drawSelection)
  15. - [drop cursor](https://codemirror.net/6/docs/ref/#view.dropCursor)
  16. - [multiple selections](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections)
  17. - [reindentation on input](https://codemirror.net/6/docs/ref/#language.indentOnInput)
  18. - [the default highlight style](https://codemirror.net/6/docs/ref/#language.defaultHighlightStyle) (as fallback)
  19. - [bracket matching](https://codemirror.net/6/docs/ref/#language.bracketMatching)
  20. - [bracket closing](https://codemirror.net/6/docs/ref/#autocomplete.closeBrackets)
  21. - [autocompletion](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion)
  22. - [rectangular selection](https://codemirror.net/6/docs/ref/#view.rectangularSelection) and [crosshair cursor](https://codemirror.net/6/docs/ref/#view.crosshairCursor)
  23. - [active line highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLine)
  24. - [active line gutter highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLineGutter)
  25. - [selection match highlighting](https://codemirror.net/6/docs/ref/#search.highlightSelectionMatches)
  26. - [search](https://codemirror.net/6/docs/ref/#search.searchKeymap)
  27. - [linting](https://codemirror.net/6/docs/ref/#lint.lintKeymap)
  28. (You'll probably want to add some language package to your setup
  29. too.)
  30. This extension does not allow customization. The idea is that,
  31. once you decide you want to configure your editor more precisely,
  32. you take this package's source (which is just a bunch of imports
  33. and an array literal), copy it into your own code, and adjust it
  34. as desired.
  35. */
  36. declare const basicSetup: Extension;
  37. /**
  38. A minimal set of extensions to create a functional editor. Only
  39. includes [the default keymap](https://codemirror.net/6/docs/ref/#commands.defaultKeymap), [undo
  40. history](https://codemirror.net/6/docs/ref/#commands.history), [special character
  41. highlighting](https://codemirror.net/6/docs/ref/#view.highlightSpecialChars), [custom selection
  42. drawing](https://codemirror.net/6/docs/ref/#view.drawSelection), and [default highlight
  43. style](https://codemirror.net/6/docs/ref/#language.defaultHighlightStyle).
  44. */
  45. declare const minimalSetup: Extension;
  46. export { basicSetup, minimalSetup };