Skip to main content

API

completer

import "github.com/aschey/bubbleprompt/completer"

Index

type Filterer

type Filterer[T any] interface {
Filter(
search string,
suggestions []suggestion.Suggestion[T],
) []suggestion.Suggestion[T]
}

type FuzzyFilter

type FuzzyFilter[T any] struct{}

func NewFuzzyFilter

func NewFuzzyFilter[T any]() FuzzyFilter[T]

func (FuzzyFilter[T]) Filter

func (f FuzzyFilter[T]) Filter(search string, suggestions []suggestion.Suggestion[T]) []suggestion.Suggestion[T]

type Metadata

type Metadata[T any] interface {
GetChildren() []suggestion.Suggestion[T]
}

type PathCompleter

type PathCompleter[T any] struct {
DirFilter func(de fs.DirEntry) bool
IgnoreCase bool
Filterer Filterer[T]
// contains filtered or unexported fields
}

func (*PathCompleter[T]) Complete

func (c *PathCompleter[T]) Complete(path string) []suggestion.Suggestion[T]

type PrefixFilter

type PrefixFilter[T any] struct{}

func NewPrefixFilter

func NewPrefixFilter[T any]() PrefixFilter[T]

func (PrefixFilter[T]) Filter

func (f PrefixFilter[T]) Filter(search string, suggestions []suggestion.Suggestion[T]) []suggestion.Suggestion[T]

type RecursiveFilterer

type RecursiveFilterer[T Metadata[T]] struct {
Filterer Filterer[T]
}

func NewRecursiveFilterer

func NewRecursiveFilterer[T Metadata[T]]() RecursiveFilterer[T]

func (RecursiveFilterer[T]) GetRecursiveSuggestions

func (f RecursiveFilterer[T]) GetRecursiveSuggestions(tokens []input.Token, cursor int, suggestions []suggestion.Suggestion[T]) []suggestion.Suggestion[T]

Generated by gomarkdoc