Skip to content

Latest commit

 

History

History
142 lines (84 loc) · 5.13 KB

FullDependencyGraphBuilder.md

File metadata and controls

142 lines (84 loc) · 5.13 KB

@unlib-js/depiDocs


@unlib-js/depi / dependency/FullDependencyGraphBuilder

dependency/FullDependencyGraphBuilder

Classes

default<T>

Extends

Type Parameters

Type Parameter Default type
T unknown

Constructors

new default()

new default<T>(__namedParameters): default<T>

Parameters
Parameter Type
__namedParameters FullDependencyGraphBuilderOptions<T>
Returns

default<T>

Overrides

default.constructor

Defined in

dependency/FullDependencyGraphBuilder.ts:39

Properties

Property Modifier Type Inherited from Defined in
depsOf readonly (inst: T) => object | object default.depsOf dependency/DependencyGraphBuilder.ts:18
onUnlistedInstance? protected OnUnlistedInstance<T> - dependency/FullDependencyGraphBuilder.ts:38

Methods

fromInstances()

fromInstances(instances): default<T>

Constructs a directed graph (DiGraph) from the provided set of instances.

The graph will represent the dependencies between the instances, as determined by the depsOf function provided in the constructor.

Parameters
Parameter Type Description
instances Set<T> The set of instances to build the dependency graph from.
Returns

default<T>

A directed graph (DiGraph) representing the dependencies between the instances.

Overrides

default.fromInstances

Defined in

dependency/FullDependencyGraphBuilder.ts:49

Interfaces

FullDependencyGraphBuilderOptions<T>

Extends

Type Parameters

Type Parameter Default type
T unknown

Properties

Property Type Description Inherited from Defined in
depsOf? (inst: T) => object | object An optional function that determines the dependencies of a given instance of type T. This function is used by the DependencyGraphBuilder to construct the dependency graph. If not provided, the depsOf function will be used. DependencyGraphBuilderOptions.depsOf dependency/DependencyGraphBuilder.ts:14
onUnlistedInstance? OnUnlistedInstance<T> An optional callback that is called when an encountered instance is not in the initial set of instances provided to the fromInstances method. See OnUnlistedInstance - dependency/FullDependencyGraphBuilder.ts:33

Type Aliases

OnUnlistedInstance()<T>

OnUnlistedInstance<T>: (unlistedInst, ctx) => boolean

A function that is called when an encountered instance is not in the initial set of instances provided to the fromInstances method.

This callback allows the caller to decide whether to include the unlisted instance in the dependency graph or not.

Type Parameters

Type Parameter Default type
T unknown

Parameters

Parameter Type Description
unlistedInst T The unlisted instance that was encountered.
ctx UnlistedInstanceContext<T> Additional context about the unlisted instance, including the current object that depends on unlistedInst, the property or constructor parameter that referenced the unlisted instance, and the set of instances that have already been added to the graph.

Returns

boolean

true if the unlisted instance should be included in the dependency graph, false otherwise.

Defined in

dependency/FullDependencyGraphBuilder.ts:22