import { default as React } from 'react'; import { OptionsConfig } from './optionsConfig'; import { RuleEngineProps } from './RuleEngineComponent'; import { RulesObject } from './utils'; interface RenderOptions { [path: string]: RenderOptions | RenderOptions[]; } interface State { value: RulesObject; renderOptions: RenderOptions; selectedRuleIndex: number; } interface RuleEngineContextType { state: State; schemaType: RuleEngineProps["schemaType"]; optionsConfig: OptionsConfig; /** Sets a value at the given path */ setPath: ( /** The path to set the value at */ path: string, /** The value to set */ value: unknown, /** * Whether to allow setting the value to `null`. * When `false`, setting a value to `null` will remove the value at the given path. * * @default false */ allowNullValue?: boolean) => void; /** Sets a render option at the given path */ setRenderOption: (path: string, value: unknown | null) => void; /** Sets the selected rule index */ setSelectedRuleIndex: (index: number) => void; /** Sets the entire rules object value */ setValue: (value: RulesObject) => void; } export declare function RuleEngineProvider({ children, initialValue, }: { children: React.ReactNode; initialValue: { value: RulesObject; schemaType: RuleEngineContextType["schemaType"]; optionsConfig: RuleEngineContextType["optionsConfig"]; }; }): React.JSX.Element; export declare function useRuleEngine(): RuleEngineContextType; export {};