@breautek/router 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.legacy.md +206 -0
- package/CHANGELOG.md +11 -191
- package/dist/router.js +985 -1808
- package/dist/src/DefaultStrategy.d.ts +5 -5
- package/dist/src/HashStrategy.d.ts +28 -28
- package/dist/src/IOnNoRoute.d.ts +4 -4
- package/dist/src/IRouterStrategyClass.d.ts +8 -8
- package/dist/src/IViewStylesheet.d.ts +4 -4
- package/dist/src/Route.d.ts +33 -33
- package/dist/src/RouteMatcher.d.ts +30 -31
- package/dist/src/Router.d.ts +89 -85
- package/dist/src/RouterStrategy.d.ts +138 -117
- package/dist/src/TransitionSlide.d.ts +17 -17
- package/dist/src/TransitionStrategy.d.ts +21 -21
- package/dist/src/URLParser.d.ts +39 -39
- package/dist/src/URLStrategy.d.ts +32 -32
- package/dist/src/View.d.ts +48 -49
- package/dist/src/api.d.ts +13 -14
- package/package.json +30 -46
- package/src/HashStrategy.ts +1 -1
- package/src/RouteMatcher.ts +0 -2
- package/src/Router.tsx +5 -2
- package/src/RouterStrategy.ts +53 -0
- package/src/URLStrategy.ts +1 -0
- package/src/View.tsx +3 -3
- package/src/api.ts +0 -2
|
@@ -1,117 +1,138 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { Router } from './Router';
|
|
4
|
-
|
|
5
|
-
export declare
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* @param
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
abstract
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
*/
|
|
69
|
-
abstract
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
*
|
|
98
|
-
* @
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
*
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { Router } from './Router';
|
|
4
|
+
import { View } from './View';
|
|
5
|
+
export declare const EVENT_URL_CHANGE: string;
|
|
6
|
+
export type URLChangeCallback = (url: string) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Invoked when the view's componentDidMount/componentWillUnmount fires.
|
|
9
|
+
*/
|
|
10
|
+
export type ViewMountChangeCallback = (view: View) => void;
|
|
11
|
+
export declare abstract class RouterStrategy extends EventEmitter {
|
|
12
|
+
private $router;
|
|
13
|
+
private $viewMountListeners;
|
|
14
|
+
private $viewUnmountListneners;
|
|
15
|
+
constructor(router: Router);
|
|
16
|
+
addViewMountCallback(cb: ViewMountChangeCallback): void;
|
|
17
|
+
removeViewMountCallback(cb: ViewMountChangeCallback): void;
|
|
18
|
+
addViewUnmountCallback(cb: ViewMountChangeCallback): void;
|
|
19
|
+
removeViewUnmountCallback(cb: ViewMountChangeCallback): void;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
* @param view
|
|
23
|
+
*/
|
|
24
|
+
__onViewMount(view: View): void;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
* @param view
|
|
28
|
+
*/
|
|
29
|
+
__onViewUnmount(view: View): void;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the router
|
|
32
|
+
*/
|
|
33
|
+
getRouter(): Router;
|
|
34
|
+
/**
|
|
35
|
+
* Sets the browser title
|
|
36
|
+
*
|
|
37
|
+
* @param {string} title
|
|
38
|
+
*/
|
|
39
|
+
setTitle(title: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Listen for URL change events
|
|
42
|
+
*
|
|
43
|
+
* @param callback
|
|
44
|
+
*/
|
|
45
|
+
addURLChangeCallback(callback: URLChangeCallback): void;
|
|
46
|
+
/**
|
|
47
|
+
* Removes an existing listener
|
|
48
|
+
*
|
|
49
|
+
* @param callback
|
|
50
|
+
*/
|
|
51
|
+
removeURLChangeCallback(callback: URLChangeCallback): void;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the URL at the given index in the history stack
|
|
54
|
+
* @param position index
|
|
55
|
+
*/
|
|
56
|
+
abstract getLocationAt(position: number): string;
|
|
57
|
+
/**
|
|
58
|
+
* Gets the current location.
|
|
59
|
+
* This is the same as calling [peek(0)]{@link peek}
|
|
60
|
+
*/
|
|
61
|
+
abstract getLocation(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Gets the size of the history stack
|
|
64
|
+
*/
|
|
65
|
+
abstract getHistoryLength(): number;
|
|
66
|
+
/**
|
|
67
|
+
* Gets the scroll restoration
|
|
68
|
+
*/
|
|
69
|
+
abstract getScrollRestoration(): ScrollRestoration;
|
|
70
|
+
/**
|
|
71
|
+
* Navigates the history
|
|
72
|
+
* @param to Must be an integer.
|
|
73
|
+
* Negative numbers go back, if possible.
|
|
74
|
+
* Positive goes forward, if possible.
|
|
75
|
+
* Zero does nothing.
|
|
76
|
+
*/
|
|
77
|
+
abstract go(to: number): void;
|
|
78
|
+
/**
|
|
79
|
+
* navigate the history forward one entry. This is an alias for [go(1)]{@link go}
|
|
80
|
+
*/
|
|
81
|
+
forward(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Navigate the history back one entry. This is an alias for [go(-1)]{@link go}
|
|
84
|
+
*/
|
|
85
|
+
back(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Returns true, if can be navigated to the given relative index
|
|
88
|
+
* @param to Must be an integer
|
|
89
|
+
*/
|
|
90
|
+
abstract canGo(to: number): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Returns true if can go back 1 entry.
|
|
93
|
+
* This is the same as calling [canGo(-1)]{@link canGo}
|
|
94
|
+
*/
|
|
95
|
+
canBack(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Returns true if can go forward 1 entry.
|
|
98
|
+
* This is the same as calling [canGo(1)]{@link canGo}
|
|
99
|
+
*/
|
|
100
|
+
canForward(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the URL stored in the history stack at the given relative index.
|
|
103
|
+
* @param to Must be an integer
|
|
104
|
+
*/
|
|
105
|
+
abstract peek(to: number): string;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the URL one entry forward.
|
|
108
|
+
* This is the same as calling [peek(1)]{@link peek}
|
|
109
|
+
*/
|
|
110
|
+
peekForward(): string;
|
|
111
|
+
/**
|
|
112
|
+
* Returns the URL one entry back.
|
|
113
|
+
* This is the same as calling [peek(-1)]{@link peek}
|
|
114
|
+
*/
|
|
115
|
+
peekBack(): string;
|
|
116
|
+
/**
|
|
117
|
+
* Pushes a new entry into the history stack, navigating to the new location.
|
|
118
|
+
* @param url
|
|
119
|
+
* @param state
|
|
120
|
+
*/
|
|
121
|
+
abstract pushState(url: string, state?: Record<any, any>): void;
|
|
122
|
+
/**
|
|
123
|
+
* Replaces the current entry in the history stack with the new location.
|
|
124
|
+
* This will navigate the screen to the new location.
|
|
125
|
+
* @param url
|
|
126
|
+
* @param state
|
|
127
|
+
*/
|
|
128
|
+
abstract replaceState(url: string, state?: Record<any, any>): void;
|
|
129
|
+
/**
|
|
130
|
+
* Clears the history stack.
|
|
131
|
+
*/
|
|
132
|
+
abstract clear(): void;
|
|
133
|
+
/**
|
|
134
|
+
* Fires the {@link EVENT_URL_CHANGE} event
|
|
135
|
+
* @param url
|
|
136
|
+
*/
|
|
137
|
+
protected _fireURLChange(url: string): void;
|
|
138
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { TransitionStrategy } from './TransitionStrategy';
|
|
2
|
-
import { View } from './View';
|
|
3
|
-
export declare enum TransitionSlideDirection {
|
|
4
|
-
LEFT = 1,
|
|
5
|
-
RIGHT = 2,
|
|
6
|
-
UP = 3,
|
|
7
|
-
DOWN = 4
|
|
8
|
-
}
|
|
9
|
-
export declare class TransitionSlide extends TransitionStrategy {
|
|
10
|
-
private $slideDirection;
|
|
11
|
-
private $slideSpeed;
|
|
12
|
-
private $transitionTimeout;
|
|
13
|
-
constructor(slideDirection: TransitionSlideDirection, slideSpeed: number);
|
|
14
|
-
protected _execute(incoming: View, exiting: View): Promise<void>;
|
|
15
|
-
private $getTransitionString;
|
|
16
|
-
private $getSlideStyle;
|
|
17
|
-
}
|
|
1
|
+
import { TransitionStrategy } from './TransitionStrategy';
|
|
2
|
+
import { View } from './View';
|
|
3
|
+
export declare enum TransitionSlideDirection {
|
|
4
|
+
LEFT = 1,
|
|
5
|
+
RIGHT = 2,
|
|
6
|
+
UP = 3,
|
|
7
|
+
DOWN = 4
|
|
8
|
+
}
|
|
9
|
+
export declare class TransitionSlide extends TransitionStrategy {
|
|
10
|
+
private $slideDirection;
|
|
11
|
+
private $slideSpeed;
|
|
12
|
+
private $transitionTimeout;
|
|
13
|
+
constructor(slideDirection: TransitionSlideDirection, slideSpeed: number);
|
|
14
|
+
protected _execute(incoming: View, exiting: View): Promise<void>;
|
|
15
|
+
private $getTransitionString;
|
|
16
|
+
private $getSlideStyle;
|
|
17
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { View } from './View';
|
|
2
|
-
export declare abstract class TransitionStrategy {
|
|
3
|
-
constructor();
|
|
4
|
-
/**
|
|
5
|
-
* Invoked when the transition should begin.
|
|
6
|
-
* The promise should only resolve once the transition
|
|
7
|
-
* has ran to completion.
|
|
8
|
-
*
|
|
9
|
-
* The `incomingView` is the view that the user is navigating to.
|
|
10
|
-
* The `exitingView` is te view that the user is currently on, and is leaving.
|
|
11
|
-
*
|
|
12
|
-
* Both views will be rendered and are free to be manipulated in anyway that is desired,
|
|
13
|
-
* however, the incomingView should be positioned in it's natural position by the end
|
|
14
|
-
* of the transition to avoid "snapping" behaviour.
|
|
15
|
-
*
|
|
16
|
-
* @param {View} incomingView
|
|
17
|
-
* @param {View} exitingView
|
|
18
|
-
*/
|
|
19
|
-
execute(incomingView: View, exitingView: View): Promise<void>;
|
|
20
|
-
protected abstract _execute(incomingView: View, exitingView: View): Promise<void>;
|
|
21
|
-
}
|
|
1
|
+
import { View } from './View';
|
|
2
|
+
export declare abstract class TransitionStrategy {
|
|
3
|
+
constructor();
|
|
4
|
+
/**
|
|
5
|
+
* Invoked when the transition should begin.
|
|
6
|
+
* The promise should only resolve once the transition
|
|
7
|
+
* has ran to completion.
|
|
8
|
+
*
|
|
9
|
+
* The `incomingView` is the view that the user is navigating to.
|
|
10
|
+
* The `exitingView` is te view that the user is currently on, and is leaving.
|
|
11
|
+
*
|
|
12
|
+
* Both views will be rendered and are free to be manipulated in anyway that is desired,
|
|
13
|
+
* however, the incomingView should be positioned in it's natural position by the end
|
|
14
|
+
* of the transition to avoid "snapping" behaviour.
|
|
15
|
+
*
|
|
16
|
+
* @param {View} incomingView
|
|
17
|
+
* @param {View} exitingView
|
|
18
|
+
*/
|
|
19
|
+
execute(incomingView: View, exitingView: View): Promise<void>;
|
|
20
|
+
protected abstract _execute(incomingView: View, exitingView: View): Promise<void>;
|
|
21
|
+
}
|
package/dist/src/URLParser.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
export interface IURLParams {
|
|
2
|
-
[key: string]: string;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Parses the URL for router paths and url-based variables.
|
|
6
|
-
*/
|
|
7
|
-
export declare class URLParser {
|
|
8
|
-
private $allowPartialMatch;
|
|
9
|
-
private $pattern;
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param {string} pattern The URL pattern
|
|
13
|
-
* @param {boolean} allowPartialMatch If true, the pattern will match again urls that contains the pattern,
|
|
14
|
-
* even if it isn't an exact match.
|
|
15
|
-
* Defaults to false.
|
|
16
|
-
*/
|
|
17
|
-
constructor(pattern: string, allowPartialMatch?: boolean);
|
|
18
|
-
/**
|
|
19
|
-
* Parses the URL and returns the url parameters.
|
|
20
|
-
* Returns null the url does not match the pattern
|
|
21
|
-
*
|
|
22
|
-
* @param {string} url The url to test
|
|
23
|
-
*/
|
|
24
|
-
parse(url: string): IURLParams;
|
|
25
|
-
/**
|
|
26
|
-
* Strips the url for parsing, removing leading and trailing forward slashes.
|
|
27
|
-
*
|
|
28
|
-
* @private
|
|
29
|
-
* @param {string} url URL to strip
|
|
30
|
-
*/
|
|
31
|
-
private $stripURL;
|
|
32
|
-
/**
|
|
33
|
-
* Splits the url into an array of URL parts, separated by the forward slash
|
|
34
|
-
*
|
|
35
|
-
* @private
|
|
36
|
-
* @param {string} url URL to split
|
|
37
|
-
*/
|
|
38
|
-
private $getParts;
|
|
39
|
-
}
|
|
1
|
+
export interface IURLParams {
|
|
2
|
+
[key: string]: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Parses the URL for router paths and url-based variables.
|
|
6
|
+
*/
|
|
7
|
+
export declare class URLParser {
|
|
8
|
+
private $allowPartialMatch;
|
|
9
|
+
private $pattern;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param {string} pattern The URL pattern
|
|
13
|
+
* @param {boolean} allowPartialMatch If true, the pattern will match again urls that contains the pattern,
|
|
14
|
+
* even if it isn't an exact match.
|
|
15
|
+
* Defaults to false.
|
|
16
|
+
*/
|
|
17
|
+
constructor(pattern: string, allowPartialMatch?: boolean);
|
|
18
|
+
/**
|
|
19
|
+
* Parses the URL and returns the url parameters.
|
|
20
|
+
* Returns null the url does not match the pattern
|
|
21
|
+
*
|
|
22
|
+
* @param {string} url The url to test
|
|
23
|
+
*/
|
|
24
|
+
parse(url: string): IURLParams;
|
|
25
|
+
/**
|
|
26
|
+
* Strips the url for parsing, removing leading and trailing forward slashes.
|
|
27
|
+
*
|
|
28
|
+
* @private
|
|
29
|
+
* @param {string} url URL to strip
|
|
30
|
+
*/
|
|
31
|
+
private $stripURL;
|
|
32
|
+
/**
|
|
33
|
+
* Splits the url into an array of URL parts, separated by the forward slash
|
|
34
|
+
*
|
|
35
|
+
* @private
|
|
36
|
+
* @param {string} url URL to split
|
|
37
|
+
*/
|
|
38
|
+
private $getParts;
|
|
39
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { RouterStrategy } from './RouterStrategy';
|
|
2
|
-
import { Router } from './Router';
|
|
3
|
-
/**
|
|
4
|
-
* @notice Using the URLStrategy requires some backend configuration
|
|
5
|
-
* to route URLs back to application.
|
|
6
|
-
*
|
|
7
|
-
* To make this easier, by default these URLs are prefixed with
|
|
8
|
-
* `/r/` to easily differentiate between URLs that needs to be re-routed back
|
|
9
|
-
* to the application vs other resources such as images.
|
|
10
|
-
*/
|
|
11
|
-
export declare class URLStrategy extends RouterStrategy {
|
|
12
|
-
private $base;
|
|
13
|
-
private $stack;
|
|
14
|
-
private $position;
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @param {Router} router
|
|
18
|
-
*/
|
|
19
|
-
constructor(router: Router);
|
|
20
|
-
private $init;
|
|
21
|
-
getLocation(): string;
|
|
22
|
-
getLocationAt(position: number): string;
|
|
23
|
-
getHistoryLength(): number;
|
|
24
|
-
getScrollRestoration(): ScrollRestoration;
|
|
25
|
-
peek(to: number): string;
|
|
26
|
-
canGo(to: number): boolean;
|
|
27
|
-
go(to: number): void;
|
|
28
|
-
pushState(url: string, state?: Record<any, any>): void;
|
|
29
|
-
replaceState(url: string, state?: Record<any, any>): void;
|
|
30
|
-
clear(): void;
|
|
31
|
-
private $navigate;
|
|
32
|
-
}
|
|
1
|
+
import { RouterStrategy } from './RouterStrategy';
|
|
2
|
+
import { Router } from './Router';
|
|
3
|
+
/**
|
|
4
|
+
* @notice Using the URLStrategy requires some backend configuration
|
|
5
|
+
* to route URLs back to application.
|
|
6
|
+
*
|
|
7
|
+
* To make this easier, by default these URLs are prefixed with
|
|
8
|
+
* `/r/` to easily differentiate between URLs that needs to be re-routed back
|
|
9
|
+
* to the application vs other resources such as images.
|
|
10
|
+
*/
|
|
11
|
+
export declare class URLStrategy extends RouterStrategy {
|
|
12
|
+
private $base;
|
|
13
|
+
private $stack;
|
|
14
|
+
private $position;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {Router} router
|
|
18
|
+
*/
|
|
19
|
+
constructor(router: Router);
|
|
20
|
+
private $init;
|
|
21
|
+
getLocation(): string;
|
|
22
|
+
getLocationAt(position: number): string;
|
|
23
|
+
getHistoryLength(): number;
|
|
24
|
+
getScrollRestoration(): ScrollRestoration;
|
|
25
|
+
peek(to: number): string;
|
|
26
|
+
canGo(to: number): boolean;
|
|
27
|
+
go(to: number): void;
|
|
28
|
+
pushState(url: string, state?: Record<any, any>): void;
|
|
29
|
+
replaceState(url: string, state?: Record<any, any>): void;
|
|
30
|
+
clear(): void;
|
|
31
|
+
private $navigate;
|
|
32
|
+
}
|
package/dist/src/View.d.ts
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RouterStrategy } from './RouterStrategy';
|
|
3
|
+
import { TransitionStrategy } from './TransitionStrategy';
|
|
4
|
+
import { IViewStylesheet } from './IViewStylesheet';
|
|
5
|
+
import "./View.scss";
|
|
6
|
+
export interface IViewProps {
|
|
7
|
+
router: RouterStrategy;
|
|
8
|
+
entryTransition?: TransitionStrategy;
|
|
9
|
+
exitTransition?: TransitionStrategy;
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class View<TPageProps extends IViewProps = IViewProps> extends React.Component<TPageProps> {
|
|
12
|
+
private $node;
|
|
13
|
+
/**
|
|
14
|
+
* @param props See [IViewProps]
|
|
15
|
+
*/
|
|
16
|
+
constructor(props: TPageProps);
|
|
17
|
+
/**
|
|
18
|
+
* Return the CSS class on this view
|
|
19
|
+
*/
|
|
20
|
+
getCSSClass(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Override to return a webpack API style stylesheet
|
|
23
|
+
*/
|
|
24
|
+
getViewStylesheet(): IViewStylesheet;
|
|
25
|
+
/**
|
|
26
|
+
* @ignore
|
|
27
|
+
*/
|
|
28
|
+
componentDidMount(): void;
|
|
29
|
+
/**
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
32
|
+
componentWillUnmount(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the underlying HTML node for this View
|
|
35
|
+
*/
|
|
36
|
+
getNode(): HTMLElement;
|
|
37
|
+
/**
|
|
38
|
+
* Get the title of this view
|
|
39
|
+
*/
|
|
40
|
+
getTitle(): Promise<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the inline styles for this view.
|
|
43
|
+
* Use React style notation.
|
|
44
|
+
*/
|
|
45
|
+
getViewStyles(): Record<any, string>;
|
|
46
|
+
protected abstract _renderView(): React.ReactNode;
|
|
47
|
+
render(): React.ReactNode;
|
|
48
|
+
}
|
package/dist/src/api.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export { VERSION as version };
|
|
1
|
+
export * from './Router';
|
|
2
|
+
export * from './DefaultStrategy';
|
|
3
|
+
export * from './HashStrategy';
|
|
4
|
+
export * from './URLStrategy';
|
|
5
|
+
export * from './Route';
|
|
6
|
+
export * from './RouterStrategy';
|
|
7
|
+
export * from './RouteMatcher';
|
|
8
|
+
export * from './TransitionStrategy';
|
|
9
|
+
export * from './TransitionSlide';
|
|
10
|
+
export * from './View';
|
|
11
|
+
export * from './IViewStylesheet';
|
|
12
|
+
declare const VERSION: string;
|
|
13
|
+
export { VERSION as version };
|