Skip to content

Types ​

TypeDescription
NavigationGuard(to, from) => boolean | Promise<boolean>
NavigationAfterHook(to, from) => void
RouteMapRecord<string, Record<string, unknown> | undefined>
TypedPush<T>Type-safe push overloads for a RouteMap
TypedReplace<T>Type-safe replace overloads for a RouteMap (segment names only)
NavigationKind'push' | 'back' | 'replace' — kind of the last navigation
SerializedStateJSON-serializable router state snapshot
TrackerEventOne page/dialog/control change delivered to tracker.onEvent
CloseReason'close_button' | 'backdrop' | 'escape' | 'gesture' | 'programmatic' | 'replace'
MicroMetaRecord<string, unknown> — free-form meta on a route, dialog or control
MicroRouterRegistrygetRegistry() result: registered routes, dialogs and controls with their meta
AudioAdapterAbstract audio playback interface
GestureConfigGesture navigation configuration

Other exported types ​

The package also exports the shape types used across the API — import them directly from vue-micro-router:

ts
import type {
  MicroRoute,
  MicroDialog,
  MicroControl,
  MicroRouterConfig,
  MicroRouterStore,
  DialogProps,
  DialogPosition,
  DialogInstance,
  FeaturePlugin,
  FeaturePluginConfig,
  TransitionType,
  PageTrackerHooks,
  Register,
} from 'vue-micro-router';

See Type-Safe Routes for how Register and per-route Attrs interfaces drive full type inference.