import { CRUD } from './crud';

export declare namespace EasyCoderData {
    interface Config {
        host: string;
    }
    interface ResStruct<T extends any = any> {
        code: number;
        msg: string;
        data: T;
    }
    interface ErrorListener {
        (msg: string): void;
    }
    interface SearchByPage<M extends Record<string, any>> {
        condition?: CRUD.Condition<M>;
        orderBy?: CRUD.OrderBy<M>[];
        fields?: CRUD.SelectField<M>[];
        pageSize?: number;
        page?: number;
    }
    interface WithPage<T extends any> {
        total: number;
        page: number;
        pageSize: number;
        list: T[];
    }
}
