Source File
app_spec.go
Belonging Package
src.elv.sh/pkg/cli
package cliimport ()// AppSpec specifies the configuration and initial state for an App.type AppSpec struct {TTY TTYMaxHeight func() intRPromptPersistent func() boolBeforeReadline []func()AfterReadline []func(string)Highlighter HighlighterPrompt PromptRPrompt PromptGlobalBindings tk.BindingsCodeAreaBindings tk.BindingsAbbreviations func(f func(abbr, full string))QuotePaste func() boolSmallWordAbbreviations func(f func(abbr, full string))CodeAreaState tk.CodeAreaStateState State}// Highlighter represents a code highlighter whose result can be delivered// asynchronously.type Highlighter interface {// Get returns the highlighted code and any static errors.Get(code string) (ui.Text, []error)// LateUpdates returns a channel for delivering late updates.LateUpdates() <-chan struct{}}// A Highlighter implementation that always returns plain text.type dummyHighlighter struct{}func (dummyHighlighter) ( string) (ui.Text, []error) {return ui.T(), nil}func (dummyHighlighter) () <-chan struct{} { return nil }// Prompt represents a prompt whose result can be delivered asynchronously.type Prompt interface {// Trigger requests a re-computation of the prompt. The force flag is set// when triggered for the first time during a ReadCode session or after a// SIGINT that resets the editor.Trigger(force bool)// Get returns the current prompt.Get() ui.Text// LastUpdates returns a channel for notifying late updates.LateUpdates() <-chan struct{}}// NewConstPrompt returns a Prompt that always shows the given text.func ( ui.Text) Prompt {return constPrompt{}}type constPrompt struct{ Content ui.Text }func (constPrompt) ( bool) {}func ( constPrompt) () ui.Text { return .Content }func (constPrompt) () <-chan struct{} { return nil }
The pages are generated with Golds v0.2.8-preview. (GOOS=darwin GOARCH=arm64)