UNPKG

@joktec/mysql

Version:

JokTec - MySql Service

20 lines 778 B
import { KeyOf } from '@joktec/core'; import { EntityOptions, IndexOptions } from 'typeorm'; import { MysqlModel } from '../models'; type KeyTypeOf<T, TYPE> = { [K in keyof T]: T[K] extends TYPE | undefined ? K : never; }[keyof T]; export interface IIndexOptions<T extends MysqlModel = any> extends IndexOptions { name?: string; fields: KeyOf<T>[]; } export interface ITableOptions<T extends MysqlModel = any> extends EntityOptions { keywords?: KeyTypeOf<T, string>[]; index?: KeyOf<T>[]; unique?: KeyOf<T>[]; textSearch?: KeyTypeOf<T, string>[]; customIndexes?: IIndexOptions<T>[]; } export declare const Tables: <T extends MysqlModel = any>(options?: ITableOptions<T>) => ClassDecorator; export {}; //# sourceMappingURL=table.decorator.d.ts.map