import type { RuntimeType } from "./RuntimeType"; import type { DeserializeNumberHandling } from "../TASONSerializerOptions"; /** 收敛 instance 字段时:期望的 JS 构造函数(仅用于 instanceof 校验/透传) */ export interface MapToRuntimeContext { /** runtimeType === "instance" 时的期望 JS 构造函数 */ ctor?: abstract new (...args: any[]) => any; } /** * 将反序列化得到的值收敛到期望 RuntimeType(叶子)。 * * **字面量保真(JSON 风格):** * 数字/字符串/布尔/null/对象/数组字面量本身已携带「无需再描述的准确类型」。 * - 数字字面量 → 某种数字 RuntimeType(number/bigint/decimal 之间可按契约收) * - **字符串字面量只表示字符串**——不得把 `"1"` 当数字、把 RFC3339 当 Date、把 `"/a/"` 当 RegExp * - 非 JSON 可表达的类型必须经 **TypeInstance**(TypeName)进入,再映射到 RuntimeType * * 同一数字 RuntimeType 可来自多种 **数值** TypeInstance(如 bigint ← Int64 / BigInt / 数字字面量)。 */ export declare function mapTypeInstanceToRuntime(runtimeType: RuntimeType, value: unknown, handling: DeserializeNumberHandling, ctx?: MapToRuntimeContext): unknown;