@angular-wave/angular.ts 0.0.16 → 0.0.17

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 (298) hide show
  1. package/README.md +5 -3
  2. package/dist/angular-ts.esm.js +1 -1
  3. package/dist/angular-ts.umd.js +1 -1
  4. package/index.html +66 -57
  5. package/package.json +1 -1
  6. package/rollup.config.js +2 -6
  7. package/src/animations/animate-children-directive.js +1 -1
  8. package/src/animations/animate-css-driver.js +1 -1
  9. package/src/animations/animate-css.js +220 -15
  10. package/src/animations/animate-js-driver.js +1 -1
  11. package/src/animations/animate-js.js +2 -2
  12. package/src/animations/animate-queue.js +3 -4
  13. package/src/animations/animation.js +1 -1
  14. package/src/animations/module.js +750 -0
  15. package/src/animations/shared.js +15 -4
  16. package/src/core/animate-runner.js +1 -1
  17. package/src/core/animate.js +4 -5
  18. package/src/core/compile.js +6 -7
  19. package/src/core/controller.js +4 -3
  20. package/src/core/filter.js +1 -1
  21. package/src/core/interpolate.js +1 -1
  22. package/src/core/interval-factory.js +1 -1
  23. package/src/core/interval.js +1 -1
  24. package/src/core/location.js +1 -1
  25. package/src/core/parser/parse.js +1 -1
  26. package/src/core/q.js +2 -3
  27. package/src/core/root-scope.js +1 -1
  28. package/src/core/sanitize-uri.js +1 -1
  29. package/src/core/sce.js +1 -1
  30. package/src/core/task-tracker-factory.js +1 -1
  31. package/src/core/timeout.js +1 -1
  32. package/src/core/urlUtils.js +1 -1
  33. package/src/directive/attrs.js +1 -1
  34. package/src/directive/bind.js +1 -1
  35. package/src/directive/class.js +2 -2
  36. package/src/directive/events.js +1 -1
  37. package/src/directive/form.js +1 -1
  38. package/src/directive/include.js +1 -1
  39. package/src/directive/input.js +1 -1
  40. package/src/directive/list.js +2 -2
  41. package/src/directive/model-options.js +1 -1
  42. package/src/directive/model.js +1 -1
  43. package/src/directive/options.js +2 -3
  44. package/src/directive/ref.js +1 -1
  45. package/src/directive/repeat.js +1 -1
  46. package/src/directive/select.js +1 -1
  47. package/src/directive/switch.js +1 -1
  48. package/src/directive/transclude.js +1 -1
  49. package/src/directive/validators.js +1 -1
  50. package/src/exts/aria.js +1 -1
  51. package/src/exts/messages.js +3 -3
  52. package/src/exts/messages.md +28 -31
  53. package/src/filters/filter.js +2 -3
  54. package/src/filters/filters.js +1 -1
  55. package/src/filters/limit-to.js +1 -1
  56. package/src/filters/order-by.js +2 -3
  57. package/src/injector.js +8 -9
  58. package/src/jqLite.js +3 -4
  59. package/src/loader.js +1 -3
  60. package/src/public.js +1 -1
  61. package/src/router/common/coreservices.js +5 -0
  62. package/src/router/{core/common → common}/queue.js +1 -1
  63. package/src/router/{core/common → common}/trace.js +21 -19
  64. package/src/router/{adapter/directives → directives}/stateDirectives.js +24 -28
  65. package/src/router/{adapter/directives → directives}/viewDirective.js +10 -9
  66. package/src/router/{core/globals.js → globals.js} +13 -3
  67. package/src/router/{core/hooks → hooks}/coreResolvables.js +6 -4
  68. package/src/router/{core/hooks → hooks}/lazyLoad.js +5 -2
  69. package/src/router/{core/hooks → hooks}/redirectTo.js +1 -1
  70. package/src/router/{core/hooks → hooks}/resolve.js +5 -4
  71. package/src/router/{core/hooks → hooks}/updateGlobals.js +1 -1
  72. package/src/router/{core/hooks → hooks}/views.js +2 -3
  73. package/src/router/index.js +60 -0
  74. package/src/router/{adapter/injectables.js → injectables.js} +9 -9
  75. package/src/router/{adapter/locationServices.js → locationServices.js} +19 -12
  76. package/src/router/{core/params → params}/param.js +5 -10
  77. package/src/router/{core/params → params}/paramType.js +4 -4
  78. package/src/router/{core/params → params}/paramTypes.js +4 -3
  79. package/src/router/{core/params → params}/stateParams.js +1 -1
  80. package/src/router/{core/path → path}/pathNode.js +2 -2
  81. package/src/router/{core/path → path}/pathUtils.js +13 -7
  82. package/src/router/{core/resolve → resolve}/resolvable.js +5 -5
  83. package/src/router/{core/resolve → resolve}/resolveContext.js +16 -6
  84. package/src/router/router.js +171 -72
  85. package/src/router/{adapter/services.js → services.js} +47 -27
  86. package/src/router/{core/state → state}/stateBuilder.js +14 -10
  87. package/src/router/{core/state → state}/stateMatcher.js +2 -3
  88. package/src/router/{core/state → state}/stateObject.js +8 -6
  89. package/src/router/{core/state → state}/stateQueueManager.js +3 -3
  90. package/src/router/{core/state → state}/stateRegistry.js +6 -7
  91. package/src/router/{core/state → state}/stateService.js +12 -15
  92. package/src/router/{core/state → state}/targetState.js +2 -2
  93. package/src/router/{adapter/statebuilders → state}/views.js +17 -15
  94. package/src/router/{adapter/stateProvider.js → stateProvider.js} +52 -9
  95. package/src/router/{adapter/templateFactory.js → templateFactory.js} +10 -19
  96. package/src/router/{core/transition → transition}/hookBuilder.js +4 -3
  97. package/src/router/{core/transition → transition}/hookRegistry.js +3 -6
  98. package/src/router/{core/transition → transition}/rejectFactory.js +4 -5
  99. package/src/router/{core/transition → transition}/transition.js +10 -12
  100. package/src/router/{core/transition → transition}/transitionHook.js +4 -4
  101. package/src/router/{core/transition → transition}/transitionService.js +13 -13
  102. package/src/router/{core/url → url}/urlConfig.js +28 -19
  103. package/src/router/{core/url → url}/urlMatcher.js +14 -16
  104. package/src/router/{core/url → url}/urlMatcherFactory.js +7 -6
  105. package/src/router/{core/url → url}/urlRouter.js +6 -30
  106. package/src/router/{core/url → url}/urlRule.js +3 -3
  107. package/src/router/{core/url → url}/urlRules.js +10 -11
  108. package/src/router/{core/url → url}/urlService.js +12 -6
  109. package/src/router/{core/view → view}/view.js +32 -27
  110. package/src/router/{adapter/viewScroll.js → viewScroll.js} +3 -0
  111. package/src/services/anchor-scroll.js +1 -1
  112. package/src/services/browser.js +1 -1
  113. package/src/services/cache-factory.js +7 -1
  114. package/src/services/cookie-reader.js +1 -1
  115. package/src/services/http-backend.js +6 -1
  116. package/src/services/http.js +4 -5
  117. package/src/services/log.js +1 -1
  118. package/src/services/template-request.js +2 -2
  119. package/src/{router/core/common → shared}/common.js +35 -16
  120. package/src/{router/core/common → shared}/predicates.js +2 -12
  121. package/src/{router/core/common → shared}/strings.js +5 -13
  122. package/src/{core → shared}/utils.js +13 -29
  123. package/test/angular.spec.js +1 -31
  124. package/test/{ng → core}/animate.spec.js +1 -1
  125. package/test/{ng → core}/compile.spec.js +2 -3
  126. package/test/{ng → core}/http.spec.js +2 -2
  127. package/test/{ng → core}/on.spec.js +1 -1
  128. package/test/{ng → core}/parse.spec.js +1 -1
  129. package/test/{ng → core}/prop.spec.js +1 -1
  130. package/test/{ng → core}/scope.spec.js +1 -1
  131. package/test/{ng/directive → directive}/a.spec.js +4 -4
  132. package/test/{ng/directive → directive}/bind.spec.js +3 -3
  133. package/test/{ng/directive → directive}/boolean.spec.js +2 -2
  134. package/test/{ng/directive → directive}/change.spec.js +3 -3
  135. package/test/{ng/directive → directive}/class.spec.js +4 -4
  136. package/test/{ng/directive → directive}/click.spec.js +3 -3
  137. package/test/{ng/directive → directive}/cloak.spec.js +4 -4
  138. package/test/{ng/directive → directive}/constoller.spec.js +5 -5
  139. package/test/{ng/directive → directive}/element-style.spec.js +3 -3
  140. package/test/{ng/directive → directive}/event.spec.js +4 -4
  141. package/test/{ng/directive → directive}/form.spec.js +5 -5
  142. package/test/{ng/directive → directive}/href.spec.js +4 -4
  143. package/test/{ng/directive → directive}/if.spec.js +5 -5
  144. package/test/{ng/directive → directive}/include.spec.js +5 -5
  145. package/test/{ng/directive → directive}/init.spec.js +4 -4
  146. package/test/{ng/directive → directive}/input.spec.js +5 -5
  147. package/test/{ng/directive → directive}/list.spec.js +3 -3
  148. package/test/{ng/directive → directive}/model-options.spec.js +6 -6
  149. package/test/{ng/directive → directive}/model.spec.js +8 -8
  150. package/test/{ng/directive → directive}/non-bindable.spec.js +3 -3
  151. package/test/{ng/directive → directive}/options.spec.js +5 -5
  152. package/test/{ng/directive → directive}/ref.spec.js +2 -2
  153. package/test/{ng/directive → directive}/repeat.spec.js +5 -5
  154. package/test/{ng/directive → directive}/script.spec.js +3 -3
  155. package/test/{ng/directive → directive}/scrset.spec.js +3 -3
  156. package/test/{ng/directive → directive}/select.spec.js +5 -5
  157. package/test/{ng/directive → directive}/show-hide.spec.js +3 -3
  158. package/test/{ng/directive → directive}/src.spec.js +3 -3
  159. package/test/{ng/directive → directive}/style.spec.js +3 -3
  160. package/test/{ng/directive → directive}/switch.spec.js +3 -3
  161. package/test/{ng/directive → directive}/validators.spec.js +3 -3
  162. package/test/{ng/filter → filter}/filter.spec.js +4 -4
  163. package/test/{ng/filter → filter}/filters.spec.js +3 -3
  164. package/test/{ng/filter → filter}/limit-to.spec.js +3 -3
  165. package/test/{ng/filter → filter}/order-by.spec.js +2 -2
  166. package/test/injector.spec.js +1 -1
  167. package/test/jqlite.spec.js +1 -1
  168. package/test/messages/messages.spec.js +1 -1
  169. package/test/min-err.spec.js +1 -1
  170. package/test/original-test.html +4 -4
  171. package/test/router/glob.spec.js +78 -0
  172. package/test/router/state.spec.js +931 -0
  173. package/test/sanitize/bing-html.spec.js +1 -1
  174. package/test/shared/common.spec.js +283 -0
  175. package/test/shared/hof.spec.js +60 -0
  176. package/test/shared/strings.spec.js +40 -0
  177. package/test/{ng → shared}/utils.spec.js +1 -1
  178. package/types/router/angular.d.ts +1 -0
  179. package/types/router/core/common/common.d.ts +370 -0
  180. package/types/router/core/common/coreservices.d.ts +80 -0
  181. package/types/router/core/common/glob.d.ts +60 -0
  182. package/types/router/core/common/hof.d.ts +160 -0
  183. package/types/router/core/common/index.d.ts +8 -0
  184. package/types/router/core/common/predicates.d.ts +25 -0
  185. package/types/router/core/common/queue.d.ts +15 -0
  186. package/types/router/core/common/safeConsole.d.ts +5 -0
  187. package/types/router/core/common/strings.d.ts +64 -0
  188. package/types/router/core/common/trace.d.ts +114 -0
  189. package/types/router/core/globals.d.ts +45 -0
  190. package/types/router/core/hooks/coreResolvables.d.ts +4 -0
  191. package/types/router/core/hooks/ignoredTransition.d.ts +2 -0
  192. package/types/router/core/hooks/invalidTransition.d.ts +2 -0
  193. package/types/router/core/hooks/lazyLoad.d.ts +12 -0
  194. package/types/router/core/hooks/onEnterExitRetain.d.ts +4 -0
  195. package/types/router/core/hooks/redirectTo.d.ts +2 -0
  196. package/types/router/core/hooks/resolve.d.ts +5 -0
  197. package/types/router/core/hooks/updateGlobals.d.ts +2 -0
  198. package/types/router/core/hooks/url.d.ts +2 -0
  199. package/types/router/core/hooks/views.d.ts +3 -0
  200. package/types/router/core/index.d.ts +12 -0
  201. package/types/router/core/interface.d.ts +102 -0
  202. package/types/router/core/params/index.d.ts +12 -0
  203. package/types/router/core/params/interface.d.ts +606 -0
  204. package/types/router/core/params/param.d.ts +65 -0
  205. package/types/router/core/params/paramType.d.ts +65 -0
  206. package/types/router/core/params/paramTypes.d.ts +190 -0
  207. package/types/router/core/params/stateParams.d.ts +15 -0
  208. package/types/router/core/path/index.d.ts +2 -0
  209. package/types/router/core/path/pathNode.d.ts +60 -0
  210. package/types/router/core/path/pathUtils.d.ts +79 -0
  211. package/types/router/core/resolve/index.d.ts +3 -0
  212. package/types/router/core/resolve/interface.d.ts +210 -0
  213. package/types/router/core/resolve/resolvable.d.ts +69 -0
  214. package/types/router/core/resolve/resolveContext.d.ts +92 -0
  215. package/types/router/core/router.d.ts +95 -0
  216. package/types/router/core/state/index.d.ts +28 -0
  217. package/types/router/core/state/interface.d.ts +708 -0
  218. package/types/router/core/state/stateBuilder.d.ts +104 -0
  219. package/types/router/core/state/stateMatcher.d.ts +11 -0
  220. package/types/router/core/state/stateObject.d.ts +155 -0
  221. package/types/router/core/state/stateQueueManager.d.ts +24 -0
  222. package/types/router/core/state/stateRegistry.d.ts +136 -0
  223. package/types/router/core/state/stateService.d.ts +350 -0
  224. package/types/router/core/state/targetState.d.ts +100 -0
  225. package/types/router/core/transition/hookBuilder.d.ts +45 -0
  226. package/types/router/core/transition/hookRegistry.d.ts +93 -0
  227. package/types/router/core/transition/index.d.ts +20 -0
  228. package/types/router/core/transition/interface.d.ts +819 -0
  229. package/types/router/core/transition/rejectFactory.d.ts +103 -0
  230. package/types/router/core/transition/transition.d.ts +527 -0
  231. package/types/router/core/transition/transitionEventType.d.ts +17 -0
  232. package/types/router/core/transition/transitionHook.d.ts +88 -0
  233. package/types/router/core/transition/transitionService.d.ts +187 -0
  234. package/types/router/core/url/index.d.ts +8 -0
  235. package/types/router/core/url/interface.d.ts +156 -0
  236. package/types/router/core/url/urlConfig.d.ts +141 -0
  237. package/types/router/core/url/urlMatcher.d.ts +180 -0
  238. package/types/router/core/url/urlMatcherFactory.d.ts +52 -0
  239. package/types/router/core/url/urlRouter.d.ts +85 -0
  240. package/types/router/core/url/urlRule.d.ts +120 -0
  241. package/types/router/core/url/urlRules.d.ts +244 -0
  242. package/types/router/core/url/urlService.d.ts +206 -0
  243. package/types/router/core/vanilla.d.ts +1 -0
  244. package/types/router/core/view/index.d.ts +2 -0
  245. package/types/router/core/view/interface.d.ts +46 -0
  246. package/types/router/core/view/view.d.ts +167 -0
  247. package/types/router/directives/stateDirectives.d.ts +3 -0
  248. package/types/router/directives/viewDirective.d.ts +143 -0
  249. package/types/router/index.d.ts +19 -0
  250. package/types/router/interface.d.ts +491 -0
  251. package/types/router/legacy/resolveService.d.ts +44 -0
  252. package/types/router/legacy/stateEvents.d.ts +123 -0
  253. package/types/router/locationServices.d.ts +43 -0
  254. package/types/router/services.d.ts +15 -0
  255. package/types/router/stateFilters.d.ts +11 -0
  256. package/types/router/stateProvider.d.ts +254 -0
  257. package/types/router/statebuilders/onEnterExitRetain.d.ts +12 -0
  258. package/types/router/statebuilders/views.d.ts +41 -0
  259. package/types/router/templateFactory.d.ts +84 -0
  260. package/types/router/viewScroll.d.ts +9 -0
  261. package/src/animations/animate.css.md +0 -263
  262. package/src/animations/animate.md +0 -933
  263. package/src/router/adapter/statebuilders/onEnterExitRetain.js +0 -29
  264. package/src/router/core/common/coreservices.js +0 -15
  265. package/src/router/core/common/safeConsole.js +0 -37
  266. package/src/router/core/interface.js +0 -3
  267. package/src/router/core/resolve/interface.js +0 -10
  268. package/src/router/core/router.js +0 -203
  269. package/src/router/core/url/interface.js +0 -1
  270. package/src/router/core/view/interface.js +0 -1
  271. /package/src/router/{core/common → common}/glob.js +0 -0
  272. /package/src/router/{core/hooks → hooks}/ignoredTransition.js +0 -0
  273. /package/src/router/{core/hooks → hooks}/invalidTransition.js +0 -0
  274. /package/src/router/{core/hooks → hooks}/onEnterExitRetain.js +0 -0
  275. /package/src/router/{core/hooks → hooks}/url.js +0 -0
  276. /package/src/router/{core/params → params}/README.md +0 -0
  277. /package/src/router/{core/state → state}/README.md +0 -0
  278. /package/src/router/{adapter/stateFilters.js → stateFilters.js} +0 -0
  279. /package/src/router/{core/transition → transition}/interface.js +0 -0
  280. /package/src/router/{core/transition → transition}/transitionEventType.js +0 -0
  281. /package/src/{router/core/common → shared}/hof.js +0 -0
  282. /package/test/{ng → core}/cache-factor.spec.js +0 -0
  283. /package/test/{ng → core}/controller-provider.spec.js +0 -0
  284. /package/test/{ng → core}/cookie-reader.spec.js +0 -0
  285. /package/test/{ng → core}/document.spec.js +0 -0
  286. /package/test/{ng → core}/filter.spec.js +0 -0
  287. /package/test/{ng → core}/http-backend.spec.js +0 -0
  288. /package/test/{ng → core}/interpolate.spec.js +0 -0
  289. /package/test/{ng → core}/interval.spec.js +0 -0
  290. /package/test/{ng → core}/location.spec.js +0 -0
  291. /package/test/{ng → core}/q.spec.js +0 -0
  292. /package/test/{ng → core}/root-element.spec.js +0 -0
  293. /package/test/{ng → core}/sanitize-uri.spec.js +0 -0
  294. /package/test/{ng → core}/sce.spec.js +0 -0
  295. /package/test/{ng → core}/template-request.spec.js +0 -0
  296. /package/test/{ng → core}/timeout.spec.js +0 -0
  297. /package/test/{ng → core}/url-utils.spec.js +0 -0
  298. /package/{src/router/adapter/interface.js → types/router/injectables.d.ts} +0 -0
@@ -0,0 +1,15 @@
1
+ import { IRootScopeService } from '../';
2
+ import { ResolveContext, TypedMap } from './core';
3
+ import { StateProvider } from './stateProvider';
4
+ declare module './core/lib/router' {
5
+ interface UIRouter {
6
+ /** @hidden */
7
+ stateProvider: StateProvider;
8
+ }
9
+ }
10
+ export declare function watchDigests($rootScope: IRootScopeService): void;
11
+ export declare namespace watchDigests {
12
+ var $inject: string[];
13
+ }
14
+ /** @hidden TODO: find a place to move this */
15
+ export declare const getLocals: (ctx: ResolveContext) => TypedMap<any>;
@@ -0,0 +1,11 @@
1
+ /** @publicapi @module ng1 */ /** */
2
+ import { StateService } from './core';
3
+ declare function $IsStateFilter($state: StateService): any;
4
+ declare namespace $IsStateFilter {
5
+ var $inject: string[];
6
+ }
7
+ declare function $IncludedByStateFilter($state: StateService): any;
8
+ declare namespace $IncludedByStateFilter {
9
+ var $inject: string[];
10
+ }
11
+ export { $IsStateFilter, $IncludedByStateFilter };
@@ -0,0 +1,254 @@
1
+ /** @publicapi @module ng1 */ /** */
2
+ import { BuilderFunction, StateRegistry, StateService, OnInvalidCallback } from './core';
3
+ import { Ng1StateDeclaration } from './interface';
4
+ /**
5
+ * The Angular 1 `StateProvider`
6
+ *
7
+ * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely
8
+ * on state.
9
+ *
10
+ * A state corresponds to a "place" in the application in terms of the overall UI and
11
+ * navigation. A state describes (via the controller / template / view properties) what
12
+ * the UI looks like and does at that place.
13
+ *
14
+ * States often have things in common, and the primary way of factoring out these
15
+ * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
16
+ * nested states.
17
+ *
18
+ * The `$stateProvider` provides interfaces to declare these states for your app.
19
+ */
20
+ 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;
254
+ }
@@ -0,0 +1,12 @@
1
+ /** @publicapi @module ng1 */ /** */
2
+ import { StateObject, TransitionStateHookFn } from './core';
3
+ /**
4
+ * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
5
+ * `onRetain` callback hooks on a [[Ng1StateDeclaration]].
6
+ *
7
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
8
+ * ensures that those hooks are injectable for @uirouter/angularjs (ng1).
9
+ *
10
+ * @internalapi
11
+ */
12
+ export declare const getStateHookBuilder: (hookName: 'onEnter' | 'onExit' | 'onRetain') => (stateObject: StateObject) => TransitionStateHookFn;
@@ -0,0 +1,41 @@
1
+ /** @publicapi @module ng1 */ /** */
2
+ import { StateObject, ViewConfig, ViewConfigFactory, PathNode, ResolveContext, IInjectable } from './core';
3
+ import { Ng1ViewDeclaration } from '../interface';
4
+ import { TemplateFactory } from '../templateFactory';
5
+ /** @internalapi */
6
+ export declare function getNg1ViewConfigFactory(): ViewConfigFactory;
7
+ /**
8
+ * This is a [[StateBuilder.builder]] function for angular1 `views`.
9
+ *
10
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
11
+ * handles the `views` property with logic specific to @uirouter/angularjs (ng1).
12
+ *
13
+ * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object
14
+ * and applies the state-level configuration to a view named `$default`.
15
+ *
16
+ * @internalapi
17
+ */
18
+ export declare function ng1ViewsBuilder(state: StateObject): {
19
+ [key: string]: Ng1ViewDeclaration;
20
+ };
21
+ /** @internalapi */
22
+ 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>;
41
+ }
@@ -0,0 +1,84 @@
1
+ import { IAugmentedJQuery } from '../';
2
+ import { IInjectable, ResolveContext, RawParams } from './core';
3
+ import { Ng1ViewDeclaration, TemplateFactoryProvider } from './interface';
4
+ /**
5
+ * Service which manages loading of templates from a ViewConfig.
6
+ */
7
+ export declare class TemplateFactory implements TemplateFactoryProvider {
8
+ /** @hidden */ private _useHttp;
9
+ /** @hidden */ private $templateRequest;
10
+ /** @hidden */ private $templateCache;
11
+ /** @hidden */ private $http;
12
+ /** @hidden */ $get: (string | (($http: any, $templateCache: any, $injector: any) => this))[];
13
+ /** @hidden */
14
+ useHttpService(value: boolean): void;
15
+ /**
16
+ * Creates a template from a configuration object.
17
+ *
18
+ * @param config Configuration object for which to load a template.
19
+ * The following properties are search in the specified order, and the first one
20
+ * that is defined is used to create the template:
21
+ *
22
+ * @param params Parameters to pass to the template function.
23
+ * @param context The resolve context associated with the template's view
24
+ *
25
+ * @return {string|object} The template html as a string, or a promise for
26
+ * that string,or `null` if no template is configured.
27
+ */
28
+ fromConfig(config: Ng1ViewDeclaration, params: any, context: ResolveContext): Promise<{
29
+ template?: string;
30
+ component?: string;
31
+ }>;
32
+ /**
33
+ * Creates a template from a string or a function returning a string.
34
+ *
35
+ * @param template html template as a string or function that returns an html template as a string.
36
+ * @param params Parameters to pass to the template function.
37
+ *
38
+ * @return {string|object} The template html as a string, or a promise for that
39
+ * string.
40
+ */
41
+ fromString(template: string | Function, params?: RawParams): any;
42
+ /**
43
+ * Loads a template from the a URL via `$http` and `$templateCache`.
44
+ *
45
+ * @param {string|Function} url url of the template to load, or a function
46
+ * that returns a url.
47
+ * @param {Object} params Parameters to pass to the url function.
48
+ * @return {string|Promise.<string>} The template html as a string, or a promise
49
+ * for that string.
50
+ */
51
+ fromUrl(url: string | Function, params: any): any;
52
+ /**
53
+ * Creates a template by invoking an injectable provider function.
54
+ *
55
+ * @param provider Function to invoke via `locals`
56
+ * @param {Function} injectFn a function used to invoke the template provider
57
+ * @return {string|Promise.<string>} The template html as a string, or a promise
58
+ * for that string.
59
+ */
60
+ fromProvider(provider: IInjectable, params: any, context: ResolveContext): Promise<any>;
61
+ /**
62
+ * Creates a component's template by invoking an injectable provider function.
63
+ *
64
+ * @param provider Function to invoke via `locals`
65
+ * @param {Function} injectFn a function used to invoke the template provider
66
+ * @return {string} The template html as a string: "<component-name input1='::$resolve.foo'></component-name>".
67
+ */
68
+ fromComponentProvider(provider: IInjectable, params: any, context: ResolveContext): Promise<any>;
69
+ /**
70
+ * Creates a template from a component's name
71
+ *
72
+ * This implements route-to-component.
73
+ * It works by retrieving the component (directive) metadata from the injector.
74
+ * It analyses the component's bindings, then constructs a template that instantiates the component.
75
+ * The template wires input and output bindings to resolves or from the parent component.
76
+ *
77
+ * @param uiView {object} The parent ui-view (for binding outputs to callbacks)
78
+ * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)
79
+ * @param component {string} Component's name in camel case.
80
+ * @param bindings An object defining the component's bindings: {foo: '<'}
81
+ * @return {string} The template as a string: "<component-name input1='::$resolve.foo'></component-name>".
82
+ */
83
+ makeComponentTemplate(uiView: IAugmentedJQuery, context: ResolveContext, component: string, bindings?: any): string;
84
+ }
@@ -0,0 +1,9 @@
1
+ export interface UIViewScrollProvider {
2
+ /**
3
+ * Uses standard anchorScroll behavior
4
+ *
5
+ * Reverts [[$uiViewScroll]] back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
6
+ * service for scrolling based on the url anchor.
7
+ */
8
+ useAnchorScroll(): void;
9
+ }