-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Augment Key during Type Mapping #12754
Copy link
Copy link
Closed
Labels
Domain: Literal TypesUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedDomain: Mapped TypesThe issue relates to mapped typesThe issue relates to mapped typesIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Metadata
Metadata
Assignees
Labels
Domain: Literal TypesUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedDomain: Mapped TypesThe issue relates to mapped typesThe issue relates to mapped typesIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Aurelia follows the convention that for any field
foo, whenfoois changed by the framework, then an attempt to callfooChanged()is made. There is (seemingly) no way to describe this convention as a type (automatically) via the Mapped Type functionality alone.I would like to open discussion to the prospect of augmenting property keys during mapping.
For example: via arthimetic:
in this use-case specifically it probably would require #12424 too, but that is beside the point here.