@angular-wave/angular.ts 0.0.20 → 0.0.22

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 (128) hide show
  1. package/Makefile +1 -1
  2. package/README.md +3 -3
  3. package/TODO.md +14 -0
  4. package/dist/angular-ts.esm.js +1 -1
  5. package/dist/angular-ts.umd.js +1 -1
  6. package/index.html +2 -1
  7. package/package.json +1 -1
  8. package/src/animations/animate-css-driver.js +2 -2
  9. package/src/animations/animate-css.js +15 -6
  10. package/src/animations/animate-js.js +1 -1
  11. package/src/animations/animate-queue.js +1 -1
  12. package/src/animations/shared.js +0 -14
  13. package/src/core/compile.js +6 -3
  14. package/src/core/q.js +9 -9
  15. package/src/core/sanitize-uri.js +1 -1
  16. package/src/core/sce.js +1 -1
  17. package/src/directive/if.js +0 -79
  18. package/src/directive/if.md +80 -0
  19. package/src/directive/include.js +0 -82
  20. package/src/directive/include.md +86 -0
  21. package/src/directive/repeat.js +0 -1
  22. package/src/loader.js +0 -1
  23. package/src/public.js +0 -2
  24. package/src/router/common/trace.js +1 -1
  25. package/src/router/directives/stateDirectives.js +16 -14
  26. package/src/router/directives/viewDirective.js +2 -2
  27. package/src/router/hooks/resolve.js +3 -4
  28. package/src/router/hooks/views.js +3 -2
  29. package/src/router/state/stateService.js +1 -2
  30. package/src/router/transition/interface.js +14 -14
  31. package/src/router/transition/rejectFactory.js +29 -20
  32. package/src/router/transition/transitionHook.js +5 -5
  33. package/src/router/url/urlMatcher.js +1 -2
  34. package/src/router/url/urlRule.js +1 -1
  35. package/src/router/url/urlRules.js +1 -1
  36. package/src/shared/common.js +0 -1
  37. package/test/module-test.html +44 -12
  38. package/test/router/services.spec.js +71 -0
  39. package/test/router/state-directives.spec.js +1208 -0
  40. package/types/angular.d.ts +132 -124
  41. package/types/index.d.ts +2350 -2187
  42. package/types/jqlite.d.ts +463 -418
  43. package/types/router/core/common/common.d.ts +70 -24
  44. package/types/router/core/common/coreservices.d.ts +30 -32
  45. package/types/router/core/common/glob.d.ts +9 -9
  46. package/types/router/core/common/hof.d.ts +12 -4
  47. package/types/router/core/common/index.d.ts +8 -8
  48. package/types/router/core/common/predicates.d.ts +1 -1
  49. package/types/router/core/common/queue.d.ts +13 -13
  50. package/types/router/core/common/safeConsole.d.ts +3 -3
  51. package/types/router/core/common/strings.d.ts +4 -2
  52. package/types/router/core/common/trace.d.ts +94 -82
  53. package/types/router/core/globals.d.ts +37 -37
  54. package/types/router/core/hooks/coreResolvables.d.ts +5 -3
  55. package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
  56. package/types/router/core/hooks/invalidTransition.d.ts +4 -2
  57. package/types/router/core/hooks/lazyLoad.d.ts +10 -5
  58. package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
  59. package/types/router/core/hooks/redirectTo.d.ts +4 -2
  60. package/types/router/core/hooks/resolve.d.ts +10 -4
  61. package/types/router/core/hooks/updateGlobals.d.ts +4 -2
  62. package/types/router/core/hooks/url.d.ts +4 -2
  63. package/types/router/core/hooks/views.d.ts +7 -3
  64. package/types/router/core/index.d.ts +11 -12
  65. package/types/router/core/interface.d.ts +83 -81
  66. package/types/router/core/params/index.d.ts +5 -5
  67. package/types/router/core/params/interface.d.ts +439 -439
  68. package/types/router/core/params/param.d.ts +72 -60
  69. package/types/router/core/params/paramType.d.ts +40 -40
  70. package/types/router/core/params/paramTypes.d.ts +169 -165
  71. package/types/router/core/params/stateParams.d.ts +13 -13
  72. package/types/router/core/path/index.d.ts +2 -2
  73. package/types/router/core/path/pathNode.d.ts +49 -49
  74. package/types/router/core/path/pathUtils.d.ts +100 -74
  75. package/types/router/core/resolve/index.d.ts +3 -3
  76. package/types/router/core/resolve/interface.d.ts +137 -137
  77. package/types/router/core/resolve/resolvable.d.ts +60 -54
  78. package/types/router/core/resolve/resolveContext.d.ts +84 -79
  79. package/types/router/core/router.d.ts +95 -86
  80. package/types/router/core/state/index.d.ts +8 -8
  81. package/types/router/core/state/interface.d.ts +667 -643
  82. package/types/router/core/state/stateBuilder.d.ts +41 -38
  83. package/types/router/core/state/stateMatcher.d.ts +11 -9
  84. package/types/router/core/state/stateObject.d.ts +154 -139
  85. package/types/router/core/state/stateQueueManager.d.ts +26 -21
  86. package/types/router/core/state/stateRegistry.d.ts +124 -121
  87. package/types/router/core/state/stateService.d.ts +380 -343
  88. package/types/router/core/state/targetState.d.ts +74 -69
  89. package/types/router/core/transition/hookBuilder.d.ts +34 -30
  90. package/types/router/core/transition/hookRegistry.d.ts +96 -74
  91. package/types/router/core/transition/index.d.ts +8 -8
  92. package/types/router/core/transition/interface.d.ts +652 -609
  93. package/types/router/core/transition/rejectFactory.d.ts +97 -97
  94. package/types/router/core/transition/transition.d.ts +565 -517
  95. package/types/router/core/transition/transitionEventType.d.ts +20 -11
  96. package/types/router/core/transition/transitionHook.d.ts +90 -82
  97. package/types/router/core/transition/transitionService.d.ts +228 -161
  98. package/types/router/core/url/index.d.ts +8 -8
  99. package/types/router/core/url/interface.d.ts +100 -87
  100. package/types/router/core/url/urlConfig.d.ts +130 -126
  101. package/types/router/core/url/urlMatcher.d.ts +132 -127
  102. package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
  103. package/types/router/core/url/urlRouter.d.ts +91 -75
  104. package/types/router/core/url/urlRule.d.ts +123 -100
  105. package/types/router/core/url/urlRules.d.ts +240 -232
  106. package/types/router/core/url/urlService.d.ts +201 -201
  107. package/types/router/core/view/index.d.ts +2 -2
  108. package/types/router/core/view/interface.d.ts +26 -26
  109. package/types/router/core/view/view.d.ts +152 -143
  110. package/types/router/directives/viewDirective.d.ts +12 -11
  111. package/types/router/index.d.ts +11 -12
  112. package/types/router/interface.d.ts +361 -351
  113. package/types/router/legacy/resolveService.d.ts +44 -40
  114. package/types/router/legacy/stateEvents.d.ts +1 -1
  115. package/types/router/locationServices.d.ts +45 -37
  116. package/types/router/services.d.ts +9 -9
  117. package/types/router/stateFilters.d.ts +3 -3
  118. package/types/router/stateProvider.d.ts +240 -235
  119. package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
  120. package/types/router/statebuilders/views.d.ts +35 -22
  121. package/types/router/templateFactory.d.ts +99 -79
  122. package/types/router/viewScroll.d.ts +7 -7
  123. package/src/directive/a.js +0 -37
  124. package/test/directive/a.spec.js +0 -192
  125. package/types/router/angular.d.ts +0 -1
  126. package/types/router/core/vanilla.d.ts +0 -1
  127. package/types/router/directives/stateDirectives.d.ts +0 -3
  128. package/types/router/injectables.d.ts +0 -1
@@ -1,9 +1,9 @@
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';
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
7
  /**
8
8
  * Global router state
9
9
  *
@@ -11,35 +11,35 @@ import { Disposable } from './interface';
11
11
  * params, current transition, etc.
12
12
  */
13
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;
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
45
  }
@@ -1,4 +1,6 @@
1
- import { Transition } from '../transition/transition';
2
- import { TransitionService } from '../transition/transitionService';
3
- export declare const registerAddCoreResolvables: (transitionService: TransitionService) => Function;
1
+ import { Transition } from "../transition/transition";
2
+ import { TransitionService } from "../transition/transitionService";
3
+ export declare const registerAddCoreResolvables: (
4
+ transitionService: TransitionService,
5
+ ) => Function;
4
6
  export declare const treeChangesCleanup: (trans: Transition) => void;
@@ -1,2 +1,4 @@
1
- import { TransitionService } from '../transition/transitionService';
2
- export declare const registerIgnoredTransitionHook: (transitionService: TransitionService) => Function;
1
+ import { TransitionService } from "../transition/transitionService";
2
+ export declare const registerIgnoredTransitionHook: (
3
+ transitionService: TransitionService,
4
+ ) => Function;
@@ -1,2 +1,4 @@
1
- import { TransitionService } from '../transition/transitionService';
2
- export declare const registerInvalidTransitionHook: (transitionService: TransitionService) => Function;
1
+ import { TransitionService } from "../transition/transitionService";
2
+ export declare const registerInvalidTransitionHook: (
3
+ transitionService: TransitionService,
4
+ ) => Function;
@@ -1,7 +1,9 @@
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;
1
+ import { Transition } from "../transition/transition";
2
+ import { TransitionService } from "../transition/transitionService";
3
+ import { StateDeclaration, LazyLoadResult } from "../state/interface";
4
+ export declare const registerLazyLoadHook: (
5
+ transitionService: TransitionService,
6
+ ) => Function;
5
7
  /**
6
8
  * Invokes a state's lazy load function
7
9
  *
@@ -9,4 +11,7 @@ export declare const registerLazyLoadHook: (transitionService: TransitionService
9
11
  * @param state the state to lazy load
10
12
  * @returns A promise for the lazy load result
11
13
  */
12
- export declare function lazyLoadState(transition: Transition, state: StateDeclaration): Promise<LazyLoadResult>;
14
+ export declare function lazyLoadState(
15
+ transition: Transition,
16
+ state: StateDeclaration,
17
+ ): Promise<LazyLoadResult>;
@@ -1,4 +1,10 @@
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;
1
+ import { TransitionService } from "../transition/transitionService";
2
+ export declare const registerOnExitHook: (
3
+ transitionService: TransitionService,
4
+ ) => Function;
5
+ export declare const registerOnRetainHook: (
6
+ transitionService: TransitionService,
7
+ ) => Function;
8
+ export declare const registerOnEnterHook: (
9
+ transitionService: TransitionService,
10
+ ) => Function;
@@ -1,2 +1,4 @@
1
- import { TransitionService } from '../transition/transitionService';
2
- export declare const registerRedirectToHook: (transitionService: TransitionService) => Function;
1
+ import { TransitionService } from "../transition/transitionService";
2
+ export declare const registerRedirectToHook: (
3
+ transitionService: TransitionService,
4
+ ) => Function;
@@ -1,5 +1,11 @@
1
- import { TransitionService } from '../transition/transitionService';
1
+ import { TransitionService } from "../transition/transitionService";
2
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;
3
+ export declare const registerEagerResolvePath: (
4
+ transitionService: TransitionService,
5
+ ) => Function;
6
+ export declare const registerLazyResolveState: (
7
+ transitionService: TransitionService,
8
+ ) => Function;
9
+ export declare const registerResolveRemaining: (
10
+ transitionService: TransitionService,
11
+ ) => Function;
@@ -1,2 +1,4 @@
1
- import { TransitionService } from '../transition/transitionService';
2
- export declare const registerUpdateGlobalState: (transitionService: TransitionService) => Function;
1
+ import { TransitionService } from "../transition/transitionService";
2
+ export declare const registerUpdateGlobalState: (
3
+ transitionService: TransitionService,
4
+ ) => Function;
@@ -1,2 +1,4 @@
1
- import { TransitionService } from '../transition/transitionService';
2
- export declare const registerUpdateUrl: (transitionService: TransitionService) => Function;
1
+ import { TransitionService } from "../transition/transitionService";
2
+ export declare const registerUpdateUrl: (
3
+ transitionService: TransitionService,
4
+ ) => Function;
@@ -1,3 +1,7 @@
1
- import { TransitionService } from '../transition/transitionService';
2
- export declare const registerLoadEnteringViews: (transitionService: TransitionService) => Function;
3
- export declare const registerActivateViews: (transitionService: TransitionService) => Function;
1
+ import { TransitionService } from "../transition/transitionService";
2
+ export declare const registerLoadEnteringViews: (
3
+ transitionService: TransitionService,
4
+ ) => Function;
5
+ export declare const registerActivateViews: (
6
+ transitionService: TransitionService,
7
+ ) => Function;
@@ -1,12 +1,11 @@
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';
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 "./interface";
@@ -1,4 +1,4 @@
1
- import { UIRouter } from './router';
1
+ import { UIRouter } from "./router";
2
2
  /**
3
3
  * An interface for getting values from dependency injection.
4
4
  *
@@ -14,89 +14,91 @@ import { UIRouter } from './router';
14
14
  * or it might be a lazy loaded `NgModule` injector scoped to a lazy load state tree.
15
15
  */
16
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;
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
91
  }
92
92
  export interface UIRouterPlugin extends Disposable {
93
- name: string;
93
+ name: string;
94
94
  }
95
- export declare abstract class UIRouterPluginBase implements UIRouterPlugin, Disposable {
96
- abstract name: string;
97
- dispose(router: UIRouter): void;
95
+ export declare abstract class UIRouterPluginBase
96
+ implements UIRouterPlugin, Disposable
97
+ {
98
+ abstract name: string;
99
+ dispose(router: UIRouter): void;
98
100
  }
99
101
  export interface Disposable {
100
- /** Instructs the Disposable to clean up any resources */
101
- dispose(router?: UIRouter): any;
102
+ /** Instructs the Disposable to clean up any resources */
103
+ dispose(router?: UIRouter): any;
102
104
  }
@@ -5,8 +5,8 @@
5
5
  *
6
6
  * @packageDocumentation @preferred
7
7
  */
8
- export * from './interface';
9
- export * from './param';
10
- export * from './paramTypes';
11
- export * from './stateParams';
12
- export * from './paramType';
8
+ export * from "./interface";
9
+ export * from "./param";
10
+ export * from "./paramTypes";
11
+ export * from "./stateParams";
12
+ export * from "./paramType";