Query API
Methods for locally accessing and iterating the token tree.
You access each of the query methods over:
sdtfEngine.query.[method]getTokenState
getTokenStateGet 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
getGroupStateGet a groupState instance from the tokens token tree.
function getGroupState(
  path: Array<string>
):
  | { status: "resolved"; groupState: GroupState }
  | { status: "unresolvable"; reason: "DOES_NOT_EXIST" };getCollectionState
getCollectionStateGet a collectionState instance from the tokens token tree.
function getCollectionState(
  path: Array<string>
):
  | { status: 'resolved'; collectionState: CollectionState }
  | { status: 'unresolvable'; reason: 'DOES_NOT_EXIST' };getNearestCollectionState
getNearestCollectionStateGet the collectionState instance enclosing the given path.
function getNearestCollectionState(
  path: Array<string>
):     | { status: 'resolved'; collectionState: CollectionState }
  | { status: 'unresolvable'; reason: 'DOES_NOT_EXIST' };getAllTokenStates
getAllTokenStatesGet all tokenState instances from the tokens token tree.
function getAllTokenStates(): Array<TokenState>;getAllGroupStates
getAllGroupStatesGet all groupState instances from the tokens token tree.
function getAllGroupStates(): Array<GroupState>;getAllCollectionStates
getAllCollectionStatesGet all collectionState instances from the tokens token tree.
function getAllCollectionStates(): Array<CollectionState>;getAllNodeStates
getAllNodeStatesGet all tokenState, groupState and collectionState instances from the tokens token tree.
function getAllNodeStates(): Array<TokenState | GroupState | CollectionState>;getTokenChildrenOf
getTokenChildrenOfGet the tokenState instances that are children of the given path.
function getTokenChildrenOf(path: Array<string>): Array<TokenState>;getGroupChildrenOf
getGroupChildrenOfGet the groupState instances that are children of the given path.
function getGroupChildrenOf(path: Array<string>): Array<GroupState>;getCollectionChildrenOf
getCollectionChildrenOfGet the collectionState instances that are children of the given path.
function getCollectionChildrenOf(path: Array<string>): Array<CollectionState>;getChildrenOf
getChildrenOfGet 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
getParentsOfGet the groupState and collectionState instances that are parents of the given path.
function getParentsOf(path: Array<string>, depth: number): Array<TokenState | GroupState | CollectionState>;getGroupChildren
getGroupChildrenGet groupState instances that are direct children of the given path.
function getGroupChildren(path: Array<string>): Array<GroupState>;getTokenChildren
getTokenChildrenGet tokenState instances that are direct children of the given path.
function getTokenChildren(path: Array<string>): Array<TokenState>;getCollectionChildren
getCollectionChildrenGet collectionState instances that are direct children of the given path.
function getCollectionChildren(path: Array<string>): Array<CollectionState>;renderJSONTree
renderJSONTreeGet the JSON representation of the tokens token tree.
function renderJSONTree(renderOptions: RenderOptions): JSON;getAliasReference
getAliasReferenceGet the aliasReference instance from given coordinates.
function getAliasReference(
  from: AliasReferenceCoordinates
): Result<AliasReference, SDTFError>;getAllAliasReferences
getAllAliasReferencesGet all aliasReference instances from the tokens token tree.
function getAllAliasReferences(): Array<AliasReference>;getAliasReferencesTo
getAliasReferencesToGet all aliasReference instances that reference the given "to" coordinates.
function getAliasReferencesTo(
  to: Partial<AliasReferenceCoordinates>,
  options: AliasReferenceResolvabilityOptions
): Array<AliasReference>;getAliasReferencesFrom
getAliasReferencesFromGet all aliasReference instances that reference the given "from" coordinates.
function getAliasReferencesFrom(
  from: Partial<AliasReferenceCoordinates>,
  options: AliasReferenceResolvabilityOptions
): Array<AliasReference>;getStatefulAliasReference
getStatefulAliasReferenceGet the statefulAliasReference instance of the given "from" coordinates.
function getStatefulAliasReference(
  from: AliasReferenceCoordinates
): Result<StatefulAliasReference, SDTFError>;getStatefulAliasReferencesTo
getStatefulAliasReferencesToGet the statefulAliasReference instances that reference the given "to" coordinates.
function getStatefulAliasReferencesTo(
  to: Partial<AliasReferenceCoordinates>,
  options: AliasReferenceResolvabilityOptions
): Array<StatefulAliasReference>;getStatefulAliasReferencesFrom
getStatefulAliasReferencesFromGet the statefulAliasReference instances that reference the given "from" coordinates.
function getStatefulAliasReferencesFrom(
  from: Partial<AliasReferenceCoordinates>,
  options: AliasReferenceResolvabilityOptions
): Array<StatefulAliasReference>;Last updated
Was this helpful?
