import { Component, type InfernoNode } from 'inferno';
import type { History, Location } from 'history';
import { type Match } from './Route';
export interface TLoaderProps
> {
params?: P;
request: Request;
onProgress?: (perc: number) => void;
}
/**
* Loader returns Response and throws error
*/
export type TLoader
, R extends Response> = ({ params, request, }: TLoaderProps
) => Promise;
export interface TLoaderData {
res?: Res;
err?: Err;
}
type TInitialData = Record;
export interface IRouterProps {
history: History;
children: InfernoNode;
initialData?: TInitialData;
}
export interface TContextRouter {
history: History;
route: {
location: Pick;
match: Match | null;
};
initialData?: TInitialData;
staticContext?: object;
}
export interface RouterContext {
router: TContextRouter;
}
/**
* The public API for putting history on context.
*/
export declare class Router extends Component {
unlisten: any;
private _loaderFetchControllers;
private _loaderIteration;
constructor(props: IRouterProps, context: {
router: TContextRouter;
});
getChildContext(): RouterContext;
computeMatch(pathname: any): Match;
componentWillMount(): void;
private _matchAndResolveLoaders;
componentWillUnmount(): void;
render(props: IRouterProps): InfernoNode;
}
export {};