fix(vue): strongly typed controller methods (#24388)

Resolves #24387
This commit is contained in:
Sean Perkins
2021-12-14 11:10:46 -05:00
committed by GitHub
parent 412e5f168e
commit a5d56b3d5a

View File

@ -24,7 +24,9 @@ import { IonToast } from '@ionic/core/components/ion-toast.js'
* register the underlying Web Component and
* (optionally) provide a framework delegate.
*/
const createController = (tagName: string, customElement: any, oldController: any, useDelegate = false) => {
const createController: {
<T>(tagName: string, customElement: any, oldController: T, useDelegate?: boolean): T
} = (tagName: string, customElement: any, oldController: any, useDelegate = false) => {
const delegate = useDelegate ? VueDelegate() : undefined;
const oldCreate = oldController.create.bind(oldController);
oldController.create = (options: any) => {