/// import { ComponentClass, StatelessComponent } from 'react'; import { Dispatch, ReducibleNode } from 'reducible-node'; import { PageInstance } from './pageInstance'; import { Navigator } from './navigator'; export declare type ValidTreeNode = { [path: string]: PageFolder | Page; }; export declare type PageTreeNode = T; export interface PageFolder { path: string; title: string; contents: PageTreeNode; } export declare function folder(title: string, contents: PageTreeNode): PageFolder; export interface ReplaceOptions { mutex?: string; params?: TParams; title?: string; parent?: string; openedFrom?: string; } export interface OpenOptions extends ReplaceOptions { insertAfterMutex?: string; } export interface Page { readonly type: { params: TParams; state: TState; }; title?: string; path: string; hidden: boolean; persistent: boolean; component: ComponentClass | StatelessComponent; node: ReducibleNode; open: (dispatch: Dispatch, navigator: Navigator, opt?: OpenOptions) => void; replace: (dispatch: Dispatch, navigator: Navigator, target: string, opt?: ReplaceOptions) => void; } export interface BuildPageOptions { title?: string; hidden?: boolean; persistent?: boolean; } export declare function buildPage(component: ComponentClass | StatelessComponent, node: ReducibleNode, options?: BuildPageOptions): Page; export interface PageOccurrence { path: string; mutex: string; params?: TParams; title?: string; parent?: string; openedFrom?: string; } export declare type PathTreeNode = string | PathTree; export interface PathTree extends Array { } export declare class Pages { private pages; private folders; private calculatedPathTree; private calculatedFolderContents; private calculatedFilteredPathTree; private calculatedFilteredFolderContents; readonly prefix: string; readonly tree: PageTreeNode; constructor(prefix: string, root: PageTreeNode); hasPage(path: string): boolean; getPage(path: string): Page; hasFolder(path: string): boolean; getFolder(path: string): PageFolder; isHidden(path: string): boolean; readonly pathTree: PathTree; readonly folderContents: { [folder: string]: string[]; }; readonly filteredPathTree: PathTree; readonly filteredFolderContents: { [folder: string]: string[]; }; buildInstance(occurrence: PageOccurrence): PageInstance; }