/
RouterEvents.ts
39 lines (36 loc) · 1.49 KB
/
RouterEvents.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Events constants, which is firing to app.
*/
export enum RouterEvents {
/**
* Router fire event `$IMA.$Router.beforeHandleRoute` before page
* manager handle the route. Event's data contain
* `{ params: Object<string, string>`, route: ima.core.router.AbstractRoute,
* path: string, options: Object<string, *>}}. The `path` is current
* path, the `params` are params extracted from path, the
* `route` is handle route for path and the `options` is route
* additional options.
*/
BEFORE_HANDLE_ROUTE = '$IMA.$Router.beforeHandleRoute',
/**
* Router fire event `$IMA.$Router.afterHandleRoute` after page
* manager handle the route. Event's data contain
* `{response: Object<string, *>, params: Object<string, string>`,
* route: ima.core.router.AbstractRoute, path: string, options: Object<string, *>}}.
* The `response` is page render result. The `path` is current
* path, the `params` are params extracted from path, the
* `route` is handle route for path and the `options` is route
* additional options.
*/
AFTER_HANDLE_ROUTE = '$IMA.$Router.afterHandleRoute',
/**
* Fired right before loading view and controller when either
* view or controller is async (or both).
*/
BEFORE_LOADING_ASYNC_ROUTE = '$IMA.$Router.beforeLoadingAsyncRoute',
/**
* Event fired when router finishes loading of async view
* and controller. If both are sync this is never fired.
*/
AFTER_LOADING_ASYNC_ROUTE = '$IMA.$Router.afterLoadingAsyncRoute',
}