@angular-wave/angular.ts 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/Makefile +1 -1
  2. package/TODO.md +14 -0
  3. package/dist/angular-ts.esm.js +1 -1
  4. package/dist/angular-ts.umd.js +1 -1
  5. package/index.html +8 -2
  6. package/package.json +1 -1
  7. package/src/animations/animate-css-driver.js +2 -2
  8. package/src/animations/animate-css.js +15 -6
  9. package/src/animations/animate-js.js +1 -1
  10. package/src/animations/animate-queue.js +1 -1
  11. package/src/animations/shared.js +0 -14
  12. package/src/core/compile.js +6 -3
  13. package/src/directive/if.js +0 -79
  14. package/src/directive/if.md +80 -0
  15. package/src/directive/include.js +0 -82
  16. package/src/directive/include.md +86 -0
  17. package/src/directive/repeat.js +0 -1
  18. package/src/filters/order-by.js +8 -8
  19. package/src/loader.js +0 -1
  20. package/src/router/common/trace.js +1 -1
  21. package/src/router/directives/stateDirectives.js +16 -14
  22. package/src/router/directives/viewDirective.js +5 -13
  23. package/src/router/hooks/resolve.js +3 -4
  24. package/src/router/hooks/views.js +3 -2
  25. package/src/router/state/stateService.js +1 -2
  26. package/src/router/stateProvider.js +8 -0
  27. package/src/router/templateFactory.js +13 -7
  28. package/src/router/transition/interface.js +14 -14
  29. package/src/router/transition/rejectFactory.js +29 -20
  30. package/src/router/transition/transition.js +5 -1
  31. package/src/router/transition/transitionHook.js +5 -5
  32. package/src/router/url/urlMatcher.js +1 -2
  33. package/src/router/url/urlRule.js +10 -2
  34. package/src/router/url/urlRules.js +1 -1
  35. package/src/services/browser.js +3 -18
  36. package/src/shared/common.js +0 -1
  37. package/test/module-test.html +44 -12
  38. package/test/router/ng-state-builder.spec.js +81 -0
  39. package/test/router/services.spec.js +70 -0
  40. package/test/router/state-directives.spec.js +1182 -0
  41. package/test/router/template-factory.spec.js +146 -0
  42. package/test/router/url-matcher-factory.spec.js +1313 -0
  43. package/test/router/view-directive.spec.js +2013 -0
  44. package/test/router/view-hook.spec.js +217 -0
  45. package/test/router/view-scroll.spec.js +77 -0
  46. package/test/router/view.spec.js +117 -0
  47. package/types/angular.d.ts +132 -124
  48. package/types/index.d.ts +2350 -2187
  49. package/types/jqlite.d.ts +463 -418
  50. package/types/router/core/common/common.d.ts +70 -24
  51. package/types/router/core/common/coreservices.d.ts +30 -32
  52. package/types/router/core/common/glob.d.ts +9 -9
  53. package/types/router/core/common/hof.d.ts +12 -4
  54. package/types/router/core/common/index.d.ts +8 -8
  55. package/types/router/core/common/predicates.d.ts +1 -1
  56. package/types/router/core/common/queue.d.ts +13 -13
  57. package/types/router/core/common/safeConsole.d.ts +3 -3
  58. package/types/router/core/common/strings.d.ts +4 -2
  59. package/types/router/core/common/trace.d.ts +94 -82
  60. package/types/router/core/globals.d.ts +37 -37
  61. package/types/router/core/hooks/coreResolvables.d.ts +5 -3
  62. package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
  63. package/types/router/core/hooks/invalidTransition.d.ts +4 -2
  64. package/types/router/core/hooks/lazyLoad.d.ts +10 -5
  65. package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
  66. package/types/router/core/hooks/redirectTo.d.ts +4 -2
  67. package/types/router/core/hooks/resolve.d.ts +10 -4
  68. package/types/router/core/hooks/updateGlobals.d.ts +4 -2
  69. package/types/router/core/hooks/url.d.ts +4 -2
  70. package/types/router/core/hooks/views.d.ts +7 -3
  71. package/types/router/core/index.d.ts +11 -12
  72. package/types/router/core/interface.d.ts +83 -81
  73. package/types/router/core/params/index.d.ts +5 -5
  74. package/types/router/core/params/interface.d.ts +439 -439
  75. package/types/router/core/params/param.d.ts +72 -60
  76. package/types/router/core/params/paramType.d.ts +40 -40
  77. package/types/router/core/params/paramTypes.d.ts +169 -165
  78. package/types/router/core/params/stateParams.d.ts +13 -13
  79. package/types/router/core/path/index.d.ts +2 -2
  80. package/types/router/core/path/pathNode.d.ts +49 -49
  81. package/types/router/core/path/pathUtils.d.ts +100 -74
  82. package/types/router/core/resolve/index.d.ts +3 -3
  83. package/types/router/core/resolve/interface.d.ts +137 -137
  84. package/types/router/core/resolve/resolvable.d.ts +60 -54
  85. package/types/router/core/resolve/resolveContext.d.ts +84 -79
  86. package/types/router/core/router.d.ts +95 -86
  87. package/types/router/core/state/index.d.ts +8 -8
  88. package/types/router/core/state/interface.d.ts +667 -643
  89. package/types/router/core/state/stateBuilder.d.ts +41 -38
  90. package/types/router/core/state/stateMatcher.d.ts +11 -9
  91. package/types/router/core/state/stateObject.d.ts +154 -139
  92. package/types/router/core/state/stateQueueManager.d.ts +26 -21
  93. package/types/router/core/state/stateRegistry.d.ts +124 -121
  94. package/types/router/core/state/stateService.d.ts +380 -343
  95. package/types/router/core/state/targetState.d.ts +74 -69
  96. package/types/router/core/transition/hookBuilder.d.ts +34 -30
  97. package/types/router/core/transition/hookRegistry.d.ts +96 -74
  98. package/types/router/core/transition/index.d.ts +8 -8
  99. package/types/router/core/transition/interface.d.ts +652 -609
  100. package/types/router/core/transition/rejectFactory.d.ts +97 -97
  101. package/types/router/core/transition/transition.d.ts +565 -517
  102. package/types/router/core/transition/transitionEventType.d.ts +20 -11
  103. package/types/router/core/transition/transitionHook.d.ts +90 -82
  104. package/types/router/core/transition/transitionService.d.ts +228 -161
  105. package/types/router/core/url/index.d.ts +8 -8
  106. package/types/router/core/url/interface.d.ts +100 -87
  107. package/types/router/core/url/urlConfig.d.ts +130 -126
  108. package/types/router/core/url/urlMatcher.d.ts +132 -127
  109. package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
  110. package/types/router/core/url/urlRouter.d.ts +91 -75
  111. package/types/router/core/url/urlRule.d.ts +123 -100
  112. package/types/router/core/url/urlRules.d.ts +240 -232
  113. package/types/router/core/url/urlService.d.ts +201 -201
  114. package/types/router/core/view/index.d.ts +2 -2
  115. package/types/router/core/view/interface.d.ts +26 -26
  116. package/types/router/core/view/view.d.ts +152 -143
  117. package/types/router/directives/viewDirective.d.ts +12 -11
  118. package/types/router/index.d.ts +11 -12
  119. package/types/router/interface.d.ts +361 -351
  120. package/types/router/legacy/resolveService.d.ts +44 -40
  121. package/types/router/legacy/stateEvents.d.ts +1 -1
  122. package/types/router/locationServices.d.ts +45 -37
  123. package/types/router/services.d.ts +9 -9
  124. package/types/router/stateFilters.d.ts +3 -3
  125. package/types/router/stateProvider.d.ts +240 -235
  126. package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
  127. package/types/router/statebuilders/views.d.ts +35 -22
  128. package/types/router/templateFactory.d.ts +99 -79
  129. package/types/router/viewScroll.d.ts +7 -7
  130. package/src/directive/a.js +0 -37
  131. package/types/router/angular.d.ts +0 -1
  132. package/types/router/core/vanilla.d.ts +0 -1
  133. package/types/router/directives/stateDirectives.d.ts +0 -3
  134. package/types/router/injectables.d.ts +0 -1
@@ -1,8 +1,16 @@
1
- import { StateDeclaration } from '../state';
2
- import { UrlMatcher } from './urlMatcher';
3
- import { UIRouter } from '../router';
4
- import { StateObject } from '../state/stateObject';
5
- import { UrlRule, UrlRuleMatchFn, UrlRuleHandlerFn, UrlRuleType, MatcherUrlRule, StateRule, RegExpRule } from './interface';
1
+ import { StateDeclaration } from "../state";
2
+ import { UrlMatcher } from "./urlMatcher";
3
+ import { UIRouter } from "../router";
4
+ import { StateObject } from "../state/stateObject";
5
+ import {
6
+ UrlRule,
7
+ UrlRuleMatchFn,
8
+ UrlRuleHandlerFn,
9
+ UrlRuleType,
10
+ MatcherUrlRule,
11
+ StateRule,
12
+ RegExpRule,
13
+ } from "./interface";
6
14
  /**
7
15
  * Creates a [[UrlRule]]
8
16
  *
@@ -14,93 +22,108 @@ import { UrlRule, UrlRuleMatchFn, UrlRuleHandlerFn, UrlRuleType, MatcherUrlRule,
14
22
  * - [[StateObject]]
15
23
  */
16
24
  export declare class UrlRuleFactory {
17
- router: UIRouter;
18
- static isUrlRule: (obj: any) => boolean;
19
- constructor(router: UIRouter);
20
- compile(str: string): UrlMatcher;
21
- create(what: string | UrlMatcher | StateObject | StateDeclaration | RegExp | UrlRuleMatchFn, handler?: string | UrlRuleHandlerFn): UrlRule;
22
- /**
23
- * A UrlRule which matches based on a UrlMatcher
24
- *
25
- * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]]
26
- *
27
- * ## Handler as a function
28
- *
29
- * If `handler` is a function, the function is invoked with:
30
- *
31
- * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]])
32
- * - url: the current Url ([[UrlParts]])
33
- * - router: the router object ([[UIRouter]])
34
- *
35
- * #### Example:
36
- * ```js
37
- * var urlMatcher = $umf.compile("/foo/:fooId/:barId");
38
- * var rule = factory.fromUrlMatcher(urlMatcher, match => "/home/" + match.fooId + "/" + match.barId);
39
- * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
40
- * var result = rule.handler(match); // '/home/123/456'
41
- * ```
42
- *
43
- * ## Handler as UrlMatcher
44
- *
45
- * If `handler` is a UrlMatcher, the handler matcher is used to create the new url.
46
- * The `handler` UrlMatcher is formatted using the matched param from the first matcher.
47
- * The url is replaced with the result.
48
- *
49
- * #### Example:
50
- * ```js
51
- * var urlMatcher = $umf.compile("/foo/:fooId/:barId");
52
- * var handler = $umf.compile("/home/:fooId/:barId");
53
- * var rule = factory.fromUrlMatcher(urlMatcher, handler);
54
- * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
55
- * var result = rule.handler(match); // '/home/123/456'
56
- * ```
57
- */
58
- fromUrlMatcher(urlMatcher: UrlMatcher, handler: string | UrlMatcher | UrlRuleHandlerFn): MatcherUrlRule;
59
- /**
60
- * A UrlRule which matches a state by its url
61
- *
62
- * #### Example:
63
- * ```js
64
- * var rule = factory.fromState($state.get('foo'), router);
65
- * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
66
- * var result = rule.handler(match);
67
- * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' }
68
- * ```
69
- */
70
- fromState(stateOrDecl: StateObject | StateDeclaration, router: UIRouter): StateRule;
71
- /**
72
- * A UrlRule which matches based on a regular expression
73
- *
74
- * The `handler` may be either a [[UrlRuleHandlerFn]] or a string.
75
- *
76
- * ## Handler as a function
77
- *
78
- * If `handler` is a function, the function is invoked with:
79
- *
80
- * - regexp match array (from `regexp`)
81
- * - url: the current Url ([[UrlParts]])
82
- * - router: the router object ([[UIRouter]])
83
- *
84
- * #### Example:
85
- * ```js
86
- * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, match => "/home/" + match[1])
87
- * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]
88
- * var result = rule.handler(match); // '/home/bar'
89
- * ```
90
- *
91
- * ## Handler as string
92
- *
93
- * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked.
94
- * The string is first interpolated using `string.replace()` style pattern.
95
- *
96
- * #### Example:
97
- * ```js
98
- * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, "/home/$1")
99
- * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]
100
- * var result = rule.handler(match); // '/home/bar'
101
- * ```
102
- */
103
- fromRegExp(regexp: RegExp, handler: string | UrlRuleHandlerFn): RegExpRule;
25
+ router: UIRouter;
26
+ static isUrlRule: (obj: any) => boolean;
27
+ constructor(router: UIRouter);
28
+ compile(str: string): UrlMatcher;
29
+ create(
30
+ what:
31
+ | string
32
+ | UrlMatcher
33
+ | StateObject
34
+ | StateDeclaration
35
+ | RegExp
36
+ | UrlRuleMatchFn,
37
+ handler?: string | UrlRuleHandlerFn,
38
+ ): UrlRule;
39
+ /**
40
+ * A UrlRule which matches based on a UrlMatcher
41
+ *
42
+ * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]]
43
+ *
44
+ * ## Handler as a function
45
+ *
46
+ * If `handler` is a function, the function is invoked with:
47
+ *
48
+ * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]])
49
+ * - url: the current Url ([[UrlParts]])
50
+ * - router: the router object ([[UIRouter]])
51
+ *
52
+ * #### Example:
53
+ * ```js
54
+ * var urlMatcher = $umf.compile("/foo/:fooId/:barId");
55
+ * var rule = factory.fromUrlMatcher(urlMatcher, match => "/home/" + match.fooId + "/" + match.barId);
56
+ * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
57
+ * var result = rule.handler(match); // '/home/123/456'
58
+ * ```
59
+ *
60
+ * ## Handler as UrlMatcher
61
+ *
62
+ * If `handler` is a UrlMatcher, the handler matcher is used to create the new url.
63
+ * The `handler` UrlMatcher is formatted using the matched param from the first matcher.
64
+ * The url is replaced with the result.
65
+ *
66
+ * #### Example:
67
+ * ```js
68
+ * var urlMatcher = $umf.compile("/foo/:fooId/:barId");
69
+ * var handler = $umf.compile("/home/:fooId/:barId");
70
+ * var rule = factory.fromUrlMatcher(urlMatcher, handler);
71
+ * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
72
+ * var result = rule.handler(match); // '/home/123/456'
73
+ * ```
74
+ */
75
+ fromUrlMatcher(
76
+ urlMatcher: UrlMatcher,
77
+ handler: string | UrlMatcher | UrlRuleHandlerFn,
78
+ ): MatcherUrlRule;
79
+ /**
80
+ * A UrlRule which matches a state by its url
81
+ *
82
+ * #### Example:
83
+ * ```js
84
+ * var rule = factory.fromState($state.get('foo'), router);
85
+ * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
86
+ * var result = rule.handler(match);
87
+ * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' }
88
+ * ```
89
+ */
90
+ fromState(
91
+ stateOrDecl: StateObject | StateDeclaration,
92
+ router: UIRouter,
93
+ ): StateRule;
94
+ /**
95
+ * A UrlRule which matches based on a regular expression
96
+ *
97
+ * The `handler` may be either a [[UrlRuleHandlerFn]] or a string.
98
+ *
99
+ * ## Handler as a function
100
+ *
101
+ * If `handler` is a function, the function is invoked with:
102
+ *
103
+ * - regexp match array (from `regexp`)
104
+ * - url: the current Url ([[UrlParts]])
105
+ * - router: the router object ([[UIRouter]])
106
+ *
107
+ * #### Example:
108
+ * ```js
109
+ * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, match => "/home/" + match[1])
110
+ * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]
111
+ * var result = rule.handler(match); // '/home/bar'
112
+ * ```
113
+ *
114
+ * ## Handler as string
115
+ *
116
+ * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked.
117
+ * The string is first interpolated using `string.replace()` style pattern.
118
+ *
119
+ * #### Example:
120
+ * ```js
121
+ * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, "/home/$1")
122
+ * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]
123
+ * var result = rule.handler(match); // '/home/bar'
124
+ * ```
125
+ */
126
+ fromRegExp(regexp: RegExp, handler: string | UrlRuleHandlerFn): RegExpRule;
104
127
  }
105
128
  /**
106
129
  * A base rule which calls `match`
@@ -109,12 +132,12 @@ export declare class UrlRuleFactory {
109
132
  * @internal
110
133
  */
111
134
  export declare class BaseUrlRule implements UrlRule {
112
- match: UrlRuleMatchFn;
113
- $id: number;
114
- priority: number;
115
- _group: number;
116
- type: UrlRuleType;
117
- handler: UrlRuleHandlerFn;
118
- matchPriority: (match: any) => number;
119
- constructor(match: UrlRuleMatchFn, handler?: UrlRuleHandlerFn);
135
+ match: UrlRuleMatchFn;
136
+ $id: number;
137
+ priority: number;
138
+ _group: number;
139
+ type: UrlRuleType;
140
+ handler: UrlRuleHandlerFn;
141
+ matchPriority: (match: any) => number;
142
+ constructor(match: UrlRuleMatchFn, handler?: UrlRuleHandlerFn);
120
143
  }