red-g / directory / Directory.Selector

Like a Directory, but must contain at least one item. You can select an Item in the directory, and convert it to an absolute Path.


type Selector

A Directory with a selected Item. You can convert the selected Item to an absolute Path.

back : Selector -> Path.Directory.Directory

Get the path to selector's parent directory.

forward : Selector -> Path

Get the Path to selectors focused Item. You could get a File or a SubDirectory!

list : Selector -> SelectList Directory.Item.Item

Get a SelectList of Items in Selector.

path : Selector -> Path.Directory.Directory

Get the path to selectors directory.

reselect : Basics.Int -> Selector -> Selector

Move selector's focus to the Item at index.

selected : Selector -> Directory.Item.Item

Get the selected Item in selector.

withItem : Basics.Int -> Directory -> Maybe Selector

Create a Selector from directory, with focus on the Item at index.