From f53175361c31f34801092e8a504f0903a9629bc8 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sun, 15 Nov 2026 04:33:29 +0000 Subject: [PATCH] refactor(core): quote InputMap constraint keys on directive declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `getInputsTypeExpression` in `@angular/compiler` emits `'alias'`, `'required'`, and `'isSignal'` as quoted string-literal property signatures in the `InputMap` type argument of `ɵɵDirectiveDeclaration` and `ɵɵComponentDeclaration` on `ɵdir` and `ɵcmp`. However, `ɵɵDirectiveDeclaration` and `ɵɵComponentDeclaration` in `@angular/core` declared those constraint keys as unquoted identifier property signatures (`{alias: string | null; required: boolean; isSignal?: boolean}`). In standard TypeScript, quoted and unquoted property signatures are structurally identical. When a property-renaming safety pass rewrites unquoted identifier property signatures in `.d.ts` type literals while preserving quoted string-literal keys, the renamed constraint keys on `InputMap` no longer match the quoted `'alias'`, `'required'`, and `'isSignal'` keys emitted on preprocessed `ɵdir` and `ɵcmp` source declarations, failing `TS2344`. Quote `'alias'`, `'required'`, and `'isSignal'` in the `InputMap` constraint on `ɵɵDirectiveDeclaration` and `ɵɵComponentDeclaration` so the declaration constraints match the quoted keys emitted by `@angular/compiler`. (cherry picked from commit 9399d67252b67fffc256de631a0d80eae2049b73) --- packages/core/src/render3/interfaces/public_definitions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/render3/interfaces/public_definitions.ts b/packages/core/src/render3/interfaces/public_definitions.ts index b31bcedf892..9902a4dc687 100644 --- a/packages/core/src/render3/interfaces/public_definitions.ts +++ b/packages/core/src/render3/interfaces/public_definitions.ts @@ -21,7 +21,7 @@ export type ɵɵDirectiveDeclaration< ExportAs extends string[], // `string` keys are for backwards compatibility with pre-16 versions. InputMap extends { - [key: string]: string | {alias: string | null; required: boolean; isSignal?: boolean}; + [key: string]: string | {'alias': string | null; 'required': boolean; 'isSignal'?: boolean}; }, OutputMap extends {[key: string]: string}, QueryFields extends string[], @@ -43,7 +43,7 @@ export type ɵɵComponentDeclaration< ExportAs extends string[], // `string` keys are for backwards compatibility with pre-16 versions. InputMap extends { - [key: string]: string | {alias: string | null; required: boolean; isSignal?: boolean}; + [key: string]: string | {'alias': string | null; 'required': boolean; 'isSignal'?: boolean}; }, OutputMap extends {[key: string]: string}, QueryFields extends string[],