@toolbox-ts/dsa
Version:
Data Structures and Algorithms implemented
20 lines • 1.2 kB
TypeScript
import { Node } from "../node/index.js";
import type { Config, Structure, RecommendedPublicAPI } from "./types.js";
export type * from "./types.js";
/**
* Iterates over node details in a structure, starting from
* a given node and following a pointer key.
* Yields each node's detail and its index in the traversal.
*/
export declare function genericDetailIterator<NT extends Node.TypeKey, AK extends string, D>(startNode: Node.Type<NT, AK, D> | undefined, pointerKey: Node.PointerKey<NT> & keyof Node.Type<NT, AK, D>): Node.DetailIterator<D>;
/**
* Creates a new structure instance with node and size management.
* @param config - Structure configuration
*/
export declare const create: <SK extends string, NT extends Node.TypeKey, AK extends string, D>({ type, nodeManagerCfg, sizing, }: Config<SK, NT, AK, D>) => Structure<SK, NT, AK, D>;
/**
* Extracts the recommended public API from a structure instance.
* Only exposes safe and useful methods for consumers.
*/
export declare const extractPublicAPI: <SK extends string, NT extends Node.TypeKey, AK extends string, D>(struct: Structure<SK, NT, AK, D>) => RecommendedPublicAPI<SK, NT, AK, D>;
//# sourceMappingURL=structure.d.ts.map