index.ts 419 B

1234567891011121314151617181920212223
  1. export type CompletionEntry = {
  2. text: string
  3. meta: string
  4. score: number
  5. }
  6. export type CompleterResult = {
  7. /**
  8. * List of completions to display
  9. */
  10. completions: CompletionEntry[]
  11. }
  12. export type Completer = (
  13. /**
  14. * The contents of the editor
  15. */
  16. text: string,
  17. /**
  18. * Position where the completer is fired
  19. */
  20. completePos: { line: number; ch: number }
  21. ) => Promise<CompleterResult | null>