@loken/hierarchies
Version:
Library for working with hierarchies of identifiers and identifiable objects.
23 lines • 891 B
TypeScript
import type { Predicate } from '@loken/utilities';
import type { NextElement } from './sequence.types.ts';
/**
* Search a sequence of elements by traversing from the `first` element and onwards using the `next` delegate.
*
* The search will stop when the first element matching the `search` predicate is found.
*/
export declare const searchSequence: <TEl>(options: {
first: TEl | undefined;
next: NextElement<TEl>;
search: Predicate<TEl>;
}) => TEl | undefined;
/**
* Search a sequence of elements by traversing from the `first` element and onwards using the `next` delegate.
*
* The search is exhaustive and will return all elements matching the `search` predicate.
*/
export declare const searchSequenceMany: <TEl>(options: {
first: TEl | undefined;
next: NextElement<TEl>;
search: Predicate<TEl>;
}) => TEl[];
//# sourceMappingURL=sequence-search.d.ts.map