/// <reference types="react" />
import './nav.css';
import { ViewController } from '../lib/ctr';
import { EventNoticer, Event } from 'somes/event';
export interface Route {
    path: string | string[];
    page: () => Promise<any>;
}
export declare type Args = string | {
    url: string;
    params?: Dict;
};
interface ParseParams {
    nav: Nav;
    url: string;
    pathname: string;
    params: Dict;
    notFound?: typeof NavPage;
    route?: Route;
}
interface PrivPageProps extends ParseParams {
    index: number;
    panel: HTMLDivElement;
}
declare class PrivPage extends ViewController<PrivPageProps> {
    m_prev: any;
    m_next: any;
    m_status: number;
    m_panel: HTMLDivElement;
    m_timeout?: any;
    m_index: number;
    m_props: PrivPageProps;
    _count: number;
    state: {
        component: typeof NavPage | null;
    };
    constructor(props: PrivPageProps);
    loader(): Promise<void>;
    get status(): number;
    get url(): string;
    get nav(): Nav;
    get pathname(): string;
    get params(): Dict<any>;
    get index(): number;
    triggerMounted(): void;
    onShow(data?: {}): void;
    onHide(): void;
    unmount(): void;
    replace(props: ParseParams): void;
    render(): JSX.Element;
    getStyle(styleStr: string): string;
    intoBackground(time: number): void;
    intoForeground(time: number, data?: Dict): void;
    intoLeave(time: number): void;
}
export interface NavArgs {
    action: 'push' | 'pop' | 'replace';
    pathname: string;
    params: Dict;
    count: number;
}
export interface NavProps {
    routes: Route[];
    initURL?: string;
    notFound?: typeof NavPage;
    onNav?: (args: NavArgs) => void;
    onEnd?: () => void;
}
export declare class Nav extends ViewController<NavProps> {
    private m_pages;
    private m_current;
    private m_routes;
    private m_animating;
    readonly onNav: EventNoticer<Event<NavArgs, Nav>>;
    readonly onEnd: EventNoticer<Event<void, Nav>>;
    static platform: string;
    private get _mcls();
    triggerNav(data: NavArgs): void;
    triggerEnd(): void;
    triggerMounted(): void;
    get length(): number;
    getPage(index: number): NavPage<{}, {}>;
    get routes(): Dict<Route>;
    private m_parseProps;
    private m_push;
    push(url: Args, animate?: boolean): boolean;
    pops(result: any, index: number, animate?: boolean): boolean;
    pop(animate?: boolean, result?: Dict): boolean;
    replace(url: Args, animate?: boolean, index?: number): boolean;
    get current(): NavPage<{}, {}>;
    render(): JSX.Element;
}
interface BaseProps<P> {
    priv: PrivPage;
    url: string;
    pathname: string;
    params: P;
}
export declare class NavPage<P = {}, S = {}> extends ViewController<BaseProps<P>, S> {
    get nav(): Nav;
    get url(): string;
    get pathname(): string;
    get index(): number;
    get params(): P;
    triggerLoad(): Promise<void>;
    triggerRemove(): void;
    triggerShow(data?: {
        active?: 'init';
        [key: string]: any;
    }): void;
    triggerHide(): void;
    pushPage(url: Args, animate?: boolean): boolean;
    popPage(animate?: boolean, result?: Dict): boolean;
    replacePage(url: Args, animate?: boolean, index?: number): boolean;
}
export {};
