knowmax-quest-utils
Version:
Utilities for creating a Knowmax Quest client.
27 lines • 1.58 kB
TypeScript
import type { IDocumentNode } from 'knowmax-quest-types';
/** Get all nodes in given node hierarchy that match given path.
* @param list Hierarchy of nodes.
* @param questId Specifies hierarchical identification of selected nodes. For example: hfd1/par1-1/lid1
*/
export declare const getNodesInPath: <T extends IDocumentNode<T>>(list: T[], questId: string) => T[];
/** Find a node by QuestId in given hierarchy
* @param list Hierarchy of nodes
* @param questId Quest id of node to find.
*/
export declare const findNodeByQuestId: <T extends IDocumentNode<T>>(list: T[], questId: string) => T | undefined;
/** Find a node in given node hierarchy.
* @param list Hierarchy of nodes
* @param isMatch Function that returns true if node is the one we are looking for.
*/
export declare const findNode: <T extends IDocumentNode<T>>(list: T[], isMatch: (node: T) => boolean) => T | undefined;
/** Get next node adjecent to node identified by quest id in given node hierarchy.
* @param list Hierarchy of nodes
* @param questId Quest id of document to find next node for. Undefined returns first node.
*/
export declare const getNextNode: <T extends IDocumentNode<T>>(list: T[], questId?: string) => T | undefined;
/** Get previous node adjecent to node identified by quest id in given node hierarchy.
* @param list Hierarchy of nodes
* @param questId Quest id of document to find previous node for. Undefined returns undefined.
*/
export declare const getPreviousNode: <T extends IDocumentNode<T>>(list: T[], questId?: string) => T | undefined;
//# sourceMappingURL=node.d.ts.map