enchanted-next-router
Version:
✨ Polished API for Next.js Router
18 lines (17 loc) • 780 B
TypeScript
/// <reference types="node" />
import type { ParsedUrlQuery } from 'querystring';
import type { Url, TransitionOptions, EnchantedRouter, EnchantedSingletonRouter } from './types';
/**
* Performs a `pushState` with arguments
* @param url of the route
* @param options object you can define `shallow` and other options
*/
export declare function push(url: Url, opts?: TransitionOptions): Promise<boolean>;
/**
* Performs a `replaceState` with arguments
* @param url of the route
* @param options object you can define `shallow` and other options
*/
export declare function replace(url: Url, opts?: TransitionOptions): Promise<boolean>;
export declare function useRouter<P extends ParsedUrlQuery>(): EnchantedRouter<P>;
export declare const Router: EnchantedSingletonRouter;