import type { EnumItem, PowerSearchConfig, PowerSearchFilter } from './types';
type FieldType = 'string' | 'number' | 'boolean' | 'date' | 'enum' | 'enum_list' | 'string_list';
type FieldTypeToJS = {
    string: string;
    number: number;
    boolean: boolean;
    date: Date | number;
    enum: string;
    enum_list: ReadonlyArray<string>;
    string_list: ReadonlyArray<string>;
};
export interface FieldDefinition<K extends string = string, T extends FieldType = FieldType> {
    readonly key: K;
    readonly type: T;
    readonly label?: string;
    /** Required for 'enum' and 'enum_list' field types. */
    readonly enumValues?: ReadonlyArray<EnumItem>;
}
/** Infers the data record type from a tuple of FieldDefinitions. */
export type InferData<D extends ReadonlyArray<FieldDefinition>> = {
    [F in D[number] as F['key']]: FieldTypeToJS[F['type']];
};
/**
 * Creates a PowerSearchConfig and an applyFilters function from field definitions.
 *
 * @example
 * ```
 * const defs = [
 *   { key: 'name', type: 'string', label: 'Name' },
 *   { key: 'age', type: 'number', label: 'Age' },
 *   { key: 'active', type: 'boolean', label: 'Active' },
 * ] as const;
 *
 * const { config, applyFilters } = createPowerSearchConfig(defs);
 * const filtered = applyFilters(filters, data);
 * ```
 */
export declare function createPowerSearchConfig<const D extends ReadonlyArray<FieldDefinition>>(definitions: D, configName?: string): {
    config: PowerSearchConfig;
    applyFilters: <T extends InferData<D>>(filters: ReadonlyArray<PowerSearchFilter>, data: ReadonlyArray<T>) => T[];
};
/**
 * React hook that memoizes the result of createPowerSearchConfig.
 *
 * @example
 * ```
 * const defs = [
 *   { key: 'name', type: 'string', label: 'Name' },
 *   { key: 'status', type: 'enum', label: 'Status', enumValues: [
 *     { value: 'active', label: 'Active' },
 *     { value: 'inactive', label: 'Inactive' },
 *   ]},
 * ] as const;
 *
 * function MyComponent() {
 *   const { config, applyFilters } = usePowerSearchConfig(defs);
 *   const filtered = applyFilters(filters, data);
 *   // ...
 * }
 * ```
 */
export declare function usePowerSearchConfig<const D extends ReadonlyArray<FieldDefinition>>(definitions: D, configName?: string): {
    config: PowerSearchConfig;
    applyFilters: <T extends InferData<D>>(filters: ReadonlyArray<PowerSearchFilter>, data: ReadonlyArray<T>) => T[];
};
export {};
//# sourceMappingURL=usePowerSearchConfig.d.ts.map