import React, { PropsWithChildren } from "react";
import { DInputProps, DInputAllType } from "../..";
type NumberAttr = number | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
type ColOrderNumber = number | "1" | "2" | "3" | "4" | "5";
type ColOrder = ColOrderNumber | "first" | "last";
type ColSize = boolean | "auto" | NumberAttr;
type ColSpec = ColSize | {
    span?: ColSize;
    offset?: NumberAttr;
    order?: ColOrder;
};
export interface DFormContextProps<T extends Record<string, DInputAllType> = Record<string, DInputAllType>> {
    data: T;
    setData: React.Dispatch<React.SetStateAction<T>>;
}
export interface DFormProps extends DFormContextProps, PropsWithChildren {
    onSubmit?: React.FormEventHandler<HTMLFormElement>;
    onInvalid?: React.FormEventHandler<HTMLFormElement>;
    className?: string;
    isNotForm?: boolean;
}
type KeyOfType<T, U> = {
    [K in keyof T]: NonNullable<T[K]> extends U ? (Exclude<T[K], null | undefined> extends U ? K : never) : never;
}[keyof T];
export interface DFormInputProps<T extends Record<string, DInputAllType> = Record<string, DInputAllType>> extends Omit<DInputProps, "value" | "onChange"> {
    name: string;
    maxDateKeyName?: KeyOfType<T, Date | string>;
    minDateKeyName?: KeyOfType<T, Date | string>;
    col?: boolean;
    xs?: ColSpec;
    sm?: ColSpec;
    md?: ColSpec;
    lg?: ColSpec;
    xl?: ColSpec;
    xxl?: ColSpec;
    arrayKey?: KeyOfType<T, unknown[]>;
    arrayFilter?: (filterData: T) => boolean;
}
type omit_dform_input = Omit<DFormInputProps, "col" | "name" | "maxDateKeyName" | "minDateKeyName" | "onkeyEnter">;
export interface DFormColumnsProps_columns<T extends Record<string, DInputAllType>> extends omit_dform_input {
    name?: keyof T;
    maxDateKeyName?: KeyOfType<T, Date | string>;
    minDateKeyName?: KeyOfType<T, Date | string>;
}
export type DFormColumnsPropsOfOptionsType = Partial<Pick<omit_dform_input, "border" | "readOnly" | "required" | "borderVariant" | "variant" | "labelAlignSelf" | "labelColumnLetter" | "labelTextPosition" | "labelType" | "labelVaraint" | "showLabel" | "useFeedBack" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "size" | "onKeyEnter">>;
export interface DFormColumnsProps<T extends Record<string, DInputAllType>> extends PropsWithChildren {
    lookupData?: T;
    options?: DFormColumnsPropsOfOptionsType;
    columns?: DFormColumnsProps_columns<T>[];
    wrapperClassName?: string;
    size?: "lg" | "sm";
}
export {};
