aspen-core
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

host

Accessors

expanded

expanded:

path

path:

pathfx

pathfx:

Path utils like join, basename, dirname etc.

Use utils from this object to ensure all operations are compliant with path style as specified by the host

Methods

collapseDirectory

  • collapseDirectory(directory: Directory): void

expandDirectory

  • expandDirectory(directory: Directory, ensureVisible?: boolean): Promise<void>
  • Parameters

    • directory: Directory
    • Default value ensureVisible: boolean = true

    Returns Promise<void>

findFileEntryInLoadedTree

  • findFileEntryInLoadedTree(path: string): FileOrDir
  • Looks up for given file or directory at path in the tree (pre-loaded tree only)

    This method, unlike Root#forceLoadFileEntryAtPath, WILL NOT, force load anything (synchronouse for that reason)

    Parameters

    • path: string

    Returns FileOrDir

flushEventQueue

  • flushEventQueue(): Promise<any>

forceLoadFileEntryAtPath

  • Brute force variant of Root#findFileEntryInLoadedTree.

    This method will force load children of Directory if it comes in way of specified path. However, it will not affect visual state of tree.

    Parameters

    • path: string

    Returns Promise<Directory | FileEntry>

getFileEntryAtIndex

  • getFileEntryAtIndex(index: number): FileEntry
  • Lookup flattened tree structure by index

    Root manages the flattened structure, which is automatically adjusted whenever a child Directory is expanded or collapsed

    Total number of items that "can" be visible at surface can be accessed by Root#branchSize

    Most windowing libraries will require you to specify item count, and upon rendering they will require data for an arbitrary index number

    Use Root#branchSize and Root#getFileEntryAtIndex respectively.

    Parameters

    • index: number

    Returns FileEntry

getIndexAtFileEntry

  • getIndexAtFileEntry(fileEntry: FileOrDir): number
  • Reverse of Root#getFileEntryAtIndex

    Parameters

    Returns number

getIndexAtFileEntryID

  • getIndexAtFileEntryID(id: number): number
  • Parameters

    • id: number

    Returns number

inotify

isItemVisibleAtSurface

  • isItemVisibleAtSurface(item: FileOrDir): boolean
  • Checks if an item is visible at surface, as opposed to being buried in the tree.

    "Visible" here does not mean visible in the current view/scroll state of rendered content. Instead, it means the item "can" be visible if scolled to the right spot.

    "Buried" means that item may (or may not) be inside an expanded directory, but at least one of its parent directory is in collapsed state preventing it from being "visible" at surface.

    Parameters

    Returns boolean

iterateTopDown

  • Like readdirp but much more sicker

    Iterates top down starting from first child of startingPoint (default Root) until exited

    âš  THIS IS A UTILITY FUNCTION, DO NOT USE IT FOR FLATTENING TREE STRUCTURES âš 

    Flattened structure (for wiring with windowing libraries) is accessible through Root.getFileEntryAtIndex. Most windowing libraries will provide you with the index they need data for. Flattened structure available through Root is managed internally and Root#branchSize is the number of items visible at surface.

    Iterator will start at level startingPoint#depth (default Root thus 0). To track stepIns and stepOuts, keep an eye on current item's depth (FileEntry#depth)

    Parameters

    Returns Promise<void>

onDidChangeDirExpansionState

  • onDidChangeDirExpansionState(cb: function): IDisposable
  • Parameters

    • cb: function
        • (directory: Directory, nowExpanded: boolean, visibleAtSurface: boolean): void
        • Parameters

          • directory: Directory
          • nowExpanded: boolean
          • visibleAtSurface: boolean

          Returns void

    Returns IDisposable

onDidChangeMetadata

  • onDidChangeMetadata(callback: function): IDisposable

onDidChangeParent

  • onDidChangeParent(callback: function): IDisposable

onDidChangePath

  • onDidChangePath(callback: function): IDisposable

onDidDispose

  • onDidDispose(cb: function): IDisposable

onDidProcessWatchEvent

  • onDidProcessWatchEvent(cb: function): IDisposable

onDidUpdate

  • onDidUpdate(cb: function): IDisposable
  • Parameters

    • cb: function
        • (): void
        • Returns void

    Returns IDisposable

onOnceChangeParent

  • onOnceChangeParent(target: FileOrDir, callback: function): IDisposable

onOnceDirectoryExpanded

  • onOnceDirectoryExpanded(directory: Directory, callback: function): IDisposable

onOnceDisposed

  • onOnceDisposed(target: FileOrDir, callback: function): IDisposable

onOnceItemVisible

  • onOnceItemVisible(item: FileOrDir, callback: function): IDisposable

onWillChangeDirExpansionState

  • onWillChangeDirExpansionState(cb: function): IDisposable
  • Parameters

    • cb: function
        • (directory: Directory, nowExpanded: boolean): void
        • Parameters

          Returns void

    Returns IDisposable

onWillChangeParent

  • onWillChangeParent(callback: function): IDisposable

onWillDispose

  • onWillDispose(cb: function): IDisposable

onWillProcessWatchEvent

  • onWillProcessWatchEvent(cb: function): IDisposable

setCollapsed

  • setCollapsed(): void

setExpanded

  • setExpanded(ensureVisible?: boolean): Promise<void>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc