UNPKG

@yandex/ymaps3-types

Version:

Types for ymaps3 maps library

20 lines (19 loc) 776 B
import { GenericComplexEntity, GenericEntity } from "./Entities"; export declare const enum TraverseOrder { PREORDER = 1, POSTORDER = -1 } export type TraverseOptions = { readonly order: TraverseOrder; readonly recurse: (node: GenericComplexEntity<unknown>) => boolean; }; export type TraverseState = TraverseOptions & { path: { node: GenericComplexEntity<unknown>; next: number; }[]; current?: GenericEntity<unknown>; }; export declare function traverseInit(entity: GenericComplexEntity<unknown>, options: TraverseOptions): TraverseState; export declare function traverseStep(state: TraverseState): void; export declare function traverseUntil(traverse: TraverseState, predicate: (entity: GenericEntity<unknown>) => boolean): void;