import { Transaction, QueryOptions, Sequelize } from 'sequelize'; import { IActive, IFieldItem } from './index.js'; interface ISelectPage { offset: number; limit: number; total: number; page: number; lastPage: number; } interface ISelectPageResult { contents: T[] | null; page: ISelectPage; } type TSelectResult = T | T[] | ISelectPageResult; type TSelectFn = (item: T, active: IActive) => Promise | void; type TQueryOptions = Transaction | QueryOptions | null; type TSelectTypes = 'row' | 'all' | 'page'; interface ISelectActive extends IActive { func?: TSelectFn; nolimit?: boolean; query?: string; queryCnt?: string; } declare const selectMap: (index: TSelectResult, type: TSelectTypes, func: (item: T) => TResult) => TResult[]; declare class SequelizeDB { readonly sequelize: Sequelize; private dbqb; private fn; constructor(sequelize: Sequelize); getTables(): Promise; getFields(table: string): Promise; validate(fn: (item: any, key: string) => void): void; selectQuery(active: IActive): Promise; countQuery(active: IActive): Promise; private queryOptions; transaction(t?: TQueryOptions): Promise<[Transaction, TQueryOptions, boolean]>; setQueryOptions(t: TQueryOptions, qo: QueryOptions): TQueryOptions; queryRow(query: string, t?: TQueryOptions): Promise; queryAll(query: string, t?: TQueryOptions): Promise; queryOne(query: string, t?: TQueryOptions): Promise; selectRow(active: ISelectActive, t?: TQueryOptions): Promise; selectAll(active: ISelectActive, t?: TQueryOptions): Promise; selectOne(active: ISelectActive, t?: TQueryOptions): Promise; selectPage(active: ISelectActive, t?: TQueryOptions): Promise>; select(_active: ISelectActive, type?: 'page', func?: TSelectFn | null, t?: TQueryOptions): Promise | null>; select(_active: ISelectActive, type: 'all', func?: TSelectFn | null, t?: TQueryOptions): Promise; select(_active: ISelectActive, type: 'row', func?: TSelectFn | null, t?: TQueryOptions): Promise; select(_active: ISelectActive, type: TSelectTypes, func?: TSelectFn | null, t?: TQueryOptions): Promise | null>; insert(active: IActive, t?: TQueryOptions): Promise<{ result: boolean; insertId: number; }>; insertAll(active: IActive, t?: TQueryOptions): Promise<{ result: boolean; insertId: number[]; } | undefined>; update(active: IActive, t?: TQueryOptions): Promise<{ result: boolean; affected: number; }>; insertUpdate(active: IActive, t?: TQueryOptions): Promise<{ result: boolean; }>; delete(active: IActive, t?: Transaction | null): Promise<{ result: boolean; }>; getErrorLogs(): string[]; } export { ISelectActive, ISelectPage, ISelectPageResult, SequelizeDB, TQueryOptions, TSelectFn, TSelectResult, TSelectTypes, selectMap };