import { ImageField, CustomFormElementVisibility, FlexConfig } from '../state'; import type { ConfigSettingProps } from '../sections/sections.types'; export type MultiSelectOption = { value: string; label: string; }; export interface UseClientSectionControlResult { value: string | number | number[] | string[] | boolean | ImageField | CustomFormElementVisibility | FlexConfig; /** The default, non-debounced `handleUpdate` callback sets a string or number value */ handleUpdate: (content?: string | number | null) => void; /** Requires a field to be passed instead of inferring it from the configSetting */ handleUpdateByField: (field: string, content?: string | number | null) => void; /** Debounced update callback for text inputs to prevent too many re-renders when typing */ handleTextUpdate: (content: string) => void; handleDebouncedTextUpdate: (content: string) => void; handleBooleanUpdate: () => void; handleMultiSelectUpdate: (selected: MultiSelectOption | MultiSelectOption[] | null) => void; handleImageUpdate: (image: ImageField) => void; handleVisibilityUpdate: (value: CustomFormElementVisibility) => void; } /** * Hook that provides value and handleUpdate callback for client section controls in admin. * * If a page is shared it will update the sectionOverrides object for the section and use the * value from that instead of the main one. * * @example * ```tsx * const { value, handleTextUpdate } = useClientSectionControl({ configSetting }); * * return ( ); * ``` */ export default function useClientSectionControl({ configSetting, }: ConfigSettingProps): UseClientSectionControlResult; //# sourceMappingURL=use-client-section-control.d.ts.map