|
8 | 8 |
|
9 | 9 | import {ChangeDetectionStrategy} from '../change_detection/constants'; |
10 | 10 | import {formatRuntimeError, RuntimeErrorCode} from '../errors'; |
11 | | -import {Mutable, Type} from '../interface/type'; |
| 11 | +import {Type, Writable} from '../interface/type'; |
12 | 12 | import {NgModuleDef} from '../metadata/ng_module_def'; |
13 | 13 | import {SchemaMetadata} from '../metadata/schema'; |
14 | 14 | import {ViewEncapsulation} from '../metadata/view'; |
@@ -338,14 +338,14 @@ interface ComponentDefinition<T> extends Omit<DirectiveDefinition<T>, 'features' |
338 | 338 | */ |
339 | 339 | export function ɵɵdefineComponent<T>( |
340 | 340 | componentDefinition: ComponentDefinition<T>, |
341 | | -): Mutable<ComponentDef<any>, keyof ComponentDef<any>> { |
| 341 | +): ComponentDef<any> { |
342 | 342 | return noSideEffects(() => { |
343 | 343 | // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent. |
344 | 344 | // See the `initNgDevMode` docstring for more information. |
345 | 345 | (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode(); |
346 | 346 |
|
347 | 347 | const baseDef = getNgDirectiveDef(componentDefinition as DirectiveDefinition<T>); |
348 | | - const def: Mutable<ComponentDef<T>, keyof ComponentDef<T>> = { |
| 348 | + const def: Writable<ComponentDef<T>> = { |
349 | 349 | ...baseDef, |
350 | 350 | decls: componentDefinition.decls, |
351 | 351 | vars: componentDefinition.vars, |
@@ -557,7 +557,7 @@ function parseAndConvertBindingsForDefinition<T>( |
557 | 557 | */ |
558 | 558 | export function ɵɵdefineDirective<T>( |
559 | 559 | directiveDefinition: DirectiveDefinition<T>, |
560 | | -): Mutable<DirectiveDef<any>, keyof DirectiveDef<any>> { |
| 560 | +): DirectiveDef<any> { |
561 | 561 | return noSideEffects(() => { |
562 | 562 | const def = getNgDirectiveDef(directiveDefinition); |
563 | 563 | initFeatures(def); |
@@ -648,9 +648,7 @@ export function getNgModuleDef<T>(type: any, throwNotFound?: boolean): NgModuleD |
648 | 648 | return ngModuleDef; |
649 | 649 | } |
650 | 650 |
|
651 | | -function getNgDirectiveDef<T>( |
652 | | - directiveDefinition: DirectiveDefinition<T>, |
653 | | -): Mutable<DirectiveDef<T>, keyof DirectiveDef<T>> { |
| 651 | +function getNgDirectiveDef<T>(directiveDefinition: DirectiveDefinition<T>): DirectiveDef<T> { |
654 | 652 | const declaredInputs: Record<string, string> = {}; |
655 | 653 |
|
656 | 654 | return { |
@@ -679,11 +677,7 @@ function getNgDirectiveDef<T>( |
679 | 677 | }; |
680 | 678 | } |
681 | 679 |
|
682 | | -function initFeatures<T>( |
683 | | - definition: |
684 | | - | Mutable<DirectiveDef<T>, keyof DirectiveDef<T>> |
685 | | - | Mutable<ComponentDef<T>, keyof ComponentDef<T>>, |
686 | | -): void { |
| 680 | +function initFeatures<T>(definition: DirectiveDef<T> | ComponentDef<T>): void { |
687 | 681 | definition.features?.forEach((fn) => fn(definition)); |
688 | 682 | } |
689 | 683 |
|
|
0 commit comments