import { Col, Fn, Literal } from 'sequelize/types/lib/utils'; import { Association } from '../override/Association'; import { Model } from '../override/Model'; import { OrderItem } from '../override/OrderItem'; interface OrderType { // TODO: For alias attribute, using col('') or consider { alias: string } (column: keyof Attrs | Fn | Literal | Col): OrderItem; } type OrderIncludeObject< T, M extends Model = T extends () => Association ? R : never, > = OrderChain; export type OrderChain = { readonly [K in keyof T]: OrderIncludeObject; } & { readonly asc: OrderType; readonly desc: OrderType; };