import { IRouterContext } from '../../types/contexts'; import { Link } from '../../types/objects'; import { IRouter6, Location } from './interfaces/IRouter6'; export type { IRouter6 }; type History4Action = 'PUSH' | 'POP' | 'REPLACE'; /** * Adds exactly 1 beforeunload event. It is no-op is such event is already added. * It's needed to make react-router 6 compatible with "history.block". */ export declare function getBeforeUnloadSingletone(): { ensureBlock: () => void; unblock: () => void; }; export declare function getRouter6BlockFn(router: IRouter6): (blockerFunction: (location: Location, action: History4Action) => void) => () => void; /** * * NOTE: Next methods/properties of the router are marked as PRIVATE - DO NOT USE in the https://github.com/remix-run/react-router/blob/main/packages/router/router.ts#L57 * - state * - getBlocker * - subscribe * - deleteBlocker * - createHref * So we should be extra careful if decide to use another version of the react-router. * Though, it's OK to use such API, because there are no alternatives yet (see https://github.com/remix-run/react-router/issues/9422) * * IMPORTANT: As of now, it was tested only using react-router 6.14.0 */ export declare class Router6AdaptedRouter implements IRouterContext { private router6; constructor(router6: IRouter6); getCurrentLink(): Link; redirect(link: Link | string): void; transfer(link: Link): void; isActive(link: Link): boolean; createHref(link: Link): string; listen(listener: (link: Link) => void): () => void; block: (listener: (link: Link) => void) => () => void; } //# sourceMappingURL=Router6AdaptedRouter.d.ts.map