summaryrefslogtreecommitdiffhomepage
path: root/flow-libs/history.js.flow
blob: 69c25e20113a53ddfbcd942c775dd6c3435986f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// @flow

declare module 'history' {

  declare class History {
    length: number;
    action: string;
    location: string;
    index: number;
    entries: Array<string>;
    createHref(location: string): string;
    push(path: string): void;
    replace(path: string): void;
    go(index: number): void;
    goBack(): void;
    goForward(): void;
    canGo(index: number): boolean;
    block(prompt?: boolean): void;
    listen(listener: (location: string, action: string) => void): void;
  }

  declare function createMemoryHistory(): History;

}