import type { TypeAliasEntry, VariableType } from "../types.js"; /** * Canonical structural identity for a type — THE replacement for raw * `JSON.stringify(t)` at identity sites (uniteTypes, loop widening, union * dedup in synthesis, coinduction pair keys). Fixes the gaps raw stringify * had (issue #473): property-order sensitivity, non-semantic metadata * leaking into the key, and unresolved top-level aliases keying * differently from their bodies. * * Deliberate identity decisions (all safe because the consumers feed * dedup/diagnostics and cycle detection, never codegen schemas): * - The TOP node resolves ONE step via safeResolveType (recursive * self-refs stay nominal via its guard); NESTED alias refs key * nominally as `alias:Name` — never expanded, so recursion terminates * and same-name refs always key equal. * - `valueArgs` ARE identity: `Age(18)` and `Age(21)` are different types. * - `tags`, `trivia`, property `description`s, `loc`, `isEffectSet`, and * `blockType.raises` are NOT identity: two types differing only in * annotations/formatting dedup together (first member's metadata wins * at union joins — acceptable for diagnostics). * - Union members sort by canonical form (`A | B` keys equal `B | A`); * object properties sort by key. */ export declare function typeKey(t: VariableType, aliases: Record): string;