@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,6 +1,11 @@
1
1
  /** @publicapi @module ng1 */ /** */
2
- import { BuilderFunction, StateRegistry, StateService, OnInvalidCallback } from './core';
3
- import { Ng1StateDeclaration } from './interface';
2
+ import {
3
+ BuilderFunction,
4
+ StateRegistry,
5
+ StateService,
6
+ OnInvalidCallback,
7
+ } from "./core";
8
+ import { Ng1StateDeclaration } from "./interface";
4
9
  /**
5
10
  * The Angular 1 `StateProvider`
6
11
  *
@@ -18,237 +23,237 @@ import { Ng1StateDeclaration } from './interface';
18
23
  * The `$stateProvider` provides interfaces to declare these states for your app.
19
24
  */
20
25
  export declare class StateProvider {
21
- private stateRegistry;
22
- private stateService;
23
- constructor(stateRegistry: StateRegistry, stateService: StateService);
24
- /**
25
- * Decorates states when they are registered
26
- *
27
- * Allows you to extend (carefully) or override (at your own peril) the
28
- * `stateBuilder` object used internally by [[StateRegistry]].
29
- * This can be used to add custom functionality to ui-router,
30
- * for example inferring templateUrl based on the state name.
31
- *
32
- * When passing only a name, it returns the current (original or decorated) builder
33
- * function that matches `name`.
34
- *
35
- * The builder functions that can be decorated are listed below. Though not all
36
- * necessarily have a good use case for decoration, that is up to you to decide.
37
- *
38
- * In addition, users can attach custom decorators, which will generate new
39
- * properties within the state's internal definition. There is currently no clear
40
- * use-case for this beyond accessing internal states (i.e. $state.$current),
41
- * however, expect this to become increasingly relevant as we introduce additional
42
- * meta-programming features.
43
- *
44
- * **Warning**: Decorators should not be interdependent because the order of
45
- * execution of the builder functions in non-deterministic. Builder functions
46
- * should only be dependent on the state definition object and super function.
47
- *
48
- *
49
- * Existing builder functions and current return values:
50
- *
51
- * - **parent** `{object}` - returns the parent state object.
52
- * - **data** `{object}` - returns state data, including any inherited data that is not
53
- * overridden by own values (if any).
54
- * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
55
- * or `null`.
56
- * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
57
- * navigable).
58
- * - **params** `{object}` - returns an array of state params that are ensured to
59
- * be a super-set of parent's params.
60
- * - **views** `{object}` - returns a views object where each key is an absolute view
61
- * name (i.e. "viewName@stateName") and each value is the config object
62
- * (template, controller) for the view. Even when you don't use the views object
63
- * explicitly on a state config, one is still created for you internally.
64
- * So by decorating this builder function you have access to decorating template
65
- * and controller properties.
66
- * - **ownParams** `{object}` - returns an array of params that belong to the state,
67
- * not including any params defined by ancestor states.
68
- * - **path** `{string}` - returns the full path from the root down to this state.
69
- * Needed for state activation.
70
- * - **includes** `{object}` - returns an object that includes every state that
71
- * would pass a `$state.includes()` test.
72
- *
73
- * #### Example:
74
- * Override the internal 'views' builder with a function that takes the state
75
- * definition, and a reference to the internal function being overridden:
76
- * ```js
77
- * $stateProvider.decorator('views', function (state, parent) {
78
- * let result = {},
79
- * views = parent(state);
80
- *
81
- * angular.forEach(views, function (config, name) {
82
- * let autoName = (state.name + '.' + name).replace('.', '/');
83
- * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
84
- * result[name] = config;
85
- * });
86
- * return result;
87
- * });
88
- *
89
- * $stateProvider.state('home', {
90
- * views: {
91
- * 'contact.list': { controller: 'ListController' },
92
- * 'contact.item': { controller: 'ItemController' }
93
- * }
94
- * });
95
- * ```
96
- *
97
- *
98
- * ```js
99
- * // Auto-populates list and item views with /partials/home/contact/list.html,
100
- * // and /partials/home/contact/item.html, respectively.
101
- * $state.go('home');
102
- * ```
103
- *
104
- * @param {string} name The name of the builder function to decorate.
105
- * @param {object} func A function that is responsible for decorating the original
106
- * builder function. The function receives two parameters:
107
- *
108
- * - `{object}` - state - The state config object.
109
- * - `{object}` - super - The original builder function.
110
- *
111
- * @return {object} $stateProvider - $stateProvider instance
112
- */
113
- decorator(name: string, func: BuilderFunction): Function | this;
114
- /**
115
- * Registers a state
116
- *
117
- * ### This is a passthrough to [[StateRegistry.register]].
118
- *
119
- * Registers a state configuration under a given state name.
120
- * The stateConfig object has the following acceptable properties.
121
- *
122
- * <a id='template'></a>
123
- *
124
- * - **`template`** - {string|function=} - html template as a string or a function that returns
125
- * an html template as a string which should be used by the uiView directives. This property
126
- * takes precedence over templateUrl.
127
- *
128
- * If `template` is a function, it will be called with the following parameters:
129
- *
130
- * - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by
131
- * applying the current state
132
- *
133
- * <a id='templateUrl'></a>
134
- *
135
- * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html
136
- * template that should be used by uiView.
137
- *
138
- * If `templateUrl` is a function, it will be called with the following parameters:
139
- *
140
- * - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by
141
- * applying the current state
142
- *
143
- * <a id='templateProvider'></a>
144
- *
145
- * - **`templateProvider`** - {function=} - Provider function that returns HTML content
146
- * string.
147
- *
148
- * <a id='controller'></a>
149
- *
150
- * - **`controller`** - {string|function=} - Controller fn that should be associated with newly
151
- * related scope or the name of a registered controller if passed as a string.
152
- *
153
- * <a id='controllerProvider'></a>
154
- *
155
- * - **`controllerProvider`** - {function=} - Injectable provider function that returns
156
- * the actual controller or string.
157
- *
158
- * <a id='controllerAs'></a>
159
- *
160
- * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be
161
- * published to scope under the controllerAs name.
162
- *
163
- * <a id='resolve'></a>
164
- *
165
- * - **`resolve`** - {object.&lt;string, function&gt;=} - An optional map of dependencies which
166
- * should be injected into the controller. If any of these dependencies are promises,
167
- * the router will wait for them all to be resolved or one to be rejected before the
168
- * controller is instantiated. If all the promises are resolved successfully, the values
169
- * of the resolved promises are injected and $stateChangeSuccess event is fired. If any
170
- * of the promises are rejected the $stateChangeError event is fired. The map object is:
171
- *
172
- * - key - {string}: name of dependency to be injected into controller
173
- * - factory - {string|function}: If string then it is alias for service. Otherwise if function,
174
- * it is injected and return value it treated as dependency. If result is a promise, it is
175
- * resolved before its value is injected into controller.
176
- *
177
- * <a id='url'></a>
178
- *
179
- * - **`url`** - {string=} - A url with optional parameters. When a state is navigated or
180
- * transitioned to, the `$stateParams` service will be populated with any
181
- * parameters that were passed.
182
- *
183
- * <a id='params'></a>
184
- *
185
- * - **`params`** - {object=} - An array of parameter names or regular expressions. Only
186
- * use this within a state if you are not using url. Otherwise you can specify your
187
- * parameters within the url. When a state is navigated or transitioned to, the
188
- * $stateParams service will be populated with any parameters that were passed.
189
- *
190
- * <a id='views'></a>
191
- *
192
- * - **`views`** - {object=} - Use the views property to set up multiple views or to target views
193
- * manually/explicitly.
194
- *
195
- * <a id='abstract'></a>
196
- *
197
- * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,
198
- * but can provide inherited properties to its common children states.
199
- *
200
- * <a id='onEnter'></a>
201
- *
202
- * - **`onEnter`** - {object=} - Callback function for when a state is entered. Good way
203
- * to trigger an action or dispatch an event, such as opening a dialog.
204
- * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
205
- *
206
- * <a id='onExit'></a>
207
- *
208
- * - **`onExit`** - {object=} - Callback function for when a state is exited. Good way to
209
- * trigger an action or dispatch an event, such as opening a dialog.
210
- * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
211
- *
212
- * <a id='reloadOnSearch'></a>
213
- *
214
- * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state
215
- * just because a search/query parameter has changed (via $location.search() or $location.hash()).
216
- * Useful for when you'd like to modify $location.search() without triggering a reload.
217
- *
218
- * <a id='data'></a>
219
- *
220
- * - **`data`** - {object=} - Arbitrary data object, useful for custom configuration.
221
- *
222
- * #### Example:
223
- * Some state name examples
224
- * ```js
225
- * // stateName can be a single top-level name (must be unique).
226
- * $stateProvider.state("home", {});
227
- *
228
- * // Or it can be a nested state name. This state is a child of the
229
- * // above "home" state.
230
- * $stateProvider.state("home.newest", {});
231
- *
232
- * // Nest states as deeply as needed.
233
- * $stateProvider.state("home.newest.abc.xyz.inception", {});
234
- *
235
- * // state() returns $stateProvider, so you can chain state declarations.
236
- * $stateProvider
237
- * .state("home", {})
238
- * .state("about", {})
239
- * .state("contacts", {});
240
- * ```
241
- *
242
- * @param {string} name A unique state name, e.g. "home", "about", "contacts".
243
- * To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
244
- * @param {object} definition State configuration object.
245
- */
246
- state(name: string, definition: Ng1StateDeclaration): StateProvider;
247
- state(definition: Ng1StateDeclaration): StateProvider;
248
- /**
249
- * Registers an invalid state handler
250
- *
251
- * This is a passthrough to [[StateService.onInvalid]] for ng1.
252
- */
253
- onInvalid(callback: OnInvalidCallback): Function;
26
+ private stateRegistry;
27
+ private stateService;
28
+ constructor(stateRegistry: StateRegistry, stateService: StateService);
29
+ /**
30
+ * Decorates states when they are registered
31
+ *
32
+ * Allows you to extend (carefully) or override (at your own peril) the
33
+ * `stateBuilder` object used internally by [[StateRegistry]].
34
+ * This can be used to add custom functionality to ui-router,
35
+ * for example inferring templateUrl based on the state name.
36
+ *
37
+ * When passing only a name, it returns the current (original or decorated) builder
38
+ * function that matches `name`.
39
+ *
40
+ * The builder functions that can be decorated are listed below. Though not all
41
+ * necessarily have a good use case for decoration, that is up to you to decide.
42
+ *
43
+ * In addition, users can attach custom decorators, which will generate new
44
+ * properties within the state's internal definition. There is currently no clear
45
+ * use-case for this beyond accessing internal states (i.e. $state.$current),
46
+ * however, expect this to become increasingly relevant as we introduce additional
47
+ * meta-programming features.
48
+ *
49
+ * **Warning**: Decorators should not be interdependent because the order of
50
+ * execution of the builder functions in non-deterministic. Builder functions
51
+ * should only be dependent on the state definition object and super function.
52
+ *
53
+ *
54
+ * Existing builder functions and current return values:
55
+ *
56
+ * - **parent** `{object}` - returns the parent state object.
57
+ * - **data** `{object}` - returns state data, including any inherited data that is not
58
+ * overridden by own values (if any).
59
+ * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
60
+ * or `null`.
61
+ * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
62
+ * navigable).
63
+ * - **params** `{object}` - returns an array of state params that are ensured to
64
+ * be a super-set of parent's params.
65
+ * - **views** `{object}` - returns a views object where each key is an absolute view
66
+ * name (i.e. "viewName@stateName") and each value is the config object
67
+ * (template, controller) for the view. Even when you don't use the views object
68
+ * explicitly on a state config, one is still created for you internally.
69
+ * So by decorating this builder function you have access to decorating template
70
+ * and controller properties.
71
+ * - **ownParams** `{object}` - returns an array of params that belong to the state,
72
+ * not including any params defined by ancestor states.
73
+ * - **path** `{string}` - returns the full path from the root down to this state.
74
+ * Needed for state activation.
75
+ * - **includes** `{object}` - returns an object that includes every state that
76
+ * would pass a `$state.includes()` test.
77
+ *
78
+ * #### Example:
79
+ * Override the internal 'views' builder with a function that takes the state
80
+ * definition, and a reference to the internal function being overridden:
81
+ * ```js
82
+ * $stateProvider.decorator('views', function (state, parent) {
83
+ * let result = {},
84
+ * views = parent(state);
85
+ *
86
+ * angular.forEach(views, function (config, name) {
87
+ * let autoName = (state.name + '.' + name).replace('.', '/');
88
+ * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
89
+ * result[name] = config;
90
+ * });
91
+ * return result;
92
+ * });
93
+ *
94
+ * $stateProvider.state('home', {
95
+ * views: {
96
+ * 'contact.list': { controller: 'ListController' },
97
+ * 'contact.item': { controller: 'ItemController' }
98
+ * }
99
+ * });
100
+ * ```
101
+ *
102
+ *
103
+ * ```js
104
+ * // Auto-populates list and item views with /partials/home/contact/list.html,
105
+ * // and /partials/home/contact/item.html, respectively.
106
+ * $state.go('home');
107
+ * ```
108
+ *
109
+ * @param {string} name The name of the builder function to decorate.
110
+ * @param {object} func A function that is responsible for decorating the original
111
+ * builder function. The function receives two parameters:
112
+ *
113
+ * - `{object}` - state - The state config object.
114
+ * - `{object}` - super - The original builder function.
115
+ *
116
+ * @return {object} $stateProvider - $stateProvider instance
117
+ */
118
+ decorator(name: string, func: BuilderFunction): Function | this;
119
+ /**
120
+ * Registers a state
121
+ *
122
+ * ### This is a passthrough to [[StateRegistry.register]].
123
+ *
124
+ * Registers a state configuration under a given state name.
125
+ * The stateConfig object has the following acceptable properties.
126
+ *
127
+ * <a id='template'></a>
128
+ *
129
+ * - **`template`** - {string|function=} - html template as a string or a function that returns
130
+ * an html template as a string which should be used by the uiView directives. This property
131
+ * takes precedence over templateUrl.
132
+ *
133
+ * If `template` is a function, it will be called with the following parameters:
134
+ *
135
+ * - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by
136
+ * applying the current state
137
+ *
138
+ * <a id='templateUrl'></a>
139
+ *
140
+ * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html
141
+ * template that should be used by uiView.
142
+ *
143
+ * If `templateUrl` is a function, it will be called with the following parameters:
144
+ *
145
+ * - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by
146
+ * applying the current state
147
+ *
148
+ * <a id='templateProvider'></a>
149
+ *
150
+ * - **`templateProvider`** - {function=} - Provider function that returns HTML content
151
+ * string.
152
+ *
153
+ * <a id='controller'></a>
154
+ *
155
+ * - **`controller`** - {string|function=} - Controller fn that should be associated with newly
156
+ * related scope or the name of a registered controller if passed as a string.
157
+ *
158
+ * <a id='controllerProvider'></a>
159
+ *
160
+ * - **`controllerProvider`** - {function=} - Injectable provider function that returns
161
+ * the actual controller or string.
162
+ *
163
+ * <a id='controllerAs'></a>
164
+ *
165
+ * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be
166
+ * published to scope under the controllerAs name.
167
+ *
168
+ * <a id='resolve'></a>
169
+ *
170
+ * - **`resolve`** - {object.&lt;string, function&gt;=} - An optional map of dependencies which
171
+ * should be injected into the controller. If any of these dependencies are promises,
172
+ * the router will wait for them all to be resolved or one to be rejected before the
173
+ * controller is instantiated. If all the promises are resolved successfully, the values
174
+ * of the resolved promises are injected and $stateChangeSuccess event is fired. If any
175
+ * of the promises are rejected the $stateChangeError event is fired. The map object is:
176
+ *
177
+ * - key - {string}: name of dependency to be injected into controller
178
+ * - factory - {string|function}: If string then it is alias for service. Otherwise if function,
179
+ * it is injected and return value it treated as dependency. If result is a promise, it is
180
+ * resolved before its value is injected into controller.
181
+ *
182
+ * <a id='url'></a>
183
+ *
184
+ * - **`url`** - {string=} - A url with optional parameters. When a state is navigated or
185
+ * transitioned to, the `$stateParams` service will be populated with any
186
+ * parameters that were passed.
187
+ *
188
+ * <a id='params'></a>
189
+ *
190
+ * - **`params`** - {object=} - An array of parameter names or regular expressions. Only
191
+ * use this within a state if you are not using url. Otherwise you can specify your
192
+ * parameters within the url. When a state is navigated or transitioned to, the
193
+ * $stateParams service will be populated with any parameters that were passed.
194
+ *
195
+ * <a id='views'></a>
196
+ *
197
+ * - **`views`** - {object=} - Use the views property to set up multiple views or to target views
198
+ * manually/explicitly.
199
+ *
200
+ * <a id='abstract'></a>
201
+ *
202
+ * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,
203
+ * but can provide inherited properties to its common children states.
204
+ *
205
+ * <a id='onEnter'></a>
206
+ *
207
+ * - **`onEnter`** - {object=} - Callback function for when a state is entered. Good way
208
+ * to trigger an action or dispatch an event, such as opening a dialog.
209
+ * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
210
+ *
211
+ * <a id='onExit'></a>
212
+ *
213
+ * - **`onExit`** - {object=} - Callback function for when a state is exited. Good way to
214
+ * trigger an action or dispatch an event, such as opening a dialog.
215
+ * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
216
+ *
217
+ * <a id='reloadOnSearch'></a>
218
+ *
219
+ * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state
220
+ * just because a search/query parameter has changed (via $location.search() or $location.hash()).
221
+ * Useful for when you'd like to modify $location.search() without triggering a reload.
222
+ *
223
+ * <a id='data'></a>
224
+ *
225
+ * - **`data`** - {object=} - Arbitrary data object, useful for custom configuration.
226
+ *
227
+ * #### Example:
228
+ * Some state name examples
229
+ * ```js
230
+ * // stateName can be a single top-level name (must be unique).
231
+ * $stateProvider.state("home", {});
232
+ *
233
+ * // Or it can be a nested state name. This state is a child of the
234
+ * // above "home" state.
235
+ * $stateProvider.state("home.newest", {});
236
+ *
237
+ * // Nest states as deeply as needed.
238
+ * $stateProvider.state("home.newest.abc.xyz.inception", {});
239
+ *
240
+ * // state() returns $stateProvider, so you can chain state declarations.
241
+ * $stateProvider
242
+ * .state("home", {})
243
+ * .state("about", {})
244
+ * .state("contacts", {});
245
+ * ```
246
+ *
247
+ * @param {string} name A unique state name, e.g. "home", "about", "contacts".
248
+ * To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
249
+ * @param {object} definition State configuration object.
250
+ */
251
+ state(name: string, definition: Ng1StateDeclaration): StateProvider;
252
+ state(definition: Ng1StateDeclaration): StateProvider;
253
+ /**
254
+ * Registers an invalid state handler
255
+ *
256
+ * This is a passthrough to [[StateService.onInvalid]] for ng1.
257
+ */
258
+ onInvalid(callback: OnInvalidCallback): Function;
254
259
  }
@@ -1,5 +1,5 @@
1
1
  /** @publicapi @module ng1 */ /** */
2
- import { StateObject, TransitionStateHookFn } from './core';
2
+ import { StateObject, TransitionStateHookFn } from "./core";
3
3
  /**
4
4
  * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
5
5
  * `onRetain` callback hooks on a [[Ng1StateDeclaration]].
@@ -9,4 +9,6 @@ import { StateObject, TransitionStateHookFn } from './core';
9
9
  *
10
10
  * @internalapi
11
11
  */
12
- export declare const getStateHookBuilder: (hookName: 'onEnter' | 'onExit' | 'onRetain') => (stateObject: StateObject) => TransitionStateHookFn;
12
+ export declare const getStateHookBuilder: (
13
+ hookName: "onEnter" | "onExit" | "onRetain",
14
+ ) => (stateObject: StateObject) => TransitionStateHookFn;
@@ -1,7 +1,14 @@
1
1
  /** @publicapi @module ng1 */ /** */
2
- import { StateObject, ViewConfig, ViewConfigFactory, PathNode, ResolveContext, IInjectable } from './core';
3
- import { Ng1ViewDeclaration } from '../interface';
4
- import { TemplateFactory } from '../templateFactory';
2
+ import {
3
+ StateObject,
4
+ ViewConfig,
5
+ ViewConfigFactory,
6
+ PathNode,
7
+ ResolveContext,
8
+ IInjectable,
9
+ } from "./core";
10
+ import { Ng1ViewDeclaration } from "../interface";
11
+ import { TemplateFactory } from "../templateFactory";
5
12
  /** @internalapi */
6
13
  export declare function getNg1ViewConfigFactory(): ViewConfigFactory;
7
14
  /**
@@ -16,26 +23,32 @@ export declare function getNg1ViewConfigFactory(): ViewConfigFactory;
16
23
  * @internalapi
17
24
  */
18
25
  export declare function ng1ViewsBuilder(state: StateObject): {
19
- [key: string]: Ng1ViewDeclaration;
26
+ [key: string]: Ng1ViewDeclaration;
20
27
  };
21
28
  /** @internalapi */
22
29
  export declare class Ng1ViewConfig implements ViewConfig {
23
- path: PathNode[];
24
- viewDecl: Ng1ViewDeclaration;
25
- factory: TemplateFactory;
26
- $id: number;
27
- loaded: boolean;
28
- controller: Function;
29
- template: string;
30
- component: string;
31
- locals: any;
32
- constructor(path: PathNode[], viewDecl: Ng1ViewDeclaration, factory: TemplateFactory);
33
- load(): Promise<this>;
34
- getTemplate: (uiView: any, context: ResolveContext) => string;
35
- /**
36
- * Gets the controller for a view configuration.
37
- *
38
- * @returns {Function|Promise.<Function>} Returns a controller, or a promise that resolves to a controller.
39
- */
40
- getController(context: ResolveContext): IInjectable | string | Promise<IInjectable | string>;
30
+ path: PathNode[];
31
+ viewDecl: Ng1ViewDeclaration;
32
+ factory: TemplateFactory;
33
+ $id: number;
34
+ loaded: boolean;
35
+ controller: Function;
36
+ template: string;
37
+ component: string;
38
+ locals: any;
39
+ constructor(
40
+ path: PathNode[],
41
+ viewDecl: Ng1ViewDeclaration,
42
+ factory: TemplateFactory,
43
+ );
44
+ load(): Promise<this>;
45
+ getTemplate: (uiView: any, context: ResolveContext) => string;
46
+ /**
47
+ * Gets the controller for a view configuration.
48
+ *
49
+ * @returns {Function|Promise.<Function>} Returns a controller, or a promise that resolves to a controller.
50
+ */
51
+ getController(
52
+ context: ResolveContext,
53
+ ): IInjectable | string | Promise<IInjectable | string>;
41
54
  }