@moxb/stellar-router-react
Version:
Stellar router: React widgets
37 lines (36 loc) • 1.35 kB
TypeScript
/// <reference types="react" />
import { UpdateMethod, NavRef, UrlArg, MyLocation } from '@moxb/stellar-router-core';
interface RedirectProps {
position?: number;
/**
* Where should we go? (List of path tokens.)
*
* Either this or location should be given.
*/
to?: string[];
/**
* Which update method should we use to execute the redirect?
*
* If you want to be able to "back" your way through
* this redirect, then you will need to use replace...
*/
updateMethod?: UpdateMethod;
/**
* If you want the original path to be saved, provide an UrlArg for that.
* (Note that the arg should be permanent, in order to survive the path change.)
*/
pathSaveArg?: UrlArg<MyLocation | null>;
/**
* Are we trying to restore a saved location? Then provide that location
*
* When supplied, this will override all other values.
*/
location?: MyLocation;
}
export declare const Redirect: ((props: RedirectProps) => JSX.Element) & {
displayName: string;
};
export declare const redirect: (props: RedirectProps) => JSX.Element;
export declare const redirectTo: (to: string[]) => JSX.Element;
export declare function redirectToNavRef<InputType>(navRef: NavRef<InputType>, tokens?: InputType, updateMethod?: UpdateMethod): JSX.Element;
export {};