/** * A9, A10 and A15: a record literal that mirrors another record field by * field, applies one transform to every field, or repeats a name it could have * written once. * * D115 §三 / D114 R1f: one family of `advisories.ts`. */ import { type Expression } from "../../ast.ts"; import { type ValueType } from "../../types.ts"; import { type AdvisoryHost } from "./roster.ts"; export declare class RecordAdvisories { private readonly host; constructor(host: AdvisoryHost); /** * A9: a closed target literal that merely mirrors the same record field by * field has the exact projection spelling `Target.from(source, overrides)`. * * This is intentionally narrower than a visual resemblance check. An * override call could mutate the source before a later manual field read, * so the advisory requires every target field, two or more same-name data * reads from one identifier, and only identifiers or literals for the * remaining fields. Optional omissions, computed values, calls, spreads, * and mixed sources all remain ordinary object literals. Authored key order * may differ: the report calls out that `.from` deliberately canonicalizes * the result to target declaration order, so an intentional wire order has * one honest reason to suppress it. */ adviseManualRecordProjection(expression: Extract, target: ValueType | null, writtenTarget: ValueType): void; /** * A10: a large closed record literal that applies one transform to every * same-name field is the long form of `Target.mapFrom(source, transform)`. * * Four fields is the deliberately conservative threshold: below it the * literal is often clearer, while a larger block is maintenance-heavy and * likely to drift. Because the transform may have effects, this proof also * requires authored property order to equal target declaration order. */ adviseManualMappedRecordProjection(expression: Extract, target: ValueType | null, writtenTarget: ValueType): void; /** Returns a name that is legal in the Type-object position of the fix. */ private recordProjectionTypeName; /** * A15: `{name: name}` and `{name}` are the same record entry when both * occurrences are ordinary identifiers. Quoted and keyword-named keys are * deliberately excluded: the AST keeps their decoded value, so comparing * names alone would erase syntax the author actually wrote. Parenthesized, * member, call, and every different-name value remain ordinary mappings. * * The edit owns only the entry, never its comma or surrounding layout. A * comment between the key and value withholds the edit rather than dropping * prose; a trailing comment sits outside the entry span and is preserved. */ adviseRedundantObjectProperty(property: Extract["properties"][number] & { kind: "ObjectProperty"; }): void; } //# sourceMappingURL=records.d.ts.map