/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { FieldSet } from '../@types/index.js'; export type CanonicalNumericFieldType = 'integer' | 'float' | 'decimal'; export type CanonicalNumericValue = number | string; /** Return whether a value already has the storage-facing canonical type and shape. */ export declare function isCanonicalNumericValue(fieldType: CanonicalNumericFieldType, value: unknown): value is CanonicalNumericValue; /** * Convert a tolerant numeric write value to its canonical representation. * `undefined` means the value was empty and should be removed. */ export declare function normalizeNumericValue(fieldType: CanonicalNumericFieldType, value: unknown, path: string, issuePath?: string): CanonicalNumericValue | undefined; /** * Normalize every user-writable numeric leaf in a schema-shaped data tree. * Mutates `data` in place. Counter fields are deliberately excluded because * their values are supplied by the lifecycle allocator. */ export declare function normalizeNumericFields(fields: FieldSet, data: Record): void;