import { ApplicationContract } from '../../Contracts/ApplicationContract'; /** * Model factory to seed database using Lucid * models * * @class ModelFactory * @constructor */ export declare class ModelFactory { protected app: ApplicationContract; Model: any; dataCallback: (faker?: any, index?: number, data?: any) => any | Promise; constructor(app: ApplicationContract, Model: any, dataCallback: (faker?: any, index?: number, data?: any) => any | Promise); /** * New up a model with attributes * * @method _newup * * @param {Object} attributes * * @return {Object} * * @private */ protected _newup(attributes: any): any; /** * Make a single instance of blueprint for a given * index. This method will evaluate the functions * in the return payload from blueprint. * * @method _makeOne * @async * * @param {Number} index * @param {Object} data * * @return {Object} * * @private */ protected _makeOne(index: any, data: any): Promise<{}>; /** * Make a single model instance with attributes * from blueprint fake values * * @method make * @async * * @param {Object} data * @param {Number} [index = 0] * * @return {Object} */ make(data?: {}, index?: number): Promise; /** * Make x number of model instances with * fake data * * @method makeMany * @async * * @param {Number} instances * @param {Object} [data = {}] * * @return {Array} */ makeMany(instances: any, data?: {}): Promise; /** * Create model instance and persist to database * and then return it back * * @method create * @async * * @param {Object} data * * @return {Object} */ create(data?: {}, index?: number): Promise; /** * Persist multiple model instances to database and get * them back as an array * * @method createMany * @async * * @param {Number} numberOfRows * @param {Object} [data = {}] * * @return {Array} */ createMany(numberOfRows: any, data?: {}): Promise; /** * Truncate the database table * * @method reset * @async * * @return {Number} */ reset(): Promise; }