@angular-wave/angular.ts 0.0.66 → 0.0.68

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 (85) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +2 -2
  3. package/package.json +1 -1
  4. package/src/animations/animate-js.js +4 -4
  5. package/src/animations/animate-swap.js +3 -0
  6. package/src/core/compile/compile.js +3 -3
  7. package/src/core/controller/controller.js +0 -5
  8. package/src/core/di/injector.js +9 -12
  9. package/src/core/di/internal-injector.js +113 -60
  10. package/src/core/interval/interval-factory.js +8 -1
  11. package/src/core/interval/interval.js +30 -16
  12. package/src/core/location/location.js +473 -626
  13. package/src/core/location/location.md +114 -0
  14. package/src/core/location/location.spec.js +1 -76
  15. package/src/core/parser/parse.js +1 -12
  16. package/src/core/parser/parse.spec.js +96 -110
  17. package/src/core/q/q.js +63 -65
  18. package/src/core/sce/sce.js +1 -3
  19. package/src/core/scope/scope.js +2 -5
  20. package/src/core/timeout/timeout.js +110 -111
  21. package/src/core/url-utils/url-utils.js +5 -0
  22. package/src/directive/input/input.js +32 -726
  23. package/src/directive/input/input.md +706 -0
  24. package/src/directive/options/options.js +2 -156
  25. package/src/directive/options/options.md +179 -0
  26. package/src/directive/select/select.js +55 -126
  27. package/src/directive/select/select.md +74 -0
  28. package/src/directive/show-hide/show-hide.js +13 -224
  29. package/src/directive/show-hide/show-hide.md +257 -0
  30. package/src/exts/messages/messages.js +2 -0
  31. package/src/filters/limit-to.spec.js +1 -1
  32. package/src/filters/order-by.spec.js +1 -1
  33. package/src/index.js +6 -2
  34. package/src/loader.js +7 -3
  35. package/src/public.js +1 -7
  36. package/src/router/params/param.js +54 -54
  37. package/src/router/path/path-utils.js +1 -0
  38. package/src/router/state/state-builder.js +2 -4
  39. package/src/router/state/state-service.js +1 -1
  40. package/src/router/state-provider.js +1 -1
  41. package/src/router/template-factory.js +10 -10
  42. package/src/router/url/url-service.js +11 -4
  43. package/src/services/anchor-scroll.js +3 -5
  44. package/src/services/browser.js +2 -9
  45. package/src/services/cache-factory.js +0 -67
  46. package/src/services/cache-factory.md +75 -0
  47. package/src/services/cookie-reader.js +36 -55
  48. package/src/services/http/http.js +62 -587
  49. package/src/services/http/http.md +413 -0
  50. package/src/services/http-backend/http-backend.js +19 -44
  51. package/src/services/template-request.js +1 -9
  52. package/src/shared/jqlite/jqlite.js +5 -70
  53. package/src/types.js +2 -4
  54. package/types/animations/animate-swap.d.ts +4 -7
  55. package/types/core/compile/compile.d.ts +6 -6
  56. package/types/core/controller/controller.d.ts +0 -5
  57. package/types/core/di/internal-injector.d.ts +73 -18
  58. package/types/core/exception-handler.d.ts +1 -1
  59. package/types/core/interval/interval-factory.d.ts +1 -1
  60. package/types/core/interval/interval.d.ts +4 -0
  61. package/types/core/location/location.d.ts +235 -166
  62. package/types/core/parser/parse.d.ts +1 -1
  63. package/types/core/q/q.d.ts +61 -40
  64. package/types/core/scope/scope.d.ts +5 -8
  65. package/types/core/timeout/timeout.d.ts +16 -26
  66. package/types/core/url-utils/url-utils.d.ts +4 -0
  67. package/types/directive/input/input.d.ts +19 -124
  68. package/types/directive/select/select.d.ts +7 -74
  69. package/types/directive/show-hide/show-hide.d.ts +11 -224
  70. package/types/loader.d.ts +4 -4
  71. package/types/router/params/param.d.ts +11 -0
  72. package/types/router/state/state-builder.d.ts +1 -2
  73. package/types/router/state/state-service.d.ts +2 -2
  74. package/types/router/state-provider.d.ts +2 -2
  75. package/types/router/template-factory.d.ts +15 -15
  76. package/types/router/url/url-service.d.ts +12 -12
  77. package/types/services/anchor-scroll.d.ts +1 -1
  78. package/types/services/browser.d.ts +0 -10
  79. package/types/services/cache-factory.d.ts +0 -67
  80. package/types/services/cookie-reader.d.ts +2 -10
  81. package/types/services/http/http.d.ts +53 -61
  82. package/types/services/http-backend/http-backend.d.ts +8 -31
  83. package/types/services/template-request.d.ts +1 -9
  84. package/types/shared/jqlite/jqlite.d.ts +11 -11
  85. package/types/types.d.ts +1 -9
@@ -1,68 +1,60 @@
1
+ /**
2
+ * Default params serializer that converts objects to strings
3
+ * according to the following rules:
4
+ *
5
+ * * `{'foo': 'bar'}` results in `foo=bar`
6
+ * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)
7
+ * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)
8
+ * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D` (stringified and encoded representation of an object)
9
+ *
10
+ * Note that serializer will sort the request parameters alphabetically.
11
+ */
1
12
  export function $HttpParamSerializerProvider(): void;
2
13
  export class $HttpParamSerializerProvider {
3
- /**
4
- * @ngdoc service
5
- * @name $httpParamSerializer
6
- * @description
7
- *
8
- * Default {@link $http `$http`} params serializer that converts objects to strings
9
- * according to the following rules:
10
- *
11
- * * `{'foo': 'bar'}` results in `foo=bar`
12
- * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)
13
- * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)
14
- * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D` (stringified and encoded representation of an object)
15
- *
16
- * Note that serializer will sort the request parameters alphabetically.
17
- */
18
14
  $get: () => (params: any) => string;
19
15
  }
16
+ /**
17
+ *
18
+ * Alternative {@link $http `$http`} params serializer that follows
19
+ * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.
20
+ * The serializer will also sort the params alphabetically.
21
+ *
22
+ * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:
23
+ *
24
+ * ```js
25
+ * $http({
26
+ * url: myUrl,
27
+ * method: 'GET',
28
+ * params: myParams,
29
+ * paramSerializer: '$httpParamSerializerJQLike'
30
+ * });
31
+ * ```
32
+ *
33
+ * It is also possible to set it as the default `paramSerializer` in the
34
+ * {@link $httpProvider#defaults `$httpProvider`}.
35
+ *
36
+ * Additionally, you can inject the serializer and use it explicitly, for example to serialize
37
+ * form data for submission:
38
+ *
39
+ * ```js
40
+ * .controller(function($http, $httpParamSerializerJQLike) {
41
+ * //...
42
+ *
43
+ * $http({
44
+ * url: myUrl,
45
+ * method: 'POST',
46
+ * data: $httpParamSerializerJQLike(myData),
47
+ * headers: {
48
+ * 'Content-Type': 'application/x-www-form-urlencoded'
49
+ * }
50
+ * });
51
+ *
52
+ * });
53
+ * ```
54
+ *
55
+ */
20
56
  export function $HttpParamSerializerJQLikeProvider(): void;
21
57
  export class $HttpParamSerializerJQLikeProvider {
22
- /**
23
- * @ngdoc service
24
- * @name $httpParamSerializerJQLike
25
- *
26
- * @description
27
- *
28
- * Alternative {@link $http `$http`} params serializer that follows
29
- * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.
30
- * The serializer will also sort the params alphabetically.
31
- *
32
- * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:
33
- *
34
- * ```js
35
- * $http({
36
- * url: myUrl,
37
- * method: 'GET',
38
- * params: myParams,
39
- * paramSerializer: '$httpParamSerializerJQLike'
40
- * });
41
- * ```
42
- *
43
- * It is also possible to set it as the default `paramSerializer` in the
44
- * {@link $httpProvider#defaults `$httpProvider`}.
45
- *
46
- * Additionally, you can inject the serializer and use it explicitly, for example to serialize
47
- * form data for submission:
48
- *
49
- * ```js
50
- * .controller(function($http, $httpParamSerializerJQLike) {
51
- * //...
52
- *
53
- * $http({
54
- * url: myUrl,
55
- * method: 'POST',
56
- * data: $httpParamSerializerJQLike(myData),
57
- * headers: {
58
- * 'Content-Type': 'application/x-www-form-urlencoded'
59
- * }
60
- * });
61
- *
62
- * });
63
- * ```
64
- *
65
- */
66
58
  $get: () => (params: any) => string;
67
59
  }
68
60
  export function defaultHttpResponseTransform(data: any, headers: any): any;
@@ -113,8 +105,8 @@ export class $HttpProvider {
113
105
  useApplyAsync: (value?: boolean | undefined) => boolean | any;
114
106
  interceptors: any[];
115
107
  xsrfTrustedOrigins: any[];
116
- $get: (string | (($browser: any, $httpBackend: any, $$cookieReader: any, $cacheFactory: any, $rootScope: any, $q: any, $injector: import("../../core/di/internal-injector").InjectorService, $sce: any) => {
117
- (requestConfig: any): HttpPromise;
108
+ $get: (string | (($browser: any, $httpBackend: any, $cacheFactory: any, $rootScope: any, $q: any, $injector: import("../../core/di/internal-injector").InjectorService, $sce: any) => {
109
+ (requestConfig: any): any;
118
110
  pendingRequests: any[];
119
111
  /**
120
112
  * @ngdoc property
@@ -1,33 +1,5 @@
1
1
  /**
2
- * @ngdoc service
3
- * @name $xhrFactory
4
- *
5
- *
6
- * @description
7
- * Factory function used to create XMLHttpRequest objects.
8
- *
9
- * Replace or decorate this service to create your own custom XMLHttpRequest objects.
10
- *
11
- * ```
12
- * angular.module('myApp', [])
13
- * .factory('$xhrFactory', function() {
14
- * return function createXhr(method, url) {
15
- * return new window.XMLHttpRequest({mozSystem: true});
16
- * };
17
- * });
18
- * ```
19
- *
20
- * @param {string} method HTTP method of the request (GET, POST, PUT, ..)
21
- * @param {string} url URL of the request.
22
- */
23
- export function $xhrFactoryProvider(): void;
24
- export class $xhrFactoryProvider {
25
- $get: () => () => XMLHttpRequest;
26
- }
27
- /**
28
- * @ngdoc service
29
- * @name $httpBackend
30
- * @requires $xhrFactory
2
+
31
3
  *
32
4
  *
33
5
  * @description
@@ -40,6 +12,11 @@ export class $xhrFactoryProvider {
40
12
  */
41
13
  export function $HttpBackendProvider(): void;
42
14
  export class $HttpBackendProvider {
43
- $get: (string | (($browser: any, $xhrFactory: any) => (method: any, url: any, post: any, callback: any, headers: any, timeout: any, withCredentials: any, responseType: any, eventHandlers: any, uploadEventHandlers: any) => void))[];
15
+ $get: (string | (($browser: import("../browser").Browser) => (method: any, url: any, post: any, callback: any, headers: any, timeout: any, withCredentials: any, responseType: any, eventHandlers: any, uploadEventHandlers: any) => void))[];
44
16
  }
45
- export function createHttpBackend($browser: any, createXhr: any, $browserDefer: any): (method: any, url: any, post: any, callback: any, headers: any, timeout: any, withCredentials: any, responseType: any, eventHandlers: any, uploadEventHandlers: any) => void;
17
+ /**
18
+ * @param {import('../browser').Browser} $browser
19
+ * @param {*} $browserDefer
20
+ * @returns
21
+ */
22
+ export function createHttpBackend($browser: import("../browser").Browser, $browserDefer: any): (method: any, url: any, post: any, callback: any, headers: any, timeout: any, withCredentials: any, responseType: any, eventHandlers: any, uploadEventHandlers: any) => void;
@@ -7,12 +7,8 @@
7
7
  export function TemplateRequestProvider(): void;
8
8
  export class TemplateRequestProvider {
9
9
  /**
10
- * @ngdoc method
11
- * @name $templateRequestProvider#httpOptions
12
- * @description
13
10
  * The options to be passed to the {@link $http} service when making the request.
14
11
  * You can use this to override options such as the "Accept" header for template requests.
15
- *
16
12
  * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the
17
13
  * options if not overridden here.
18
14
  *
@@ -21,10 +17,6 @@ export class TemplateRequestProvider {
21
17
  */
22
18
  httpOptions: (val?: string | undefined) => string | TemplateRequestProvider;
23
19
  /**
24
- * @ngdoc service
25
- * @name $templateRequest
26
- *
27
- * @description
28
20
  * The `$templateRequest` service runs security checks then downloads the provided template using
29
21
  * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
30
22
  * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
@@ -41,7 +33,7 @@ export class TemplateRequestProvider {
41
33
  * 3rd party modules should use `$templateRequest` if their services or directives are loading
42
34
  * templates.
43
35
  *
44
- * @param {string|TrustedResourceUrl} tpl The HTTP request template URL
36
+ * @param {string} tpl The HTTP request template URL
45
37
  * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty
46
38
  *
47
39
  * @return {Promise} a promise for the HTTP response data of the given URL.
@@ -2,19 +2,19 @@
2
2
  * JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
3
3
  * and execution of chain functions.
4
4
  *
5
- * @param {string|Node|JQLite|ArrayLike<Element>|(() => void)} element
5
+ * @param {string|Node|JQLite|ArrayLike<Element>|(() => void)|Window} element
6
6
  * @returns {JQLite}
7
7
  */
8
- export function JQLite(element: string | Node | JQLite | ArrayLike<Element> | (() => void)): JQLite;
8
+ export function JQLite(element: string | Node | JQLite | ArrayLike<Element> | (() => void) | Window): JQLite;
9
9
  export class JQLite {
10
10
  /**
11
11
  * JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
12
12
  * and execution of chain functions.
13
13
  *
14
- * @param {string|Node|JQLite|ArrayLike<Element>|(() => void)} element
14
+ * @param {string|Node|JQLite|ArrayLike<Element>|(() => void)|Window} element
15
15
  * @returns {JQLite}
16
16
  */
17
- constructor(element: string | Node | JQLite | ArrayLike<Element> | (() => void));
17
+ constructor(element: string | Node | JQLite | ArrayLike<Element> | (() => void) | Window);
18
18
  /**
19
19
  * Remove all child nodes of the set of matched elements from the DOM and clears CACHE data, associated with the node.
20
20
  * @returns {JQLite} The current instance of JQLite.
@@ -38,9 +38,9 @@ export class JQLite {
38
38
  controller(name?: string): any;
39
39
  /**
40
40
  * Return instance of injector attached to element
41
- * @returns {import('../../types').InjectorService}
41
+ * @returns {import('../../core/di/internal-injector').InjectorService}
42
42
  */
43
- injector(): import("../../types").InjectorService;
43
+ injector(): import("../../core/di/internal-injector").InjectorService;
44
44
  /**
45
45
  * Adds an event listener to each element in the JQLite collection.
46
46
  *
@@ -104,15 +104,15 @@ export class JQLite {
104
104
  replaceWith(arg1: any): this;
105
105
  children(): JQLite;
106
106
  /**
107
- * @param {string} node
107
+ * @param {string|JQLite} node
108
108
  * @returns {JQLite}
109
109
  */
110
- append(node: string): JQLite;
110
+ append(node: string | JQLite): JQLite;
111
111
  /**
112
- * @param {string} node
112
+ * @param {string|JQLite} node
113
113
  * @returns {JQLite}
114
114
  */
115
- prepend(node: string): JQLite;
115
+ prepend(node: string | JQLite): JQLite;
116
116
  /**
117
117
  * @param {string} newElement
118
118
  * @returns {JQLite}
@@ -129,7 +129,7 @@ export class JQLite {
129
129
  /**
130
130
  * TODO: REMOVE! This function being used ONLY in tests!
131
131
  */
132
- triggerHandler(event: any, extraParameters: any): void | JQLite;
132
+ triggerHandler(event: any, extraParameters: any): this;
133
133
  toString(): string;
134
134
  eq(index: any): JQLite;
135
135
  length: number;
package/types/types.d.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  export type BootstrapConfig = any;
2
2
  export type Injectable<T_1> = Function | Array<string | Function>;
3
3
  export type Annotated = {
4
- /**
5
- * *
6
- */
7
4
  $inject: Array<string>;
8
5
  };
9
6
  export type AnnotatedFunction = Function & Annotated & Array<any>;
@@ -163,12 +160,7 @@ export type ServiceProviderFactory = Function;
163
160
  /**
164
161
  * Interface for a service provider.
165
162
  */
166
- export type ServiceProvider = {
167
- /**
168
- * - The $get property that represents a service instance or a factory function.
169
- */
170
- $get: any;
171
- };
163
+ export type ServiceProvider = any | Function;
172
164
  export type Module = any;
173
165
  export type FormController = {
174
166
  /**