@angular-wave/angular.ts 0.0.65 → 0.0.67

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 (79) 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 +6 -0
  5. package/src/animations/animate-swap.js +3 -0
  6. package/src/animations/animation.js +1 -1
  7. package/src/core/compile/compile.js +16 -4
  8. package/src/core/controller/controller.js +5 -5
  9. package/src/core/di/injector.js +133 -259
  10. package/src/core/di/injector.md +3 -3
  11. package/src/core/di/injector.spec.js +30 -24
  12. package/src/core/di/internal-injector.js +286 -0
  13. package/src/core/filter/filter.js +5 -0
  14. package/src/core/parser/parse.js +1 -12
  15. package/src/core/parser/parse.spec.js +96 -110
  16. package/src/core/sce/sce.js +6 -1
  17. package/src/core/timeout/timeout.js +110 -111
  18. package/src/directive/input/input.js +32 -726
  19. package/src/directive/input/input.md +706 -0
  20. package/src/directive/select/select.js +48 -122
  21. package/src/directive/select/select.md +74 -0
  22. package/src/directive/show-hide/show-hide.js +13 -224
  23. package/src/directive/show-hide/show-hide.md +257 -0
  24. package/src/filters/limit-to.spec.js +1 -1
  25. package/src/filters/order-by.spec.js +1 -1
  26. package/src/index.js +6 -2
  27. package/src/loader.js +8 -4
  28. package/src/public.js +1 -7
  29. package/src/router/services.js +9 -4
  30. package/src/router/state/state-builder.js +6 -7
  31. package/src/router/state/state-registry.js +5 -0
  32. package/src/router/state/state-service.js +1 -1
  33. package/src/router/state/views.js +2 -1
  34. package/src/router/state-provider.js +1 -1
  35. package/src/router/template-factory.js +15 -14
  36. package/src/router/url/url-service.js +4 -4
  37. package/src/services/anchor-scroll.js +2 -2
  38. package/src/services/browser.js +2 -9
  39. package/src/services/cache-factory.js +0 -67
  40. package/src/services/cache-factory.md +75 -0
  41. package/src/services/cookie-reader.js +36 -55
  42. package/src/services/http/http.js +73 -586
  43. package/src/services/http/http.md +413 -0
  44. package/src/services/http-backend/http-backend.js +19 -44
  45. package/src/services/template-request.js +1 -9
  46. package/src/shared/jqlite/jqlite.js +4 -69
  47. package/src/types.js +8 -12
  48. package/types/animations/animate-js.d.ts +1 -1
  49. package/types/animations/animate-swap.d.ts +4 -7
  50. package/types/animations/animation.d.ts +1 -1
  51. package/types/core/compile/compile.d.ts +7 -7
  52. package/types/core/controller/controller.d.ts +1 -6
  53. package/types/core/di/injector.d.ts +13 -7
  54. package/types/core/di/internal-injector.d.ts +91 -0
  55. package/types/core/exception-handler.d.ts +1 -1
  56. package/types/core/filter/filter.d.ts +1 -1
  57. package/types/core/parser/parse.d.ts +1 -1
  58. package/types/core/sce/sce.d.ts +1 -1
  59. package/types/core/timeout/timeout.d.ts +16 -26
  60. package/types/directive/input/input.d.ts +19 -124
  61. package/types/directive/select/select.d.ts +7 -74
  62. package/types/directive/show-hide/show-hide.d.ts +11 -224
  63. package/types/loader.d.ts +4 -4
  64. package/types/router/services.d.ts +8 -1
  65. package/types/router/state/state-builder.d.ts +1 -2
  66. package/types/router/state/state-registry.d.ts +2 -2
  67. package/types/router/state/state-service.d.ts +2 -2
  68. package/types/router/state-provider.d.ts +2 -2
  69. package/types/router/template-factory.d.ts +16 -16
  70. package/types/router/url/url-service.d.ts +4 -4
  71. package/types/services/anchor-scroll.d.ts +1 -1
  72. package/types/services/browser.d.ts +0 -10
  73. package/types/services/cache-factory.d.ts +0 -67
  74. package/types/services/cookie-reader.d.ts +2 -10
  75. package/types/services/http/http.d.ts +53 -61
  76. package/types/services/http-backend/http-backend.d.ts +8 -31
  77. package/types/services/template-request.d.ts +1 -9
  78. package/types/shared/jqlite/jqlite.d.ts +9 -9
  79. package/types/types.d.ts +5 -38
@@ -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: any, $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,10 +104,10 @@ 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
112
  * @param {string} node
113
113
  * @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,5 +1,9 @@
1
1
  export type BootstrapConfig = any;
2
2
  export type Injectable<T_1> = Function | Array<string | Function>;
3
+ export type Annotated = {
4
+ $inject: Array<string>;
5
+ };
6
+ export type AnnotatedFunction = Function & Annotated & Array<any>;
3
7
  export type ComponentOptions = any;
4
8
  export type ControllerConstructor = Function;
5
9
  export type OnChangesObject = any;
@@ -156,12 +160,7 @@ export type ServiceProviderFactory = Function;
156
160
  /**
157
161
  * Interface for a service provider.
158
162
  */
159
- export type ServiceProvider = {
160
- /**
161
- * - The $get property that represents a service instance or a factory function.
162
- */
163
- $get: any;
164
- };
163
+ export type ServiceProvider = any | Function;
165
164
  export type Module = any;
166
165
  export type FormController = {
167
166
  /**
@@ -409,35 +408,3 @@ export type ModelValidators = {
409
408
  export type AsyncModelValidators = {
410
409
  [x: string]: (arg0: any, arg1: any) => Promise<any>;
411
410
  };
412
- export type InjectorService = {
413
- /**
414
- * - Annotate a function or an array of inline annotations.
415
- */
416
- annotate: (arg0: Function, arg1: boolean | undefined) => string[];
417
- /**
418
- * - Get a service by name.
419
- */
420
- get: (arg0: string, arg1: string | undefined) => any;
421
- /**
422
- * - Instantiate a type constructor with optional locals.
423
- */
424
- instantiate: (arg0: Function, arg1: any | null) => any;
425
- /**
426
- * - Invoke a function with optional context and locals.
427
- */
428
- invoke: (arg0: Injectable<Function | ((...args: any[]) => any)>, arg1: any | undefined, arg2: any | undefined) => any;
429
- /**
430
- * - Add and load new modules to the injector.
431
- */
432
- loadNewModules?: (arg0: Array<Module | string | Injectable<(...args: any[]) => void>>) => void;
433
- /**
434
- * - A map of all the modules loaded into the injector.
435
- */
436
- modules?: {
437
- [x: string]: Module;
438
- };
439
- /**
440
- * - Indicates if strict dependency injection is enforced.
441
- */
442
- strictDi?: boolean;
443
- };