filer.ts

view source

Declarations
#

4 declarations

Filer
#

filer.ts view source

import {Filer} from '@fuzdev/gro/filer.js';

root_dir

type PathId

readonly

files

type Map<PathId, Disknode>

readonly

constructor

type new (options?: FilerOptions): Filer

options

default EMPTY_OBJECT

get_by_id

type (id: PathId) => Disknode | undefined

get_or_create

type (id: PathId) => Disknode

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>

inited

type boolean

getter

FilerOptions
#

filer.ts view source

FilerOptions import type {FilerOptions} from '@fuzdev/gro/filer.js';

watch_dir?

type ({ dir, on_change, filter, absolute, chokidar, ignored }: WatchDirOptions): WatchNodeFs

__0

returns WatchNodeFs

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<...> import {filter_dependents} from '@fuzdev/gro/filer.js';

disknode

get_by_id

type (id: PathId) => Disknode | undefined

filter?

type FileFilter
optional

results

type Set<PathId>
default new Set()

searched

type Set<PathId>
default new Set()

log?

type Logger
optional

returns

Set<PathId>

OnFilerChange
#

filer.ts view source

OnFilerChange import type {OnFilerChange} from '@fuzdev/gro/filer.js';

(call)

type (change: WatcherChange, disknode: Disknode): void

change

disknode

returns void

Depends on
#

Imported by
#