UNPKG

1.75 kBTypeScriptView Raw
1import { Reducible, Action, Dispatch } from 'reducible-node';
2import { PageInstance } from './pageInstance';
3import { Pages, PageOccurrence } from './pages';
4export interface PageReplaceOptions extends PageOccurrence<any> {
5 toRemoveMutex: string;
6}
7export interface PageOpenOptions extends PageOccurrence<any> {
8 insertAfterMutex?: string;
9}
10export interface PageCloseOptions {
11 mutex: string;
12 goto?: string;
13}
14export declare class Navigator implements Reducible<Navigator> {
15 private pages;
16 private instances;
17 private activePageMutex;
18 private activeChildren;
19 constructor(pages: Pages);
20 readonly all: PageInstance<any, any>[];
21 readonly roots: PageInstance<any, any>[];
22 readonly active: PageInstance<any, any> | undefined;
23 readonly activeMutex: string | undefined;
24 readonly activeRootMutex: string | undefined;
25 readonly activeRoot: PageInstance<any, any> | undefined;
26 readonly activeRootIndex: number;
27 readonly indexAsChildOfActiveRoot: number;
28 hasChildren(mutex: string): boolean;
29 childrenOf(mutex: string): PageInstance<any, any>[];
30 pageFromMutex(mutex: string | undefined): PageInstance<any, any> | undefined;
31 getActiveChild(mutex: string | undefined): string | undefined;
32 private persistInstances(instances);
33 private persistActivePage(instances, mutex);
34 reduce(action: Action<any>): this;
35 transit(dispatch: Dispatch, mutex: string | undefined): void;
36 open(dispatch: Dispatch, occurrence: PageOpenOptions): void;
37 replace(dispatch: Dispatch, toRemoveMutex: string, occurrence: PageOccurrence<any>): void;
38 close(dispatch: Dispatch, mutex: string, goto?: string): void;
39 load(dispatch: Dispatch): void;
40 clear(dispatch: Dispatch): void;
41}