import { Model } from "sequelize-typescript"; import { NonAbstract } from "sequelize-typescript/dist/shared/types"; import { Attributes } from "sequelize"; export declare type CommonModelStatic = (new () => M) & NonAbstract; export declare abstract class CommonModel extends Model { /** * return the prefix for this type of class' id */ abstract idPrefix(): string; uniqueIdentifier?: string[]; id: string; static generateId(instance: CommonModel): void; static generateIds(instances: CommonModel[]): void; static validateId(instance: CommonModel): void; static validateIds(instances: CommonModel[]): void; createdAt: Date; updatedAt: Date; touch(): Promise; idIsDefault(): boolean; abstract apiData(): Promise<{ [key: string]: any; }>; /** * Find an instance of this class, regardless of scope. * Throw if the instance cannot be found. */ static findById(this: CommonModelStatic, id: string): Promise; /** * Update many instances at once, never exceeding a set batch size for */ static updateAllInBatches(this: CommonModelStatic, instances: CommonModel[], values: Partial<{ [key in keyof Attributes]: T[key]; }>): Promise; /** * Ensures there isn't a duplicate version of this instance based on name or key. */ static ensureUnique & { name?: string; key?: string; state?: string; }>(this: CommonModelStatic, instance: T): Promise; }