Home Manual Reference Source Test
import {SourceBrowser} from 'atscm/src/lib/gulp/src.ts'
public class | source

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

Stores how queued nodes depend on each other

private
private

_pushed: *

The pushed node's ids

private

The pushed node's paths

private

_queue: *

private
private

_reject: *

Method Summary

Public Methods
public

async browse(path: string, options: undefined): Promise

Starts the browser at the given path.

public

processPath(options: ProcessPathOptions): Promise

Enqueues a SourceBrowser#_processPath call with the given options.

public

readNode(undefined: undefined): Promise

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

async _pushNode(node: BrowsedFileNode): Promise

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:

NameTypeAttributeDescription
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

public get atserverVersion: string source

Private Members

private _atserverVersion: * source

private _dependingOn: * source

Stores how queued nodes depend on each other

private _nodeHandler: * source

private _pushed: * source

The pushed node's ids

private _pushedPath: * source

The pushed node's paths

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.

Params:

NameTypeAttributeDescription
path string
options undefined

Return:

Promise

public processPath(options: ProcessPathOptions): Promise source

Enqueues a SourceBrowser#_processPath call with the given options.

Params:

NameTypeAttributeDescription
options ProcessPathOptions

Return:

Promise

public readNode(undefined: undefined): Promise source

Can be called by transformers to read this path before finishing it's parent nodes.

Params:

NameTypeAttributeDescription
undefined undefined

Return:

Promise

Private Methods

private _processNode(node: BrowsedFileNode): Promise source

Handles a node's dependencies and calls SourceBrowser#_pushNode once it's ready.

Params:

NameTypeAttributeDescription
node BrowsedFileNode

Return:

Promise

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:

NameTypeAttributeDescription
undefined ProcessPathOptions

Return:

Promise

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:

NameTypeAttributeDescription
node BrowsedFileNode

Return:

Promise