import { JSX } from "react";
import { Get } from "type-fest";
import React, { ComponentProps, ReactElement, ReactNode } from "react";
import { PropsWithChildren } from "react";
import { ImageScales } from "@muritavo/webpack-microfrontend-scripts/bin/types/ImageScales";
import { UploadTask } from "firebase/storage";
import { FieldPath, FromOnePercentUtility, NamespaceAccessors, PathObject } from "../type-utils";
import Button from "../components/Button";
import CheckBox from "../components/CheckBox";
import Radio from "../components/Radio/Radio";
import { FileInputViewProps } from "../components/FileInput/View/View.types";
import { AnswerByField, FormField, GenericFormFieldProps } from "../components/Form/FormField/FormField.types";
import { FormMode } from "../components/Form/Form.types";
type DeepPartial<T> = {
    [P in keyof T]?: NonNullable<T[P]> extends Function ? T[P] : DeepPartial<T[P]>;
};
type IfUtilityHas<N extends NamespaceAccessors, Declare> = FromOnePercentUtility<N> extends `To define this property you need to set OnepercentUtility.${string} globally` ? undefined : Declare;
/**
 * Defines the available UI features and their settings.
 */
export type OneUIContextSpecs = {
    component: {
        asyncTriggerContainer: {
            LoadingComponent: () => ReactElement;
        };
        spacing: {
            variants: {
                [k in FromOnePercentUtility<"UIElements.SpacingVariants">]: string;
            };
        };
        collapsable: {
            className: string;
        };
        form: {
            fieldWrapper: {
                [k in `${keyof typeof FormMode}-${FormField["type"]}`]: string | ((p: PropsWithChildren<FormField & {
                    value: any;
                }>) => ReactNode);
            };
            titleVariant: FromOnePercentUtility<"UIElements.TextVariants">;
            labelVariant: FromOnePercentUtility<"UIElements.TextVariants">;
            /** Label shown when a field is optional */
            optionalLabel: string;
            /** Label shown when a required field was not provided */
            requiredLabel: string;
            onFileUpload(questionId: string, file: File): UploadTask;
            extensions: IfUtilityHas<"UIElements.FormExtension", {
                [K in FromOnePercentUtility<"UIElements.FormExtension">["fields"]["type"]]: {
                    ReadOnly?: (props: Omit<GenericFormFieldProps<K>, "onAnswer" | "error">) => ReactElement;
                    Input: (props: GenericFormFieldProps<K>) => ReactElement;
                    validator: (answer: AnswerByField<{
                        type: K;
                    }> | undefined, question: FormField & (FromOnePercentUtility<"UIElements.FormExtension">["fields"] & {
                        type: K;
                    })) => {
                        isValid: boolean;
                        error?: string;
                    };
                };
            }>;
        };
        text: IfUtilityHas<"UIElements.TextVariants", {
            className: {
                [k in React.ComponentProps<(typeof import("../components/Text"))["default"]>["type"]]: string;
            };
            htmlTag: {
                [k in React.ComponentProps<(typeof import("../components/Text"))["default"]>["type"]]: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
            };
        }>;
        button?: {
            className?: {
                [k in NonNullable<React.ComponentProps<(typeof import("../components/Button"))["default"]>["variant"]>]?: string;
            };
            Component?: (props: ComponentProps<typeof Button>) => ReactElement;
        };
        input: {
            className: {
                /** The wrapper around input tag & caption element (used for error and caption) */
                container: string;
                /** The input html tag */
                input: string;
            };
            labelVariants: {
                error?: FromOnePercentUtility<"UIElements.TextVariants">;
                disclaimer?: FromOnePercentUtility<"UIElements.TextVariants">;
            };
        };
        fileInput: {
            View: (props: FileInputViewProps) => ReactElement;
            button: {
                variant: FromOnePercentUtility<"UIElements.ButtonVariants">;
            };
        };
        passwordInput: {
            iconSrc: {
                passwordHidden: string;
                passwordVisible: string;
            };
        };
        asyncWrapper: {
            LoadingComponent?: () => JSX.Element;
            messages: {
                error: {
                    title: string;
                    retryBtn: string;
                };
            };
        };
        select: {
            StateIndicator: (props: {
                open: boolean;
            }) => JSX.Element;
            className?: {
                dropdown?: string;
                item?: string;
                selectedItem?: string;
                input?: string;
            };
        };
        header: {
            LogoImage: () => JSX.Element;
            MoreOptions: ({ open }: {
                open: boolean;
            }) => JSX.Element;
        };
        table: {
            controls: {
                PrevPage: ({ disabled }: {
                    disabled: boolean;
                }) => JSX.Element;
                NextPage: ({ disabled }: {
                    disabled: boolean;
                }) => JSX.Element;
            };
        };
        tooltip: {
            className?: string;
        };
        adaptiveDialog: {
            dialogClassName: string;
            backdropClassName: string;
            variant: {
                [k in FromOnePercentUtility<"UIElements.AdaptiveDialogVariants">]: string;
            };
        };
        adaptiveSidebar: {
            className: string;
            controlClassName: string;
        };
        checkbox: {
            Component?: (props: ComponentProps<typeof CheckBox>) => ReactElement;
        };
        radio: {
            Component?: (props: ComponentProps<typeof Radio>) => ReactElement;
        };
        tabs: {
            item: string;
            container: string;
        };
    };
    hook: {
        ui: {
            usePaginationControls: {
                LeftControl: () => ReactElement;
                RightControl: () => ReactElement;
                className?: string;
            };
        };
    };
    state: {
        imageScale: ImageScales;
    };
};
/**
 * The configuration object used to set up the UI provider.
 */
export type ContextConfigSpecs = DeepPartial<OneUIContextSpecs> & PathObject<OneUIContextSpecs, "component.text">;
declare function OneUIProvider({ children, config, }: PropsWithChildren<{
    config: ContextConfigSpecs;
}>): import("react/jsx-runtime").JSX.Element;
/**
 * The main provider component that wraps your app to enable UI features.
 */
export default OneUIProvider;
/**
 * A hook to access the current UI configuration.
 */
export declare function useOneUIContext(): OneUIContextSpecs;
/**
 * A hook to get a specific UI view component.
 */
export declare function useOneUIView<P extends FieldPath<OneUIContextSpecs>>(oneuiConfigPath: P, componentName: string): NonNullable<import("type-fest/source/get").GetWithPath<OneUIContextSpecs, P extends string ? import("type-fest").Split<import("type-fest/source/get").FixPathSquareBrackets<P>, "."> : P, {}>>;
/**
 * A hook to retrieve a specific value from the UI configuration.
 */
export declare function useOneUIConfig<P extends FieldPath<OneUIContextSpecs>>(prop: P): Get<OneUIContextSpecs, P>;
export declare function useOneUIConfig<P extends FieldPath<OneUIContextSpecs>, T extends DeepPartial<Get<OneUIContextSpecs, P>>>(prop: P, defaultValue: T): NonNullable<Get<OneUIContextSpecs, P>>;
/**
 * A hook to get the current image scale setting.
 */
export declare function useCurrentImageScale(): DeepPartial<ImageScales>;
