@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,25 @@
1
+ import { Predicate } from './common';
2
+ export declare const isUndefined: (x: any) => boolean;
3
+ export declare const isDefined: Predicate<any>;
4
+ export declare const isNull: (o: any) => boolean;
5
+ export declare const isNullOrUndefined: Predicate<any>;
6
+ export declare const isFunction: (x: any) => x is Function;
7
+ export declare const isNumber: (x: any) => x is number;
8
+ export declare const isString: (x: any) => x is string;
9
+ export declare const isObject: (x: any) => boolean;
10
+ export declare const isArray: (arg: any) => arg is any[];
11
+ export declare const isDate: (x: any) => x is Date;
12
+ export declare const isRegExp: (x: any) => x is RegExp;
13
+ /**
14
+ * Predicate which checks if a value is injectable
15
+ *
16
+ * A value is "injectable" if it is a function, or if it is an ng1 array-notation-style array
17
+ * where all the elements in the array are Strings, except the last one, which is a Function
18
+ */
19
+ export declare function isInjectable(val: any): boolean;
20
+ /**
21
+ * Predicate which checks if a value looks like a Promise
22
+ *
23
+ * It is probably a Promise if it's an object, and it has a `then` property which is a Function
24
+ */
25
+ export declare const isPromise: (x: any) => x is Promise<any>;
@@ -0,0 +1,15 @@
1
+ export declare class Queue<T> {
2
+ private _items;
3
+ private _limit;
4
+ private _evictListeners;
5
+ onEvict: (val: (item: T) => void) => (item: T) => void;
6
+ constructor(_items?: T[], _limit?: number);
7
+ enqueue(item: T): T;
8
+ evict(): T;
9
+ dequeue(): T;
10
+ clear(): Array<T>;
11
+ size(): number;
12
+ remove(item: T): T;
13
+ peekTail(): T;
14
+ peekHead(): T;
15
+ }
@@ -0,0 +1,5 @@
1
+ export declare const safeConsole: {
2
+ log: any;
3
+ error: any;
4
+ table: any;
5
+ };
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Functions that manipulate strings
3
+ *
4
+ * Although these functions are exported, they are subject to change without notice.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ import { IInjectable } from './common';
9
+ /**
10
+ * Returns a string shortened to a maximum length
11
+ *
12
+ * If the string is already less than the `max` length, return the string.
13
+ * Else return the string, shortened to `max - 3` and append three dots ("...").
14
+ *
15
+ * @param max the maximum length of the string to return
16
+ * @param str the input string
17
+ */
18
+ export declare function maxLength(max: number, str: string): string;
19
+ /**
20
+ * Returns a string, with spaces added to the end, up to a desired str length
21
+ *
22
+ * If the string is already longer than the desired length, return the string.
23
+ * Else returns the string, with extra spaces on the end, such that it reaches `length` characters.
24
+ *
25
+ * @param length the desired length of the string to return
26
+ * @param str the input string
27
+ */
28
+ export declare function padString(length: number, str: string): string;
29
+ export declare function kebobString(camelCase: string): string;
30
+ export declare function functionToString(fn: Function): any;
31
+ export declare function fnToString(fn: IInjectable): any;
32
+ export declare function stringify(o: any): string;
33
+ /** Returns a function that splits a string on a character or substring */
34
+ export declare const beforeAfterSubstr: (char: string) => (str: string) => string[];
35
+ export declare const hostRegex: RegExp;
36
+ export declare const stripLastPathElement: (str: string) => string;
37
+ export declare const splitHash: (str: string) => string[];
38
+ export declare const splitQuery: (str: string) => string[];
39
+ export declare const splitEqual: (str: string) => string[];
40
+ export declare const trimHashVal: (str: string) => string;
41
+ /**
42
+ * Splits on a delimiter, but returns the delimiters in the array
43
+ *
44
+ * #### Example:
45
+ * ```js
46
+ * var splitOnSlashes = splitOnDelim('/');
47
+ * splitOnSlashes("/foo"); // ["/", "foo"]
48
+ * splitOnSlashes("/foo/"); // ["/", "foo", "/"]
49
+ * ```
50
+ */
51
+ export declare function splitOnDelim(delim: string): (str: string) => string[];
52
+ /**
53
+ * Reduce fn that joins neighboring strings
54
+ *
55
+ * Given an array of strings, returns a new array
56
+ * where all neighboring strings have been joined.
57
+ *
58
+ * #### Example:
59
+ * ```js
60
+ * let arr = ["foo", "bar", 1, "baz", "", "qux" ];
61
+ * arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ]
62
+ * ```
63
+ */
64
+ export declare function joinNeighborsR(acc: any[], x: any): any[];
@@ -0,0 +1,114 @@
1
+ import { Transition } from '../transition/transition';
2
+ import { ViewTuple } from '../view';
3
+ import { ActiveUIView, ViewConfig, ViewContext } from '../view/interface';
4
+ import { Resolvable } from '../resolve/resolvable';
5
+ import { PathNode } from '../path/pathNode';
6
+ import { PolicyWhen } from '../resolve/interface';
7
+ import { TransitionHook } from '../transition/transitionHook';
8
+ import { HookResult } from '../transition/interface';
9
+ import { StateObject } from '../state/stateObject';
10
+ /**
11
+ * Trace categories Enum
12
+ *
13
+ * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]]
14
+ *
15
+ * `trace.enable(Category.TRANSITION)`
16
+ *
17
+ * These can also be provided using a matching string, or position ordinal
18
+ *
19
+ * `trace.enable("TRANSITION")`
20
+ *
21
+ * `trace.enable(1)`
22
+ */
23
+ declare enum Category {
24
+ RESOLVE = 0,
25
+ TRANSITION = 1,
26
+ HOOK = 2,
27
+ UIVIEW = 3,
28
+ VIEWCONFIG = 4
29
+ }
30
+ export { Category };
31
+ /**
32
+ * Prints UI-Router Transition trace information to the console.
33
+ */
34
+ export declare class Trace {
35
+ /** @internal */
36
+ approximateDigests: number;
37
+ /** @internal */
38
+ private _enabled;
39
+ /** @internal */
40
+ constructor();
41
+ /** @internal */
42
+ private _set;
43
+ /**
44
+ * Enables a trace [[Category]]
45
+ *
46
+ * ```js
47
+ * trace.enable("TRANSITION");
48
+ * ```
49
+ *
50
+ * @param categories categories to enable. If `categories` is omitted, all categories are enabled.
51
+ * Also takes strings (category name) or ordinal (category position)
52
+ */
53
+ enable(...categories: (Category | string | number)[]): any;
54
+ /**
55
+ * Disables a trace [[Category]]
56
+ *
57
+ * ```js
58
+ * trace.disable("VIEWCONFIG");
59
+ * ```
60
+ *
61
+ * @param categories categories to disable. If `categories` is omitted, all categories are disabled.
62
+ * Also takes strings (category name) or ordinal (category position)
63
+ */
64
+ disable(...categories: (Category | string | number)[]): any;
65
+ /**
66
+ * Retrieves the enabled stateus of a [[Category]]
67
+ *
68
+ * ```js
69
+ * trace.enabled("VIEWCONFIG"); // true or false
70
+ * ```
71
+ *
72
+ * @returns boolean true if the category is enabled
73
+ */
74
+ enabled(category: Category | string | number): boolean;
75
+ /** @internal called by ui-router code */
76
+ traceTransitionStart(trans: Transition): void;
77
+ /** @internal called by ui-router code */
78
+ traceTransitionIgnored(trans: Transition): void;
79
+ /** @internal called by ui-router code */
80
+ traceHookInvocation(step: TransitionHook, trans: Transition, options: any): void;
81
+ /** @internal called by ui-router code */
82
+ traceHookResult(hookResult: HookResult, trans: Transition, transitionOptions: any): void;
83
+ /** @internal called by ui-router code */
84
+ traceResolvePath(path: PathNode[], when: PolicyWhen, trans?: Transition): void;
85
+ /** @internal called by ui-router code */
86
+ traceResolvableResolved(resolvable: Resolvable, trans?: Transition): void;
87
+ /** @internal called by ui-router code */
88
+ traceError(reason: any, trans: Transition): void;
89
+ /** @internal called by ui-router code */
90
+ traceSuccess(finalState: StateObject, trans: Transition): void;
91
+ /** @internal called by ui-router code */
92
+ traceUIViewEvent(event: string, viewData: ActiveUIView, extra?: string): void;
93
+ /** @internal called by ui-router code */
94
+ traceUIViewConfigUpdated(viewData: ActiveUIView, context: ViewContext): void;
95
+ /** @internal called by ui-router code */
96
+ traceUIViewFill(viewData: ActiveUIView, html: string): void;
97
+ /** @internal called by ui-router code */
98
+ traceViewSync(pairs: ViewTuple[]): void;
99
+ /** @internal called by ui-router code */
100
+ traceViewServiceEvent(event: string, viewConfig: ViewConfig): void;
101
+ /** @internal called by ui-router code */
102
+ traceViewServiceUIViewEvent(event: string, viewData: ActiveUIView): void;
103
+ }
104
+ /**
105
+ * The [[Trace]] singleton
106
+ *
107
+ * #### Example:
108
+ * ```js
109
+ * import {trace} from "@uirouter/core";
110
+ * trace.enable(1, 5);
111
+ * ```
112
+ */
113
+ declare const trace: Trace;
114
+ export { trace };
@@ -0,0 +1,45 @@
1
+ import { StateParams } from './params/stateParams';
2
+ import { StateDeclaration } from './state/interface';
3
+ import { StateObject } from './state/stateObject';
4
+ import { Transition } from './transition/transition';
5
+ import { Queue } from './common/queue';
6
+ import { Disposable } from './interface';
7
+ /**
8
+ * Global router state
9
+ *
10
+ * This is where we hold the global mutable state such as current state, current
11
+ * params, current transition, etc.
12
+ */
13
+ export declare class UIRouterGlobals implements Disposable {
14
+ /**
15
+ * Current parameter values
16
+ *
17
+ * The parameter values from the latest successful transition
18
+ */
19
+ params: StateParams;
20
+ /**
21
+ * Current state
22
+ *
23
+ * The to-state from the latest successful transition
24
+ */
25
+ current: StateDeclaration;
26
+ /**
27
+ * Current state (internal object)
28
+ *
29
+ * The to-state from the latest successful transition
30
+ * @internal
31
+ */
32
+ $current: StateObject;
33
+ /**
34
+ * The current started/running transition.
35
+ * This transition has reached at least the onStart phase, but is not yet complete
36
+ */
37
+ transition: Transition;
38
+ /** @internal */
39
+ lastStartedTransitionId: number;
40
+ /** @internal */
41
+ transitionHistory: Queue<Transition>;
42
+ /** @internal */
43
+ successfulTransitions: Queue<Transition>;
44
+ dispose(): void;
45
+ }
@@ -0,0 +1,4 @@
1
+ import { Transition } from '../transition/transition';
2
+ import { TransitionService } from '../transition/transitionService';
3
+ export declare const registerAddCoreResolvables: (transitionService: TransitionService) => Function;
4
+ export declare const treeChangesCleanup: (trans: Transition) => void;
@@ -0,0 +1,2 @@
1
+ import { TransitionService } from '../transition/transitionService';
2
+ export declare const registerIgnoredTransitionHook: (transitionService: TransitionService) => Function;
@@ -0,0 +1,2 @@
1
+ import { TransitionService } from '../transition/transitionService';
2
+ export declare const registerInvalidTransitionHook: (transitionService: TransitionService) => Function;
@@ -0,0 +1,12 @@
1
+ import { Transition } from '../transition/transition';
2
+ import { TransitionService } from '../transition/transitionService';
3
+ import { StateDeclaration, LazyLoadResult } from '../state/interface';
4
+ export declare const registerLazyLoadHook: (transitionService: TransitionService) => Function;
5
+ /**
6
+ * Invokes a state's lazy load function
7
+ *
8
+ * @param transition a Transition context
9
+ * @param state the state to lazy load
10
+ * @returns A promise for the lazy load result
11
+ */
12
+ export declare function lazyLoadState(transition: Transition, state: StateDeclaration): Promise<LazyLoadResult>;
@@ -0,0 +1,4 @@
1
+ import { TransitionService } from '../transition/transitionService';
2
+ export declare const registerOnExitHook: (transitionService: TransitionService) => Function;
3
+ export declare const registerOnRetainHook: (transitionService: TransitionService) => Function;
4
+ export declare const registerOnEnterHook: (transitionService: TransitionService) => Function;
@@ -0,0 +1,2 @@
1
+ import { TransitionService } from '../transition/transitionService';
2
+ export declare const registerRedirectToHook: (transitionService: TransitionService) => Function;
@@ -0,0 +1,5 @@
1
+ import { TransitionService } from '../transition/transitionService';
2
+ export declare const RESOLVE_HOOK_PRIORITY = 1000;
3
+ export declare const registerEagerResolvePath: (transitionService: TransitionService) => Function;
4
+ export declare const registerLazyResolveState: (transitionService: TransitionService) => Function;
5
+ export declare const registerResolveRemaining: (transitionService: TransitionService) => Function;
@@ -0,0 +1,2 @@
1
+ import { TransitionService } from '../transition/transitionService';
2
+ export declare const registerUpdateGlobalState: (transitionService: TransitionService) => Function;
@@ -0,0 +1,2 @@
1
+ import { TransitionService } from '../transition/transitionService';
2
+ export declare const registerUpdateUrl: (transitionService: TransitionService) => Function;
@@ -0,0 +1,3 @@
1
+ import { TransitionService } from '../transition/transitionService';
2
+ export declare const registerLoadEnteringViews: (transitionService: TransitionService) => Function;
3
+ export declare const registerActivateViews: (transitionService: TransitionService) => Function;
@@ -0,0 +1,12 @@
1
+ export * from './common/index';
2
+ export * from './params/index';
3
+ export * from './path/index';
4
+ export * from './resolve/index';
5
+ export * from './state/index';
6
+ export * from './transition/index';
7
+ export * from './url/index';
8
+ export * from './view/index';
9
+ export * from './globals';
10
+ export * from './router';
11
+ export * from './vanilla';
12
+ export * from './interface';
@@ -0,0 +1,102 @@
1
+ import { UIRouter } from './router';
2
+ /**
3
+ * An interface for getting values from dependency injection.
4
+ *
5
+ * This is primarily used to get resolve values for a given token.
6
+ * An instance of the `UIInjector` can be retrieved from the current transition using [[Transition.injector]].
7
+ *
8
+ * ---
9
+ *
10
+ * If no resolve is found for a token, then it will delegate to the native injector.
11
+ * The native injector may be Angular 1 `$injector`, Angular 2 `Injector`, or a simple polyfill.
12
+ *
13
+ * In Angular 2, the native injector might be the root Injector,
14
+ * or it might be a lazy loaded `NgModule` injector scoped to a lazy load state tree.
15
+ */
16
+ export interface UIInjector {
17
+ /**
18
+ * Gets a value from the injector.
19
+ *
20
+ * For a given token, returns the value from the injector that matches the token.
21
+ * If the token is for a resolve that has not yet been fetched, this throws an error.
22
+ *
23
+ * #### Example:
24
+ * ```js
25
+ * var myResolve = injector.get('myResolve');
26
+ * ```
27
+ *
28
+ * #### ng1 Example:
29
+ * ```js
30
+ * // Fetch StateService
31
+ * injector.get('$state').go('home');
32
+ * ```
33
+ *
34
+ * #### ng2 Example:
35
+ * ```js
36
+ * import {StateService} from "ui-router-ng2";
37
+ * // Fetch StateService
38
+ * injector.get(StateService).go('home');
39
+ * ```
40
+ *
41
+ * #### Typescript Example:
42
+ * ```js
43
+ * var stringArray = injector.get<string[]>('myStringArray');
44
+ * ```
45
+ *
46
+ * ### `NOWAIT` policy
47
+ *
48
+ * When using [[ResolvePolicy.async]] === `NOWAIT`, the value returned from `get()` is a promise for the result.
49
+ * The promise is not automatically unwrapped.
50
+ *
51
+ * @param token the key for the value to get. May be a string, a class, or any arbitrary object.
52
+ * @return the Dependency Injection value that matches the token
53
+ */
54
+ get(token: any): any;
55
+ /** Gets a value as type `T` (generics parameter) */
56
+ get<T>(token: any): T;
57
+ /**
58
+ * Asynchronously gets a value from the injector
59
+ *
60
+ * For a given token, returns a promise for the value from the injector that matches the token.
61
+ * If the token is for a resolve that has not yet been fetched, this triggers the resolve to load.
62
+ *
63
+ * #### Example:
64
+ * ```js
65
+ * return injector.getAsync('myResolve').then(value => {
66
+ * if (value === 'declined') return false;
67
+ * });
68
+ * ```
69
+ *
70
+ * @param token the key for the value to get. May be a string or arbitrary object.
71
+ * @return a Promise for the Dependency Injection value that matches the token
72
+ */
73
+ getAsync(token: any): Promise<any>;
74
+ /** Asynchronously gets a value as type `T` (generics parameter) */
75
+ getAsync<T>(token: any): Promise<T>;
76
+ /**
77
+ * Gets a value from the native injector
78
+ *
79
+ * Returns a value from the native injector, bypassing anything in the [[ResolveContext]].
80
+ *
81
+ * Example:
82
+ * ```js
83
+ * let someThing = injector.getNative(SomeToken);
84
+ * ```
85
+ *
86
+ * @param token the key for the value to get. May be a string or arbitrary object.
87
+ * @return the Dependency Injection value that matches the token
88
+ */
89
+ getNative(token: any): any;
90
+ getNative<T>(token: any): T;
91
+ }
92
+ export interface UIRouterPlugin extends Disposable {
93
+ name: string;
94
+ }
95
+ export declare abstract class UIRouterPluginBase implements UIRouterPlugin, Disposable {
96
+ abstract name: string;
97
+ dispose(router: UIRouter): void;
98
+ }
99
+ export interface Disposable {
100
+ /** Instructs the Disposable to clean up any resources */
101
+ dispose(router?: UIRouter): any;
102
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This module contains code for State Parameters.
3
+ *
4
+ * See [[ParamDeclaration]]
5
+ *
6
+ * @packageDocumentation @preferred
7
+ */
8
+ export * from './interface';
9
+ export * from './param';
10
+ export * from './paramTypes';
11
+ export * from './stateParams';
12
+ export * from './paramType';