import { LookupInRecord, FileInRecord } from '@easy-coder/sdk/data';
import { InputProps } from '@arco-design/web-react';

export declare namespace VariableDefine {
    interface Base<T extends string> {
        apiName: string;
        type: T;
        required?: boolean;
        label: string;
    }
    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 Number extends Base<'number'> {
    }
    interface String extends Base<'string'> {
    }
    interface Json extends Base<'json'> {
    }
    interface Object extends Base<'object'> {
        prototype: Record<string, Desc>;
    }
    interface Array extends Base<'array'> {
        item: Omit<Desc, 'label' | 'apiName'>;
    }
    interface Enum extends Base<'enum'> {
        enumGroupName: string;
        optionUseApiName?: boolean;
        options?: {
            value: string;
            label: string;
        }[];
    }
    interface MultipleEnum extends Base<'multipleEnum'> {
        enumGroupName: string;
        optionUseApiName?: boolean;
        options?: {
            value: string;
            label: string;
        }[];
    }
    interface Lookup extends Base<'lookup'> {
        modalName: string;
    }
    interface MultipleLookup extends Base<'multipleLookup'> {
        modalName: string;
    }
    interface File extends Base<'file'> {
        maxLength?: number;
    }
    type Desc = DateTime | Date | Boolean | Float | Text | Number | String | Json | Object | Array | Enum | MultipleEnum | Lookup | MultipleLookup | File;
}
export declare namespace VariableSetter {
    interface Base<D extends VariableDefine.Desc, V> {
        define: D;
        value?: V;
        size?: InputProps['size'];
        readonly?: boolean;
        disabled?: boolean;
        onChange?: (v?: V) => void;
    }
    interface DateTime extends Base<VariableDefine.DateTime, string> {
    }
    interface Date extends Base<VariableDefine.Date, string> {
    }
    interface Boolean extends Base<VariableDefine.Boolean, boolean> {
    }
    interface Float extends Base<VariableDefine.Float, number> {
    }
    interface Text extends Base<VariableDefine.Text, string> {
    }
    interface Number extends Base<VariableDefine.Number, number> {
    }
    interface String extends Base<VariableDefine.String, string> {
    }
    interface Json extends Base<VariableDefine.Json, any> {
    }
    interface Object extends Base<VariableDefine.Object, Record<string, any>> {
    }
    interface Array extends Base<VariableDefine.Array, any[]> {
    }
    interface Enum extends Base<VariableDefine.Enum, string | number> {
    }
    interface MultipleEnum extends Base<VariableDefine.MultipleEnum, number[]> {
    }
    interface Lookup extends Base<VariableDefine.Lookup, LookupInRecord> {
    }
    interface MultipleLookup extends Base<VariableDefine.MultipleLookup, LookupInRecord[]> {
    }
    interface File extends Base<VariableDefine.File, FileInRecord[]> {
    }
    interface Desc {
        datetime: DateTime;
        date: Date;
        boolean: Boolean;
        float: Float;
        text: Text;
        number: Number;
        string: String;
        json: Json;
        object: Object;
        array: Array;
        enum: Enum;
        multipleEnum: MultipleEnum;
        lookup: Lookup;
        multipleLookup: MultipleLookup;
        file: File;
    }
}
