import { DefaultPathsOptions, PathsOptions } from 'type-fest/source/paths';
import { Path, BaseBagelField, InputBagelField, SelectBagelField, ArrayBagelField, ArrayFieldVal, Attributes, BglFormSchemaT, FieldByP, ShallowBglFormSchemaT, UploadInputProps } from '../types/BagelForm';
interface IconType {
    name: string;
}
interface AutoFillField {
    name: string;
}
interface InputTypeHTMLAttribute {
    type: string;
}
type MaybeRefOrGetter<T> = T | (() => T) | {
    value: T;
};
export interface InputOptions<T, P extends Path<T>> extends Partial<BaseBagelField<T, P>> {
    defaultValue?: string | number;
    autocomplete?: AutoFillField;
    helpText?: string;
    title?: string;
}
export interface DateOptions<T, K extends Path<T>> extends InputOptions<T, K> {
    enableTime?: boolean;
    mode?: 'day' | 'month' | 'year';
    locale?: string;
    timezone?: string;
}
export interface TextInputOptions<T, K extends Path<T>> extends InputOptions<T, K> {
    type?: InputTypeHTMLAttribute['type'];
    pattern?: string;
    multiline?: boolean;
    autoheight?: boolean;
    code?: boolean;
    rows?: number | string;
    icon?: IconType;
    iconStart?: IconType;
}
export interface SlctInputOptions<T, K extends Path<T>> extends InputOptions<T, K> {
    searchable?: boolean;
    multiselect?: boolean;
    clearable?: boolean;
    placeholder?: string;
}
export interface NumFieldOptions<T, K extends Path<T>> extends InputOptions<T, K> {
    max?: number;
    min?: number;
    step?: number;
    layout?: 'default' | 'vertical' | 'horizontal';
    padZero?: number;
    center?: boolean;
    useGrouping?: boolean;
}
export interface RichTextOptions<T, P extends Path<T>> extends InputOptions<T, P> {
    height?: number | string;
    basic?: boolean;
    simple?: boolean;
    debug?: boolean;
    hideToolbar?: boolean;
    hideInlineToolbar?: boolean;
    hideImages?: boolean;
    hideVideos?: boolean;
    hideEmbed?: boolean;
    hideTables?: boolean;
    hideAlignment?: boolean;
    hideDirections?: boolean;
    hideH5H6?: boolean;
    hide?: string[];
    autofocus?: boolean;
    textColor?: string;
    fontSize?: number | string;
}
export interface TelInputOptions<T, P extends Path<T>> extends InputOptions<T, P> {
    pattern?: string;
    autocomplete?: AutoFillField;
    onlyCountries?: string[];
    defaultCountry?: string;
    excludeCountries?: string[];
}
export declare function getBaseField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, labelOrRest?: string | Partial<BaseBagelField<T, P>>, rest?: Partial<BaseBagelField<T, P>>): BaseBagelField<T, P, PO>;
export declare function richText<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: RichTextOptions<T, P>): BaseBagelField<T, P, PO>;
export declare function txtField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: TextInputOptions<T, P>): InputBagelField<T, P, PO>;
export declare function selectField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: any, fieldOptions?: SlctInputOptions<T, P>): SelectBagelField<T, P, PO>;
export declare const slctField: typeof selectField;
interface CheckInputOptions<T, K extends Path<T>> extends Omit<InputOptions<T, K>, 'defaultValue'> {
    value?: string | number | boolean;
    defaultValue?: string | number | boolean;
}
export declare function checkField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: CheckInputOptions<T, P>): BaseBagelField<T, P, PO>;
interface EmailInputOptions<T, P extends Path<T>> extends InputOptions<T, P> {
    autocorrect?: boolean;
    serverValidate?: boolean;
    preventFakeEmails?: boolean;
    pattern?: string;
}
export declare function emailField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: EmailInputOptions<T, P>): BaseBagelField<T, P, PO>;
export declare function dateField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: DateOptions<T, P>): BaseBagelField<T, P, PO>;
export declare function numField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: NumFieldOptions<T, P>): BaseBagelField<T, P, PO>;
export declare function frmRow<T, PO extends PathsOptions = DefaultPathsOptions>(...children: Array<BaseBagelField<T, any, PO>>): {
    $el: string;
    class: string;
    children: Array<BaseBagelField<T, any, PO>>;
};
export interface UploadOptions<T, K extends Path<T>> extends Omit<UploadInputProps, 'id'>, InputOptions<T, K> {
}
export declare function uploadField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: UploadOptions<T, P>): BaseBagelField<T, P, PO>;
interface RangeOptions<T, K extends Path<T>> extends InputOptions<T, K> {
    min?: number;
    max?: number;
    step?: number;
    rtl?: boolean;
    multiRange?: boolean;
    formatValue?: (value: number) => string;
}
export declare function rangeField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: RangeOptions<T, P>): BaseBagelField<T, P, PO>;
export declare function bglForm<T>(idOrField?: string | FieldByP<T, Path<T>>, ...schema: FieldByP<T, Path<T>>[]): {
    $el: string;
    id: string;
    attrs: {
        schema: (string | FieldByP<T, Path<T>>)[];
    };
} | {
    $el: string;
    attrs: {
        schema: (FieldByP<T, Path<T>> | undefined)[];
    };
    id?: undefined;
};
export declare function telField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: TelInputOptions<T, P>): BaseBagelField<T, P, PO>;
export declare function colorField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id?: P, label?: string, options?: {
    [key: string]: any;
}): BaseBagelField<T, P, PO>;
export declare function findBglFieldById<T>(id: string, _schema: ShallowBglFormSchemaT<T>): FieldByP<T, Path<T>> | undefined;
export interface ArrayAttrs<T, P extends Path<T>> extends Attributes<T, P> {
    delete?: boolean;
    add?: boolean;
    schema?: MaybeRefOrGetter<BglFormSchemaT<ArrayFieldVal<T, P>>>;
    type?: ArrayType;
}
export interface ArrayFieldOptions<T, K extends Path<T>> extends InputOptions<T, K>, ArrayAttrs<T, K> {
}
export type ArrayType = 'number' | 'text';
export declare function arrField<T, P extends Path<T, PO>, PO extends PathsOptions = DefaultPathsOptions>(id: P, label: string, schemaOrType: BglFormSchemaT<ArrayFieldVal<T, P>> | ArrayType, options?: ArrayFieldOptions<T, P>): ArrayBagelField<T, P, PO>;
export declare function createSchema<T, PO extends PathsOptions = DefaultPathsOptions>(): {
    txtField: <P extends Path<T, PO>>(id?: P, label?: string, options?: TextInputOptions<T, P>) => InputBagelField<T, P, PO>;
    selectField: <P extends Path<T, PO>>(id?: P, label?: string, options?: any, fieldOptions?: SlctInputOptions<T, P>) => SelectBagelField<T, P, PO>;
    dateField: <P extends Path<T, PO>>(id?: P, label?: string, options?: DateOptions<T, P>) => BaseBagelField<T, P, PO>;
    telField: <P extends Path<T, PO>>(id?: P, label?: string, options?: TelInputOptions<T, P>) => BaseBagelField<T, P, PO>;
    frmRow: (...children: Array<BaseBagelField<T, any, PO>>) => {
        $el: string;
        class: string;
        children: BaseBagelField<T, any, PO>[];
    };
    numField: <P extends Path<T, PO>>(id?: P, label?: string, options?: NumFieldOptions<T, P>) => BaseBagelField<T, P, PO>;
    checkField: <P extends Path<T, PO>>(id?: P, label?: string, options?: CheckInputOptions<T, P>) => BaseBagelField<T, P, PO>;
    emailField: <P extends Path<T, PO>>(id?: P, label?: string, options?: EmailInputOptions<T, P>) => BaseBagelField<T, P, PO>;
    uploadField: <P extends Path<T, PO>>(id?: P, label?: string, options?: UploadOptions<T, P>) => BaseBagelField<T, P, PO>;
    rangeField: <P extends Path<T, PO>>(id?: P, label?: string, options?: RangeOptions<T, P>) => BaseBagelField<T, P, PO>;
    colorField: <P extends Path<T, PO>>(id?: P, label?: string, options?: {
        [key: string]: any;
    }) => BaseBagelField<T, P, PO>;
    richText: <P extends Path<T, PO>>(id?: P, label?: string, options?: RichTextOptions<T, P>) => BaseBagelField<T, P, PO>;
};
export declare function useForm(): {
    txtField: typeof txtField;
    selectField: typeof selectField;
    checkField: typeof checkField;
    dateField: typeof dateField;
    numField: typeof numField;
    emailField: typeof emailField;
    frmRow: typeof frmRow;
    uploadField: typeof uploadField;
    rangeField: typeof rangeField;
    bglForm: typeof bglForm;
    telField: typeof telField;
    colorField: typeof colorField;
    arrField: typeof arrField;
    richText: typeof richText;
    findBglFieldById: typeof findBglFieldById;
    getBaseField: typeof getBaseField;
    createSchema: typeof createSchema;
};
export {};
//# sourceMappingURL=BagelFormUtils.d.ts.map