export interface AnyRouteObject { path?: string | undefined; element?: React.ReactNode; } export type AnyUseRoute = (routes: AnyRouteObject[], location?: Location) => React.ReactElement | null; export interface AnyRouteMatch { route: AnyRouteObject; params: Record; } export type AnyLocation = { pathname?: string; } | string; export type AnyRouterSubscriberOpts = Record; export type AnyRouterSubscriber = (routerState: { location: { pathname: string; }; matches: AnyRouteMatch[]; }, opts?: AnyRouterSubscriberOpts) => void; export interface AnyRouter { state: { location: { pathname: string; }; matches: AnyRouteMatch[]; }; subscribe: (callback: AnyRouterSubscriber) => () => void; } export type AnyCreateRouter = (routes: AnyRouteObject[], options?: Options) => AnyRouter;