ng-zorro-antd
ng-zorro-antd copied to clipboard
NzDrawerComponent Type Definition error
Reproduction link
https://stackblitz.com/edit/ng-zorro-antd-ivy-kotjtq
Steps to reproduce
I am upgrading to version 14. However, the Drawer Component gives an error during the build.
What is expected?
Property 'nzContentParams' in type 'NzDrawerComponent<T, R, D>' is not assignable to the same property in base type 'NzDrawerOptionsOfComponent<any, any>'.
What is actually happening?
Error: node_modules/ng-zorro-antd/drawer/drawer.component.d.ts:73:5 - error TS2416: Property 'nzContentParams' in type 'NzDrawerComponent<T, R, D>' is not assignable to the same property in base type 'NzDrawerOptionsOfComponent<any, any>'.
Type 'D | undefined' is not assignable to type 'Partial<any> | undefined'.
Type 'D' is not assignable to type 'Partial<any> | undefined'.
Type 'D' is not assignable to type 'Partial<any>'.
73 nzContentParams?: D;
~~~~~~~~~~~~~~~
node_modules/ng-zorro-antd/drawer/drawer.component.d.ts:17:70
17 export declare class NzDrawerComponent<T = NzSafeAny, R = NzSafeAny, D = NzSafeAny> extends NzDrawerRef<T, R> implements OnInit, OnDestroy, AfterViewInit, OnChanges, NzDrawerOptionsOfComponent {
~~~~~~~~~~~~~
This type parameter might need an `extends Partial<any>` constraint.
node_modules/ng-zorro-antd/drawer/drawer.component.d.ts:17:70
17 export declare class NzDrawerComponent<T = NzSafeAny, R = NzSafeAny, D = NzSafeAny> extends NzDrawerRef<T, R> implements OnInit, OnDestroy, AfterViewInit, OnChanges, NzDrawerOptionsOfComponent {
~~~~~~~~~~~~~
This type parameter might need an `extends Partial<any> | undefined` constraint.
Environment | Info |
---|---|
ng-zorro-antd | 14.0.0 |
Browser | Chrome |
Downgrading TypeScript version from 4.8.2 to 4.7.2 fixed the issue
Yes. I confirm that NzDrawerComponent has this error with TypeScript version 4.8.2.
I also run into this problem.
We do also have this problem with typescript 4.8.2
Same problem here with Typescript 4.8.4
Hey :) this pull request here will fix this problem :)