export interface TopoSortOptions { /** * Function to get the unique identifier of an item (what's found in getDeps). */ getId: (item: T) => string; /** * Function to get the dependencies of an item by its identifier. */ getDeps: (item: T) => string[]; /** If false, deps not present in the input array are silently skipped. @default true */ strict?: boolean; } /** * Orders items based on their dependency relationships. * - Uses Depth-First Search (DFS) to determine the order. * * Throws Reference Error when: * - An item has a circular dependency. * - A dependency is not found in the input set and strict mode is enabled. * * @example * ```ts * [a] → [b] ← [c] * ↓ ↙ ↑ ↗ * [d] → [e] [f] * * topoSort({ a: [b,d] }, { b: [d] }, { c: [b] }, { d: [e] }, { e: [f] }, { f: [] }) * // result: [{ f: [] }, { e: [f] }, { d: [e] }, { b: [d] }, { a: [b,d] }, { c: [b] }] * ``` */ export declare function topoSort(items: T[], options: TopoSortOptions): T[];