import { BaseRecord } from './common';

export declare namespace ModalField {
    type Type = 'datetime' | 'date' | 'boolean' | 'number' | 'float' | 'string' | 'text' | 'json' | 'enum' | 'lookup' | 'file';
    interface Base<T extends Type> {
        name: string;
        type: T;
        required?: boolean;
        unique?: boolean;
        apiName: string;
        label: string;
        isSystem?: boolean;
    }
    interface DateTime extends Base<'datetime'> {
    }
    interface Date extends Base<'date'> {
    }
    interface Boolean extends Base<'boolean'> {
    }
    interface Float extends Base<'float'> {
    }
    interface Text extends Base<'text'> {
    }
    interface Json extends Base<'json'> {
    }
    interface Number extends Base<'number'> {
        autoIncrement?: boolean;
    }
    interface String extends Base<'string'> {
        maxLength?: number;
    }
    interface Enum extends Base<'enum'> {
        enumGroupName: string;
        multiple?: boolean;
    }
    interface Lookup extends Base<'lookup'> {
        modalName: string;
        multiple?: boolean;
    }
    interface File extends Base<'file'> {
        maxLength?: number;
    }
    type Field = DateTime | Date | Boolean | Float | Text | Json | Number | String | Enum | Lookup | File;
}
export interface Modal extends Omit<BaseRecord, '_created_by' | '_updated_by'> {
    apiName: string;
    name: string;
    label: string;
    displayField: string;
    isSystem?: boolean;
    fields: ModalField.Field[];
}
