import type { ConfigType } from '@uploadcare/file-uploader';
import { defineLocale } from '@uploadcare/file-uploader';
import type { EventMap } from '@uploadcare/file-uploader';
import { FC } from 'react';
import { default as React_2 } from 'react';
import type { Ref } from 'react';
import { UploadCtxProvider } from '@uploadcare/file-uploader';

declare type CommonProps = {
    /**
     * The class name for wrapper over uploader
     */
    className?: string;
    /**
     * The class name for uploader
     */
    classNameUploader?: string;
    /**
     * The unique ID
     */
    ctxName?: string;
};

declare type ConfigProps = Partial<Omit<ConfigType, "pubkey">> & {
    pubkey: ConfigType["pubkey"];
};

export { defineLocale }

declare type EventProps = Partial<TEventsSchema>;

export declare const FileUploaderInline: FC<TProps<"Inline">>;

declare type FileUploaderInlineProps = {};

export declare const FileUploaderMinimal: FC<TProps<"Minimal">>;

declare type FileUploaderMinimalProps = {};

declare type FileUploaderModes = 'Regular' | 'Minimal' | 'Inline';

export declare const FileUploaderRegular: FC<TProps<"Regular">>;

declare type FileUploaderRegularProps = {
    /**
     * The prop controls the button's visibility in regular mode.
     */
    headless?: boolean;
};

export declare type TEventsSchema = {
    [K in keyof EventMap as TPrefixOnAndCamelCase<K>]: (event: EventMap[K]["detail"]) => void;
};

declare type TExtraPrefixOn<S extends string> = `on${Capitalize<S>}`;

declare type TPrefixOnAndCamelCase<S extends string> = TExtraPrefixOn<TToCamelCase<S>>;

export declare type TProps<T extends FileUploaderModes> = CommonProps & ConfigProps & EventProps & UploadCtxPropviderProps & Pick<TProps_2, "fallback"> & (T extends "Regular" ? FileUploaderRegularProps : T extends "Minimal" ? FileUploaderMinimalProps : T extends "Inline" ? FileUploaderInlineProps : never);

declare type TProps_2 = {
    fallback?: React_2.ReactChild | React_2.ReactFragment | React_2.ReactPortal | null;
    condition?: boolean;
    children: React_2.ReactNode;
};

declare type TToCamelCase<S extends string> = S extends `${infer Head}-${infer Tail}` ? `${Lowercase<Head>}${Capitalize<TToCamelCase<Tail>>}` : Lowercase<S>;

declare type UploadCtxPropviderProps = {
    apiRef?: Ref<InstanceType<UploadCtxProvider>>;
};

export { UploadCtxProvider }


export * from "@uploadcare/file-uploader/types/index.js";

export { }
