export function AND(...args: any[]): any[]; export function OR(...args: any[]): any[]; export function isCommand(data: any): boolean; /** * @param {typeof import("./record").Record} Model * @param {string} fieldName */ export function isOne(Model: typeof import('./record').Record, fieldName: string): boolean | undefined; /** * @param {typeof import("./record").Record} Model * @param {string} fieldName */ export function isMany(Model: typeof import('./record').Record, fieldName: string): boolean | undefined; /** @param {Record} record */ export function isRecord(record: Record): boolean; /** * @param {typeof import("./record").Record} Model * @param {string} fieldName */ export function isRelation(Model: typeof import('./record').Record, fieldName: string): boolean | undefined; export function isFieldDefinition(val: any): any; /** @typedef {import("./record").Record} Record */ /** @typedef {import("./record_list").RecordList} RecordList */ export const modelRegistry: import('../../web/core/registry').Registry; export const FIELD_DEFINITION_SYM: unique symbol; /** @typedef {ATTR_SYM|MANY_SYM|ONE_SYM} FIELD_SYM */ export const ATTR_SYM: unique symbol; export const MANY_SYM: unique symbol; export const ONE_SYM: unique symbol; export const OR_SYM: unique symbol; export const IS_RECORD_SYM: unique symbol; export const IS_FIELD_SYM: unique symbol; /** @deprecated equivalent to IS_DELETED_SYM */ export const IS_DELETING_SYM: unique symbol; export const IS_DELETED_SYM: unique symbol; export const STORE_SYM: unique symbol; export namespace fields { /** * @template {keyof import("models").Models} M * @param {M} targetModel * @param {Object} [param1={}] * @param {(this: Record) => any} [param1.compute] if set, the value of this relational field is declarative and * is computed automatically. All reactive accesses recalls that function. The context of * the function is the record. Returned value is new value assigned to this field. * @param {boolean} [param1.eager=false] when field is computed, determines whether the computation * of this field is eager or lazy. By default, fields are computed lazily, which means that * they are computed when dependencies change AND when this field is being used. In eager mode, * the field is immediately (re-)computed when dependencies changes, which matches the built-in * behaviour of OWL reactive. * @param {string} [param1.inverse] if set, the name of field in targetModel that acts as the inverse. * @param {(this: Record, r: import("models").Models[M]) => void} [param1.onAdd] function that is called when a record is added * in the relation. * @param {(this: Record, r: import("models").Models[M]) => void} [param1.onDelete] function that is called when a record is removed * from the relation. * @param {(this: Record) => void} [param1.onUpdate] function that is called when the field value is updated. * This is called at least once at record creation. * @returns {import("models").Models[M]} */ function One(targetModel: M, param1?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | undefined; inverse?: string | undefined; onAdd?: ((this: Record, r: import("models").Models[M]) => void) | undefined; onDelete?: ((this: Record, r: import("models").Models[M]) => void) | undefined; onUpdate?: ((this: Record) => void) | undefined; } | undefined): import("models").Models[M]; /** * @template {keyof import("models").Models} M * @param {M} targetModel * @param {Object} [param1={}] * @param {(this: Record) => any} [param1.compute] if set, the value of this relational field is declarative and * is computed automatically. All reactive accesses recalls that function. The context of * the function is the record. Returned value is new value assigned to this field. * @param {boolean} [param1.eager=false] when field is computed, determines whether the computation * of this field is eager or lazy. By default, fields are computed lazily, which means that * they are computed when dependencies change AND when this field is being used. In eager mode, * the field is immediately (re-)computed when dependencies changes, which matches the built-in * behaviour of OWL reactive. * @param {string} [param1.inverse] if set, the name of field in targetModel that acts as the inverse. * @param {(this: Record, r: import("models").Models[M]) => void} [param1.onAdd] function that is called when a record is added * in the relation. * @param {(this: Record, r: import("models").Models[M]) => void} [param1.onDelete] function that is called when a record is removed * from the relation. * @param {(this: Record) => void} [param1.onUpdate] function that is called when the field value is updated. * This is called at least once at record creation. * @param {(this: Record, r1: import("models").Models[M], r2: import("models").Models[M]) => number} [param1.sort] if defined, this field * is automatically sorted by this function. * @returns {import("models").Models[M][]} */ function Many(targetModel: M, param1?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | undefined; inverse?: string | undefined; onAdd?: ((this: Record, r: import("models").Models[M]) => void) | undefined; onDelete?: ((this: Record, r: import("models").Models[M]) => void) | undefined; onUpdate?: ((this: Record) => void) | undefined; sort?: ((this: Record, r1: import("models").Models[M], r2: import("models").Models[M]) => number) | undefined; } | undefined): import("models").Models[M][]; /** * @template T * @param {T} def * @param {Object} [param1={}] * @param {(this: Record) => any} [param1.compute] if set, the value of this attr field is declarative and * is computed automatically. All reactive accesses recalls that function. The context of * the function is the record. Returned value is new value assigned to this field. * @param {boolean} [param1.eager=false] when field is computed, determines whether the computation * of this field is eager or lazy. By default, fields are computed lazily, which means that * they are computed when dependencies change AND when this field is being used. In eager mode, * the field is immediately (re-)computed when dependencies changes, which matches the built-in * behaviour of OWL reactive. * @param {(this: Record) => void} [param1.onUpdate] function that is called when the field value is updated. * This is called at least once at record creation. * @param {(this: Record, Object, Object) => number} [param1.sort] if defined, this field is automatically sorted * by this function. * @param {'datetime'|'date'} [param1.type] if defined, automatically transform to a * specific type. * @returns {T} */ function Attr(def: T, param1?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | undefined; onUpdate?: ((this: Record) => void) | undefined; sort?: ((this: Record, Object: any, Object: any) => number) | undefined; type?: "date" | "datetime" | undefined; } | undefined): T; /** * HTML fields are ATTR that are automatically markup when the data being inserted is a markup. * * @param {string} def * @param {Object} [param1={}] * @param {(this: Record) => any} [param1.compute] if set, the value of this html field is declarative and * is computed automatically. All reactive accesses recalls that function. The context of * the function is the record. Returned value is new value assigned to this field. * @param {boolean} [param1.eager=false] when field is computed, determines whether the computation * of this field is eager or lazy. By default, fields are computed lazily, which means that * they are computed when dependencies change AND when this field is being used. In eager mode, * the field is immediately (re-)computed when dependencies changes, which matches the built-in * behaviour of OWL reactive. * @param {(this: Record) => void} [param1.onUpdate] function that is called when the field value is updated. * This is called at least once at record creation. * @returns {string|markup } */ function Html(def: string, param1?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | undefined; onUpdate?: ((this: Record) => void) | undefined; } | undefined): string | markup; /** * @param {Object} [param0={}] * @param {(this: Record) => any} [param0.compute] if set, the value of this date field is declarative and * is computed automatically. All reactive accesses recalls that function. The context of * the function is the record. Returned value is new value assigned to this field. * @param {boolean} [param0.eager=false] when field is computed, determines whether the computation * of this field is eager or lazy. By default, fields are computed lazily, which means that * they are computed when dependencies change AND when this field is being used. In eager mode, * the field is immediately (re-)computed when dependencies changes, which matches the built-in * behaviour of OWL reactive. * @param {(this: Record) => void} [param0.onUpdate] function that is called when the field value is updated. * This is called at least once at record creation. * @returns {luxon.DateTime} */ function Date(param0?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | undefined; onUpdate?: ((this: Record) => void) | undefined; } | undefined): luxon.DateTime; /** * @param {Object} [param0={}] * @param {(this: Record) => any} [param0.compute] if set, the value of this datetime field is declarative and * is computed automatically. All reactive accesses recalls that function. The context of * the function is the record. Returned value is new value assigned to this field. * @param {boolean} [param0.eager=false] when field is computed, determines whether the computation * of this field is eager or lazy. By default, fields are computed lazily, which means that * they are computed when dependencies change AND when this field is being used. In eager mode, * the field is immediately (re-)computed when dependencies changes, which matches the built-in * behaviour of OWL reactive. * @param {(this: Record) => void} [param0.onUpdate] function that is called when the field value is updated. * This is called at least once at record creation. * @returns {luxon.DateTime} */ function Datetime(param0?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | undefined; onUpdate?: ((this: Record) => void) | undefined; } | undefined): luxon.DateTime; } export type Record = import('./record').Record; export type RecordList = import('./record_list').RecordList; export type FIELD_SYM = typeof ATTR_SYM | typeof MANY_SYM | typeof ONE_SYM;