import { BaseRecord, BaseResource } from 'adminjs'; import mongoose from 'mongoose'; import { FindOptions } from './utils/filter.types'; import Property from './property'; /** * Adapter for mongoose resource * @private */ declare class Resource extends BaseResource { private readonly dbType; /** * @typedef {Object} MongooseModel * @private * @see https://mongoosejs.com/docs/models.html */ readonly MongooseModel: mongoose.Model; /** * Initialize the class with the Resource name * @param {MongooseModel} MongooseModel Class which subclass mongoose.Model * @memberof Resource */ constructor(MongooseModel: any); static isAdapterFor(MoongooseModel: any): boolean; databaseName(): string; databaseType(): string; name(): string; id(): string; properties(): Property[]; property(name: string): Property; count(filters?: any): Promise; find(filters: {}, { limit, offset, sort }: FindOptions): any; findOne(id: string): Promise; findMany(ids: string[]): Promise; build(params: any): BaseRecord; create(params: any): Promise; update(id: any, params: any): Promise; delete(id: any): Promise; static stringifyId(mongooseObj: any): any; /** * Check all params against values they hold. In case of wrong value it corrects it. * * What it does exactly: * - changes all empty strings to `null`s for the ObjectID properties. * - changes all empty strings to [] for array fields * * @param {Object} params received from AdminJS form * * @return {Object} converted params */ parseParams(params: any): any; } export default Resource;