import type { MenuProps } from './Menu.types';
type BasicItemOrGroup = {
    id: unknown;
    primary?: unknown;
    items?: {
        id: unknown;
        primary?: unknown;
    }[] | undefined;
};
type BasicSelectable = {
    id: unknown;
    primary?: unknown;
    selected?: boolean | undefined;
    items?: {
        id: unknown;
        primary?: unknown;
        selected?: boolean | undefined;
    }[] | undefined;
};
type ExtractItem<T> = Extract<T, {
    primary: unknown;
}>;
type GenericItemOrGroup<T> = T | (T extends {
    items?: (infer U)[] | undefined;
} ? U extends {
    id: unknown;
} ? U : never : never);
type GenericItem<T> = ExtractItem<T> | ExtractItem<GenericItemOrGroup<T>>;
type PickId<T extends {
    id: unknown;
}> = [T] extends [never] ? unknown : GenericItemOrGroup<T>['id'];
declare const helpers: {
    isItem<T extends object>(item: T): item is ExtractItem<T>;
    getItem<T extends BasicItemOrGroup>(items: T[], id: PickId<T>): GenericItem<T> | undefined;
    getPath<T extends BasicItemOrGroup>(items: T[], id: PickId<T>): GenericItemOrGroup<T>[];
    setItem<T extends BasicItemOrGroup>(items: T[], id: PickId<T>, newItem: GenericItemOrGroup<T>): T[];
    mapItem<T extends BasicItemOrGroup>(items: T[], id: PickId<T>, fn: (item: ExtractItem<T>, index: number, array: T[]) => ExtractItem<T>): T[];
    mapTree<T extends BasicItemOrGroup>(items: T[], fn: (item: ExtractItem<T>, index: number, array: T[]) => ExtractItem<T>): GenericItemOrGroup<T>[];
    flatten<T extends BasicItemOrGroup>(items: T[], ancestors?: GenericItemOrGroup<T>[], options?: {
        parentFirst?: boolean;
    }): ExtractItem<T>[];
    toggleSelected<T extends BasicSelectable>(items: T[], id: PickId<T>, mode?: MenuProps["mode"], bool?: boolean): T[];
    selectItem<T extends BasicSelectable>(items: T[], id: PickId<T>, mode?: MenuProps["mode"]): T[];
    deselectItem<T extends BasicSelectable>(items: T[], id: PickId<T>, mode?: MenuProps["mode"]): T[];
    getSelected<T extends BasicSelectable>(items: T[]): ExtractItem<T>[];
    prependTo<T extends BasicItemOrGroup>(items: T[], newItems: GenericItemOrGroup<T>[], id?: PickId<T>): GenericItemOrGroup<T>[];
    appendTo<T extends BasicItemOrGroup>(items: T[], newItems: GenericItemOrGroup<T>[], id?: PickId<T>): GenericItemOrGroup<T>[];
    getNextItem<T extends BasicItemOrGroup>(items: T[], itemId?: PickId<T>): GenericItemOrGroup<T> | undefined;
    getPrevItem<T extends BasicItemOrGroup>(items: T[], itemId?: PickId<T>): GenericItemOrGroup<T> | undefined;
    getParentItem<T extends BasicItemOrGroup>(items: T[], itemId?: PickId<T>): GenericItemOrGroup<T> | undefined;
};
export default helpers;
//# sourceMappingURL=helpers.d.ts.map