SourceBrowser
Browses the local file system for nodes.
Constructor Summary
Public Constructor | ||
public |
constructor(options: *) Sets up a new browser. |
Member Summary
Public Members | ||
public get |
|
Private Members | ||
private |
|
|
private |
_dependingOn: * Stores how queued nodes depend on each other |
|
private |
_nodeHandler: * |
|
private |
_pushed: * The pushed node's ids |
|
private |
_pushedPath: * The pushed node's paths |
|
private |
_queue: * |
|
private |
|
|
private |
_reject: * |
Method Summary
Public Methods | ||
public |
Starts the browser at the given path. |
|
public |
processPath(options: ProcessPathOptions): Promise Enqueues a SourceBrowser#_processPath call with the given options. |
|
public |
Can be called by transformers to read this path before finishing it's parent nodes. |
Private Methods | ||
private |
_processNode(node: BrowsedFileNode): Promise Handles a node's dependencies and calls SourceBrowser#_pushNode once it's ready. |
|
private |
async _processPath(undefined: ProcessPathOptions): Promise Where the real browsing happens: Stats the given path, discovering new node definition files, if any and finally pushes discovered nodes to SourceBrowser#_processNode. |
|
private |
Reads a node's value file (if it's a variable) and calls SourceBrowser#_nodeHandler with it, finishing the node's processing and promoting it's dependents, if any. |
Public Constructors
public constructor(options: *) source
Sets up a new browser.
Params:
Name | Type | Attribute | Description |
options | * | The options to apply. |
|
options.handleNode | * | A callback called with every discovered node. |
|
options.readNodeFile | * | A callback deciding if a node file should be read. |
Public Members
Private Members
private _atserverVersion: * source
private _nodeHandler: * source
private _queue: * source
private _readNodeFile: * source
private _reject: * source
Public Methods
public async browse(path: string, options: undefined): Promise source
Starts the browser at the given path.
public processPath(options: ProcessPathOptions): Promise source
Enqueues a SourceBrowser#_processPath call with the given options.
Params:
Name | Type | Attribute | Description |
options | ProcessPathOptions |
public readNode(undefined: undefined): Promise source
Can be called by transformers to read this path before finishing it's parent nodes.
Params:
Name | Type | Attribute | Description |
undefined | undefined |
Private Methods
private _processNode(node: BrowsedFileNode): Promise source
Handles a node's dependencies and calls SourceBrowser#_pushNode once it's ready.
Params:
Name | Type | Attribute | Description |
node | BrowsedFileNode |
private async _processPath(undefined: ProcessPathOptions): Promise source
Where the real browsing happens: Stats the given path, discovering new node definition files, if any and finally pushes discovered nodes to SourceBrowser#_processNode.
Params:
Name | Type | Attribute | Description |
undefined | ProcessPathOptions |
private async _pushNode(node: BrowsedFileNode): Promise source
Reads a node's value file (if it's a variable) and calls SourceBrowser#_nodeHandler with it, finishing the node's processing and promoting it's dependents, if any.
Params:
Name | Type | Attribute | Description |
node | BrowsedFileNode |