index.d.cts 1022 B

12345678910111213141516171819202122232425262728293031
  1. import { Selection, Plugin } from 'prosemirror-state';
  2. import { ResolvedPos, Node, Slice } from 'prosemirror-model';
  3. import { Mappable } from 'prosemirror-transform';
  4. /**
  5. Gap cursor selections are represented using this class. Its
  6. `$anchor` and `$head` properties both point at the cursor position.
  7. */
  8. declare class GapCursor extends Selection {
  9. /**
  10. Create a gap cursor.
  11. */
  12. constructor($pos: ResolvedPos);
  13. map(doc: Node, mapping: Mappable): Selection;
  14. content(): Slice;
  15. eq(other: Selection): boolean;
  16. toJSON(): any;
  17. }
  18. /**
  19. Create a gap cursor plugin. When enabled, this will capture clicks
  20. near and arrow-key-motion past places that don't have a normally
  21. selectable position nearby, and create a gap cursor selection for
  22. them. The cursor is drawn as an element with class
  23. `ProseMirror-gapcursor`. You can either include
  24. `style/gapcursor.css` from the package's directory or add your own
  25. styles to make it visible.
  26. */
  27. declare function gapCursor(): Plugin;
  28. export { GapCursor, gapCursor };