export { miss, MatchMiss } from './route-resolver/matchers/errors'
+/**
+ * Internal functions and types for the experimental router.
+ * They should all be prefixed with `_` to avoid conflicts with the public API.
+ */
+
+export { mergeRouteRecord as _mergeRouteRecord } from './router'
+
// in the new experimental router, there are only parents
// this should create type errors if someone is realying on children
declare module 'vue-router' {
| EXPERIMENTAL_RouteRecordNormalized_Group
}
+/**
+ * Merges route record objects for the experimental resolver format.
+ * This function is specifically designed to work with objects that will be passed to normalizeRouteRecord().
+ *
+ * @internal
+ *
+ * @param main - main route record object
+ * @param routeRecords - route records to merge (from definePage imports)
+ * @returns merged route record object
+ */
+export function mergeRouteRecord(
+ main: EXPERIMENTAL_RouteRecordNormalized,
+ // TODO: actual type
+ ...routeRecords: Partial<EXPERIMENTAL_RouteRecordNormalized>[]
+) {
+ for (const record of routeRecords) {
+ main.meta = { ...main.meta, ...record.meta }
+ }
+ return main
+}
+
// TODO: probably need some generic types
// <TResolver extends NEW_RouterResolver_Base>,
/**