import { AccessibleDescriptionGenerator, ActionElementEventHandler, BaseOption, BaseOptionMap, BaseTranslationWithLabel, BaseTranslations, Classname, Classnames, CommonRuleSubComponentProps, DropEffect, FlexibleOption, FlexibleOptionListProp, FullCombinator, FullField, FullOperator, FullOption, FullOptionList, GenericizeRuleGroupType, GetOptionIdentifierType, GroupOptions, InputType, MatchConfig, MatchMode, MatchModeOptions, MoveOptions, Option, ParseNumbersPropConfig, Path, QueryActions, QueryBuilderFlags, QueryValidator, RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleOrGroupArray, RuleType, ToFullOption, ValidationMap, ValidationResult, ValueChangeEventHandler, ValueEditorType, ValueSource, ValueSourceFlexibleOptions, ValueSourceFullOptions, ValueSources } from "@react-querybuilder/core"; import { ComponentType, ForwardRefExoticComponent, MouseEvent, ReactNode, Ref, RefAttributes } from "react"; import { AsyncThunk, AsyncThunkConfig, PayloadAction, Slice, WithSlice } from "@reduxjs/toolkit"; //#region ../../node_modules/type-fest/source/set-non-nullable.d.ts /** Create a type that makes the given keys non-nullable, while keeping the remaining keys as is. If no keys are given, all keys will be made non-nullable. Use-case: You want to define a single model where the only thing that changes is whether or not some or all of the keys are non-nullable. @example ``` import type {SetNonNullable} from 'type-fest'; type Foo = { a: number | null; b: string | undefined; c?: boolean | null; }; // Note: In the following example, `c` can no longer be `null`, but it's still optional. type SomeNonNullable = SetNonNullable; //=> {a: null | number; b: string; c?: boolean} type AllNonNullable = SetNonNullable; //=> {a: number; b: string; c?: boolean} ``` @category Object */ type SetNonNullable = { [Key in keyof BaseType]: Key extends Keys ? NonNullable : BaseType[Key] }; //#endregion //#region src/components/RuleGroup.d.ts interface UseRuleGroup extends RuleGroupProps { addGroup: ActionElementEventHandler; addRule: ActionElementEventHandler; accessibleDescription: string; muted?: boolean; classNames: Pick<{ [k in keyof Classnames]: string }, "header" | "shiftActions" | "dragHandle" | "combinators" | "notToggle" | "addRule" | "addGroup" | "cloneGroup" | "lockGroup" | "muteGroup" | "removeGroup" | "body">; cloneGroup: ActionElementEventHandler; onCombinatorChange: ValueChangeEventHandler; onGroupAdd: (group: RuleGroupTypeAny, parentPath: Path, context?: any) => void; onIndependentCombinatorChange: (value: any, index: number, context?: any) => void; onNotToggleChange: (checked: boolean, context?: any) => void; outerClassName: string; pathsMemo: { path: Path; disabled: boolean; }[]; removeGroup: ActionElementEventHandler; ruleGroup: RuleGroupType | RuleGroupTypeIC; shiftGroupDown: (event?: MouseEvent, context?: any) => void; shiftGroupUp: (event?: MouseEvent, context?: any) => void; toggleLockGroup: ActionElementEventHandler; toggleMuteGroup: ActionElementEventHandler; validationClassName: string; validationResult: boolean | ValidationResult; } //#endregion //#region src/types/props.d.ts /** * Base interface for all subcomponents. * * @group Props */ interface CommonSubComponentProps { /** * CSS classNames to be applied. * * This is `string` and not {@link Classname} because the {@link Rule} * and {@link RuleGroup} components run `clsx()` to produce the `className` * that gets passed to each subcomponent. */ className?: string; /** * Path to this subcomponent's rule/group within the query. */ path: Path; /** * The level of the current group. Always equal to `path.length`. */ level: number; /** * The title/tooltip for this control. */ title?: string; /** * Disables the control. */ disabled?: boolean; /** * Container for custom props that are passed to all components. */ context?: any; /** * Validation result of the parent rule/group. */ validation?: boolean | ValidationResult; /** * Test ID for this component. */ testID?: string; /** * All subcomponents receive the configuration schema as a prop. */ schema: Schema; } /** * Base interface for selectors and editors. * * @group Props */ interface SelectorOrEditorProps extends CommonSubComponentProps { value?: string; handleOnChange(value: any): void; } /** * Base interface for selector components. */ interface BaseSelectorProps extends SelectorOrEditorProps> { options: FullOptionList; } /** * Props for all `value` selector components. * * @group Props */ interface ValueSelectorProps extends BaseSelectorProps { multiple?: boolean; listsAsArrays?: boolean; } /** * Props for `combinatorSelector` components. * * @group Props */ interface CombinatorSelectorProps extends BaseSelectorProps { options: FullOptionList; rules: RuleOrGroupArray; ruleGroup: RuleGroupTypeAny; } /** * Props for `fieldSelector` components. * * @group Props */ interface FieldSelectorProps extends BaseSelectorProps, CommonRuleSubComponentProps { operator?: F extends FullField ? OperatorName : string; } /** * Props for `matchModeEditor` components. * * @group Props */ interface MatchModeEditorProps extends BaseSelectorProps, CommonRuleSubComponentProps { match: MatchConfig; selectorComponent?: ComponentType; numericEditorComponent?: ComponentType; thresholdPlaceholder?: string; classNames: { matchMode: string; matchThreshold: string; }; options: FullOptionList>; field: string; fieldData: FullField; } /** * Props for `operatorSelector` components. * * @group Props */ interface OperatorSelectorProps extends BaseSelectorProps, CommonRuleSubComponentProps { options: FullOptionList; field: string; fieldData: FullField; } /** * Props for `valueSourceSelector` components. * * @group Props */ interface ValueSourceSelectorProps extends BaseSelectorProps, CommonRuleSubComponentProps { options: FullOptionList>; field: string; fieldData: FullField; } /** * Utility type representing props for selector components * that could potentially be any of the standard selector types. * * @group Props */ type VersatileSelectorProps = ValueSelectorProps & Partial & Partial & Partial; /** * A translation for a component with `title` and `label`. * * @group Props */ interface TranslationWithLabel extends BaseTranslationWithLabel {} /** * The shape of the `translations` prop. * * @group Props */ interface Translations extends BaseTranslations {} /** * Props passed to every action component (rendered as `