import { SpecifyDesignTokenFormat } from '../../../definitions/index.js'; import { SDTFNodeState, TreeState } from '../../state/TreeState.js'; import { QueryContext } from './QueryContext.js'; import { TreePath } from '../../state/path/TreePath.js'; export type QueryResultDetail = { isRoot: boolean; parentPath: TreePath; isComplete: boolean; nodes: Array; sdtf: SpecifyDesignTokenFormat; }; export type MergeDedupeFn = ((treeState: TreeState, node: SDTFNodeState) => void) | true; /** * The QueryResult class provides an abstraction to work with the tree node returned by a SDTF query. */ export declare class QueryResult extends Array { #private; constructor(queryContext: QueryContext, treeState: TreeState); static get [Symbol.species](): ArrayConstructor; /** * Indicates whether the selected nodes are part of the same resulting JSON tree. */ get isContinuous(): boolean; protected dedupeFn(treeState: TreeState, node: SDTFNodeState, inc?: number): void; /** * Check if the result contains some nodes of the specified type. * @param nodeType */ hasNodeType(nodeType: 'collection' | 'group' | 'token'): boolean; /** * Check if the result contains only nodes of the specified type. * @param nodeType */ hasOnlyNodeType(nodeType: 'collection' | 'group' | 'token'): boolean; /** * Produces an analysis of the resulting nodes. */ render(): Array; /** * Produces a new tree state with the resulting nodes. * @param dedupeFn */ merge(dedupeFn?: MergeDedupeFn): { treeState: TreeState; }; getPaths(type: 'string'): Array; getPaths(type: 'array'): Array>; getPaths(type?: undefined): Array; /** * Renders the resulting nodes as a JSON object using the QueryResultDetail structure. */ toJSON(): { isContinuous: boolean; graphs: { isRoot: boolean; parentPath: TreePath; isComplete: boolean; sdtf: SpecifyDesignTokenFormat; }[]; }; /** * @internal */ toArray(): NodeState[]; }