/** * @file * * Mock of Obsidian's `NumberValue`, the Bases value wrapping a number. */ import type { NumberValue as NumberValueOriginal } from 'obsidian'; import type { RenderContext } from './RenderContext.cjs'; import { PrimitiveValue } from './PrimitiveValue.cjs'; /** * Mock of Obsidian's `NumberValue`, a Bases value wrapping a number. */ export declare class NumberValue extends PrimitiveValue { /** * The value type's identifier, `'Number'` - Obsidian's own name for this class of value. */ static type: string; /** * The lucide icon name standing for this value's type. */ icon: string; /** * Creates a value wrapping `value`. * * @param value - The number to wrap; `0` when omitted. */ constructor(value?: number); /** * Mock-only factory: creates a number value, spyable via `vi.spyOn(NumberValue, 'create__')`. * * @param value - The number to wrap; `0` when omitted. * @returns The new number value. */ static create__(value?: number): NumberValue; /** * Mock-only: views a value typed as Obsidian's `NumberValue` as this mock. * * @param value - The value typed as the original `NumberValue`. * @returns The same object, typed as the mock. */ static fromOriginalType4__(value: NumberValueOriginal): NumberValue; /** * Mock-only: views this mock as Obsidian's `NumberValue` type. * * @returns The same object, typed as the original `NumberValue`. */ asOriginalType4__(): NumberValueOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(NumberValue.prototype, 'constructor4__')`. * * @param _value - The number the value was created with. */ constructor4__(_value?: number): void; /** * Renders the value into an element, as Obsidian does: the number's string form, or the infinity SIGN for * an infinite one. * * Obsidian's guard is `isFinite(data) || isNaN(data)`, so a `NaN` renders as the text `NaN` and only * `Infinity` and `-Infinity` reach the sign - which is written unsigned, so both infinities render as `∞`. * The sign is the one place a number renders as something other than what {@link NumberValue.toString} * answers. * * @param el - The element to render into. * @param _context - The rendering context; unused. */ renderTo(el: HTMLElement, _context: RenderContext): void; }