1 | import { History } from 'aurelia-history';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export declare class BrowserHistory extends History {
|
7 | |
8 |
|
9 |
|
10 |
|
11 | constructor(linkHandler: LinkHandler);
|
12 | /**
|
13 | * Activates the history object.
|
14 | * @param options The set of options to activate history with.
|
15 | * @returns Whether or not activation occurred.
|
16 | */
|
17 | activate(options?: Object): boolean;
|
18 | /**
|
19 | * Deactivates the history object.
|
20 | */
|
21 | deactivate(): void;
|
22 | /**
|
23 | * Returns the fully-qualified root of the current history object.
|
24 | * @returns The absolute root of the application.
|
25 | */
|
26 | getAbsoluteRoot(): string;
|
27 | /**
|
28 | * Causes a history navigation to occur.
|
29 | *
|
30 | * @param fragment The history fragment to navigate to.
|
31 | * @param options The set of options that specify how the navigation should occur.
|
32 | * @return Promise if triggering navigation, otherwise true/false indicating if navigation occurred.
|
33 | */
|
34 | navigate(fragment?: string, { trigger, replace }?: {
|
35 | trigger?: boolean;
|
36 | replace?: boolean;
|
37 | }): boolean;
|
38 | /**
|
39 | * Causes the history state to navigate back.
|
40 | */
|
41 | navigateBack(): void;
|
42 | /**
|
43 | * Sets the document title.
|
44 | */
|
45 | setTitle(title: string): void;
|
46 | /**
|
47 | * Sets a key in the history page state.
|
48 | * @param key The key for the value.
|
49 | * @param value The value to set.
|
50 | */
|
51 | setState(key: string, value: any): void;
|
52 | /**
|
53 | * Gets a key in the history page state.
|
54 | * @param key The key for the value.
|
55 | * @return The value for the key.
|
56 | */
|
57 | getState(key: string): any;
|
58 | /**
|
59 | * Returns the current index in the navigation history.
|
60 | * @returns The current index.
|
61 | */
|
62 | getHistoryIndex(): number;
|
63 | /**
|
64 | * Move to a specific position in the navigation history.
|
65 | * @param movement The amount of steps, positive or negative, to move.
|
66 | */
|
67 | go(movement: number): void;
|
68 | }
|
69 | /**
|
70 | * Provides information about how to handle an anchor event.
|
71 | */
|
72 | export interface AnchorEventInfo {
|
73 | |
74 |
|
75 |
|
76 | shouldHandleEvent: boolean;
|
77 | |
78 |
|
79 |
|
80 | href: string;
|
81 | |
82 |
|
83 |
|
84 | anchor: Element;
|
85 | }
|
86 |
|
87 |
|
88 |
|
89 | export declare class LinkHandler {
|
90 | |
91 |
|
92 |
|
93 |
|
94 |
|
95 | activate(history: BrowserHistory): void;
|
96 | |
97 |
|
98 |
|
99 | deactivate(): void;
|
100 | }
|
101 |
|
102 |
|
103 |
|
104 |
|
105 | export declare class DefaultLinkHandler extends LinkHandler {
|
106 | |
107 |
|
108 |
|
109 | constructor();
|
110 | /**
|
111 | * Activate the instance.
|
112 | *
|
113 | * @param history The BrowserHistory instance that navigations should be dispatched to.
|
114 | */
|
115 | activate(history: BrowserHistory): void;
|
116 | /**
|
117 | * Deactivate the instance. Event handlers and other resources should be cleaned up here.
|
118 | */
|
119 | deactivate(): void;
|
120 | /**
|
121 | * Gets the href and a "should handle" recommendation, given an Event.
|
122 | *
|
123 | * @param event The Event to inspect for target anchor and href.
|
124 | */
|
125 | static getEventInfo(event: Event): AnchorEventInfo;
|
126 | /**
|
127 | * Finds the closest ancestor that's an anchor element.
|
128 | *
|
129 | * @param el The element to search upward from.
|
130 | * @returns The link element that is the closest ancestor.
|
131 | */
|
132 | static findClosestAnchor(el: Element): Element;
|
133 | /**
|
134 | * Gets a value indicating whether or not an anchor targets the current window.
|
135 | *
|
136 | * @param target The anchor element whose target should be inspected.
|
137 | * @returns True if the target of the link element is this window; false otherwise.
|
138 | */
|
139 | static targetIsThisWindow(target: Element): boolean;
|
140 | }
|
141 | /**
|
142 | * Configures the plugin by registering BrowserHistory as the implementation of History in the DI container.
|
143 | * @param config The FrameworkConfiguration object provided by Aurelia.
|
144 | */
|
145 | export declare function configure(config: Object): void; |
\ | No newline at end of file |