/** * @packageDocumentation * Shared Floyd-cycle-guarded linked-structure traversal utilities. */ /** * Result shape returned by linked-structure searches. */ export type LinkedStructureLookupResult = Readonly<{ found: false; }> | Readonly<{ found: true; value: Value; }>; /** * Resolve the first matching value while traversing a linked structure. * * @param options - Linked-structure traversal options. * * - `startNode`: Initial node to inspect. * - `getNextNode`: Function that returns the next node in the chain. * - `resolveValue`: Function that returns a lookup result for the current node. * * @returns Lookup result for the first resolved value; otherwise a non-matching * lookup result when traversal reaches the chain end or detects a * parent-cycle. */ export declare const resolveFirstValueInLinkedStructure: ({ getNextNode, resolveValue, startNode, }: Readonly<{ getNextNode: (node: Node) => Node | null; resolveValue: (node: Node) => LinkedStructureLookupResult; startNode: Node | null; }>) => LinkedStructureLookupResult; /** * Check whether any node in a linked structure satisfies a predicate. * * @param options - Linked-structure traversal options. * * - `startNode`: Initial node to inspect. * - `getNextNode`: Function that returns the next node in the chain. * - `isMatch`: Predicate used to test each visited node. * * @returns `true` when any visited node matches; otherwise `false`. */ export declare const isAnyLinkedStructureNodeMatching: ({ getNextNode, isMatch, startNode, }: Readonly<{ getNextNode: (node: Node) => Node | null; isMatch: (node: Node) => boolean; startNode: Node | null; }>) => boolean; //# sourceMappingURL=cycle-safe-linked-search.d.ts.map