@angular-wave/angular.ts 0.0.21 → 0.0.23

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.
Files changed (134) hide show
  1. package/Makefile +1 -1
  2. package/TODO.md +14 -0
  3. package/dist/angular-ts.esm.js +1 -1
  4. package/dist/angular-ts.umd.js +1 -1
  5. package/index.html +8 -2
  6. package/package.json +1 -1
  7. package/src/animations/animate-css-driver.js +2 -2
  8. package/src/animations/animate-css.js +15 -6
  9. package/src/animations/animate-js.js +1 -1
  10. package/src/animations/animate-queue.js +1 -1
  11. package/src/animations/shared.js +0 -14
  12. package/src/core/compile.js +6 -3
  13. package/src/directive/if.js +0 -79
  14. package/src/directive/if.md +80 -0
  15. package/src/directive/include.js +0 -82
  16. package/src/directive/include.md +86 -0
  17. package/src/directive/repeat.js +0 -1
  18. package/src/filters/order-by.js +8 -8
  19. package/src/loader.js +0 -1
  20. package/src/router/common/trace.js +1 -1
  21. package/src/router/directives/stateDirectives.js +16 -14
  22. package/src/router/directives/viewDirective.js +5 -13
  23. package/src/router/hooks/resolve.js +3 -4
  24. package/src/router/hooks/views.js +3 -2
  25. package/src/router/state/stateService.js +1 -2
  26. package/src/router/stateProvider.js +8 -0
  27. package/src/router/templateFactory.js +13 -7
  28. package/src/router/transition/interface.js +14 -14
  29. package/src/router/transition/rejectFactory.js +29 -20
  30. package/src/router/transition/transition.js +5 -1
  31. package/src/router/transition/transitionHook.js +5 -5
  32. package/src/router/url/urlMatcher.js +1 -2
  33. package/src/router/url/urlRule.js +10 -2
  34. package/src/router/url/urlRules.js +1 -1
  35. package/src/services/browser.js +3 -18
  36. package/src/shared/common.js +0 -1
  37. package/test/module-test.html +44 -12
  38. package/test/router/ng-state-builder.spec.js +81 -0
  39. package/test/router/services.spec.js +70 -0
  40. package/test/router/state-directives.spec.js +1182 -0
  41. package/test/router/template-factory.spec.js +146 -0
  42. package/test/router/url-matcher-factory.spec.js +1313 -0
  43. package/test/router/view-directive.spec.js +2013 -0
  44. package/test/router/view-hook.spec.js +217 -0
  45. package/test/router/view-scroll.spec.js +77 -0
  46. package/test/router/view.spec.js +117 -0
  47. package/types/angular.d.ts +132 -124
  48. package/types/index.d.ts +2350 -2187
  49. package/types/jqlite.d.ts +463 -418
  50. package/types/router/core/common/common.d.ts +70 -24
  51. package/types/router/core/common/coreservices.d.ts +30 -32
  52. package/types/router/core/common/glob.d.ts +9 -9
  53. package/types/router/core/common/hof.d.ts +12 -4
  54. package/types/router/core/common/index.d.ts +8 -8
  55. package/types/router/core/common/predicates.d.ts +1 -1
  56. package/types/router/core/common/queue.d.ts +13 -13
  57. package/types/router/core/common/safeConsole.d.ts +3 -3
  58. package/types/router/core/common/strings.d.ts +4 -2
  59. package/types/router/core/common/trace.d.ts +94 -82
  60. package/types/router/core/globals.d.ts +37 -37
  61. package/types/router/core/hooks/coreResolvables.d.ts +5 -3
  62. package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
  63. package/types/router/core/hooks/invalidTransition.d.ts +4 -2
  64. package/types/router/core/hooks/lazyLoad.d.ts +10 -5
  65. package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
  66. package/types/router/core/hooks/redirectTo.d.ts +4 -2
  67. package/types/router/core/hooks/resolve.d.ts +10 -4
  68. package/types/router/core/hooks/updateGlobals.d.ts +4 -2
  69. package/types/router/core/hooks/url.d.ts +4 -2
  70. package/types/router/core/hooks/views.d.ts +7 -3
  71. package/types/router/core/index.d.ts +11 -12
  72. package/types/router/core/interface.d.ts +83 -81
  73. package/types/router/core/params/index.d.ts +5 -5
  74. package/types/router/core/params/interface.d.ts +439 -439
  75. package/types/router/core/params/param.d.ts +72 -60
  76. package/types/router/core/params/paramType.d.ts +40 -40
  77. package/types/router/core/params/paramTypes.d.ts +169 -165
  78. package/types/router/core/params/stateParams.d.ts +13 -13
  79. package/types/router/core/path/index.d.ts +2 -2
  80. package/types/router/core/path/pathNode.d.ts +49 -49
  81. package/types/router/core/path/pathUtils.d.ts +100 -74
  82. package/types/router/core/resolve/index.d.ts +3 -3
  83. package/types/router/core/resolve/interface.d.ts +137 -137
  84. package/types/router/core/resolve/resolvable.d.ts +60 -54
  85. package/types/router/core/resolve/resolveContext.d.ts +84 -79
  86. package/types/router/core/router.d.ts +95 -86
  87. package/types/router/core/state/index.d.ts +8 -8
  88. package/types/router/core/state/interface.d.ts +667 -643
  89. package/types/router/core/state/stateBuilder.d.ts +41 -38
  90. package/types/router/core/state/stateMatcher.d.ts +11 -9
  91. package/types/router/core/state/stateObject.d.ts +154 -139
  92. package/types/router/core/state/stateQueueManager.d.ts +26 -21
  93. package/types/router/core/state/stateRegistry.d.ts +124 -121
  94. package/types/router/core/state/stateService.d.ts +380 -343
  95. package/types/router/core/state/targetState.d.ts +74 -69
  96. package/types/router/core/transition/hookBuilder.d.ts +34 -30
  97. package/types/router/core/transition/hookRegistry.d.ts +96 -74
  98. package/types/router/core/transition/index.d.ts +8 -8
  99. package/types/router/core/transition/interface.d.ts +652 -609
  100. package/types/router/core/transition/rejectFactory.d.ts +97 -97
  101. package/types/router/core/transition/transition.d.ts +565 -517
  102. package/types/router/core/transition/transitionEventType.d.ts +20 -11
  103. package/types/router/core/transition/transitionHook.d.ts +90 -82
  104. package/types/router/core/transition/transitionService.d.ts +228 -161
  105. package/types/router/core/url/index.d.ts +8 -8
  106. package/types/router/core/url/interface.d.ts +100 -87
  107. package/types/router/core/url/urlConfig.d.ts +130 -126
  108. package/types/router/core/url/urlMatcher.d.ts +132 -127
  109. package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
  110. package/types/router/core/url/urlRouter.d.ts +91 -75
  111. package/types/router/core/url/urlRule.d.ts +123 -100
  112. package/types/router/core/url/urlRules.d.ts +240 -232
  113. package/types/router/core/url/urlService.d.ts +201 -201
  114. package/types/router/core/view/index.d.ts +2 -2
  115. package/types/router/core/view/interface.d.ts +26 -26
  116. package/types/router/core/view/view.d.ts +152 -143
  117. package/types/router/directives/viewDirective.d.ts +12 -11
  118. package/types/router/index.d.ts +11 -12
  119. package/types/router/interface.d.ts +361 -351
  120. package/types/router/legacy/resolveService.d.ts +44 -40
  121. package/types/router/legacy/stateEvents.d.ts +1 -1
  122. package/types/router/locationServices.d.ts +45 -37
  123. package/types/router/services.d.ts +9 -9
  124. package/types/router/stateFilters.d.ts +3 -3
  125. package/types/router/stateProvider.d.ts +240 -235
  126. package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
  127. package/types/router/statebuilders/views.d.ts +35 -22
  128. package/types/router/templateFactory.d.ts +99 -79
  129. package/types/router/viewScroll.d.ts +7 -7
  130. package/src/directive/a.js +0 -37
  131. package/types/router/angular.d.ts +0 -1
  132. package/types/router/core/vanilla.d.ts +0 -1
  133. package/types/router/directives/stateDirectives.d.ts +0 -3
  134. package/types/router/injectables.d.ts +0 -1
@@ -1,8 +1,8 @@
1
- import { Param } from '../params/param';
2
- import { ParamTypes } from '../params/paramTypes';
3
- import { RawParams } from '../params/interface';
4
- import { UrlMatcherCompileConfig } from './interface';
5
- import { ParamFactory } from './urlMatcherFactory';
1
+ import { Param } from "../params/param";
2
+ import { ParamTypes } from "../params/paramTypes";
3
+ import { RawParams } from "../params/interface";
4
+ import { UrlMatcherCompileConfig } from "./interface";
5
+ import { ParamFactory } from "./urlMatcherFactory";
6
6
  /**
7
7
  * Matches URLs against patterns.
8
8
  *
@@ -55,126 +55,131 @@ import { ParamFactory } from './urlMatcherFactory';
55
55
  *
56
56
  */
57
57
  export declare class UrlMatcher {
58
- /** @internal */
59
- static nameValidator: RegExp;
60
- /** @internal */
61
- private _cache;
62
- /** @internal */
63
- private _children;
64
- /** @internal */
65
- private _params;
66
- /** @internal */
67
- private _segments;
68
- /** @internal */
69
- private _compiled;
70
- /** @internal */
71
- private readonly config;
72
- /** The pattern that was passed into the constructor */
73
- pattern: string;
74
- /** @internal */
75
- static encodeDashes(str: string): string;
76
- /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */
77
- static pathSegmentsAndParams(matcher: UrlMatcher): any;
78
- /** @internal Given a matcher, return an array with the matcher's query params */
79
- static queryParams(matcher: UrlMatcher): Param[];
80
- /**
81
- * Compare two UrlMatchers
82
- *
83
- * This comparison function converts a UrlMatcher into static and dynamic path segments.
84
- * Each static path segment is a static string between a path separator (slash character).
85
- * Each dynamic segment is a path parameter.
86
- *
87
- * The comparison function sorts static segments before dynamic ones.
88
- */
89
- static compare(a: UrlMatcher, b: UrlMatcher): number;
90
- /**
91
- * @param pattern The pattern to compile into a matcher.
92
- * @param paramTypes The [[ParamTypes]] registry
93
- * @param paramFactory A [[ParamFactory]] object
94
- * @param config A [[UrlMatcherCompileConfig]] configuration object
95
- */
96
- constructor(pattern: string, paramTypes: ParamTypes, paramFactory: ParamFactory, config?: UrlMatcherCompileConfig);
97
- /**
98
- * Creates a new concatenated UrlMatcher
99
- *
100
- * Builds a new UrlMatcher by appending another UrlMatcher to this one.
101
- *
102
- * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.
103
- */
104
- append(url: UrlMatcher): UrlMatcher;
105
- /** @internal */
106
- isRoot(): boolean;
107
- /** Returns the input pattern string */
108
- toString(): string;
109
- private _getDecodedParamValue;
110
- /**
111
- * Tests the specified url/path against this matcher.
112
- *
113
- * Tests if the given url matches this matcher's pattern, and returns an object containing the captured
114
- * parameter values. Returns null if the path does not match.
115
- *
116
- * The returned object contains the values
117
- * of any search parameters that are mentioned in the pattern, but their value may be null if
118
- * they are not present in `search`. This means that search parameters are always treated
119
- * as optional.
120
- *
121
- * #### Example:
122
- * ```js
123
- * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
124
- * x: '1', q: 'hello'
125
- * });
126
- * // returns { id: 'bob', q: 'hello', r: null }
127
- * ```
128
- *
129
- * @param path The URL path to match, e.g. `$location.path()`.
130
- * @param search URL search parameters, e.g. `$location.search()`.
131
- * @param hash URL hash e.g. `$location.hash()`.
132
- * @param options
133
- *
134
- * @returns The captured parameter values.
135
- */
136
- exec(path: string, search?: any, hash?: string, options?: any): RawParams;
137
- /**
138
- * @internal
139
- * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.
140
- *
141
- * @returns {Array.<Param>} An array of [[Param]] objects. Must be treated as read-only. If the
142
- * pattern has no parameters, an empty array is returned.
143
- */
144
- parameters(opts?: any): Param[];
145
- /**
146
- * @internal
147
- * Returns a single parameter from this UrlMatcher by id
148
- *
149
- * @param id
150
- * @param opts
151
- * @returns {T|Param|any|boolean|UrlMatcher|null}
152
- */
153
- parameter(id: string, opts?: any): Param;
154
- /**
155
- * Validates the input parameter values against this UrlMatcher
156
- *
157
- * Checks an object hash of parameters to validate their correctness according to the parameter
158
- * types of this `UrlMatcher`.
159
- *
160
- * @param params The object hash of parameters to validate.
161
- * @returns Returns `true` if `params` validates, otherwise `false`.
162
- */
163
- validates(params: RawParams): boolean;
164
- /**
165
- * Given a set of parameter values, creates a URL from this UrlMatcher.
166
- *
167
- * Creates a URL that matches this pattern by substituting the specified values
168
- * for the path and search parameters.
169
- *
170
- * #### Example:
171
- * ```js
172
- * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
173
- * // returns '/user/bob?q=yes'
174
- * ```
175
- *
176
- * @param values the values to substitute for the parameters in this pattern.
177
- * @returns the formatted URL (path and optionally search part).
178
- */
179
- format(values?: RawParams): string;
58
+ /** @internal */
59
+ static nameValidator: RegExp;
60
+ /** @internal */
61
+ private _cache;
62
+ /** @internal */
63
+ private _children;
64
+ /** @internal */
65
+ private _params;
66
+ /** @internal */
67
+ private _segments;
68
+ /** @internal */
69
+ private _compiled;
70
+ /** @internal */
71
+ private readonly config;
72
+ /** The pattern that was passed into the constructor */
73
+ pattern: string;
74
+ /** @internal */
75
+ static encodeDashes(str: string): string;
76
+ /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */
77
+ static pathSegmentsAndParams(matcher: UrlMatcher): any;
78
+ /** @internal Given a matcher, return an array with the matcher's query params */
79
+ static queryParams(matcher: UrlMatcher): Param[];
80
+ /**
81
+ * Compare two UrlMatchers
82
+ *
83
+ * This comparison function converts a UrlMatcher into static and dynamic path segments.
84
+ * Each static path segment is a static string between a path separator (slash character).
85
+ * Each dynamic segment is a path parameter.
86
+ *
87
+ * The comparison function sorts static segments before dynamic ones.
88
+ */
89
+ static compare(a: UrlMatcher, b: UrlMatcher): number;
90
+ /**
91
+ * @param pattern The pattern to compile into a matcher.
92
+ * @param paramTypes The [[ParamTypes]] registry
93
+ * @param paramFactory A [[ParamFactory]] object
94
+ * @param config A [[UrlMatcherCompileConfig]] configuration object
95
+ */
96
+ constructor(
97
+ pattern: string,
98
+ paramTypes: ParamTypes,
99
+ paramFactory: ParamFactory,
100
+ config?: UrlMatcherCompileConfig,
101
+ );
102
+ /**
103
+ * Creates a new concatenated UrlMatcher
104
+ *
105
+ * Builds a new UrlMatcher by appending another UrlMatcher to this one.
106
+ *
107
+ * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.
108
+ */
109
+ append(url: UrlMatcher): UrlMatcher;
110
+ /** @internal */
111
+ isRoot(): boolean;
112
+ /** Returns the input pattern string */
113
+ toString(): string;
114
+ private _getDecodedParamValue;
115
+ /**
116
+ * Tests the specified url/path against this matcher.
117
+ *
118
+ * Tests if the given url matches this matcher's pattern, and returns an object containing the captured
119
+ * parameter values. Returns null if the path does not match.
120
+ *
121
+ * The returned object contains the values
122
+ * of any search parameters that are mentioned in the pattern, but their value may be null if
123
+ * they are not present in `search`. This means that search parameters are always treated
124
+ * as optional.
125
+ *
126
+ * #### Example:
127
+ * ```js
128
+ * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
129
+ * x: '1', q: 'hello'
130
+ * });
131
+ * // returns { id: 'bob', q: 'hello', r: null }
132
+ * ```
133
+ *
134
+ * @param path The URL path to match, e.g. `$location.path()`.
135
+ * @param search URL search parameters, e.g. `$location.search()`.
136
+ * @param hash URL hash e.g. `$location.hash()`.
137
+ * @param options
138
+ *
139
+ * @returns The captured parameter values.
140
+ */
141
+ exec(path: string, search?: any, hash?: string, options?: any): RawParams;
142
+ /**
143
+ * @internal
144
+ * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.
145
+ *
146
+ * @returns {Array.<Param>} An array of [[Param]] objects. Must be treated as read-only. If the
147
+ * pattern has no parameters, an empty array is returned.
148
+ */
149
+ parameters(opts?: any): Param[];
150
+ /**
151
+ * @internal
152
+ * Returns a single parameter from this UrlMatcher by id
153
+ *
154
+ * @param id
155
+ * @param opts
156
+ * @returns {T|Param|any|boolean|UrlMatcher|null}
157
+ */
158
+ parameter(id: string, opts?: any): Param;
159
+ /**
160
+ * Validates the input parameter values against this UrlMatcher
161
+ *
162
+ * Checks an object hash of parameters to validate their correctness according to the parameter
163
+ * types of this `UrlMatcher`.
164
+ *
165
+ * @param params The object hash of parameters to validate.
166
+ * @returns Returns `true` if `params` validates, otherwise `false`.
167
+ */
168
+ validates(params: RawParams): boolean;
169
+ /**
170
+ * Given a set of parameter values, creates a URL from this UrlMatcher.
171
+ *
172
+ * Creates a URL that matches this pattern by substituting the specified values
173
+ * for the path and search parameters.
174
+ *
175
+ * #### Example:
176
+ * ```js
177
+ * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
178
+ * // returns '/user/bob?q=yes'
179
+ * ```
180
+ *
181
+ * @param values the values to substitute for the parameters in this pattern.
182
+ * @returns the formatted URL (path and optionally search part).
183
+ */
184
+ format(values?: RawParams): string;
180
185
  }
@@ -1,14 +1,14 @@
1
- import { UrlMatcher } from './urlMatcher';
2
- import { Param, ParamType, ParamTypeDefinition } from '../params';
3
- import { UrlMatcherCompileConfig } from './interface';
4
- import { StateDeclaration } from '../state';
5
- import { UIRouter } from '../router';
1
+ import { UrlMatcher } from "./urlMatcher";
2
+ import { Param, ParamType, ParamTypeDefinition } from "../params";
3
+ import { UrlMatcherCompileConfig } from "./interface";
4
+ import { StateDeclaration } from "../state";
5
+ import { UIRouter } from "../router";
6
6
  export declare class ParamFactory {
7
- private router;
8
- fromConfig(id: string, type: ParamType, state: StateDeclaration): Param;
9
- fromPath(id: string, type: ParamType, state: StateDeclaration): Param;
10
- fromSearch(id: string, type: ParamType, state: StateDeclaration): Param;
11
- constructor(router: UIRouter);
7
+ private router;
8
+ fromConfig(id: string, type: ParamType, state: StateDeclaration): Param;
9
+ fromPath(id: string, type: ParamType, state: StateDeclaration): Param;
10
+ fromSearch(id: string, type: ParamType, state: StateDeclaration): Param;
11
+ constructor(router: UIRouter);
12
12
  }
13
13
  /**
14
14
  * Factory for [[UrlMatcher]] instances.
@@ -17,36 +17,40 @@ export declare class ParamFactory {
17
17
  * `$urlMatcherFactory` or ng1 providers as `$urlMatcherFactoryProvider`.
18
18
  */
19
19
  export declare class UrlMatcherFactory {
20
- private router;
21
- /** Creates a new [[Param]] for a given location (DefType) */
22
- paramFactory: ParamFactory;
23
- UrlMatcher: typeof UrlMatcher;
24
- Param: typeof Param;
25
- constructor(/** @internal */ router: UIRouter);
26
- /**
27
- * Creates a [[UrlMatcher]] for the specified pattern.
28
- *
29
- * @param pattern The URL pattern.
30
- * @param config The config object hash.
31
- * @returns The UrlMatcher.
32
- */
33
- compile(pattern: string, config?: UrlMatcherCompileConfig): UrlMatcher;
34
- /**
35
- * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.
36
- *
37
- * @param object The object to perform the type check against.
38
- * @returns `true` if the object matches the `UrlMatcher` interface, by
39
- * implementing all the same methods.
40
- */
41
- isMatcher(object: any): boolean;
42
- /** @internal */
43
- $get(): this;
44
- /** @deprecated use [[UrlConfig.caseInsensitive]] */
45
- caseInsensitive: (value?: boolean) => boolean;
46
- /** @deprecated use [[UrlConfig.defaultSquashPolicy]] */
47
- defaultSquashPolicy: (value?: boolean | string) => string | boolean;
48
- /** @deprecated use [[UrlConfig.strictMode]] */
49
- strictMode: (value?: boolean) => boolean;
50
- /** @deprecated use [[UrlConfig.type]] */
51
- type: (name: string, definition?: ParamTypeDefinition, definitionFn?: () => ParamTypeDefinition) => any;
20
+ private router;
21
+ /** Creates a new [[Param]] for a given location (DefType) */
22
+ paramFactory: ParamFactory;
23
+ UrlMatcher: typeof UrlMatcher;
24
+ Param: typeof Param;
25
+ constructor(/** @internal */ router: UIRouter);
26
+ /**
27
+ * Creates a [[UrlMatcher]] for the specified pattern.
28
+ *
29
+ * @param pattern The URL pattern.
30
+ * @param config The config object hash.
31
+ * @returns The UrlMatcher.
32
+ */
33
+ compile(pattern: string, config?: UrlMatcherCompileConfig): UrlMatcher;
34
+ /**
35
+ * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.
36
+ *
37
+ * @param object The object to perform the type check against.
38
+ * @returns `true` if the object matches the `UrlMatcher` interface, by
39
+ * implementing all the same methods.
40
+ */
41
+ isMatcher(object: any): boolean;
42
+ /** @internal */
43
+ $get(): this;
44
+ /** @deprecated use [[UrlConfig.caseInsensitive]] */
45
+ caseInsensitive: (value?: boolean) => boolean;
46
+ /** @deprecated use [[UrlConfig.defaultSquashPolicy]] */
47
+ defaultSquashPolicy: (value?: boolean | string) => string | boolean;
48
+ /** @deprecated use [[UrlConfig.strictMode]] */
49
+ strictMode: (value?: boolean) => boolean;
50
+ /** @deprecated use [[UrlConfig.type]] */
51
+ type: (
52
+ name: string,
53
+ definition?: ParamTypeDefinition,
54
+ definitionFn?: () => ParamTypeDefinition,
55
+ ) => any;
52
56
  }
@@ -1,9 +1,9 @@
1
- import { UrlMatcher } from './urlMatcher';
2
- import { RawParams } from '../params';
3
- import { UIRouter } from '../router';
4
- import { UrlRuleFactory } from './urlRule';
5
- import { MatchResult, UrlParts, UrlRule, UrlRuleHandlerFn } from './interface';
6
- import { TargetState, TargetStateDef } from '../state';
1
+ import { UrlMatcher } from "./urlMatcher";
2
+ import { RawParams } from "../params";
3
+ import { UIRouter } from "../router";
4
+ import { UrlRuleFactory } from "./urlRule";
5
+ import { MatchResult, UrlParts, UrlRule, UrlRuleHandlerFn } from "./interface";
6
+ import { TargetState, TargetStateDef } from "../state";
7
7
  /**
8
8
  * Updates URL and responds to URL changes
9
9
  *
@@ -13,73 +13,89 @@ import { TargetState, TargetStateDef } from '../state';
13
13
  * For configuring URL rules, use the [[UrlRules]] which can be found as [[UrlService.rules]].
14
14
  */
15
15
  export declare class UrlRouter {
16
- private router;
17
- /** used to create [[UrlRule]] objects for common cases */
18
- urlRuleFactory: UrlRuleFactory;
19
- /** @internal */ private location;
20
- /** @internal */
21
- constructor(/** @internal */ router: UIRouter);
22
- /** Internal API. */
23
- update(read?: boolean): void;
24
- /**
25
- * Internal API.
26
- *
27
- * Pushes a new location to the browser history.
28
- *
29
- * @internal
30
- * @param urlMatcher
31
- * @param params
32
- * @param options
33
- */
34
- push(urlMatcher: UrlMatcher, params?: RawParams, options?: {
35
- replace?: string | boolean;
36
- }): void;
37
- /**
38
- * Builds and returns a URL with interpolated parameters
39
- *
40
- * #### Example:
41
- * ```js
42
- * matcher = $umf.compile("/about/:person");
43
- * params = { person: "bob" };
44
- * $bob = $urlRouter.href(matcher, params);
45
- * // $bob == "/about/bob";
46
- * ```
47
- *
48
- * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.
49
- * @param params An object of parameter values to fill the matcher's required parameters.
50
- * @param options Options object. The options are:
51
- *
52
- * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
53
- *
54
- * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
55
- */
56
- href(urlMatcher: UrlMatcher, params?: any, options?: {
57
- absolute: boolean;
58
- }): string;
59
- /** @deprecated use [[UrlService.sync]]*/
60
- sync: (evt?: any) => void;
61
- /** @deprecated use [[UrlService.listen]]*/
62
- listen: (enabled?: boolean) => Function;
63
- /** @deprecated use [[UrlService.deferIntercept]]*/
64
- deferIntercept: (defer?: boolean) => void;
65
- /** @deprecated use [[UrlService.interceptDeferred]]*/
66
- interceptDeferred: boolean;
67
- /** @deprecated use [[UrlService.match]]*/
68
- match: (urlParts: UrlParts) => MatchResult;
69
- /** @deprecated use [[UrlRules.initial]]*/
70
- initial: (handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef) => void;
71
- /** @deprecated use [[UrlRules.otherwise]]*/
72
- otherwise: (handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef) => void;
73
- /** @deprecated use [[UrlRules.removeRule]]*/
74
- removeRule: (rule: UrlRule) => void;
75
- /** @deprecated use [[UrlRules.rule]]*/
76
- rule: (rule: UrlRule) => Function;
77
- /** @deprecated use [[UrlRules.rules]]*/
78
- rules: () => UrlRule[];
79
- /** @deprecated use [[UrlRules.sort]]*/
80
- sort: (compareFn?: (a: UrlRule, b: UrlRule) => number) => void;
81
- /** @deprecated use [[UrlRules.when]]*/
82
- when: (matcher: RegExp | UrlMatcher | string, handler: string | UrlRuleHandlerFn, options?: {
83
- priority: number;
84
- }) => UrlRule;
16
+ private router;
17
+ /** used to create [[UrlRule]] objects for common cases */
18
+ urlRuleFactory: UrlRuleFactory;
19
+ /** @internal */ private location;
20
+ /** @internal */
21
+ constructor(/** @internal */ router: UIRouter);
22
+ /** Internal API. */
23
+ update(read?: boolean): void;
24
+ /**
25
+ * Internal API.
26
+ *
27
+ * Pushes a new location to the browser history.
28
+ *
29
+ * @internal
30
+ * @param urlMatcher
31
+ * @param params
32
+ * @param options
33
+ */
34
+ push(
35
+ urlMatcher: UrlMatcher,
36
+ params?: RawParams,
37
+ options?: {
38
+ replace?: string | boolean;
39
+ },
40
+ ): void;
41
+ /**
42
+ * Builds and returns a URL with interpolated parameters
43
+ *
44
+ * #### Example:
45
+ * ```js
46
+ * matcher = $umf.compile("/about/:person");
47
+ * params = { person: "bob" };
48
+ * $bob = $urlRouter.href(matcher, params);
49
+ * // $bob == "/about/bob";
50
+ * ```
51
+ *
52
+ * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.
53
+ * @param params An object of parameter values to fill the matcher's required parameters.
54
+ * @param options Options object. The options are:
55
+ *
56
+ * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
57
+ *
58
+ * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
59
+ */
60
+ href(
61
+ urlMatcher: UrlMatcher,
62
+ params?: any,
63
+ options?: {
64
+ absolute: boolean;
65
+ },
66
+ ): string;
67
+ /** @deprecated use [[UrlService.sync]]*/
68
+ sync: (evt?: any) => void;
69
+ /** @deprecated use [[UrlService.listen]]*/
70
+ listen: (enabled?: boolean) => Function;
71
+ /** @deprecated use [[UrlService.deferIntercept]]*/
72
+ deferIntercept: (defer?: boolean) => void;
73
+ /** @deprecated use [[UrlService.interceptDeferred]]*/
74
+ interceptDeferred: boolean;
75
+ /** @deprecated use [[UrlService.match]]*/
76
+ match: (urlParts: UrlParts) => MatchResult;
77
+ /** @deprecated use [[UrlRules.initial]]*/
78
+ initial: (
79
+ handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef,
80
+ ) => void;
81
+ /** @deprecated use [[UrlRules.otherwise]]*/
82
+ otherwise: (
83
+ handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef,
84
+ ) => void;
85
+ /** @deprecated use [[UrlRules.removeRule]]*/
86
+ removeRule: (rule: UrlRule) => void;
87
+ /** @deprecated use [[UrlRules.rule]]*/
88
+ rule: (rule: UrlRule) => Function;
89
+ /** @deprecated use [[UrlRules.rules]]*/
90
+ rules: () => UrlRule[];
91
+ /** @deprecated use [[UrlRules.sort]]*/
92
+ sort: (compareFn?: (a: UrlRule, b: UrlRule) => number) => void;
93
+ /** @deprecated use [[UrlRules.when]]*/
94
+ when: (
95
+ matcher: RegExp | UrlMatcher | string,
96
+ handler: string | UrlRuleHandlerFn,
97
+ options?: {
98
+ priority: number;
99
+ },
100
+ ) => UrlRule;
85
101
  }