@angular-wave/angular.ts 0.0.72 → 0.1.0

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 (58) hide show
  1. package/.github/workflows/types.yml +19 -0
  2. package/dist/angular-ts.esm.js +2 -2
  3. package/dist/angular-ts.umd.js +2 -2
  4. package/package.json +1 -1
  5. package/src/animations/animate-js.html +5 -2
  6. package/src/animations/animate-queue.js +1 -1
  7. package/src/animations/animate.js +1 -26
  8. package/src/core/compile/attributes.js +8 -1
  9. package/src/core/compile/compile.js +432 -368
  10. package/src/core/compile/compile.spec.js +0 -1
  11. package/src/core/controller/controller.js +9 -3
  12. package/src/core/interpolate/interpolate.js +14 -10
  13. package/src/core/q/q.js +2 -1
  14. package/src/directive/change/change.js +3 -1
  15. package/src/directive/form/form.js +4 -3
  16. package/src/directive/list/list.js +3 -3
  17. package/src/directive/messages/messages.js +177 -172
  18. package/src/directive/model/model.js +261 -471
  19. package/src/directive/switch/switch.js +4 -4
  20. package/src/router/directives/state-directives.js +2 -9
  21. package/src/router/hooks/core-resolvables.js +5 -3
  22. package/src/router/path/path-utils.js +1 -2
  23. package/src/router/resolve/resolve-context.js +15 -29
  24. package/src/router/state/state-builder.js +38 -13
  25. package/src/router/state/state-object.js +12 -22
  26. package/src/router/state/state-queue-manager.js +2 -3
  27. package/src/router/state/state-registry.js +2 -1
  28. package/src/router/state/state-service.js +2 -3
  29. package/src/router/transition/transition.js +5 -3
  30. package/src/router/url/url-rule.js +14 -2
  31. package/src/router/view/view.js +2 -8
  32. package/src/router/view/view.spec.js +1 -1
  33. package/src/shared/common.js +3 -8
  34. package/src/shared/common.spec.js +1 -19
  35. package/src/shared/hof.js +1 -8
  36. package/src/shared/jqlite/jqlite.js +1 -1
  37. package/src/shared/predicates.js +6 -2
  38. package/src/types.js +2 -3
  39. package/tsconfig.json +1 -1
  40. package/types/animations/animate-queue.d.ts +1 -1
  41. package/types/core/compile/attributes.d.ts +10 -1
  42. package/types/core/interpolate/interpolate.d.ts +5 -5
  43. package/types/core/q/q.d.ts +4 -2
  44. package/types/directive/form/form.d.ts +3 -1
  45. package/types/directive/messages/messages.d.ts +76 -0
  46. package/types/directive/model/model.d.ts +101 -239
  47. package/types/router/resolve/resolve-context.d.ts +0 -2
  48. package/types/router/state/state-object.d.ts +12 -9
  49. package/types/router/state/state-registry.d.ts +2 -2
  50. package/types/router/transition/transition.d.ts +1 -2
  51. package/types/router/url/url-rule.d.ts +6 -1
  52. package/types/shared/common.d.ts +0 -3
  53. package/types/shared/hof.d.ts +0 -1
  54. package/types/shared/jqlite/jqlite.d.ts +2 -2
  55. package/types/shared/predicates.d.ts +2 -0
  56. package/types/types.d.ts +4 -2
  57. package/src/router/injectables.js +0 -263
  58. package/types/router/injectables.d.ts +0 -1
@@ -16,18 +16,18 @@ export class $InterpolateProvider {
16
16
  * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
17
17
  *
18
18
  * @param {string=} value new value to set the starting symbol to.
19
- * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
19
+ * @returns {string|$InterpolateProvider} Returns the symbol when used as getter and self if used as setter.
20
20
  */
21
- startSymbol: (value?: string | undefined) => string | (Window & typeof globalThis);
21
+ startSymbol: (value?: string | undefined) => string | $InterpolateProvider;
22
22
  /**
23
23
  * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
24
24
  *
25
25
  * @param {string=} value new value to set the ending symbol to.
26
- * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
26
+ * @returns {string|$InterpolateProvider} Returns the symbol when used as getter and self if used as setter.
27
27
  */
28
- endSymbol: (value?: string | undefined) => string | (Window & typeof globalThis);
28
+ endSymbol: (value?: string | undefined) => string | $InterpolateProvider;
29
29
  $get: (string | (($parse: import("../parser/parse").ParseService, $exceptionHandler: import("../exception-handler").ErrorHandler, $sce: any) => {
30
- (text: string, mustHaveExpression?: boolean | undefined, trustedContext?: string | undefined, allOrNothing?: boolean | undefined): (arg0: context) => any;
30
+ (text: string, mustHaveExpression?: boolean | undefined, trustedContext?: string | undefined, allOrNothing?: boolean | undefined): Function;
31
31
  /**
32
32
  * @ngdoc method
33
33
  * @name $interpolate#startSymbol
@@ -4,7 +4,7 @@
4
4
  * @property {function(
5
5
  * ((value: T) => (PromiseLike<never>|PromiseLike<T>|T))|null,
6
6
  * ((reason: any) => (PromiseLike<never>|PromiseLike<T>|T))|null,
7
- * ((state: any) => any)
7
+ * ((state: any) => any)=
8
8
  * ): QPromise<T|never>} then - Calls one of the success or error callbacks asynchronously as soon as the result is available.
9
9
  * @property {function(
10
10
  * ((value: T) => (QPromise<never>|QPromise<T>|T))|null,
@@ -13,6 +13,7 @@
13
13
  * ): QPromise<T|never>} then - Calls one of the success or error callbacks asynchronously as soon as the result is available.
14
14
  * @property {function(((reason: any) => (PromiseLike<never>|PromiseLike<T>|T))|null): QPromise<T>|T} catch - Shorthand for promise.then(null, errorCallback).
15
15
  * @property {function(((reason: any) => (QPromise<never>|QPromise<T>|T))|null): QPromise<T>|T} catch - Shorthand for promise.then(null, errorCallback).
16
+ * @property {function(Array.<QPromise<T>>): QPromise<T>} all
16
17
  * @property {function(function(): void): QPromise<T>} finally - Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value.
17
18
  * @property {number} [$$intervalId] - Internal id set by the $interval service for callback notifications
18
19
  * @property {number} [$$timeoutId] - Timeout id set by the $timeout service for cancelations
@@ -53,11 +54,12 @@ export type QPromise<T> = {
53
54
  /**
54
55
  * - Calls one of the success or error callbacks asynchronously as soon as the result is available.
55
56
  */
56
- then: (arg0: ((value: T) => (PromiseLike<never> | PromiseLike<T> | T)) | null, arg1: ((reason: any) => (PromiseLike<never> | PromiseLike<T> | T)) | null, arg2: ((state: any) => any)) => QPromise<T | never>;
57
+ then: (arg0: ((value: T) => (PromiseLike<never> | PromiseLike<T> | T)) | null, arg1: ((reason: any) => (PromiseLike<never> | PromiseLike<T> | T)) | null, arg2: ((state: any) => any) | undefined) => QPromise<T | never>;
57
58
  /**
58
59
  * - Shorthand for promise.then(null, errorCallback).
59
60
  */
60
61
  catch: (arg0: ((reason: any) => (PromiseLike<never> | PromiseLike<T> | T)) | null) => QPromise<T> | T;
62
+ all: (arg0: Array<QPromise<T>>) => QPromise<T>;
61
63
  /**
62
64
  * - Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value.
63
65
  */
@@ -141,17 +141,19 @@ export namespace FormController {
141
141
  }
142
142
  export function setupValidity(instance: any): void;
143
143
  export function addSetValidityMethod(context: any): void;
144
+ export function isObjectEmpty(obj: any): boolean;
144
145
  export namespace nullFormCtrl {
145
146
  export function $addControl(): void;
146
147
  export let $getControls: () => any;
147
148
  export { nullFormRenameControl as $$renameControl };
148
149
  export function $removeControl(): void;
149
- export function $setValidity(): void;
150
+ export let $setValidity: (...any: any) => any;
150
151
  export function $setDirty(): void;
151
152
  export function $setPristine(): void;
152
153
  export function $setSubmitted(): void;
153
154
  export function $$setSubmitted(): void;
154
155
  }
156
+ export const PENDING_CLASS: "ng-pending";
155
157
  export const formDirective: (string | (($timeout: any, $parse: any) => {
156
158
  name: string;
157
159
  restrict: string;
@@ -0,0 +1,76 @@
1
+ export function ngMessagesDirective($animate: any): {
2
+ require: string;
3
+ restrict: string;
4
+ controller: ($element: any, $scope: any, $attrs: any) => NgMessageCtrl;
5
+ };
6
+ export namespace ngMessagesDirective {
7
+ let $inject: string[];
8
+ }
9
+ export function ngMessagesIncludeDirective($templateRequest: any, $compile: any): {
10
+ restrict: string;
11
+ require: string;
12
+ link($scope: any, element: any, attrs: any): void;
13
+ };
14
+ export namespace ngMessagesIncludeDirective {
15
+ let $inject_1: string[];
16
+ export { $inject_1 as $inject };
17
+ }
18
+ export function ngMessageDirective($animate: any): {
19
+ restrict: string;
20
+ transclude: string;
21
+ priority: number;
22
+ terminal: boolean;
23
+ require: string;
24
+ link(scope: any, element: any, attrs: any, ngMessagesCtrl: any, $transclude: any): void;
25
+ };
26
+ export namespace ngMessageDirective {
27
+ let $inject_2: string[];
28
+ export { $inject_2 as $inject };
29
+ }
30
+ export function ngMessageExpDirective($animate: any): {
31
+ restrict: string;
32
+ transclude: string;
33
+ priority: number;
34
+ terminal: boolean;
35
+ require: string;
36
+ link(scope: any, element: any, attrs: any, ngMessagesCtrl: any, $transclude: any): void;
37
+ };
38
+ export namespace ngMessageExpDirective { }
39
+ export function ngMessageDefaultDirective($animate: any): {
40
+ restrict: string;
41
+ transclude: string;
42
+ priority: number;
43
+ terminal: boolean;
44
+ require: string;
45
+ link(scope: any, element: any, attrs: any, ngMessagesCtrl: any, $transclude: any): void;
46
+ };
47
+ export namespace ngMessageDefaultDirective { }
48
+ declare class NgMessageCtrl {
49
+ /**
50
+ * @param {import('../../shared/jqlite/jqlite').JQLite} $element
51
+ * @param {import('../../core/scope/scope').Scope} $scope
52
+ * @param {import('../../core/compile/attributes').Attributes} $attrs
53
+ * @param {*} $animate
54
+ */
55
+ constructor($element: import("../../shared/jqlite/jqlite").JQLite, $scope: import("../../core/scope/scope").Scope, $attrs: import("../../core/compile/attributes").Attributes, $animate: any);
56
+ $element: import("../../shared/jqlite/jqlite").JQLite;
57
+ $scope: import("../../core/scope/scope").Scope;
58
+ $attrs: import("../../core/compile/attributes").Attributes;
59
+ $animate: any;
60
+ latestKey: number;
61
+ nextAttachId: number;
62
+ messages: {};
63
+ renderLater: boolean;
64
+ cachedCollection: {};
65
+ head: any;
66
+ default: any;
67
+ getAttachId(): number;
68
+ render(collection?: {}): void;
69
+ reRender(): void;
70
+ register(comment: any, messageCtrl: any, isDefault: any): void;
71
+ deregister(comment: any, isDefault: any): void;
72
+ findPreviousMessage(parent: any, comment: any): any;
73
+ insertMessageNode(parent: any, comment: any, key: any): void;
74
+ removeMessageNode(parent: any, comment: any, key: any): void;
75
+ }
76
+ export {};
@@ -1,32 +1,69 @@
1
+ export function ngModelDirective($rootScope: any): {
2
+ restrict: string;
3
+ require: string[];
4
+ controller: typeof NgModelController;
5
+ priority: number;
6
+ compile: (element: any) => {
7
+ pre: (scope: any, element: any, attr: any, ctrls: any) => void;
8
+ post: (scope: any, element: any, attr: any, ctrls: any) => void;
9
+ };
10
+ };
11
+ export const ngModelMinErr: (arg0: string, ...arg1: any[]) => Error;
1
12
  /**
2
13
  *
3
- * @param {*} $scope
4
- * @param {import('../../core/exception-handler').ErrorHandler} $exceptionHandler
5
- * @param {*} $attr
6
- * @param {*} $element
7
- * @param {*} $parse
8
- * @param {*} $animate
9
- * @param {*} $timeout
10
- * @param {*} $q
11
- * @param {*} $interpolate
14
+ * @property {*} $viewValue The actual value from the control's view.
15
+ *
16
+ * @property {*} $modelValue The value in the model that the control is bound to.
17
+ * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
18
+ * the control updates the ngModelController with a new `$viewValue` from the DOM, usually via user input.
19
+ *
20
+ * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever
21
+ the bound ngModel expression changes programmatically. The `$formatters` are not called when the
22
+ value of the control is changed by user interaction.
23
+ *
24
+ * @property {Object.<string, (string, string) => boolean>} $validators A collection of validators that are applied whenever the model value changes.
25
+ * The key value within the object refers to the name of the validator while the function refers to the validation operation.
26
+ * The validation operation is provided with the model value as an argument and must return a true or false value depending on the response of that validation.
27
+ *
28
+ * @property {Object.<string, function(string, string) => QPromise>} $asyncValidators A collection of validations that are expected to perform an asynchronous validation (e.g. a HTTP request).
29
+ * The validation function that is provided is expected to return a promise when it is run during the model validation process
30
+ *
31
+ * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever
32
+ * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change
33
+ * to {@link ngModel.NgModelController#$modelValue `$modelValue`}.
34
+ * It is called with no arguments, and its return value is ignored.
35
+ * This can be used in place of additional $watches against the model value.
36
+ *
37
+ * @property {Object} $error An object hash with all failing validator ids as keys.
38
+ * @property {Object} $pending An object hash with all pending validator ids as keys.
39
+ *
40
+ * @property {boolean} $untouched True if control has not lost focus yet.
41
+ * @property {boolean} $touched True if control has lost focus.
42
+ * @property {boolean} $pristine True if user has not interacted with the control yet.
43
+ * @property {boolean} $dirty True if user has already interacted with the control.
44
+ * @property {boolean} $valid True if there is no error.
45
+ * @property {boolean} $invalid True if at least one error on the control.
46
+ * @property {string} $name The name attribute of the control.
12
47
  */
13
- export function NgModelController($scope: any, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: any, $element: any, $parse: any, $animate: any, $timeout: any, $q: any, $interpolate: any): void;
14
48
  export class NgModelController {
49
+ static $inject: string[];
15
50
  /**
16
- *
17
- * @param {*} $scope
51
+ * @param {import('../../core/scope/scope').Scope} $scope
18
52
  * @param {import('../../core/exception-handler').ErrorHandler} $exceptionHandler
19
- * @param {*} $attr
20
- * @param {*} $element
21
- * @param {*} $parse
53
+ * @param {import('../../core/compile/attributes').Attributes} $attr
54
+ * @param {import('../../shared/jqlite/jqlite').JQLite} $element
55
+ * @param {import("../../core/parser/parse").ParseService} $parse
22
56
  * @param {*} $animate
23
57
  * @param {*} $timeout
24
- * @param {*} $q
58
+ * @param {import("../../core/q/q").QPromise<any>} $q
25
59
  * @param {*} $interpolate
26
60
  */
27
- constructor($scope: any, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: any, $element: any, $parse: any, $animate: any, $timeout: any, $q: any, $interpolate: any);
28
- $viewValue: number;
29
- $modelValue: number;
61
+ constructor($scope: import("../../core/scope/scope").Scope, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: import("../../core/compile/attributes").Attributes, $element: import("../../shared/jqlite/jqlite").JQLite, $parse: import("../../core/parser/parse").ParseService, $animate: any, $timeout: any, $q: import("../../core/q/q").QPromise<any>, $interpolate: any);
62
+ /** @type {any} The actual value from the control's view */
63
+ $viewValue: any;
64
+ /** @type {any} The value in the model that the control is bound to. */
65
+ $modelValue: any;
66
+ /** @type {any} */
30
67
  $$rawModelValue: any;
31
68
  $validators: {};
32
69
  $asyncValidators: {};
@@ -34,10 +71,15 @@ export class NgModelController {
34
71
  $formatters: any[];
35
72
  $viewChangeListeners: any[];
36
73
  $untouched: boolean;
74
+ /** @type {boolean} */
37
75
  $touched: boolean;
76
+ /** @type {boolean} */
38
77
  $pristine: boolean;
78
+ /** @type {boolean} */
39
79
  $dirty: boolean;
80
+ /** @type {boolean} */
40
81
  $valid: boolean;
82
+ /** @type {boolean} */
41
83
  $invalid: boolean;
42
84
  $error: {};
43
85
  $$success: {};
@@ -48,7 +90,7 @@ export class NgModelController {
48
90
  $getControls: () => any;
49
91
  $$renameControl: (control: any, name: any) => void;
50
92
  $removeControl: () => void;
51
- $setValidity: () => void;
93
+ $setValidity: (...any: any) => any;
52
94
  $setDirty: () => void;
53
95
  $setPristine: () => void;
54
96
  $setSubmitted: () => void;
@@ -62,26 +104,52 @@ export class NgModelController {
62
104
  createChild(options: ModelOptionsConfig): any;
63
105
  };
64
106
  $$updateEvents: string;
65
- $$updateEventHandler: any;
66
- $$parsedNgModel: any;
67
- $$parsedNgModelAssign: any;
68
- $$ngModelGet: any;
69
- $$ngModelSet: any;
107
+ $$updateEventHandler(ev: any): void;
108
+ $$parsedNgModel: import("../../core/parser/parse").CompiledExpression;
109
+ $$parsedNgModelAssign: (arg0: any, arg1: any) => any;
110
+ /** @type {import("../../core/parser/parse").CompiledExpression|((Scope) => any)} */
111
+ $$ngModelGet: import("../../core/parser/parse").CompiledExpression | ((Scope: any) => any);
112
+ $$ngModelSet: (arg0: any, arg1: any) => any;
70
113
  $$pendingDebounce: any;
71
114
  $$parserValid: boolean;
72
115
  $$parserName: string;
116
+ /** @type {number} */
73
117
  $$currentValidationRunId: number;
74
- $$scope: any;
75
- $$rootScope: any;
76
- $$attr: any;
77
- $$element: any;
118
+ $$scope: import("../../core/scope/scope").Scope;
119
+ $$rootScope: import("../../core/scope/scope").Scope;
120
+ $$attr: import("../../core/compile/attributes").Attributes;
121
+ $$element: import("../../shared/jqlite/jqlite").JQLite;
78
122
  $$animate: any;
79
123
  $$timeout: any;
80
- $$parse: any;
81
- $$q: any;
124
+ $$parse: import("../../core/parser/parse").ParseService;
125
+ $$q: import("../../core/q/q").QPromise<any>;
82
126
  $$exceptionHandler: import("../../core/exception-handler").ErrorHandler;
127
+ $$hasNativeValidators: boolean;
128
+ set(object: any, property: any): void;
129
+ unset(object: any, property: any): void;
130
+ $setValidity(validationErrorKey: any, state: any): void;
83
131
  $$initGetterSetters(): void;
84
- $render: () => void;
132
+ /**
133
+ * @ngdoc method
134
+ * @name ngModel.NgModelController#$render
135
+ *
136
+ * @description
137
+ * Called when the view needs to be updated. It is expected that the user of the ng-model
138
+ * directive will implement this method.
139
+ *
140
+ * The `$render()` method is invoked in the following situations:
141
+ *
142
+ * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last
143
+ * committed value then `$render()` is called to update the input control.
144
+ * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and
145
+ * the `$viewValue` are different from last time.
146
+ *
147
+ * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of
148
+ * `$modelValue` and `$viewValue` are actually different from their previous values. If `$modelValue`
149
+ * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be
150
+ * invoked if you only change a property on the objects.
151
+ */
152
+ $render(): void;
85
153
  /**
86
154
  * @ngdoc method
87
155
  * @name ngModel.NgModelController#$isEmpty
@@ -256,10 +324,6 @@ export class NgModelController {
256
324
  $validate(): void;
257
325
  $$runValidators(modelValue: any, viewValue: any, doneCallback: any): void;
258
326
  /**
259
- * @ngdoc method
260
- * @name ngModel.NgModelController#$commitViewValue
261
- *
262
- * @description
263
327
  * Commit a pending update to the `$modelValue`.
264
328
  *
265
329
  * Updates may be pending by a debounced event or because the input is waiting for a some future
@@ -468,212 +532,10 @@ export class NgModelController {
468
532
  /**
469
533
  * This method is called internally to run the $formatters on the $modelValue
470
534
  */
471
- $$format(): number;
535
+ $$format(): any;
472
536
  /**
473
537
  * This method is called internally when the bound scope value changes.
474
538
  */
475
539
  $$setModelValue(modelValue: any): void;
476
540
  $$setUpdateOnEvents(): void;
477
541
  }
478
- export namespace NgModelController {
479
- let $inject: string[];
480
- }
481
- export const ngModelMinErr: (arg0: string, ...arg1: any[]) => Error;
482
- /**
483
- * @ngdoc directive
484
- * @name ngModel
485
- * @restrict A
486
- * @priority 1
487
- * @param {string} ngModel assignable {@link guide/expression Expression} to bind to.
488
- *
489
- * @description
490
- * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a
491
- * property on the scope using {@link ngModel.NgModelController NgModelController},
492
- * which is created and exposed by this directive.
493
- *
494
- * `ngModel` is responsible for:
495
- *
496
- * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`
497
- * require.
498
- * - Providing validation behavior (i.e. required, number, email, url).
499
- * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).
500
- * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`,
501
- * `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations.
502
- * - Registering the control with its parent {@link ng.directive:form form}.
503
- *
504
- * Note: `ngModel` will try to bind to the property given by evaluating the expression on the
505
- * current scope. If the property doesn't already exist on this scope, it will be created
506
- * implicitly and added to the scope.
507
- *
508
- * For best practices on using `ngModel`, see:
509
- *
510
- * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)
511
- *
512
- * For basic examples, how to use `ngModel`, see:
513
- *
514
- * - {@link ng.directive:input input}
515
- * - {@link input[text] text}
516
- * - {@link input[checkbox] checkbox}
517
- * - {@link input[radio] radio}
518
- * - {@link input[number] number}
519
- * - {@link input[email] email}
520
- * - {@link input[url] url}
521
- * - {@link input[date] date}
522
- * - {@link input[datetime-local] datetime-local}
523
- * - {@link input[time] time}
524
- * - {@link input[month] month}
525
- * - {@link input[week] week}
526
- * - {@link ng.directive:select select}
527
- * - {@link ng.directive:textarea textarea}
528
- *
529
- * ## Complex Models (objects or collections)
530
- *
531
- * By default, `ngModel` watches the model by reference, not value. This is important to know when
532
- * binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the
533
- * object or collection change, `ngModel` will not be notified and so the input will not be re-rendered.
534
- *
535
- * The model must be assigned an entirely new object or collection before a re-rendering will occur.
536
- *
537
- * Some directives have options that will cause them to use a custom `$watchCollection` on the model expression
538
- * - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or
539
- * if the select is given the `multiple` attribute.
540
- *
541
- * The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the
542
- * first level of the object (or only changing the properties of an item in the collection if it's an array) will still
543
- * not trigger a re-rendering of the model.
544
- *
545
- * ## CSS classes
546
- * The following CSS classes are added and removed on the associated input/select/textarea element
547
- * depending on the validity of the model.
548
- *
549
- * - `ng-valid`: the model is valid
550
- * - `ng-invalid`: the model is invalid
551
- * - `ng-valid-[key]`: for each valid key added by `$setValidity`
552
- * - `ng-invalid-[key]`: for each invalid key added by `$setValidity`
553
- * - `ng-pristine`: the control hasn't been interacted with yet
554
- * - `ng-dirty`: the control has been interacted with
555
- * - `ng-touched`: the control has been blurred
556
- * - `ng-untouched`: the control hasn't been blurred
557
- * - `ng-pending`: any `$asyncValidators` are unfulfilled
558
- * - `ng-empty`: the view does not contain a value or the value is deemed "empty", as defined
559
- * by the {@link ngModel.NgModelController#$isEmpty} method
560
- * - `ng-not-empty`: the view contains a non-empty value
561
- *
562
- * Keep in mind that ngAnimate can detect each of these classes when added and removed.
563
- *
564
- * @animations
565
- * Animations within models are triggered when any of the associated CSS classes are added and removed
566
- * on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`,
567
- * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.
568
- * The animations that are triggered within ngModel are similar to how they work in ngClass and
569
- * animations can be hooked into using CSS transitions, keyframes as well as JS animations.
570
- *
571
- * The following example shows a simple way to utilize CSS transitions to style an input element
572
- * that has been rendered as invalid after it has been validated:
573
- *
574
- * <pre>
575
- * //be sure to include ngAnimate as a module to hook into more
576
- * //advanced animations
577
- * .my-input {
578
- * transition:0.5s linear all;
579
- * background: white;
580
- * }
581
- * .my-input.ng-invalid {
582
- * background: red;
583
- * color:white;
584
- * }
585
- * </pre>
586
- *
587
- * @example
588
- * ### Basic Usage
589
- * <example deps="angular-animate.js" animations="true" fixBase="true" module="inputExample" name="ng-model">
590
- <file name="index.html">
591
- <script>
592
- angular.module('inputExample', [])
593
- .controller('ExampleController', ['$scope', function($scope) {
594
- $scope.val = '1';
595
- }]);
596
- </script>
597
- <style>
598
- .my-input {
599
- transition:all linear 0.5s;
600
- background: transparent;
601
- }
602
- .my-input.ng-invalid {
603
- color:white;
604
- background: red;
605
- }
606
- </style>
607
- <p id="inputDescription">
608
- Update input to see transitions when valid/invalid.
609
- Integer is a valid value.
610
- </p>
611
- <form name="testForm" ng-controller="ExampleController">
612
- <input ng-model="val" ng-pattern="/^\d+$/" name="anim" class="my-input"
613
- aria-describedby="inputDescription" />
614
- </form>
615
- </file>
616
- * </example>
617
- *
618
- * @example
619
- * ### Binding to a getter/setter
620
- *
621
- * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a
622
- * function that returns a representation of the model when called with zero arguments, and sets
623
- * the internal state of a model when called with an argument. It's sometimes useful to use this
624
- * for models that have an internal representation that's different from what the model exposes
625
- * to the view.
626
- *
627
- * <div class="alert alert-success">
628
- * **Best Practice:** It's best to keep getters fast because AngularJS is likely to call them more
629
- * frequently than other parts of your code.
630
- * </div>
631
- *
632
- * You use this behavior by adding `ng-model-options="{ getterSetter: true }"` to an element that
633
- * has `ng-model` attached to it. You can also add `ng-model-options="{ getterSetter: true }"` to
634
- * a `<form>`, which will enable this behavior for all `<input>`s within it. See
635
- * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.
636
- *
637
- * The following example shows how to use `ngModel` with a getter/setter:
638
- *
639
- * @example
640
- * <example name="ngModel-getter-setter" module="getterSetterExample">
641
- <file name="index.html">
642
- <div ng-controller="ExampleController">
643
- <form name="userForm">
644
- <label>Name:
645
- <input type="text" name="userName"
646
- ng-model="user.name"
647
- ng-model-options="{ getterSetter: true }" />
648
- </label>
649
- </form>
650
- <pre>user.name = <span ng-bind="user.name()"></span></pre>
651
- </div>
652
- </file>
653
- <file name="app.js">
654
- angular.module('getterSetterExample', [])
655
- .controller('ExampleController', ['$scope', function($scope) {
656
- let _name = 'Brian';
657
- $scope.user = {
658
- name: function(newName) {
659
- // Note that newName can be undefined for two reasons:
660
- // 1. Because it is called as a getter and thus called with no arguments
661
- // 2. Because the property should actually be set to undefined. This happens e.g. if the
662
- // input is invalid
663
- return arguments.length ? (_name = newName) : _name;
664
- }
665
- };
666
- }]);
667
- </file>
668
- * </example>
669
- */
670
- export const ngModelDirective: (string | (($rootScope: any) => {
671
- restrict: string;
672
- require: string[];
673
- controller: typeof NgModelController;
674
- priority: number;
675
- compile: (element: any) => {
676
- pre: (scope: any, element: any, attr: any, ctrls: any) => void;
677
- post: (scope: any, element: any, attr: any, ctrls: any) => void;
678
- };
679
- }))[];
@@ -92,8 +92,6 @@ export class ResolveContext {
92
92
  getDependencies(resolvable: any): any;
93
93
  }
94
94
  declare class UIInjectorImpl {
95
- constructor(context: any);
96
- context: any;
97
95
  native: any;
98
96
  get(token: any): any;
99
97
  getAsync(token: any): any;
@@ -9,16 +9,18 @@
9
9
  * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]].
10
10
  */
11
11
  export class StateObject {
12
- /**
13
- * Create a state object to put the private/internal implementation details onto.
14
- * The object's prototype chain looks like:
15
- * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)
16
- *
17
- * @param stateDecl the user-supplied State Declaration
18
- * @returns {StateObject} an internal State object
19
- */
20
- static create(stateDecl: any): StateObject;
21
12
  constructor(config: any);
13
+ name: any;
14
+ navigable: any;
15
+ /** @type {?StateObject} */
16
+ parent: StateObject | null;
17
+ params: any;
18
+ url: any;
19
+ $$state: () => this;
20
+ self: any;
21
+ __stateObjectCache: {
22
+ nameGlob: Glob;
23
+ };
22
24
  /**
23
25
  * Returns true if the provided parameter is the same state.
24
26
  *
@@ -68,3 +70,4 @@ export namespace StateObject {
68
70
  /** Predicate which returns true if the object is an internal [[StateObject]] object */
69
71
  function isState(obj: any): boolean;
70
72
  }
73
+ import { Glob } from "../common/glob";
@@ -89,9 +89,9 @@ export class StateRegistry {
89
89
  * If the state has children, they are are also removed from the registry.
90
90
  *
91
91
  * @param stateOrName the state's name or object representation
92
- * @returns {StateObject[]} a list of removed states
92
+ * @returns {import('./state-object').StateObject[]} a list of removed states
93
93
  */
94
- deregister(stateOrName: any): StateObject[];
94
+ deregister(stateOrName: any): import("./state-object").StateObject[];
95
95
  get(stateOrName: any, base: any, ...args: any[]): any;
96
96
  /**
97
97
  * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).
@@ -151,7 +151,6 @@ export class Transition {
151
151
  * @returns a [[UIInjector]]
152
152
  */
153
153
  injector(state: any, pathName?: string): {
154
- context: any;
155
154
  native: any;
156
155
  get(token: any): any;
157
156
  getAsync(token: any): any;
@@ -219,7 +218,7 @@ export class Transition {
219
218
  * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])
220
219
  * @param state the state in the "to path" which should receive the new resolve (otherwise, the root state)
221
220
  */
222
- addResolvable(resolvable: any, state?: string): void;
221
+ addResolvable(resolvable: any, state: any): void;
223
222
  /**
224
223
  * Gets the transition from which this transition was redirected.
225
224
  *
@@ -132,5 +132,10 @@ export class BaseUrlRule {
132
132
  $id: number;
133
133
  _group: any;
134
134
  handler: any;
135
- matchPriority(): number;
135
+ /**
136
+ * This function should be overridden
137
+ * @param {*} [params]
138
+ * @returns {number}
139
+ */
140
+ matchPriority(params?: any): number;
136
141
  }
@@ -68,7 +68,6 @@ export function createProxyFunctions(source: any, target: any, bind: any, fnName
68
68
  * @returns {Object} - A new object with `parent` as its prototype and properties from `extra`.
69
69
  */
70
70
  export function inherit(parent: any, extra?: any): any;
71
- export function _inArray(array: any, obj: any): any;
72
71
  export function _removeFrom(array: any, obj: any): any;
73
72
  /**
74
73
  * Applies a set of defaults to an options object. The options object is filtered
@@ -172,8 +171,6 @@ export const toJson: any;
172
171
  /** Naive forEach implementation works with Objects or Arrays */
173
172
  export function forEach(obj: any, cb: any, _this: any): void;
174
173
  export function equals(o1: any, o2: any): any;
175
- /** Given an array, returns true if the object is found in the array, (using includes) */
176
- export const inArray: any;
177
174
  /**
178
175
  * Given an array, and an item, if the item is found in the array, it removes it (in-place).
179
176
  * The same array is returned