import { EventBus } from '../../odoo/owl'; /** * @template {typeof Model} T * @param {T} ModelClass * @param {Object} params * @param {Object} [options] * @param {Function} [options.beforeFirstLoad] * @returns {InstanceType} */ export function useModel(ModelClass: T, params: Object, options?: { beforeFirstLoad?: Function | undefined; } | undefined): InstanceType; /** * @template {typeof Model} T * @param {T} ModelClass * @param {Object} params * @param {Object} [options] * @param {Function} [options.onUpdate] * @param {Function} [options.onWillStart] * @param {Function} [options.onWillStartAfterLoad] * @returns {InstanceType} */ export function useModelWithSampleData(ModelClass: T, params: Object, options?: { onUpdate?: Function | undefined; onWillStart?: Function | undefined; onWillStartAfterLoad?: Function | undefined; } | undefined): InstanceType; export function _makeFieldFromPropertyDefinition(name: any, definition: any, relatedPropertyField: any): any; export function addPropertyFieldDefs(orm: any, resModel: any, context: any, fields: any, groupBy: any): Promise; /** * @typedef {import("@web/search/search_model").SearchParams} SearchParams */ export class Model { /** * @param {Object} env * @param {Object} services */ constructor(env: Object, params: any, services: Object); env: Object; orm: any; bus: EventBus; /** * @param {Object} params * @param {Object} services */ setup(): void; /** * @param {SearchParams} searchParams */ load(): Promise; /** * This function is meant to be overriden by models that want to implement * the sample data feature. It should return true iff the last loaded state * actually contains data. If not, another load will be done (if the sample * feature is enabled) with the orm service substituted by another using the * SampleServer, to have sample data to display instead of an empty screen. * * @returns {boolean} */ hasData(): boolean; /** * This function is meant to be overriden by models that want to combine * sample data with real groups that exist on the server. * * @returns {boolean} */ getGroups(): boolean; notify(): void; } export namespace Model { let services: any[]; } export type SearchParams = import('../search/search_model').SearchParams;