@angular-wave/angular.ts 0.8.0 → 0.8.1

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 (63) hide show
  1. package/@types/angular.d.ts +3 -3
  2. package/@types/core/di/ng-module.d.ts +61 -25
  3. package/@types/interface.d.ts +1 -1
  4. package/@types/router/directives/state-directives.d.ts +2 -2
  5. package/@types/router/directives/view-directive.d.ts +1 -1
  6. package/@types/router/params/param-type.d.ts +0 -1
  7. package/@types/router/{globals.d.ts → router.d.ts} +1 -1
  8. package/@types/router/state/state-registry.d.ts +2 -2
  9. package/@types/router/state/state-service.d.ts +6 -9
  10. package/@types/router/transition/transition-service.d.ts +3 -3
  11. package/@types/router/transition/transition.d.ts +4 -4
  12. package/@types/router/url/url-matcher.d.ts +0 -1
  13. package/@types/router/url/url-rule.d.ts +13 -4
  14. package/@types/router/url/url-service.d.ts +2 -2
  15. package/@types/shared/hof.d.ts +0 -6
  16. package/CHANGELOG.md +0 -72
  17. package/CONTRIBUTING.md +0 -1
  18. package/DEVELOPERS.md +0 -1
  19. package/TRIAGING.md +0 -1
  20. package/dist/angular-ts.esm.js +102 -102
  21. package/dist/angular-ts.umd.js +102 -102
  22. package/dist/angular-ts.umd.min.js +1 -1
  23. package/docs/layouts/shortcodes/version.html +1 -1
  24. package/docs/static/typedoc/assets/hierarchy.js +1 -1
  25. package/docs/static/typedoc/assets/navigation.js +1 -1
  26. package/docs/static/typedoc/assets/search.js +1 -1
  27. package/docs/static/typedoc/classes/NgModule.html +3 -3
  28. package/docs/static/typedoc/types/Injectable.html +4 -1
  29. package/docs/static/typedoc/types/InjectableFactory.html +1 -4
  30. package/package.json +2 -2
  31. package/src/angular.js +10 -10
  32. package/src/core/di/ng-module.js +26 -21
  33. package/src/core/parse/parse.spec.js +29 -30
  34. package/src/directive/events/event.spec.js +5 -5
  35. package/src/directive/messages/messages.md +0 -4
  36. package/src/directive/repeat/repeat.js +1 -1
  37. package/src/injection-tokens.js +2 -2
  38. package/src/interface.ts +1 -2
  39. package/src/ng.js +5 -5
  40. package/src/ng.spec.js +1 -1
  41. package/src/router/directives/state-directives.js +5 -5
  42. package/src/router/directives/state-directives.spec.js +2 -2
  43. package/src/router/directives/view-directive.js +5 -5
  44. package/src/router/directives/view-directive.spec.js +20 -20
  45. package/src/router/params/param-type.js +0 -1
  46. package/src/router/params/param.js +1 -1
  47. package/src/router/{globals.js → router.js} +1 -1
  48. package/src/router/services.spec.js +3 -3
  49. package/src/router/state/state-registry.js +2 -2
  50. package/src/router/state/state-service.js +5 -8
  51. package/src/router/template-factory.spec.js +6 -6
  52. package/src/router/transition/transition-service.js +2 -2
  53. package/src/router/transition/transition.js +2 -2
  54. package/src/router/url/url-matcher.js +9 -11
  55. package/src/router/url/url-rule.js +7 -2
  56. package/src/router/url/url-service.js +6 -3
  57. package/src/router/url/url-service.spec.js +6 -39
  58. package/src/router/view-scroll.js +3 -1
  59. package/src/router/view-scroll.spec.js +11 -11
  60. package/src/services/location/location.js +9 -2
  61. package/src/services/location/location.spec.js +6 -0
  62. package/src/shared/common.js +5 -5
  63. package/src/shared/hof.js +0 -14
@@ -18,7 +18,7 @@ export class Angular {
18
18
  getInjector: typeof getInjector;
19
19
  getScope: typeof getScope;
20
20
  errorHandlingConfig: typeof errorHandlingConfig;
21
- $injectTokens: Readonly<Record<string, string>>;
21
+ $t: Readonly<Record<string, string>>;
22
22
  /**
23
23
  * Use this function to manually start up AngularTS application.
24
24
  *
@@ -124,14 +124,14 @@ export class Angular {
124
124
  * @param {string} name The name of the module to create or retrieve.
125
125
  * @param {Array.<string>} [requires] If specified then new module is being created. If
126
126
  * unspecified then the module is being retrieved for further configuration.
127
- * @param {Array<any>|Function} [configFn] Optional configuration function for the module that gets
127
+ * @param {import("./interface.js").Injectable} [configFn] Optional configuration function for the module that gets
128
128
  * passed to {@link NgModule.config NgModule.config()}.
129
129
  * @returns {NgModule} A newly registered module.
130
130
  */
131
131
  module(
132
132
  name: string,
133
133
  requires?: Array<string>,
134
- configFn?: Array<any> | Function,
134
+ configFn?: import("./interface.js").Injectable,
135
135
  ): NgModule;
136
136
  }
137
137
  /**
@@ -22,9 +22,13 @@ export class NgModule {
22
22
  /**
23
23
  * @param {string} name - Name of the module
24
24
  * @param {Array<string>} requires - List of modules which the injector will load before the current module
25
- * @param {Function} [configFn]
25
+ * @param {import("../../interface.js").Injectable} [configFn]
26
26
  */
27
- constructor(name: string, requires: Array<string>, configFn?: Function);
27
+ constructor(
28
+ name: string,
29
+ requires: Array<string>,
30
+ configFn?: import("../../interface.js").Injectable,
31
+ );
28
32
  /**
29
33
  * Name of the current module.
30
34
  * @type {string}
@@ -42,8 +46,8 @@ export class NgModule {
42
46
  invokeQueue: Array<Array<any>>;
43
47
  /** @type {!Array<Array<*>>} */
44
48
  configBlocks: Array<Array<any>>;
45
- /** @type {!Array.<Function>} */
46
- runBlocks: Array<Function>;
49
+ /** @type {!Array.<import("../../interface.js").Injectable>} */
50
+ runBlocks: Array<import("../../interface.js").Injectable>;
47
51
  /**
48
52
  * @param {string} name
49
53
  * @param {any} object
@@ -58,62 +62,94 @@ export class NgModule {
58
62
  constant(name: string, object: any): NgModule;
59
63
  /**
60
64
  *
61
- * @param {Function} configFn
65
+ * @param {import("../../interface.js").Injectable} configFn
62
66
  * @returns {NgModule}
63
67
  */
64
- config(configFn: Function): NgModule;
68
+ config(configFn: import("../../interface.js").Injectable): NgModule;
65
69
  /**
66
- * @param {Function} block
70
+ * @param {import("../../interface.js").Injectable} block
67
71
  * @returns {NgModule}
68
72
  */
69
- run(block: Function): NgModule;
73
+ run(block: import("../../interface.js").Injectable): NgModule;
70
74
  /**
71
75
  * @param {string} name
72
- * @param {*} options
76
+ * @param {import("../../interface.js").Injectable} options
73
77
  * @returns {NgModule}
74
78
  */
75
- component(name: string, options: any): NgModule;
79
+ component(
80
+ name: string,
81
+ options: import("../../interface.js").Injectable,
82
+ ): NgModule;
76
83
  /**
77
84
  * @param {string} name
78
- * @param {*} providerFunction
85
+ * @param {import("../../interface.js").Injectable} providerFunction
79
86
  * @returns {NgModule}
80
87
  */
81
- factory(name: string, providerFunction: any): NgModule;
88
+ factory(
89
+ name: string,
90
+ providerFunction: import("../../interface.js").Injectable,
91
+ ): NgModule;
82
92
  /**
83
93
  * @param {string} name
84
- * @param {*} serviceFunction
94
+ * @param {import("../../interface.js").Injectable} serviceFunction
85
95
  * @returns {NgModule}
86
96
  */
87
- service(name: string, serviceFunction: any): NgModule;
97
+ service(
98
+ name: string,
99
+ serviceFunction: import("../../interface.js").Injectable,
100
+ ): NgModule;
88
101
  /**
89
102
  * @param {string} name
90
- * @param {*} providerType
103
+ * @param {import("../../interface.js").Injectable} providerType
91
104
  * @returns {NgModule}
92
105
  */
93
- provider(name: string, providerType: any): NgModule;
106
+ provider(
107
+ name: string,
108
+ providerType: import("../../interface.js").Injectable,
109
+ ): NgModule;
94
110
  /**
95
111
  * @param {string} name
96
- * @param {*} decorFn
112
+ * @param {import("../../interface.js").Injectable} decorFn
97
113
  * @returns {NgModule}
98
114
  */
99
- decorator(name: string, decorFn: any): NgModule;
115
+ decorator(
116
+ name: string,
117
+ decorFn: import("../../interface.js").Injectable,
118
+ ): NgModule;
100
119
  /**
101
120
  * @param {string} name
102
- * @param {*} directiveFactory
121
+ * @param {import("../../interface.js").Injectable} directiveFactory
103
122
  * @returns {NgModule}
104
123
  */
105
- directive(name: string, directiveFactory: any): NgModule;
124
+ directive(
125
+ name: string,
126
+ directiveFactory: import("../../interface.js").Injectable,
127
+ ): NgModule;
106
128
  /**
107
129
  * @param {string} name
108
- * @param {*} animationFactory
130
+ * @param {import("../../interface.js").Injectable} animationFactory
109
131
  * @returns {NgModule}
110
132
  */
111
- animation(name: string, animationFactory: any): NgModule;
112
- filter(name: any, filterFn: any): this;
133
+ animation(
134
+ name: string,
135
+ animationFactory: import("../../interface.js").Injectable,
136
+ ): NgModule;
113
137
  /**
114
138
  * @param {string} name
115
- * @param {*} ctlFn
139
+ * @param {import("../../interface.js").Injectable} filterFn
140
+ * @return {NgModule}
141
+ */
142
+ filter(
143
+ name: string,
144
+ filterFn: import("../../interface.js").Injectable,
145
+ ): NgModule;
146
+ /**
147
+ * @param {string} name
148
+ * @param {import("../../interface.js").Injectable} ctlFn
116
149
  * @returns {NgModule}
117
150
  */
118
- controller(name: string, ctlFn: any): NgModule;
151
+ controller(
152
+ name: string,
153
+ ctlFn: import("../../interface.js").Injectable,
154
+ ): NgModule;
119
155
  }
@@ -36,13 +36,13 @@ export type ExpandoStore = {
36
36
  * ```
37
37
  */
38
38
  export type AnnotatedFactory = [...string[], (...args: any[]) => any];
39
+ export type InjectableFactory = (...args: any[]) => any;
39
40
  /**
40
41
  * A factory that can be either a standalone function or a dependency-annotated array.
41
42
  *
42
43
  * The array form is used to support minification-safe dependency injection.
43
44
  * See {@link AnnotatedFactory}.
44
45
  */
45
- export type InjectableFactory = (...args: any[]) => any;
46
46
  export type Injectable = AnnotatedFactory | InjectableFactory;
47
47
  /**
48
48
  * An object that defines how a service is constructed.
@@ -27,7 +27,7 @@ export namespace $StateRefDynamicDirective {
27
27
  }
28
28
  /**
29
29
  * @param {*} $state
30
- * @param {import('../globals.js').RouterGlobals} $routerGlobals
30
+ * @param {import('../router.js').Router} $router
31
31
  * @param {*} $interpolate
32
32
  * @param {*} $stateRegistry
33
33
  * @param {*} $transitions
@@ -35,7 +35,7 @@ export namespace $StateRefDynamicDirective {
35
35
  */
36
36
  export function $StateRefActiveDirective(
37
37
  $state: any,
38
- $routerGlobals: import("../globals.js").RouterGlobals,
38
+ $router: import("../router.js").Router,
39
39
  $interpolate: any,
40
40
  $stateRegistry: any,
41
41
  $transitions: any,
@@ -20,7 +20,7 @@ export namespace $ViewDirectiveFill {
20
20
  * The ng-view can be targeted in a View using the name ([[StateDeclaration.views]]).
21
21
  *
22
22
  * - `autoscroll`: an expression. When it evaluates to true, the `ng-view` will be scrolled into view when it is activated.
23
- * Uses [[$ngViewScroll]] to do the scrolling.
23
+ * Uses [[$viewScroll]] to do the scrolling.
24
24
  *
25
25
  * - `onload`: Expression to evaluate whenever the view updates.
26
26
  *
@@ -25,7 +25,6 @@ export class ParamType {
25
25
  /**
26
26
  * @param def A configuration object which contains the custom type definition. The object's
27
27
  * properties will override the default methods and/or pattern in `ParamType`'s public interface.
28
- * @returns a new ParamType object
29
28
  */
30
29
  constructor(def: any);
31
30
  pattern: RegExp;
@@ -5,7 +5,7 @@
5
5
  * This is where we hold the global mutable state such as current state, current
6
6
  * params, current transition, etc.
7
7
  */
8
- export class RouterGlobals {
8
+ export class Router {
9
9
  /**
10
10
  * Current parameter values
11
11
  *
@@ -10,13 +10,13 @@ export class StateRegistryProvider {
10
10
  /**
11
11
  * @param urlService
12
12
  * @param stateService
13
- * @param {import('../globals.js').RouterGlobals} globals
13
+ * @param {import('../router.js').Router} globals
14
14
  * @param viewService
15
15
  */
16
16
  constructor(
17
17
  urlService: any,
18
18
  stateService: any,
19
- globals: import("../globals.js").RouterGlobals,
19
+ globals: import("../router.js").Router,
20
20
  viewService: any,
21
21
  );
22
22
  states: {};
@@ -7,34 +7,31 @@ export class StateProvider {
7
7
  static $inject: string[];
8
8
  /**
9
9
  *
10
- * @param {import('../globals.js').RouterGlobals} globals
10
+ * @param {import('../router.js').Router} globals
11
11
  * @param {*} transitionService
12
12
  */
13
- constructor(
14
- globals: import("../globals.js").RouterGlobals,
15
- transitionService: any,
16
- );
13
+ constructor(globals: import("../router.js").Router, transitionService: any);
17
14
  /**
18
15
  * The latest successful state parameters
19
16
  *
20
- * @deprecated This is a passthrough through to [[RouterGlobals.params]]
17
+ * @deprecated This is a passthrough through to [[Router.params]]
21
18
  */
22
19
  get params(): import("../params/state-params.js").StateParams;
23
20
  /**
24
21
  * The current [[StateDeclaration]]
25
22
  *
26
- * @deprecated This is a passthrough through to [[RouterGlobals.current]]
23
+ * @deprecated This is a passthrough through to [[Router.current]]
27
24
  */
28
25
  get current(): import("./interface.js").StateDeclaration;
29
26
  /**
30
27
  * The current [[StateObject]] (an internal API)
31
28
  *
32
- * @deprecated This is a passthrough through to [[RouterGlobals.$current]]
29
+ * @deprecated This is a passthrough through to [[Router.$current]]
33
30
  */
34
31
  get $current(): import("./state-object.js").StateObject;
35
32
  stateRegistry: any;
36
33
  urlService: any;
37
- globals: import("../globals.js").RouterGlobals;
34
+ globals: import("../router.js").Router;
38
35
  transitionService: any;
39
36
  invalidCallbacks: any[];
40
37
  _defaultErrorHandler: ($error$: any) => never;
@@ -23,10 +23,10 @@ export namespace defaultTransOpts {
23
23
  export class TransitionProvider {
24
24
  static $inject: string[];
25
25
  /**
26
- * @param {import('../globals.js').RouterGlobals} globals
26
+ * @param {import('../router.js').Router} globals
27
27
  * @param viewService
28
28
  */
29
- constructor(globals: import("../globals.js").RouterGlobals, viewService: any);
29
+ constructor(globals: import("../router.js").Router, viewService: any);
30
30
  _transitionCount: number;
31
31
  /** The transition hook types, such as `onEnter`, `onStart`, etc */
32
32
  _eventTypes: any[];
@@ -34,7 +34,7 @@ export class TransitionProvider {
34
34
  _registeredHooks: {};
35
35
  /** The paths on a criteria object */
36
36
  _criteriaPaths: {};
37
- globals: import("../globals.js").RouterGlobals;
37
+ globals: import("../router.js").Router;
38
38
  $view: any;
39
39
  _deregisterHookFns: {};
40
40
  _pluginapi: any;
@@ -18,18 +18,18 @@ export class Transition implements IHookRegistry {
18
18
  * encapsulates the "from state".
19
19
  * @param {import('../state/target-state.js').TargetState} targetState The target state and parameters being transitioned to (also, the transition options)
20
20
  * @param {import('../transition/transition-service.js').TransitionProvider} transitionService The [[TransitionService]] instance
21
- * @param {import('../globals.js').RouterGlobals} globals
21
+ * @param {import('../router.js').Router} globals
22
22
  */
23
23
  constructor(
24
24
  fromPath: Array<import("../path/path-node.js").PathNode>,
25
25
  targetState: import("../state/target-state.js").TargetState,
26
26
  transitionService: import("../transition/transition-service.js").TransitionProvider,
27
- globals: import("../globals.js").RouterGlobals,
27
+ globals: import("../router.js").Router,
28
28
  );
29
29
  /**
30
- * @type {import('../globals.js').RouterGlobals}
30
+ * @type {import('../router.js').Router}
31
31
  */
32
- globals: import("../globals.js").RouterGlobals;
32
+ globals: import("../router.js").Router;
33
33
  transitionService: import("../transition/transition-service.js").TransitionProvider;
34
34
  _deferred: any;
35
35
  /**
@@ -50,7 +50,6 @@
50
50
  *
51
51
  */
52
52
  export class UrlMatcher {
53
- static encodeDashes(str: any): string;
54
53
  /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */
55
54
  static pathSegmentsAndParams(matcher: any): any;
56
55
  /** @internal Given a matcher, return an array with the matcher's query params */
@@ -9,10 +9,19 @@
9
9
  * - [[StateObject]]
10
10
  */
11
11
  export class UrlRuleFactory {
12
- constructor(urlService: any, stateService: any, routerGlobals: any);
13
- urlService: any;
14
- stateService: any;
15
- routerGlobals: any;
12
+ /**
13
+ * @param {import('../url/url-service.js').UrlService} urlService
14
+ * @param {import('../state/state-service.js').StateProvider} stateService
15
+ * @param {import('../router.js').Router} routerGlobals
16
+ */
17
+ constructor(
18
+ urlService: import("../url/url-service.js").UrlService,
19
+ stateService: import("../state/state-service.js").StateProvider,
20
+ routerGlobals: import("../router.js").Router,
21
+ );
22
+ urlService: import("../url/url-service.js").UrlService;
23
+ stateService: import("../state/state-service.js").StateProvider;
24
+ routerGlobals: import("../router.js").Router;
16
25
  /**
17
26
  *
18
27
  * @param {*} what
@@ -6,13 +6,13 @@ export class UrlService {
6
6
  /**
7
7
  * @param {import("../../services/location/location").LocationProvider} $locationProvider
8
8
  * @param {import("../../router/state/state-service.js").StateProvider} stateService
9
- * @param {import("../../router/globals.js").RouterGlobals} globals
9
+ * @param {import("../router.js").Router} globals
10
10
  * @param {import("../../router/url/url-config.js").UrlConfigProvider} urlConfigProvider
11
11
  */
12
12
  constructor(
13
13
  $locationProvider: any,
14
14
  stateService: import("../../router/state/state-service.js").StateProvider,
15
- globals: import("../../router/globals.js").RouterGlobals,
15
+ globals: import("../router.js").Router,
16
16
  urlConfigProvider: import("../../router/url/url-config.js").UrlConfigProvider,
17
17
  );
18
18
  /** @type {import("../../services/location/location").Location} */
@@ -54,11 +54,6 @@ export function compose(...args: any[]): () => any;
54
54
  * then, piped is: h(g(f(x)))
55
55
  */
56
56
  export function pipe(...args: any[]): any;
57
- /**
58
- * Given two functions that return truthy or falsey values, returns a function that returns truthy
59
- * if at least one of the functions returns truthy for the given arguments
60
- */
61
- export function or(fn1: any, fn2: any): (...args: any[]) => any;
62
57
  /**
63
58
  * Sorta like Pattern Matching (a functional programming conditional construct)
64
59
  *
@@ -109,6 +104,5 @@ export function pattern(struct: any): (arg0: any) => any;
109
104
  */
110
105
  export const propEq: any;
111
106
  export function parse(name: any): any;
112
- export function all(fn1: any): (arr: any) => any;
113
107
  export function is(ctor: any): (obj: any) => boolean;
114
108
  export function val(v: any): () => any;