TypeScript definitions. How to use them?

private resetCreateNewCommercePopup()
{
	const view = (<any>this.$refs.createNewCommercePopup).f7View as ViewComponent;

	view.router.navigate("/commerces/create-new-commerce", { clearPreviousHistory: true, animate: false });
}

That “as ViewComponent”, what exactly I’m suposed to import or make it work?
The way it is obviously is giving me a “Cannot find name ‘ViewComponent’” error =\

After updating for the last version (I’m adding npm directly from github) and adding this on my tsconfig.js, all I needed was to …f7view as View.View; and import { View } from “framework7/components/view/view”; (Visual Studio - The Good One, not that Code thing - imported that automagically)

It worked for the intended effect (intellisense).

"paths":
	{
		"@/*":
		[
			"src/*"
		],

		"*":
		[
			"node_modules/framework7-vue/*"
		]
	},
1 Like