import { AbstractModel } from "./models/abstract-model";
import { SmartDbDictionary } from "./models/smart-db-dictionary";
export interface SmartDbOptions {
    module: string;
    sqlFilesDirectory: string;
    smartDbDictionary?: typeof SmartDbDictionary | any[];
    skipAutoUpgrade?: boolean;
}
export interface SmartDbRunResult {
    lastId: number;
    changes: number;
    affected: number;
}
export interface SmartDbTableInfo {
    name: string;
    fields: SmartDbFieldDescription[];
}
export interface SmartDbFieldDescription {
    cid?: string | number;
    name: string;
    type: string;
    virtual?: boolean;
    notNull?: boolean;
    defaultValue?: number | string | boolean;
    isPk?: boolean;
}
export interface SmartDbSqlComparison {
    compare: string | SqlFieldDescriptor;
    with: string | SqlFieldDescriptor;
    operation?: SqlOperationType;
}
export declare type SqlValueType = string | number | boolean | Date;
export declare enum FieldNamingStyle {
    Database = 0,
    TypeScript = 1,
    All = 2
}
export interface GenericModelData {
    [key: string]: any;
}
export interface AttributeInfo {
    attribute: string;
    type: string;
    alias?: string;
    physical?: boolean;
    virtual?: boolean;
    alternative?: boolean;
    typeScriptStyle?: boolean;
}
export interface ModelAttributeMap {
    [key: string]: AttributeInfo;
}
export interface AbstractModelGlobals<T extends AbstractModel<T, D>, D extends GenericModelData> {
    attributeMap: ModelAttributeMap;
    getTableName: () => string;
    from: (other: T | D) => T;
}
export interface SqlWhere {
    or?: SqlWhere | SqlWhere[];
    and?: SqlWhere | SqlWhere[];
    expression?: SmartDbSqlComparison[];
    [key: string]: SqlValueType | SqlValueType[] | SqlOperation | SqlWhere | SqlWhere[] | SmartDbSqlComparison[];
}
export declare type SqlUpdateValues = GenericModelData;
export declare type SqlOrderBy = string | string[];
declare type SqlGroupBy = string | string[];
export interface SqlLimit {
    offset?: number;
    limit?: number;
}
export interface SectionDescription<T extends AbstractModel<T, D>, D extends GenericModelData> {
    model: (new () => T) | string;
    where?: SqlWhere;
    fields?: string | SqlFieldDescriptor | (string | SqlFieldDescriptor)[] | null;
    groupBy?: SqlGroupBy;
    limit?: SqlLimit;
}
export interface SmartDbSqlOptions<T extends AbstractModel<T, D>, D extends GenericModelData> {
    firstOnly?: boolean;
    where?: SqlWhere;
    fields?: string | SqlFieldDescriptor | (string | SqlFieldDescriptor)[] | null;
    orderBy?: SqlOrderBy;
    groupBy?: SqlGroupBy;
    limit?: SqlLimit;
    count?: boolean;
    distinct?: boolean;
    collapseRow?: boolean;
    indexedBy?: string;
    union?: SectionDescription<T, D> | SectionDescription<T, D>[];
    minus?: SectionDescription<T, D> | SectionDescription<T, D>[];
    intersect?: SectionDescription<T, D> | SectionDescription<T, D>[];
    style?: FieldNamingStyle;
}
export declare enum SqlOperationType {
    GT = ">",
    GE = ">=",
    LT = "<",
    LE = "<=",
    EQ = "=",
    NE = "!=",
    IN = "IN",
    NOT_IN = "NOT IN",
    LIKE = "LIKE",
    NOT_LIKE = "NOT LIKE",
    IS_NULL = "IS NULL",
    IS_NOT_NULL = "IS NOT NULL",
    LITERAL = "LITERAL",
    VALUE = "VALUE"
}
export declare enum SqlFieldOperationType {
    VALUE = "VALUE",
    FIELD = "FIELD",
    COUNT = "COUNT",
    COALESCE = "COALESCE"
}
export interface SqlFieldDescriptor {
    operation: SqlFieldOperationType;
    value: SqlFieldDescriptor | SqlValueType | (SqlFieldDescriptor | SqlValueType)[];
    alias?: string;
    literal?: boolean;
}
export interface SqlOperation {
    operation: SqlOperationType;
    value: SqlValueType | SqlValueType[];
    key?: string;
    literalOperation?: SqlOperationType;
}
export interface KeyValueList {
    [key: string]: SqlValueType;
}
export interface IndexedGenericModelData<T extends AbstractModel<T, D>, D extends GenericModelData> {
    [key: string]: T | GenericModelData;
}
export interface SmartDbSqlBuildDataResults {
    sql: string;
    values: SqlValueType[];
}
export interface SmartDbDatabase {
}
export interface SmartDbConnector {
}
export {};
