@angular-wave/angular.ts 0.0.39 → 0.0.40

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 (137) hide show
  1. package/Makefile +2 -0
  2. package/README.md +1 -1
  3. package/dist/angular-ts.esm.js +2 -2
  4. package/dist/angular-ts.umd.js +2 -1
  5. package/package.json +1 -1
  6. package/rollup.config.js +10 -5
  7. package/src/angular.spec.js +25 -26
  8. package/src/animations/animate-css-driver.js +3 -3
  9. package/src/animations/animate-queue.js +7 -7
  10. package/src/animations/animation.js +2 -2
  11. package/src/animations/shared.js +6 -6
  12. package/src/binding.spec.js +7 -7
  13. package/src/core/animate/animate.js +5 -5
  14. package/src/core/animate/animate.spec.js +31 -31
  15. package/src/core/cache/cache-factory.html +18 -0
  16. package/src/core/cache/{cache-factor.test.js → cache-factory.test.js} +1 -1
  17. package/src/core/compile/compile.js +31 -25
  18. package/src/core/compile/compile.md +2 -2
  19. package/src/core/cookie-reader.spec.js +2 -2
  20. package/src/core/core.html +22 -0
  21. package/src/core/core.test.js +12 -0
  22. package/src/core/document.spec.js +4 -4
  23. package/src/core/exception-handler.js +30 -23
  24. package/src/core/interpolate/interpolate.js +7 -0
  25. package/src/core/{cache/cache-factor.html → location/location.html} +1 -1
  26. package/src/core/location/location.js +2 -2
  27. package/src/core/location/location.spec.js +17 -17
  28. package/src/core/location/location.test.js +12 -0
  29. package/src/core/on.spec.js +3 -3
  30. package/src/core/parser/parse.html +18 -0
  31. package/src/core/parser/parse.spec.js +1 -1
  32. package/src/core/parser/parse.test.js +12 -0
  33. package/src/core/prop.spec.js +3 -4
  34. package/src/core/pubsub/pubsub.html +18 -0
  35. package/src/core/pubsub/pubsub.spec.js +1 -1
  36. package/src/core/pubsub/pubsub.test.js +12 -0
  37. package/src/core/q/q.html +18 -0
  38. package/src/core/q/q.js +33 -0
  39. package/src/core/q/q.test.js +0 -0
  40. package/src/core/root-element.spec.js +4 -4
  41. package/src/core/sanitize/sanitize-uri.spec.js +1 -1
  42. package/src/core/sanitize/sanitize-uri.test.js +12 -0
  43. package/src/core/sanitize/sanitize.html +21 -0
  44. package/src/core/sce/sce.html +18 -0
  45. package/src/core/sce/sce.spec.js +2 -1
  46. package/src/core/sce/sce.test.js +12 -0
  47. package/src/core/scope/scope.html +18 -0
  48. package/src/core/scope/scope.js +1 -1
  49. package/src/core/scope/scope.spec.js +1 -1
  50. package/src/core/scope/scope.test.js +12 -0
  51. package/src/core/task-tracker-factory.js +9 -11
  52. package/src/core/timeout/timeout.html +18 -0
  53. package/src/core/timeout/timeout.js +9 -0
  54. package/src/core/timeout/timeout.spec.js +2 -2
  55. package/src/core/timeout/timout.test.js +12 -0
  56. package/src/core/url-utils/url-utils.html +18 -0
  57. package/src/core/url-utils/url-utils.spec.js +4 -2
  58. package/src/core/url-utils/url-utils.test.js +12 -0
  59. package/src/directive/attrs/attrs.spec.js +1 -2
  60. package/src/directive/attrs/boolean.spec.js +1 -2
  61. package/src/directive/attrs/element-style.spec.js +6 -7
  62. package/src/directive/attrs/src.spec.js +1 -2
  63. package/src/directive/bind/bind.spec.js +1 -2
  64. package/src/directive/class/class.spec.js +15 -16
  65. package/src/directive/cloak/cloak.spec.js +3 -4
  66. package/src/directive/controller/controller.spec.js +4 -5
  67. package/src/directive/events/click.spec.js +1 -2
  68. package/src/directive/events/event.spec.js +1 -1
  69. package/src/directive/events/events.js +7 -0
  70. package/src/directive/form/form.spec.js +17 -17
  71. package/src/directive/if/if.spec.js +2 -2
  72. package/src/directive/include/include.js +2 -2
  73. package/src/directive/include/include.spec.js +32 -32
  74. package/src/directive/init/init.spec.js +2 -3
  75. package/src/directive/input/input.spec.js +3 -3
  76. package/src/directive/list/list.spec.js +1 -2
  77. package/src/directive/model/model.js +13 -0
  78. package/src/directive/model/model.spec.js +4 -5
  79. package/src/directive/model-options/model-options.spec.js +3 -3
  80. package/src/directive/non-bindable/non-bindable.spec.js +1 -2
  81. package/src/directive/options/options.js +5 -5
  82. package/src/directive/options/options.spec.js +13 -13
  83. package/src/directive/ref/href.spec.js +1 -2
  84. package/src/directive/repeat/repeat.spec.js +12 -12
  85. package/src/directive/script/script.spec.js +2 -3
  86. package/src/directive/select/select.js +6 -6
  87. package/src/directive/select/select.spec.js +5 -5
  88. package/src/directive/show-hide/show-hide.spec.js +12 -13
  89. package/src/directive/style/style.spec.js +3 -4
  90. package/src/directive/switch/switch.spec.js +2 -3
  91. package/src/directive/validators/validators.spec.js +1 -1
  92. package/src/exts/aria/aria.spec.js +1 -2
  93. package/src/exts/messages/messages.spec.js +5 -5
  94. package/src/filters/filter.spec.js +5 -5
  95. package/src/filters/filters.html +21 -0
  96. package/src/filters/filters.spec.js +3 -3
  97. package/src/filters/filters.test.js +12 -0
  98. package/src/filters/limit-to.md +1 -1
  99. package/src/filters/limit-to.spec.js +4 -4
  100. package/src/filters/order-by.spec.js +2 -2
  101. package/src/index.js +186 -31
  102. package/src/loader.js +49 -11
  103. package/src/public.js +2 -3
  104. package/src/router/directives/state-directives.spec.js +90 -90
  105. package/src/router/directives/view-directive.js +2 -2
  106. package/src/router/directives/view-directive.spec.js +9 -9
  107. package/src/router/state/state.spec.js +2 -4
  108. package/src/router/template-factory.spec.js +2 -2
  109. package/src/router/transition/hook-registry.js +2 -2
  110. package/src/router/view/view.spec.js +1 -1
  111. package/src/services/browser.js +56 -39
  112. package/src/services/document.js +16 -13
  113. package/src/services/log.js +39 -43
  114. package/src/services/template-request.js +9 -0
  115. package/src/shared/common.js +0 -3
  116. package/src/shared/jqlite/jqlite.js +83 -89
  117. package/src/shared/jqlite/jqlite.spec.js +218 -222
  118. package/src/shared/strings.js +2 -2
  119. package/src/shared/test-utils.js +2 -2
  120. package/src/shared/utils.js +8 -11
  121. package/types/animations/shared.d.ts +1 -1
  122. package/types/core/exception-handler.d.ts +9 -42
  123. package/types/core/interpolate/interpolate.d.ts +1 -1
  124. package/types/core/q/q.d.ts +35 -1
  125. package/types/core/task-tracker-factory.d.ts +18 -11
  126. package/types/core/timeout/timeout.d.ts +10 -1
  127. package/types/directive/model/model.d.ts +28 -4
  128. package/types/index.d.ts +664 -79
  129. package/types/services/browser.d.ts +50 -20
  130. package/types/services/document.d.ts +13 -9
  131. package/types/services/log.d.ts +37 -34
  132. package/types/services/template-request.d.ts +1 -1
  133. package/types/shared/common.d.ts +0 -1
  134. package/types/shared/jqlite/jqlite.d.ts +6 -7
  135. package/types/shared/utils.d.ts +22 -22
  136. package/types-back/index.d.ts +1 -75
  137. /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { isInjectable, isNull, isPromise } from "./predicates";
9
9
  import { isUndefined, isFunction, isString, isObject } from "./utils";
10
- import { identity, pushR, tail } from "./common";
10
+ import { pushR, tail } from "./common";
11
11
  import { pattern, val } from "./hof";
12
12
  /**
13
13
  * Returns a string shortened to a maximum length
@@ -75,7 +75,7 @@ export function stringify(o) {
75
75
  [isRejection, (x) => x._transitionRejection.toString()],
76
76
  [hasToString, (x) => x.toString()],
77
77
  [isInjectable, functionToString],
78
- [val(true), identity],
78
+ [val(true), (x) => x],
79
79
  ]);
80
80
  function format(value) {
81
81
  if (isObject(value)) {
@@ -1,11 +1,11 @@
1
- import { jqLite } from "./jqlite/jqlite";
1
+ import { JQLite } from "./jqlite/jqlite";
2
2
 
3
3
  /**
4
4
  * @param {HTMLElement} element
5
5
  * @param {string} event
6
6
  */
7
7
  export function browserTrigger(element, event) {
8
- jqLite(element)[0].dispatchEvent(
8
+ JQLite(element)[0].dispatchEvent(
9
9
  new Event(event, { bubbles: true, cancelable: true }),
10
10
  );
11
11
  }
@@ -52,8 +52,8 @@ export function isArrayLike(obj) {
52
52
  if (obj == null || isWindow(obj)) return false;
53
53
 
54
54
  // arrays, strings and jQuery/jqLite objects are array like
55
- // * we have to check the existence of jqLite first as this method is called
56
- // via the forEach method when constructing the jqLite object in the first place
55
+ // * we have to check the existence of JQLite first as this method is called
56
+ // via the forEach method when constructing the JQLite object in the first place
57
57
  if (Array.isArray(obj) || obj instanceof Array || isString(obj)) return true;
58
58
 
59
59
  // Support: iOS 8.2 (not reproducible in simulator)
@@ -1174,6 +1174,8 @@ export function assertArgFn(arg, name, acceptArrayAnnotation) {
1174
1174
  return arg;
1175
1175
  }
1176
1176
 
1177
+ export const minErrConfig = {};
1178
+
1177
1179
  /**
1178
1180
  * @description
1179
1181
  *
@@ -1201,21 +1203,16 @@ export function assertArgFn(arg, name, acceptArrayAnnotation) {
1201
1203
  * @param {string} module The namespace to use for the new minErr instance.
1202
1204
  * @returns {function(string, string, ...*): Error} minErr instance
1203
1205
  */
1204
-
1205
- export const minErrConfig = {};
1206
-
1207
1206
  export function minErr(module) {
1208
1207
  const url = 'https://errors.angularjs.org/"NG_VERSION_FULL"/';
1209
1208
  const regex = `${url.replace(".", "\\.")}[\\s\\S]*`;
1210
1209
  const errRegExp = new RegExp(regex, "g");
1211
1210
 
1212
- return function () {
1213
- const code = arguments[0];
1214
- const template = arguments[1];
1211
+ return function (...args) {
1212
+ const code = args[0];
1213
+ const template = args[1];
1215
1214
  let message = `[${module ? `${module}:` : ""}${code}] `;
1216
- const templateArgs = sliceArgs(arguments, 2).map((arg) =>
1217
- toDebugString(arg),
1218
- );
1215
+ const templateArgs = sliceArgs(args, 2).map((arg) => toDebugString(arg));
1219
1216
  let paramPrefix;
1220
1217
  let i;
1221
1218
 
@@ -47,4 +47,4 @@ export const ANIMATION_DELAY_PROP: string;
47
47
  export const ANIMATION_DURATION_PROP: string;
48
48
  export const TRANSITION_DELAY_PROP: string;
49
49
  export const TRANSITION_DURATION_PROP: string;
50
- export const ngMinErr: (...args: any[]) => Error;
50
+ export const ngMinErr: (arg0: string, arg1: string, ...arg2: any[]) => Error;
@@ -1,46 +1,13 @@
1
1
  /**
2
- * @ngdoc service
3
- * @name $exceptionHandler
4
- * @requires ng.$log
5
- *
6
- *
7
- * @description
8
- * Any uncaught exception in AngularJS expressions is delegated to this service.
9
- * The default implementation simply delegates to `$log.error` which logs it into
10
- * the browser console.
11
- *
12
- *
13
- * ## Example:
14
- *
15
- * The example below will overwrite the default `$exceptionHandler` in order to (a) log uncaught
16
- * errors to the backend for later inspection by the developers and (b) to use `$log.warn()` instead
17
- * of `$log.error()`.
18
- *
19
- * ```js
20
- * angular.
21
- * module('exceptionOverwrite', []).
22
- * factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) {
23
- * return function myExceptionHandler(exception, cause) {
24
- * logErrorsToBackend(exception, cause);
25
- * $log.warn(exception, cause);
26
- * };
27
- * }]);
28
- * ```
29
- *
30
- * <hr />
31
- * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`
32
- * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}
33
- * (unless executed during a digest).
34
- *
35
- * If you wish, you can manually delegate exceptions, e.g.
36
- * `try { ... } catch(e) { $exceptionHandler(e); }`
37
- *
38
- * @param {Error} exception Exception associated with the error.
39
- * @param {string=} cause Optional information about the context in which
40
- * the error was thrown.
41
- *
2
+ * @constructor
3
+ * @this {angular.ExceptionHandlerProvider}
42
4
  */
43
- export function $ExceptionHandlerProvider(): void;
5
+ export function $ExceptionHandlerProvider(this: import("../index").angular.ServiceProvider): void;
44
6
  export class $ExceptionHandlerProvider {
45
- $get: (string | (($log: any) => (...args: any[]) => void))[];
7
+ $get: (string | (($log: import("../services/log").angular.LogService) => angular.ErrorHandler))[];
8
+ }
9
+ export function errorHandler(exception: any, cause: any): void;
10
+ export namespace angular {
11
+ type ExceptionHandlerProvider = import("../index").angular.ServiceProvider;
12
+ type ErrorHandler = (exception: Error, cause?: string) => void;
46
13
  }
@@ -37,7 +37,7 @@ export class $InterpolateProvider {
37
37
  * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
38
38
  */
39
39
  endSymbol: (value?: string | undefined) => string | (Window & typeof globalThis);
40
- $get: (string | (($parse: any, $exceptionHandler: any, $sce: any) => {
40
+ $get: (string | (($parse: any, $exceptionHandler: import("../exception-handler").angular.ErrorHandler, $sce: any) => {
41
41
  (text: string, mustHaveExpression?: boolean | undefined, trustedContext?: string | undefined, allOrNothing?: boolean | undefined): (arg0: context) => any;
42
42
  /**
43
43
  * @ngdoc method
@@ -7,7 +7,7 @@
7
7
  */
8
8
  export function $QProvider(): void;
9
9
  export class $QProvider {
10
- $get: (string | (($rootScope: any, $exceptionHandler: any) => any))[];
10
+ $get: (string | (($rootScope: any, $exceptionHandler: import("../exception-handler").angular.ErrorHandler) => any))[];
11
11
  /**
12
12
  * @ngdoc method
13
13
  * @name $qProvider#errorOnUnhandledRejections
@@ -29,3 +29,37 @@ export class $$QProvider {
29
29
  errorOnUnhandledRejections: (value: any) => boolean | this;
30
30
  }
31
31
  export function markQExceptionHandled(q: any): void;
32
+ export namespace angular {
33
+ type QPromise<T> = {
34
+ /**
35
+ * - Calls one of the success or error callbacks asynchronously as soon as the result is available.
36
+ */
37
+ then: (arg0: ((value: T) => (PromiseLike<never> | PromiseLike<T> | T)) | null, arg1: ((reason: any) => (PromiseLike<never> | PromiseLike<T> | T)) | null, arg2: ((state: any) => any)) => angular.QPromise<T | never>;
38
+ /**
39
+ * - Shorthand for promise.then(null, errorCallback).
40
+ */
41
+ catch: (arg0: ((reason: any) => (PromiseLike<never> | PromiseLike<T> | T)) | null) => angular.QPromise<T> | T;
42
+ /**
43
+ * - Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value.
44
+ */
45
+ finally: (arg0: () => void) => angular.QPromise<T>;
46
+ };
47
+ type Deferred<T> = {
48
+ /**
49
+ * - Resolves the promise with a value or another promise.
50
+ */
51
+ resolve: (arg0: T | angular.QPromise<T>) => void;
52
+ /**
53
+ * - Rejects the promise with a reason.
54
+ */
55
+ reject: (arg0: any) => void;
56
+ /**
57
+ * - Provides a progress notification.
58
+ */
59
+ notify: (arg0: any) => void;
60
+ /**
61
+ * - The promise associated with this deferred object.
62
+ */
63
+ promise: angular.QPromise<T>;
64
+ };
65
+ }
@@ -1,3 +1,7 @@
1
+ export function $$TaskTrackerFactoryProvider(): void;
2
+ export class $$TaskTrackerFactoryProvider {
3
+ $get: (string | ((log: import("../services/log").angular.LogService) => TaskTracker))[];
4
+ }
1
5
  /**
2
6
  * ! This is a private undocumented service !
3
7
  *
@@ -7,19 +11,22 @@
7
11
  *
8
12
  * A `TaskTracker` can keep track of pending tasks (grouped by type) and can notify interested
9
13
  * parties when all pending tasks (or tasks of a specific type) have been completed.
10
- *
11
- * @param {$log} log - A logger instance (such as `$log`). Used to log error during callback
12
- * execution.
13
- *
14
- *
14
+ * @param {import('../services/log').angular.LogService} log
15
15
  */
16
- export function $$TaskTrackerFactoryProvider(): void;
17
- export class $$TaskTrackerFactoryProvider {
18
- $get: () => any;
19
- }
20
- export function TaskTracker(log: any): void;
16
+ export function TaskTracker(log: import("../services/log").angular.LogService): void;
21
17
  export class TaskTracker {
22
- constructor(log: any);
18
+ /**
19
+ * ! This is a private undocumented service !
20
+ *
21
+ * @name $$taskTrackerFactory
22
+ * @description
23
+ * A function to create `TaskTracker` instances.
24
+ *
25
+ * A `TaskTracker` can keep track of pending tasks (grouped by type) and can notify interested
26
+ * parties when all pending tasks (or tasks of a specific type) have been completed.
27
+ * @param {import('../services/log').angular.LogService} log
28
+ */
29
+ constructor(log: import("../services/log").angular.LogService);
23
30
  ALL_TASKS_TYPE: string;
24
31
  DEFAULT_TASK_TYPE: string;
25
32
  /**
@@ -1,4 +1,13 @@
1
- export function $timeout($rootScope: any, $browser: any, $q: any, $$q: any, $exceptionHandler: any): {
1
+ /**
2
+ *
3
+ * @param {*} $rootScope
4
+ * @param {*} $browser
5
+ * @param {*} $q
6
+ * @param {*} $$q
7
+ * @param {import('../exception-handler').angular.ErrorHandler} $exceptionHandler
8
+ * @returns
9
+ */
10
+ export function $timeout($rootScope: any, $browser: any, $q: any, $$q: any, $exceptionHandler: import("../exception-handler").angular.ErrorHandler): {
2
11
  (fn?: (() => any) | undefined, delay?: number | undefined, invokeApply?: boolean | undefined, ...args: any[]): Promise<any>;
3
12
  /**
4
13
  * @ngdoc method
@@ -1,6 +1,30 @@
1
- export function NgModelController($scope: any, $exceptionHandler: any, $attr: any, $element: any, $parse: any, $animate: any, $timeout: any, $q: any, $interpolate: any): void;
1
+ /**
2
+ *
3
+ * @param {*} $scope
4
+ * @param {import('../../core/exception-handler').angular.ErrorHandler} $exceptionHandler
5
+ * @param {*} $attr
6
+ * @param {*} $element
7
+ * @param {*} $parse
8
+ * @param {*} $animate
9
+ * @param {*} $timeout
10
+ * @param {*} $q
11
+ * @param {*} $interpolate
12
+ */
13
+ export function NgModelController($scope: any, $exceptionHandler: import("../../core/exception-handler").angular.ErrorHandler, $attr: any, $element: any, $parse: any, $animate: any, $timeout: any, $q: any, $interpolate: any): void;
2
14
  export class NgModelController {
3
- constructor($scope: any, $exceptionHandler: any, $attr: any, $element: any, $parse: any, $animate: any, $timeout: any, $q: any, $interpolate: any);
15
+ /**
16
+ *
17
+ * @param {*} $scope
18
+ * @param {import('../../core/exception-handler').angular.ErrorHandler} $exceptionHandler
19
+ * @param {*} $attr
20
+ * @param {*} $element
21
+ * @param {*} $parse
22
+ * @param {*} $animate
23
+ * @param {*} $timeout
24
+ * @param {*} $q
25
+ * @param {*} $interpolate
26
+ */
27
+ constructor($scope: any, $exceptionHandler: import("../../core/exception-handler").angular.ErrorHandler, $attr: any, $element: any, $parse: any, $animate: any, $timeout: any, $q: any, $interpolate: any);
4
28
  $viewValue: number;
5
29
  $modelValue: number;
6
30
  $$rawModelValue: any;
@@ -49,7 +73,7 @@ export class NgModelController {
49
73
  $$timeout: any;
50
74
  $$parse: any;
51
75
  $$q: any;
52
- $$exceptionHandler: any;
76
+ $$exceptionHandler: import("../../core/exception-handler").angular.ErrorHandler;
53
77
  $$initGetterSetters(): void;
54
78
  $render: () => void;
55
79
  /**
@@ -448,7 +472,7 @@ export class NgModelController {
448
472
  export namespace NgModelController {
449
473
  let $inject: string[];
450
474
  }
451
- export const ngModelMinErr: (...args: any[]) => Error;
475
+ export const ngModelMinErr: (arg0: string, arg1: string, ...arg2: any[]) => Error;
452
476
  /**
453
477
  * @ngdoc directive
454
478
  * @name ngModel