Explicitly specify a type for created components in ionic 4

I have a vague recollection from some time ago that the answer to my question is “no”, but…

Is there any way in ionic 4 to explicitly specify the type of a component returned from a create method? For example, on an ion-loading or ion-modal

when you do:

const loading = await this.loadingController.create({message: ‘Hellooo’,duration: 2000});


const modal = await this.modalController.create({component: ModalPage});

Is there anyway at all to import the type (like you used to be able to do in ionic 3) and define it, so your code would look like this…

const loading:Loading = await this.loadingController.create({message: ‘Hellooo’,duration: 2000});


const modal:Modal = await this.modalController.create({component: ModalPage});

I can see that the types “are” defined and exported here:


I just can’t find what import statement gets access to them??? Like I say, I have this distant memory that you’re not actually supposed to do this anymore for “some reason”.

Can anyone shed any light?


Somebody must know… surely?

The answer does appear to be “no” unless an interface has been explicitly written/exposed