function resolveRouterConfig(router, appConfig, order) {
	// @ts-ignore backwards compat with router.mode for a few versions (TODO)
	router.type = router.type ?? router.mode;
	const routerMode =
		typeof router.type === "string" ? routerModes[router.type] : router.type;

	invariant(routerMode, `Invalid router type: ${router.type}`);

	const config = routerMode.resolveConfig(router, appConfig, order);
	config.internals.type = routerMode;
	return config;
}
@param {RouterSchemaInput} router
@param {import("./app.js").AppOptions} appConfig
@param {number} order
@returns {RouterSchema}