export function AND(...args: any[]): any[]; export function OR(...args: any[]): any[]; export function isCommandList(data: any): boolean; export function isCommand(data: any): boolean; /** * Normalize a list of many commands. * * @param {Array|Object|null|false|undefined} command Many command. Can * either be: * - A falsy value or an empty array: interpreted as a "clear" command. * - An object: interpreted as a replace. * - A command. * - An array of commands. * - An array of raw values: interpreted as a replace. * @returns {Array<[string, any[]]>} Normalized list of `[mode, value]` arrays. */ export function normalizeManyCommands(command: any[] | Object | null | false | undefined): Array<[string, any[]]>; /** * @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; export function isComputedDefinition(val: any): any; export function makeRecordFieldLocalId(recordLocalId: any, fieldName: any): string; /** * Wraps the given methods so they run untracked: reactive reads inside them * never subscribe the caller's computation. Applied once at module load on a * class prototype (or the class itself for statics); the wrapper runs on the * call receiver. Defined non-enumerable, like the class methods it shadows. * * @param {Object} object * @param {string[]} names */ export function untrackFunctions(object: Object, names: string[]): void; /** @typedef {import("./record").Record} Record */ /** @typedef {import("./record_list").RecordList} RecordList */ export const modelRegistry: import('../../web/core/registry').Registry; export const COMPUTED_SYM: unique symbol; 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; 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. * @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; } | 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. * @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; } | 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 {boolean} [param1.asProxy=false] a read returns the value as a proxy, so that * mutating its content is observed too. Only for an object, an array, a Map or a Set. * @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; asProxy?: boolean | 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. * @returns {string|markup } */ function Html(def: string, param1?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | 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. * @returns {import("luxon").DateTime} */ function Date(param0?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | undefined; } | undefined): any; /** * @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. * @returns {import("luxon").DateTime} */ function Datetime(param0?: { compute?: ((this: Record) => any) | undefined; eager?: boolean | undefined; } | undefined): any; } export const technicalKeysOnRecords: Set; 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;