import { DataType, INTEGER, STRING, TEXT, DATE, DATEONLY, UUIDV4, } from 'sequelize' type ModelAttribute = { allowNull?: boolean, primaryKey?: boolean, type: DataType, } export type Model = { tableName?: string, modelName?: string, options?: { timestamps?: boolean, paranoid?: boolean, createdAt?: string | boolean, updatedAt?: string | boolean, deletedAt?: string | boolean, }, attributes: Record, } type IntegerType = typeof INTEGER | ReturnType type NumberType = IntegerType type VarcharType = typeof STRING type TextType = typeof TEXT | ReturnType type StringType = VarcharType | TextType type DateTimeType = typeof DATE type DateOnlyType = typeof DATEONLY type DateType = DateTimeType | DateOnlyType type InferType = ( V extends NumberType ? number : V extends StringType ? string : V extends DateType ? Date : V extends typeof UUIDV4 ? string : unknown ) export type InferModel = { [K in keyof M['attributes']]-?: InferType } export { INTEGER, STRING, TEXT, DATEONLY, DATE, UUIDV4, }