@unlib-js/depi • Docs
@unlib-js/depi / dependency/FullDependencyGraphBuilder
default
<T
>
Type Parameter | Default type |
---|---|
T |
unknown |
new default<
T
>(__namedParameters
):default
<T
>
Parameter | Type |
---|---|
__namedParameters |
FullDependencyGraphBuilderOptions <T > |
default
<T
>
dependency/FullDependencyGraphBuilder.ts:39
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 |
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.
Parameter | Type | Description |
---|---|---|
instances |
Set <T > |
The set of instances to build the dependency graph from. |
default
<T
>
A directed graph (DiGraph) representing the dependencies between the instances.
dependency/FullDependencyGraphBuilder.ts:49
Type Parameter | Default type |
---|---|
T |
unknown |
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 |
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 Parameter | Default type |
---|---|
T |
unknown |
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. |
boolean
true
if the unlisted instance should be included in the
dependency graph, false
otherwise.