filer.ts

Declarations
#

4 declarations

view source

Filer
#

filer.ts view source

root_dir

type PathId

readonly

files

type Map<PathId, Disknode>

readonly

constructor

type new (options?: FilerOptions): Filer

options
default EMPTY_OBJECT

get_by_id

get_or_create

filter

type (predicate: (disknode: Disknode) => boolean): Disknode[] | null

predicate
type (disknode: Disknode) => boolean
returns Disknode[] | null

init

Initialize the filer to populate files without watching. Safe to call multiple times - subsequent calls are no-ops. Used by gen files to access the file graph.

type (): Promise<void>

returns Promise<void>

watch

type (listener: OnFilerChange): Promise<() => void>

listener
returns Promise<() => void>

close

type (): Promise<void>

returns Promise<void>

FilerOptions
#

filer.ts view source

FilerOptions

watch_dir

type typeof watch_dir

watch_dir_options

type Partial<OmitStrict<WatchDirOptions, 'on_change'>>

package_json_cache

type Record<string, PackageJson>

log

type Logger

filter_dependents
#

filer.ts view source

(disknode: Disknode, get_by_id: (id: PathId) => Disknode | undefined, filter?: FileFilter | undefined, results?: Set<PathId>, searched?: Set<...>, log?: Logger | undefined): Set<...>

disknode

get_by_id

type (id: PathId) => Disknode | undefined

filter?

type FileFilter | undefined
optional

results

type Set<PathId>
default new Set()

searched

type Set<PathId>
default new Set()

log?

type Logger | undefined
optional

returns

Set<PathId>

OnFilerChange
#

Depends on
#

Imported by
#