import { type FilterGroup } from "@fn-sphere/core"; import type { BasicFilterSphereInput } from "../types.js"; import type { FilterSchemaContext } from "./use-filter-schema-context.js"; export interface FilterSphereInput extends BasicFilterSphereInput { /** * The filter rule. * * If provided, the filter rule will be controlled. * Don't forget to update the rule when it changes. * * This prop will overwrite the `defaultRule` prop. */ ruleValue?: FilterGroup; defaultRule?: FilterGroup | (() => FilterGroup); /** * The callback when the filter rule changes. */ onRuleChange?: (data: { filterRule: FilterGroup; predicate: (data: Data) => boolean; }) => void; /** * Same as `onRuleChange`, but receives the predicate function. * * @deprecated Use `onRuleChange` instead. */ onPredicateChange?: (predicate: (data: Data) => boolean) => void; } export declare const defaultContext: FilterSchemaContext; /** * * Provides a predicate function that can be used to filter data. * * Must be used within a `FilterSchemaProvider` or `FilterSphereProvider` component. * * @example * ```ts * const { predicate, context } = useFilterSphere({ schema: yourDataSchema }); * const filteredData = data.filter(predicate); * ``` */ export declare const useFilterSphere: (props: FilterSphereInput) => { filterRule: FilterGroup; /** * @deprecated Use `totalRuleCount` directly. */ countTotalRules: () => number; readonly totalRuleCount: number; readonly validRuleCount: number; /** * @deprecated Use `predicate` directly. */ getPredicate: () => (data: Data) => boolean; readonly predicate: (data: Data) => boolean; reset: (newRule?: FilterGroup) => void; context: FilterSchemaContext; }; //# sourceMappingURL=use-filter-sphere.d.ts.map