kevcjones / ngx-simple-modal

A simple unopinionated framework to implement simple modal based behaviour in angular (v2+) projects.
MIT License
52 stars 28 forks source link

TypeScript error for SimpleModalComponent.onClosing #27

Closed cubitworx closed 6 years ago

cubitworx commented 6 years ago

https://github.com/KevCJones/ngx-simple-modal/blob/1e29f0e18d8acb6a5c843250891ff61fa44da71f/src/simple-modal/simple-modal.component.ts#L80

When using this module in a typescript project (v2.6.2) the above method signature produces the following error:

ERROR in [at-loader] ./node_modules/ngx-simple-modal/dist/simple-modal/simple-modal.component.d.ts:13:26
TS7006: Parameter 'component' implicitly has an 'any' type.

I assume it should be typehinted as follows:

onClosing(callback: (component: SimpleModalComponent<any, any>) => Promise<any>): void {

This could be overcome by using skiplibcheck: true but not a good setting to impose on a user.

kevcjones-archived commented 6 years ago

New TS version, new problems. Simple enough fix at least, thanks for finding.

kevcjones-archived commented 6 years ago

Is now part of ngx-simple-modal@latest.