/** @packageDocumentation * @module Quantity */ import type { FormatterSpec } from "./Formatter/FormatterSpec"; import type { FormattingSpecArgs, FormattingSpecProvider } from "./Formatter/Interfaces"; import type { ParserSpec } from "./ParserSpec"; import type { UnitSystemKey } from "./Interfaces"; /** Arguments for constructing a [[FormatSpecHandle]]. * @beta */ export interface FormatSpecHandleArgs extends FormattingSpecArgs { /** The provider that supplies current formatting spec lookups. */ provider: FormattingSpecProvider; } /** A handle to formatting and parsing specs for a specific KoQ and persistence unit. * Reads the current specs from the provider on access. Use [[QuantityFormatter.getFormatSpecHandle]] * to create instances. * * When formatting is not yet ready, [[format]] returns a `value.toString()` fallback. * Dispose the handle when it is no longer needed to invalidate it. * * @beta */ export declare class FormatSpecHandle implements Disposable { private _disposed; private readonly _provider; private readonly _koqName; private readonly _persistenceUnit; private readonly _system; constructor(args: FormatSpecHandleArgs); /** The KoQ name this handle is keyed to. */ get koqName(): string; /** The persistence unit this handle is keyed to. */ get persistenceUnit(): string; /** The unit system this handle is pinned to, or `undefined` for the active system. */ get system(): UnitSystemKey | undefined; /** The current FormatterSpec, or undefined if not yet loaded. */ get formatterSpec(): FormatterSpec | undefined; /** The current ParserSpec, or undefined if not yet loaded. */ get parserSpec(): ParserSpec | undefined; /** Format a quantity value using the current spec. * If the formatter is not yet ready, returns `value.toString()` as a fallback. * @param value - The numeric value to format. * @returns The formatted string. */ format(value: number): string; /** Invalidate this handle. * Idempotent and safe to call multiple times. * No additional teardown is required because the handle owns no external resources. */ [Symbol.dispose](): void; private _getEntry; } //# sourceMappingURL=FormatSpecHandle.d.ts.map