probe-web / @probe-web/client / index / DirectorySourceProvider
Class: DirectorySourceProvider
Defined in: sources.ts:92
Serve sources from a directory the user picked (showDirectoryPicker()), matched by path suffix. The tree is indexed once (skipping target, node_modules and dot-directories); call reindex() after files are added.
Implements
Constructors
Constructor
new DirectorySourceProvider(root, opts?): DirectorySourceProvider;Defined in: sources.ts:100
maxFiles caps how many files are indexed (default 20 000), so picking a huge tree stays cheap.
Parameters
| Parameter | Type |
|---|---|
root | DirectoryHandleLike |
opts | { maxFiles?: number; } |
opts.maxFiles? | number |
Returns
DirectorySourceProvider
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
SKIP | readonly | Set<string> | Directory names never indexed (dot-directories are skipped as well). | sources.ts:97 |
Methods
reindex()
reindex(): void;Defined in: sources.ts:106
Forget the index; the tree is walked again on the next lookup.
Returns
void
resolve()
resolve(path): Promise<string | null>;Defined in: sources.ts:133
The workspace-relative file path maps to (see matchSourcePath), or null.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<string | null>
Implementation of
read()
read(path): Promise<string | null>;Defined in: sources.ts:138
The text of the file path maps to, or null if none matches.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<string | null>