Query API
Methods for locally accessing and iterating the token tree.
You access each of the query methods over:
sdtfEngine.query.[method]
getTokenState
getTokenState
Get a tokenState instance from the tokens token tree.
function getTokenState(
path: Array<string>
):
| { status: "resolved"; tokenState: TokenState<Type> }
| { status: "unresolvable"; reason: "DOES_NOT_EXIST" };
getGroupState
getGroupState
Get a groupState instance from the tokens token tree.
function getGroupState(
path: Array<string>
):
| { status: "resolved"; groupState: GroupState }
| { status: "unresolvable"; reason: "DOES_NOT_EXIST" };
getCollectionState
getCollectionState
Get a collectionState instance from the tokens token tree.
function getCollectionState(
path: Array<string>
):
| { status: 'resolved'; collectionState: CollectionState }
| { status: 'unresolvable'; reason: 'DOES_NOT_EXIST' };
getNearestCollectionState
getNearestCollectionState
Get the collectionState instance enclosing the given path.
function getNearestCollectionState(
path: Array<string>
): | { status: 'resolved'; collectionState: CollectionState }
| { status: 'unresolvable'; reason: 'DOES_NOT_EXIST' };
getAllTokenStates
getAllTokenStates
Get all tokenState instances from the tokens token tree.
function getAllTokenStates(): Array<TokenState>;
getAllGroupStates
getAllGroupStates
Get all groupState instances from the tokens token tree.
function getAllGroupStates(): Array<GroupState>;
getAllCollectionStates
getAllCollectionStates
Get all collectionState instances from the tokens token tree.
function getAllCollectionStates(): Array<CollectionState>;
getAllNodeStates
getAllNodeStates
Get all tokenState, groupState and collectionState instances from the tokens token tree.
function getAllNodeStates(): Array<TokenState | GroupState | CollectionState>;
getTokenChildrenOf
getTokenChildrenOf
Get the tokenState instances that are children of the given path.
function getTokenChildrenOf(path: Array<string>): Array<TokenState>;
getGroupChildrenOf
getGroupChildrenOf
Get the groupState instances that are children of the given path.
function getGroupChildrenOf(path: Array<string>): Array<GroupState>;
getCollectionChildrenOf
getCollectionChildrenOf
Get the collectionState instances that are children of the given path.
function getCollectionChildrenOf(path: Array<string>): Array<CollectionState>;
getChildrenOf
getChildrenOf
Get the tokenState, groupState and collectionState instances that are children of the given path.
function getChildrenOf(path: Array<string>, depth: number): Array<TokenState | GroupState | CollectionState>;
getParentsOf
getParentsOf
Get the groupState and collectionState instances that are parents of the given path.
function getParentsOf(path: Array<string>, depth: number): Array<TokenState | GroupState | CollectionState>;
getGroupChildren
getGroupChildren
Get groupState instances that are direct children of the given path.
function getGroupChildren(path: Array<string>): Array<GroupState>;
getTokenChildren
getTokenChildren
Get tokenState instances that are direct children of the given path.
function getTokenChildren(path: Array<string>): Array<TokenState>;
getCollectionChildren
getCollectionChildren
Get collectionState instances that are direct children of the given path.
function getCollectionChildren(path: Array<string>): Array<CollectionState>;
renderJSONTree
renderJSONTree
Get the JSON representation of the tokens token tree.
function renderJSONTree(renderOptions: RenderOptions): JSON;
getAliasReference
getAliasReference
Get the aliasReference instance from given coordinates.
function getAliasReference(
from: AliasReferenceCoordinates
): Result<AliasReference, SDTFError>;
getAllAliasReferences
getAllAliasReferences
Get all aliasReference instances from the tokens token tree.
function getAllAliasReferences(): Array<AliasReference>;
getAliasReferencesTo
getAliasReferencesTo
Get all aliasReference instances that reference the given "to" coordinates.
function getAliasReferencesTo(
to: Partial<AliasReferenceCoordinates>,
options: AliasReferenceResolvabilityOptions
): Array<AliasReference>;
getAliasReferencesFrom
getAliasReferencesFrom
Get all aliasReference instances that reference the given "from" coordinates.
function getAliasReferencesFrom(
from: Partial<AliasReferenceCoordinates>,
options: AliasReferenceResolvabilityOptions
): Array<AliasReference>;
getStatefulAliasReference
getStatefulAliasReference
Get the statefulAliasReference instance of the given "from" coordinates.
function getStatefulAliasReference(
from: AliasReferenceCoordinates
): Result<StatefulAliasReference, SDTFError>;
getStatefulAliasReferencesTo
getStatefulAliasReferencesTo
Get the statefulAliasReference instances that reference the given "to" coordinates.
function getStatefulAliasReferencesTo(
to: Partial<AliasReferenceCoordinates>,
options: AliasReferenceResolvabilityOptions
): Array<StatefulAliasReference>;
getStatefulAliasReferencesFrom
getStatefulAliasReferencesFrom
Get the statefulAliasReference instances that reference the given "from" coordinates.
function getStatefulAliasReferencesFrom(
from: Partial<AliasReferenceCoordinates>,
options: AliasReferenceResolvabilityOptions
): Array<StatefulAliasReference>;
Last updated
Was this helpful?