/**
 * Sort a list by its `position` field ascending (nulls treated as 0).
 * Returns a new array; the input is not mutated.
 */
export declare const sortByPosition: <T extends {
    position: number | null;
}>(items: T[]) => T[];
/**
 * Depth-first flatten of a tree's descendants (root excluded), preserving each
 * level's order. Works on any node exposing a nullable `children` array.
 */
export declare const flattenTree: <T extends {
    children: T[] | null;
}>(root?: T | null) => T[];
/**
 * Map every node id in a tree to its 1-based depth (root = 1). Works on any
 * node exposing an `id` and a nullable `children` array.
 */
export declare const buildDepthMap: <T extends {
    id: number;
    children: T[] | null;
}>(tree: T | null | undefined, depth?: number, map?: Map<number, number>) => Map<number, number>;
