@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,10 +1,10 @@
1
- import { StateObject } from './stateObject';
2
- import { StateMatcher } from './stateMatcher';
3
- import { StateQueueManager } from './stateQueueManager';
4
- import { StateDeclaration, _StateDeclaration } from './interface';
5
- import { BuilderFunction } from './stateBuilder';
6
- import { StateOrName } from './interface';
7
- import { UIRouter } from '../router';
1
+ import { StateObject } from "./stateObject";
2
+ import { StateMatcher } from "./stateMatcher";
3
+ import { StateQueueManager } from "./stateQueueManager";
4
+ import { StateDeclaration, _StateDeclaration } from "./interface";
5
+ import { BuilderFunction } from "./stateBuilder";
6
+ import { StateOrName } from "./interface";
7
+ import { UIRouter } from "../router";
8
8
  /**
9
9
  * The signature for the callback function provided to [[StateRegistry.onStatesChanged]].
10
10
  *
@@ -13,124 +13,127 @@ import { UIRouter } from '../router';
13
13
  * @param event a string; either "registered" or "deregistered"
14
14
  * @param states the list of [[StateDeclaration]]s that were registered (or deregistered).
15
15
  */
16
- export declare type StateRegistryListener = (event: 'registered' | 'deregistered', states: StateDeclaration[]) => void;
16
+ export declare type StateRegistryListener = (
17
+ event: "registered" | "deregistered",
18
+ states: StateDeclaration[],
19
+ ) => void;
17
20
  /**
18
21
  * A registry for all of the application's [[StateDeclaration]]s
19
22
  *
20
23
  * This API is found at `router.stateRegistry` ([[UIRouter.stateRegistry]])
21
24
  */
22
25
  export declare class StateRegistry {
23
- private router;
24
- private _root;
25
- private states;
26
- /** @internal */
27
- matcher: StateMatcher;
28
- private builder;
29
- /** @internal */
30
- stateQueue: StateQueueManager;
31
- /** @internal */
32
- listeners: StateRegistryListener[];
33
- /** @internal */
34
- constructor(router: UIRouter);
35
- /** @internal */
36
- private _registerRoot;
37
- /** @internal */
38
- dispose(): void;
39
- /**
40
- * Listen for a State Registry events
41
- *
42
- * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry.
43
- *
44
- * #### Example:
45
- * ```js
46
- * let allStates = registry.get();
47
- *
48
- * // Later, invoke deregisterFn() to remove the listener
49
- * let deregisterFn = registry.onStatesChanged((event, states) => {
50
- * switch(event) {
51
- * case: 'registered':
52
- * states.forEach(state => allStates.push(state));
53
- * break;
54
- * case: 'deregistered':
55
- * states.forEach(state => {
56
- * let idx = allStates.indexOf(state);
57
- * if (idx !== -1) allStates.splice(idx, 1);
58
- * });
59
- * break;
60
- * }
61
- * });
62
- * ```
63
- *
64
- * @param listener a callback function invoked when the registered states changes.
65
- * The function receives two parameters, `event` and `state`.
66
- * See [[StateRegistryListener]]
67
- * @return a function that deregisters the listener
68
- */
69
- onStatesChanged(listener: StateRegistryListener): () => void;
70
- /**
71
- * Gets the implicit root state
72
- *
73
- * Gets the root of the state tree.
74
- * The root state is implicitly created by UI-Router.
75
- * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]]
76
- *
77
- * @return the root [[StateObject]]
78
- */
79
- root(): StateObject;
80
- /**
81
- * Adds a state to the registry
82
- *
83
- * Registers a [[StateDeclaration]] or queues it for registration.
84
- *
85
- * Note: a state will be queued if the state's parent isn't yet registered.
86
- *
87
- * @param stateDefinition the definition of the state to register.
88
- * @returns the internal [[StateObject]] object.
89
- * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]).
90
- * If the state was only queued, then the object is not fully built.
91
- */
92
- register(stateDefinition: _StateDeclaration): StateObject;
93
- /** @internal */
94
- private _deregisterTree;
95
- /**
96
- * Removes a state from the registry
97
- *
98
- * This removes a state from the registry.
99
- * If the state has children, they are are also removed from the registry.
100
- *
101
- * @param stateOrName the state's name or object representation
102
- * @returns {StateObject[]} a list of removed states
103
- */
104
- deregister(stateOrName: StateOrName): StateObject[];
105
- /**
106
- * Gets all registered states
107
- *
108
- * Calling this method with no arguments will return a list of all the states that are currently registered.
109
- * Note: this does not return states that are *queued* but not yet registered.
110
- *
111
- * @return a list of [[StateDeclaration]]s
112
- */
113
- get(): StateDeclaration[];
114
- /**
115
- * Gets a registered state
116
- *
117
- * Given a state or a name, finds and returns the [[StateDeclaration]] from the registry.
118
- * Note: this does not return states that are *queued* but not yet registered.
119
- *
120
- * @param stateOrName either the name of a state, or a state object.
121
- * @param base the base state to use when stateOrName is relative.
122
- * @return a registered [[StateDeclaration]] that matched the `stateOrName`, or null if the state isn't registered.
123
- */
124
- get(stateOrName: StateOrName, base?: StateOrName): StateDeclaration;
125
- /**
126
- * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).
127
- * More than one BuilderFunction can be registered for a given property.
128
- *
129
- * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.
130
- *
131
- * @param property The name of the State property being registered for.
132
- * @param builderFunction The BuilderFunction which will be used to build the State property
133
- * @returns a function which deregisters the BuilderFunction
134
- */
135
- decorator(property: string, builderFunction: BuilderFunction): Function;
26
+ private router;
27
+ private _root;
28
+ private states;
29
+ /** @internal */
30
+ matcher: StateMatcher;
31
+ private builder;
32
+ /** @internal */
33
+ stateQueue: StateQueueManager;
34
+ /** @internal */
35
+ listeners: StateRegistryListener[];
36
+ /** @internal */
37
+ constructor(router: UIRouter);
38
+ /** @internal */
39
+ private _registerRoot;
40
+ /** @internal */
41
+ dispose(): void;
42
+ /**
43
+ * Listen for a State Registry events
44
+ *
45
+ * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry.
46
+ *
47
+ * #### Example:
48
+ * ```js
49
+ * let allStates = registry.get();
50
+ *
51
+ * // Later, invoke deregisterFn() to remove the listener
52
+ * let deregisterFn = registry.onStatesChanged((event, states) => {
53
+ * switch(event) {
54
+ * case: 'registered':
55
+ * states.forEach(state => allStates.push(state));
56
+ * break;
57
+ * case: 'deregistered':
58
+ * states.forEach(state => {
59
+ * let idx = allStates.indexOf(state);
60
+ * if (idx !== -1) allStates.splice(idx, 1);
61
+ * });
62
+ * break;
63
+ * }
64
+ * });
65
+ * ```
66
+ *
67
+ * @param listener a callback function invoked when the registered states changes.
68
+ * The function receives two parameters, `event` and `state`.
69
+ * See [[StateRegistryListener]]
70
+ * @return a function that deregisters the listener
71
+ */
72
+ onStatesChanged(listener: StateRegistryListener): () => void;
73
+ /**
74
+ * Gets the implicit root state
75
+ *
76
+ * Gets the root of the state tree.
77
+ * The root state is implicitly created by UI-Router.
78
+ * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]]
79
+ *
80
+ * @return the root [[StateObject]]
81
+ */
82
+ root(): StateObject;
83
+ /**
84
+ * Adds a state to the registry
85
+ *
86
+ * Registers a [[StateDeclaration]] or queues it for registration.
87
+ *
88
+ * Note: a state will be queued if the state's parent isn't yet registered.
89
+ *
90
+ * @param stateDefinition the definition of the state to register.
91
+ * @returns the internal [[StateObject]] object.
92
+ * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]).
93
+ * If the state was only queued, then the object is not fully built.
94
+ */
95
+ register(stateDefinition: _StateDeclaration): StateObject;
96
+ /** @internal */
97
+ private _deregisterTree;
98
+ /**
99
+ * Removes a state from the registry
100
+ *
101
+ * This removes a state from the registry.
102
+ * If the state has children, they are are also removed from the registry.
103
+ *
104
+ * @param stateOrName the state's name or object representation
105
+ * @returns {StateObject[]} a list of removed states
106
+ */
107
+ deregister(stateOrName: StateOrName): StateObject[];
108
+ /**
109
+ * Gets all registered states
110
+ *
111
+ * Calling this method with no arguments will return a list of all the states that are currently registered.
112
+ * Note: this does not return states that are *queued* but not yet registered.
113
+ *
114
+ * @return a list of [[StateDeclaration]]s
115
+ */
116
+ get(): StateDeclaration[];
117
+ /**
118
+ * Gets a registered state
119
+ *
120
+ * Given a state or a name, finds and returns the [[StateDeclaration]] from the registry.
121
+ * Note: this does not return states that are *queued* but not yet registered.
122
+ *
123
+ * @param stateOrName either the name of a state, or a state object.
124
+ * @param base the base state to use when stateOrName is relative.
125
+ * @return a registered [[StateDeclaration]] that matched the `stateOrName`, or null if the state isn't registered.
126
+ */
127
+ get(stateOrName: StateOrName, base?: StateOrName): StateDeclaration;
128
+ /**
129
+ * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).
130
+ * More than one BuilderFunction can be registered for a given property.
131
+ *
132
+ * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.
133
+ *
134
+ * @param property The name of the State property being registered for.
135
+ * @param builderFunction The BuilderFunction which will be used to build the State property
136
+ * @returns a function which deregisters the BuilderFunction
137
+ */
138
+ decorator(property: string, builderFunction: BuilderFunction): Function;
136
139
  }