import { EventBus } from '../../odoo/owl'; /** * @template {Model} T * @param {new (env: Object, params: Object, services: Object) => T} ModelClass * @param {Object} params * @param {Object} [options] * @param {Function} [options.onUpdate] * @returns {T} */ export function useModel(ModelClass: new (env: Object, params: Object, services: Object) => T, params: Object, options?: { onUpdate?: Function | undefined; } | undefined): T; /** * @typedef {import("@web/search/search_model").SearchParams} SearchParams */ export class Model extends EventBus { /** * @param {Object} env * @param {Object} services */ constructor(env: Object, params: any, services: Object); env: Object; orm: any; useSampleModel: boolean; /** * @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;