import { FIELD_TYPES, OptionType } from '@connector/ui';
export type TableValue = Record<string, string | number | boolean>[];
export type FieldValue = string | number | OptionType | boolean | Date | OptionType[] | TableValue;
export type FormStateValues = Partial<Record<string, FieldValue>>;
export type FormStateErrors = Partial<Record<string, string | boolean>>;
export interface FormState {
    values: FormStateValues;
    errors: FormStateErrors;
}
export interface Value {
    value?: FieldValue;
    name: string;
}
interface Payload {
    values?: FormStateValues;
    value?: Value;
    fieldNames?: string[];
}
export interface FormActionValue {
    type: string;
    payload?: Payload;
}
export type ValidationObject = {
    msg: string;
};
export interface Validations {
    isRequired?: boolean | ValidationObject;
    isUrl?: boolean | ValidationObject;
    isEmail?: boolean | ValidationObject;
    disableFuture?: boolean | ValidationObject;
    disablePast?: boolean | ValidationObject;
    maxCharacters?: number;
    maxRows?: number;
    range?: {
        min: number;
        max: number;
    };
}
export interface InterfaceDetails {
    id: string;
    args?: {
        [key: string]: string;
    };
    previousArgs?: {
        [key: string]: string;
    };
    optionalArgs?: {
        [key: string]: string;
    };
    pagination?: {
        enabled: boolean;
        limit?: number | null;
    };
}
export interface FieldListResponse {
    name: string;
    placeholder?: string;
    type: FIELD_TYPES | 'multi-select' | 'multiline';
    label: string;
    value?: string | number;
    disabled?: boolean;
    disablePast?: boolean;
    disableFuture?: boolean;
    validations?: Validations;
    defaultOptions?: boolean | OptionType[];
    interfaceDetails?: InterfaceDetails;
    createOptionInterfaceDetails?: InterfaceDetails;
    searchInterfaceDetails?: InterfaceDetails;
    isInfiniteScrollable?: boolean;
    isApiSearchEnabled?: boolean;
    min?: number;
    max?: number;
    multiline?: boolean;
    maxRows?: number;
    limit?: number;
    rows?: number;
    cols?: number;
    rowId?: string;
    priority: number;
    defaultValue?: string | number;
    columns?: FormFields[];
    meta?: {
        [key: string]: string | number | boolean;
    };
    isClearable?: boolean;
    isFieldCustom?: boolean;
    fieldAccessMode?: string;
}
export interface FormFields extends FieldListResponse {
    type: FIELD_TYPES;
    isMultiSelect?: boolean;
    loadOptionsOnFocus?: boolean;
}
export interface ObjectItem extends OptionType {
    id: string;
    name: string;
    logoUrl: string;
    searchInterfaceDetails?: InterfaceDetails;
    interfaceDetails?: InterfaceDetails;
    hasCustomFields?: boolean;
    customFieldsArgs?: Record<string, unknown>;
    type: 'create' | 'link' | 'edit' | 'search_and_link';
    connectorId: string;
    cardId: string;
    authenticated?: boolean;
    connectorName?: string;
    searchObject?: string;
    expandedView?: boolean;
    cardAccessMode?: 'read_write' | null;
    userAuthEnabled?: boolean;
}
export type FormArgValue = string | boolean | number | (string | number)[] | TableValue;
export interface PreviewArgs {
    [key: string]: string;
}
export type PreviewMeta = {
    externalResourceId: string;
    formId: string;
    searchKeyword?: string;
    searchResultLabel?: string;
};
export {};
//# sourceMappingURL=form.d.ts.map