import { UseBoundStoreWithEqualityFn } from 'zustand/traditional';
import { ReadonlyStoreApi, ExtractState, PartObjFromArrOfKeys } from './types.js';
import 'zustand';

/**
 * Extends the UseBoundStoreWithEqualityFn type to include the function overload for an array selector.
 */
type UseBoundStoreWithArraySelector<S extends ReadonlyStoreApi<unknown>> = {
    <U, A extends (keyof ExtractState<S>)[]>(selector: A, equals?: (a: PartObjFromArrOfKeys<ExtractState<S>, A>, b: PartObjFromArrOfKeys<ExtractState<S>, A>) => boolean): PartObjFromArrOfKeys<ExtractState<S>, A>;
} & UseBoundStoreWithEqualityFn<S>;
/**
 * This enhances the traditionalstore hook by adding another style of selector: an array of keys from the provided store.
 * It elimnates the need to use multiple hooks or a complex selector function.
 */
declare const withArraySelector: <T>(storeHook: UseBoundStoreWithEqualityFn<ReadonlyStoreApi<T>>) => UseBoundStoreWithArraySelector<ReadonlyStoreApi<T>>;

export { withArraySelector };
