Documentation
¶
Index ¶
- type AdvancedModel
- func (fp *AdvancedModel) FullHelpForMode() [][]key.Binding
- func (fp *AdvancedModel) GetDirectorySelectionMode() bool
- func (fp *AdvancedModel) GetError() error
- func (fp *AdvancedModel) GetSelected() ([]string, bool)
- func (fp *AdvancedModel) Init() tea.Cmd
- func (fp *AdvancedModel) IsDirectorySelectionMode() bool
- func (fp *AdvancedModel) SetDirectorySelectionMode(enabled bool)
- func (fp *AdvancedModel) SetShowHidden(show bool)
- func (fp *AdvancedModel) SetShowPreview(show bool)
- func (fp *AdvancedModel) SetSize(width, height int)
- func (fp *AdvancedModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (fp *AdvancedModel) View() string
- type CancelFilePickerMsg
- type CompatFilepicker
- type File
- type Model
- type Operation
- type Option
- func WithCompatibilityMode(compat bool) Option
- func WithDetailedView(detailed bool) Option
- func WithDirectorySelection(enabled bool) Option
- func WithGlobPattern(pattern string) Option
- func WithJailDirectory(path string) Option
- func WithMaxHistorySize(size int) Option
- func WithPreviewWidth(width int) Option
- func WithShowHidden(show bool) Option
- func WithShowIcons(show bool) Option
- func WithShowPreview(show bool) Option
- func WithShowSizes(show bool) Option
- func WithSortMode(mode SortMode) Option
- func WithStartPath(path string) Option
- type SelectFileMsg
- type SortMode
- type ViewState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancedModel ¶ added in v0.0.21
type AdvancedModel struct {
// contains filtered or unexported fields
}
AdvancedModel represents the advanced file picker model
func New ¶ added in v0.0.21
func New(options ...Option) *AdvancedModel
New creates a new file picker with the specified options
func NewAdvancedModel ¶ added in v0.0.21
func NewAdvancedModel(startPath string) *AdvancedModel
NewAdvancedModel creates a new advanced file picker Deprecated: Use New(WithStartPath(startPath)) instead
func (*AdvancedModel) FullHelpForMode ¶ added in v0.0.21
func (fp *AdvancedModel) FullHelpForMode() [][]key.Binding
FullHelpForMode returns keybindings for the expanded help view based on the current mode
func (*AdvancedModel) GetDirectorySelectionMode ¶ added in v0.0.21
func (fp *AdvancedModel) GetDirectorySelectionMode() bool
GetDirectorySelectionMode returns whether directory selection mode is enabled
func (*AdvancedModel) GetError ¶ added in v0.0.21
func (fp *AdvancedModel) GetError() error
GetError returns any error that occurred
func (*AdvancedModel) GetSelected ¶ added in v0.0.21
func (fp *AdvancedModel) GetSelected() ([]string, bool)
GetSelected returns the selected file paths
func (*AdvancedModel) Init ¶ added in v0.0.21
func (fp *AdvancedModel) Init() tea.Cmd
Init initializes the file picker
func (*AdvancedModel) IsDirectorySelectionMode ¶ added in v0.0.21
func (fp *AdvancedModel) IsDirectorySelectionMode() bool
IsDirectorySelectionMode returns whether directory selection mode is enabled
func (*AdvancedModel) SetDirectorySelectionMode ¶ added in v0.0.21
func (fp *AdvancedModel) SetDirectorySelectionMode(enabled bool)
SetDirectorySelectionMode enables or disables directory selection mode
func (*AdvancedModel) SetShowHidden ¶ added in v0.0.21
func (fp *AdvancedModel) SetShowHidden(show bool)
SetShowHidden sets whether to show hidden files
func (*AdvancedModel) SetShowPreview ¶ added in v0.0.21
func (fp *AdvancedModel) SetShowPreview(show bool)
SetShowPreview sets whether to show file preview
func (*AdvancedModel) SetSize ¶ added in v0.0.21
func (fp *AdvancedModel) SetSize(width, height int)
SetSize sets the width and height of the file picker
func (*AdvancedModel) View ¶ added in v0.0.21
func (fp *AdvancedModel) View() string
View renders the advanced file picker (Tier 4)
type CancelFilePickerMsg ¶
type CancelFilePickerMsg struct{}
type CompatFilepicker ¶ added in v0.0.21
type CompatFilepicker struct { DirAllowed bool FileAllowed bool CurrentDirectory string Height int // contains filtered or unexported fields }
CompatFilepicker provides compatibility with the old bubbles filepicker interface
type File ¶ added in v0.0.21
type File struct { Name string Path string IsDir bool Size int64 ModTime time.Time Mode os.FileMode Selected bool Hidden bool }
File represents a file or directory with extended metadata
type Model ¶
type Model struct { *AdvancedModel // Compatibility fields Title string Error string Filepicker CompatFilepicker SelectedPath string // contains filtered or unexported fields }
Model provides backward compatibility with the original bobatea filepicker API
func NewModel ¶
func NewModel() Model
NewModel creates a new file picker with backward compatibility This maintains the original bobatea API while using the advanced implementation
func NewModelWithOptions ¶ added in v0.0.21
NewModelWithOptions creates a new file picker with backward compatibility using options
type Option ¶ added in v0.0.21
type Option func(*AdvancedModel)
Option represents a configuration option for the file picker
func WithCompatibilityMode ¶ added in v0.0.21
WithCompatibilityMode enables compatibility mode (no additional effect currently)
func WithDetailedView ¶ added in v0.0.21
WithDetailedView sets whether to show detailed file information
func WithDirectorySelection ¶ added in v0.0.21
WithDirectorySelection enables or disables directory selection mode
func WithGlobPattern ¶ added in v0.0.21
WithGlobPattern sets the initial glob pattern filter
func WithJailDirectory ¶ added in v0.0.21
WithJailDirectory sets a directory restriction boundary - navigation will be limited to this directory and subdirectories
func WithMaxHistorySize ¶ added in v0.0.21
WithMaxHistorySize sets the maximum number of history entries
func WithPreviewWidth ¶ added in v0.0.21
WithPreviewWidth sets the width of the preview panel
func WithShowHidden ¶ added in v0.0.21
WithShowHidden sets whether to show hidden files
func WithShowIcons ¶ added in v0.0.21
WithShowIcons sets whether to show file icons
func WithShowPreview ¶ added in v0.0.21
WithShowPreview sets whether to show file preview
func WithShowSizes ¶ added in v0.0.21
WithShowSizes sets whether to show file sizes
func WithSortMode ¶ added in v0.0.21
WithSortMode sets the initial sort mode
func WithStartPath ¶ added in v0.0.21
WithStartPath sets the starting directory path
type SelectFileMsg ¶
type SelectFileMsg struct {
Path string
}
Messages for compatibility with existing bobatea filepicker API