/** * The reactive names of one module: which names read reactively without being a * `state` themselves, which names *are* `state`, and what each `computed` is * computed from. * * D115 §三: three questions about one module's declarations, asked by the Look * freezing check and by the watch-ring refusals. They are one reading of the * program body, so they are one module rather than three walks in the middle of * the Web analyzer. */ import { type Program } from "@velarscript/compiler/extension"; /** The function spelling of a derived value; `computed` the declaration is what it becomes. */ export declare function isRetiredAccessorName(name: string): boolean; /** * Every name in a module or component body whose read is reactive but whose * binding is not itself a state/prop reference: a computed accessor, a resource * handle, an action handle. A Look literal that reads one of these freezes it * exactly as it freezes a state read (LOK-D1). * * The retired `computed(...)` accessor stays in the callee test even though it * is not a global any more (D71 replaced it with the declaration): analysis * after a migration diagnostic still has to stay coherent, so the name a * retired declaration binds is treated as derived exactly as it was before. */ export declare function collectDerivedReactiveNames(program: Program): ReadonlySet; /** * D114 P6 item 6 (ST-U2): one same-module `computed` and the state it is * computed *from*, so `watch doubled:` writing `count` is refused where the * runtime's per-task observer budget used to stop it after 50,000 rounds. * * The hop is exactly one, and it is proved rather than guessed: * * - **Same module.** A cross-module `computed` is a name this program cannot * read the body of, so it is not in this map and nothing is reported. * - **One hop.** Only the names the computed's own initializer reads are * sources. A computed that reads another computed contributes that other * computed's name, not the state underneath it, so a two-hop chain fails * the comparison and stays with the runtime budget. * - **Unconditional.** A read inside a ternary branch, on the right of `and`, * `or` or `??`, or inside a function body is a read this evaluation may not * make, so it is not a proved cycle. The condition of a ternary and the left * operand of a short-circuit are always evaluated and are read. * * A name declared twice answers null, for `collectReactiveWriters`'s reason: a * refusal that has to be right every time cannot pick one of two bodies. */ export declare function collectReactiveDerivations(program: Program): ReadonlyMap | null>; /** Every `state name = ...` of one module: true where it is declared exactly once. */ export declare function collectReactiveStateNames(program: Program): ReadonlyMap; //# sourceMappingURL=reactive-names.d.ts.map