@angular-wave/angular.ts 0.0.41 → 0.0.42

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 (72) hide show
  1. package/README.md +27 -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/core/compile/compile.js +1 -1
  6. package/src/core/compile/compile.md +2 -5
  7. package/src/core/exception-handler.js +6 -6
  8. package/src/core/interpolate/interpolate.js +1 -1
  9. package/src/core/location/location.spec.js +0 -4
  10. package/src/core/q/q.js +1 -1
  11. package/src/core/scope/scope.js +1 -1
  12. package/src/core/task-tracker-factory.js +2 -2
  13. package/src/core/timeout/timeout.js +1 -1
  14. package/src/core/url-utils/url-utils.js +0 -2
  15. package/src/directive/bind/bind.js +2 -2
  16. package/src/directive/change/change.js +1 -1
  17. package/src/directive/cloak/cloak.js +1 -1
  18. package/src/directive/events/events.js +1 -1
  19. package/src/directive/form/form.js +2 -2
  20. package/src/directive/init/init.js +1 -1
  21. package/src/directive/list/list.js +1 -1
  22. package/src/directive/model/model.js +1 -1
  23. package/src/directive/model-options/model-options.js +56 -421
  24. package/src/directive/model-options/model-options.md +407 -0
  25. package/src/directive/model-options/model-options.spec.js +1 -1
  26. package/src/directive/non-bindable/non-bindable.js +1 -2
  27. package/src/directive/style/style.js +1 -1
  28. package/src/directive/switch/switch.js +2 -2
  29. package/src/directive/transclude/transclude.js +2 -2
  30. package/src/index.js +0 -461
  31. package/src/loader.js +1 -1
  32. package/src/public.js +1 -1
  33. package/src/router/template-factory.js +2 -2
  34. package/src/router/view-scroll.js +1 -1
  35. package/src/services/browser.js +1 -1
  36. package/src/services/document.js +2 -2
  37. package/src/services/log.js +1 -1
  38. package/src/services/template-request.js +1 -1
  39. package/src/shared/jqlite/jqlite.js +52 -44
  40. package/src/shared/jqlite/jqlite.spec.js +0 -1
  41. package/src/shared/utils.js +1 -1
  42. package/src/types.js +447 -9
  43. package/tsconfig.json +1 -1
  44. package/types/animations/shared.d.ts +1 -1
  45. package/types/core/exception-handler.d.ts +5 -7
  46. package/types/core/interpolate/interpolate.d.ts +1 -1
  47. package/types/core/q/q.d.ts +1 -1
  48. package/types/core/task-tracker-factory.d.ts +5 -5
  49. package/types/core/timeout/timeout.d.ts +2 -2
  50. package/types/directive/bind/bind.d.ts +4 -4
  51. package/types/directive/change/change.d.ts +2 -2
  52. package/types/directive/cloak/cloak.d.ts +2 -2
  53. package/types/directive/init/init.d.ts +2 -2
  54. package/types/directive/list/list.d.ts +2 -2
  55. package/types/directive/model/model.d.ts +13 -7
  56. package/types/directive/model-options/model-options.d.ts +49 -0
  57. package/types/directive/non-bindable/non-bindable.d.ts +2 -3
  58. package/types/directive/style/style.d.ts +2 -2
  59. package/types/directive/switch/switch.d.ts +4 -4
  60. package/types/index.d.ts +1 -702
  61. package/types/public.d.ts +2 -2
  62. package/types/router/template-factory.d.ts +4 -4
  63. package/types/services/browser.d.ts +3 -3
  64. package/types/services/document.d.ts +4 -6
  65. package/types/services/log.d.ts +2 -2
  66. package/types/services/template-request.d.ts +1 -1
  67. package/types/shared/jqlite/jqlite.d.ts +10 -2
  68. package/types/shared/utils.d.ts +2 -2
  69. package/types/types.d.ts +437 -33
  70. package/types-back/index.d.ts +1 -27
  71. package/types-back/jqlite.d.ts +0 -81
  72. package/types-back/global.d.ts +0 -11
@@ -614,12 +614,63 @@ JQLite.prototype.controller = function (name) {
614
614
 
615
615
  /**
616
616
  * Return instance of injector attached to element
617
- * @returns {import('../../types').angular.InjectorService}
617
+ * @returns {import('../../types').InjectorService}
618
618
  */
619
619
  JQLite.prototype.injector = function () {
620
620
  return JQLiteInheritedData(this[0], "$injector");
621
621
  };
622
622
 
623
+ /**
624
+ * Adds an event listener to each element in the JQLite collection.
625
+ *
626
+ * @param {string} type - The event type(s) to listen for. Multiple event types can be specified, separated by a space.
627
+ * @param {Function} fn - The function to execute when the event is triggered.
628
+ * @returns {JQLite} The JQLite collection for chaining.
629
+ */
630
+ JQLite.prototype.on = function (type, fn) {
631
+ // Do not add event handlers to non-elements because they will not be cleaned up.
632
+ for (let i = 0, ii = this.length; i < ii; i++) {
633
+ const element = this[i];
634
+ if (!elementAcceptsData(element)) {
635
+ return;
636
+ }
637
+
638
+ const expandoStore = getExpando(element, true);
639
+
640
+ if (!expandoStore.handle) {
641
+ expandoStore.handle = createEventHandler(element, expandoStore.events);
642
+ }
643
+ // http://jsperf.com/string-indexof-vs-split
644
+ const types = type.indexOf(" ") >= 0 ? type.split(" ") : [type];
645
+ let j = types.length;
646
+
647
+ const addHandler = function (type, specialHandlerWrapper, noEventListener) {
648
+ let eventFns = expandoStore.events[type];
649
+
650
+ if (!eventFns) {
651
+ eventFns = expandoStore.events[type] = [];
652
+ eventFns.specialHandlerWrapper = specialHandlerWrapper;
653
+ if (type !== "$destroy" && !noEventListener) {
654
+ element.addEventListener(type, expandoStore.handle);
655
+ }
656
+ }
657
+
658
+ eventFns.push(fn);
659
+ };
660
+
661
+ while (j--) {
662
+ type = types[j];
663
+ if (MOUSE_EVENT_MAP[type]) {
664
+ addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper);
665
+ addHandler(type, undefined, true);
666
+ } else {
667
+ addHandler(type);
668
+ }
669
+ }
670
+ }
671
+ return this;
672
+ };
673
+
623
674
  export function getBooleanAttrName(element, name) {
624
675
  // check dom last since we will most likely fail on name
625
676
  const booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];
@@ -781,50 +832,7 @@ forEach(
781
832
  forEach(
782
833
  {
783
834
  removeData: removeElementData,
784
- on: (element, type, fn) => {
785
- // Do not add event handlers to non-elements because they will not be cleaned up.
786
- if (!elementAcceptsData(element)) {
787
- return;
788
- }
789
-
790
- const expandoStore = getExpando(element, true);
791
-
792
- if (!expandoStore.handle) {
793
- expandoStore.handle = createEventHandler(element, expandoStore.events);
794
- }
795
-
796
- // http://jsperf.com/string-indexof-vs-split
797
- const types = type.indexOf(" ") >= 0 ? type.split(" ") : [type];
798
- let i = types.length;
799
-
800
- const addHandler = function (
801
- type,
802
- specialHandlerWrapper,
803
- noEventListener,
804
- ) {
805
- let eventFns = expandoStore.events[type];
806
835
 
807
- if (!eventFns) {
808
- eventFns = expandoStore.events[type] = [];
809
- eventFns.specialHandlerWrapper = specialHandlerWrapper;
810
- if (type !== "$destroy" && !noEventListener) {
811
- element.addEventListener(type, expandoStore.handle);
812
- }
813
- }
814
-
815
- eventFns.push(fn);
816
- };
817
-
818
- while (i--) {
819
- type = types[i];
820
- if (MOUSE_EVENT_MAP[type]) {
821
- addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper);
822
- addHandler(type, undefined, true);
823
- } else {
824
- addHandler(type);
825
- }
826
- }
827
- },
828
836
  off: JQLiteOff,
829
837
  replaceWith(element, replaceNode) {
830
838
  let index;
@@ -568,7 +568,6 @@ describe("jqLite", () => {
568
568
  document.body.appendChild(node);
569
569
 
570
570
  expect(CACHE.has(node[EXPANDO])).toBe(false);
571
- debugger;
572
571
  expect(getOrSetCacheData(node, "foo")).toBeUndefined();
573
572
  expect(CACHE.has(node[EXPANDO])).toBe(false);
574
573
 
@@ -1201,7 +1201,7 @@ export const minErrConfig = {};
1201
1201
  * should all be static strings, not variables or general expressions.
1202
1202
  *
1203
1203
  * @param {string} module The namespace to use for the new minErr instance.
1204
- * @returns {function(string, string, ...*): Error} minErr instance
1204
+ * @returns {function(string, ...*): Error} minErr instance
1205
1205
  */
1206
1206
  export function minErr(module) {
1207
1207
  const url = 'https://errors.angularjs.org/"NG_VERSION_FULL"/';
package/src/types.js CHANGED
@@ -1,13 +1,451 @@
1
1
  /**
2
- * @typedef {Object} angular.InjectorService
3
- * @property {function(Function, boolean=): string[]} annotate Annotate a function or an array of inline annotations.
4
- * @property {function(any[]): string[]} annotate Annotate an inline annotated function.
5
- * @property {function(string, string=): T} get Get a service by name.
6
- * @property {function(new (...args: any[]): T, any=): T} instantiate Instantiate a type constructor with optional locals.
7
- * @property {function(Injectable<Function | ((...args: any[]) => T)>, any=, any=): T} invoke Invoke a function with optional context and locals.
8
- * @property {function(Array<IModule | string | Injectable<(...args: any[]) => void>>): void} loadNewModules Add and load new modules to the injector.
9
- * @property {Object.<string, IModule>} modules A map of all the modules loaded into the injector.
10
- * @property {boolean} strictDi Indicates if strict dependency injection is enforced.
2
+ * @typedef {Object} BootstrapConfig
3
+ * @description Configuration option for AngularTS bootstrap process.
4
+ * @property {boolean} debugInfoEnabled - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
5
+ * @property {boolean} [strictDi] - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
6
+ */
7
+
8
+ /**
9
+ * @typedef {Function|Array<string|Function>} Injectable
10
+ * @description Represents a type that can be injected, either as a function or an array of strings/functions.
11
+ * @template T
12
+ */
13
+
14
+ /**
15
+ * @typedef {Object} ComponentOptions
16
+ * @description Component definition object (a simplified directive definition object)
17
+ * @property {string |Injectable<ControllerConstructor>> | undefined} [controller]
18
+ * Controller constructor function or name of a registered controller.
19
+ * Use array form for dependencies (necessary with strictDi).
20
+ * @property {string | undefined} [controllerAs]
21
+ * Identifier name for the controller published to its scope (default: '$ctrl').
22
+ * @property {string |Injectable<(...args: any[]) => string> | undefined} [template]
23
+ * HTML template string or function returning an HTML template.
24
+ * If a function, injects $element and $attrs.
25
+ * Use array form for dependencies (necessary with strictDi).
26
+ * @property {string |Injectable<(...args: any[]) => string> | undefined} [templateUrl]
27
+ * Path or function returning a path to an HTML template.
28
+ * If a function, injects $element and $attrs.
29
+ * Use array form for dependencies (necessary with strictDi).
30
+ * @property {{ [boundProperty: string]: string } | undefined} [bindings]
31
+ * DOM attribute bindings to component properties.
32
+ * Component properties are bound to the controller, not the scope.
33
+ * @property {boolean | { [slot: string]: string } | undefined} [transclude]
34
+ * Whether transclusion is enabled. Disabled by default.
35
+ * @property {{ [controller: string]: string } | undefined} [require]
36
+ * Requires controllers of other directives, binding them to this component's controller.
37
+ * Keys specify property names under which required controllers (object values) are bound.
38
+ * Required controllers available before $onInit method execution.
39
+ */
40
+
41
+ /**
42
+ * @typedef {Function} ControllerConstructor
43
+ * @description Controller constructor type for AngularJS. Note: Instead of classes, plain functions are often used as controller constructors, especially in examples.
44
+ * @param {...any} args Arguments passed to the controller constructor.
45
+ * @returns {void | Controller} Returns nothing or an instance of IController.
46
+ */
47
+
48
+ /**
49
+ * @typedef {Object} OnChangesObject
50
+ * @description Object representing changes in one-way bound properties.
51
+ * Keys are the names of the bound properties that have changed, and values are instances of IChangesObject.
52
+ * @property {ChangesObject<any>} property - Represents a changed property.
53
+ */
54
+
55
+ /**
56
+ * @typedef {Object} ChangesObject
57
+ * @description Object representing changes in a property.
58
+ * @property {*} currentValue - Current value of the property.
59
+ * @property {*} previousValue - Previous value of the property.
60
+ * @property {function(): boolean} isFirstChange - Function to check if it's the first change of the property.
61
+ */
62
+
63
+ /**
64
+ * @typedef {Object} Controller
65
+ * @description Interface representing the lifecycle hooks for AngularJS directive controllers.
66
+ * @see {@link https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks}
67
+ * @see {@link https://docs.angularjs.org/guide/component}
68
+ *
69
+ * @property {function(): void} [$onInit]
70
+ * Called on each controller after all the controllers on an element have been constructed and had their bindings
71
+ * initialized (and before the pre & post linking functions for the directives on this element). This is a good
72
+ * place to put initialization code for your controller.
73
+ *
74
+ * @property {function(): void} [$doCheck]
75
+ * Called on each turn of the digest cycle. Provides an opportunity to detect and act on changes.
76
+ * Any actions that you wish to take in response to the changes that you detect must be invoked from this hook;
77
+ * implementing this has no effect on when `$onChanges` is called. For example, this hook could be useful if you wish
78
+ * to perform a deep equality check, or to check a `Date` object, changes to which would not be detected by Angular's
79
+ * change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; if detecting changes,
80
+ * you must store the previous value(s) for comparison to the current values.
81
+ *
82
+ * @property {function(OnChangesObject): void} [$onChanges]
83
+ * Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
84
+ * properties that have changed, and the values are an {@link IChangesObject} object of the form
85
+ * { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
86
+ * cloning the bound value to prevent accidental mutation of the outer value.
87
+ *
88
+ * @property {function(): void} [$onDestroy]
89
+ * Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
90
+ * watches and event handlers.
91
+ *
92
+ * @property {function(): void} [$postLink]
93
+ * Called after this controller's element and its children have been linked. Similar to the post-link function this
94
+ * hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain
95
+ * templateUrl directives will not have been compiled and linked since they are waiting for their template to load
96
+ * asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered
97
+ * analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
98
+ * different in Angular 1 there is no direct mapping and care should be taken when upgrading.
99
+ *
100
+ * @property {*} [s: string]
101
+ * IController implementations frequently do not implement any of its methods.
102
+ * A string indexer indicates to TypeScript not to issue a weak type error in this case.
103
+ */
104
+
105
+ /**
106
+ * @typedef {Object.<string, any>} Attributes
107
+ *
108
+ * @property {(name: string) => string} $normalize
109
+ * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form.
110
+ * Also there is special case for Moz prefix starting with upper case letter.
111
+ *
112
+ * @property {(newClasses: string, oldClasses: string) => void} $updateClass
113
+ * Adds and removes the appropriate CSS class values to the element based on the difference between
114
+ * the new and old CSS class values (specified as newClasses and oldClasses).
115
+ *
116
+ * @property {(key: string, value: any) => void} $set
117
+ * Set DOM element attribute value.
118
+ *
119
+ * @property {<T>(name: string, fn: (value?: T) => any) => Function} $observe
120
+ * Observes an interpolated attribute.
121
+ * The observer function will be invoked once during the next $digest
122
+ * following compilation. The observer is then invoked whenever the
123
+ * interpolated value changes.
124
+ *
125
+ * @property {Object.<string, string>} $attr
126
+ * A map of DOM element attribute names to the normalized name. This is needed
127
+ * to do reverse lookup from normalized name back to actual name.
128
+ * @see http://docs.angularjs.org/api/ng/type/$compile.directive.Attributes
129
+ */
130
+
131
+ /**
132
+ * @typedef {import('./core/scope/scope').Scope} TScope
133
+ */
134
+
135
+ /**
136
+ * @typedef {import('./shared/jqlite/jqlite').JQLite} TElement
137
+ */
138
+
139
+ /**
140
+ * @typedef {Attributes} TAttributes
141
+ */
142
+
143
+ /**
144
+ * @typedef {DirectiveController} TController
145
+ */
146
+
147
+ /**
148
+ * @typedef {Controller | Controller[] | { [key: string]: Controller }} DirectiveController
149
+ * @description Represents a directive controller, which can be:
150
+ * - A single instance of {@link Controller}
151
+ * - An array of {@link Controller}
152
+ * - An object where keys are string identifiers and values are {@link Controller}
153
+ */
154
+
155
+ /**
156
+ * @template [S=import('./core/scope/scope').Scope]
157
+ * @template {TScope} S - The type of the directive's scope.
158
+ *
159
+ * @template [T=import('./shared/jqlite/jqlite').JQLite]
160
+ * @template {TElement} T - The type of the directive's element.
161
+ *
162
+ * @template [A=Attributes]
163
+ * @template {TAttributes} A - The type of the directive's attributes.
164
+ *
165
+ * @template [C=Controller]
166
+ * @template {TController} C - The type of the directive's controller.
167
+ */
168
+
169
+ /**
170
+ * Compile function for an AngularJS directive.
171
+ *
172
+ * @callback DirectiveCompileFn
173
+ * @param {TElement} templateElement - The template element.
174
+ * @param {TAttributes} templateAttributes - The template attributes.
175
+ * @param {TranscludeFunction} transclude - @deprecated The transclude function. Note: The transclude function that is passed to the compile function is deprecated,
176
+ * as it e.g. does not know about the right outer scope. Please use the transclude function
177
+ * that is passed to the link function instead.
178
+ * @returns {void | DirectiveLinkFn | DirectivePrePost} Returns void, DirectiveLinkFn, or DirectivePrePost.
179
+ */
180
+
181
+ /**
182
+ * Link function for an AngularJS directive.
183
+ *
184
+ * @callback DirectiveLinkFn
185
+ * @param {TScope} scope
186
+ * @param {TElement} instanceElement
187
+ * @param {TAttributes} instanceAttributes
188
+ * @param {TController} [controller]
189
+ * @param {TranscludeFunction} [transclude]
190
+ * @returns {void}
191
+ */
192
+
193
+ /**
194
+ * @callback CloneAttachFunction
195
+ * @param {JQLite} [clonedElement]
196
+ * @param {Scope} [scope] // Let's hint but not force cloneAttachFn's signature
197
+ * @returns {any}
198
+ */
199
+
200
+ /**
201
+ * This corresponds to $transclude passed to controllers and to the transclude function passed to link functions.
202
+ * https://docs.angularjs.org/api/ng/service/$compile#-controller-
203
+ * http://teropa.info/blog/2015/06/09/transclusion.html
204
+ *
205
+ * @typedef {Object} TranscludeFunction
206
+ * @property {function(TScope, CloneAttachFunction, JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithScope
207
+ * @property {function(CloneAttachFunction=, JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithoutScope
208
+ * @property {function(string): boolean} isSlotFilled - Returns true if the specified slot contains content (i.e., one or more DOM nodes)
209
+ */
210
+
211
+ /**
212
+ * @typedef {function(TScope, CloneAttachFunction, JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithScope
213
+ */
214
+
215
+ /**
216
+ * @typedef {function(CloneAttachFunction=, JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithoutScope
217
+ */
218
+
219
+ /**
220
+ * Represents the pre and post linking functions of a directive.
221
+ *
222
+ *
223
+ * @typedef {Object} DirectivePrePost
224
+ * @property {DirectiveLinkFn | undefined} [pre]
225
+ * The pre-linking function of the directive.
226
+ * @property {DirectiveLinkFn | undefined} [post]
227
+ * The post-linking function of the directive.
228
+ */
229
+
230
+ /**
231
+ * Directive definition object.
232
+ *
233
+ *
234
+ * @typedef {Object} Directive
235
+ * @property {DirectiveCompileFn | undefined} [compile]
236
+ * Compile function for the directive.
237
+ * @property {string | Injectable<ControllerConstructor> | undefined} [controller]
238
+ * Controller constructor or name.
239
+ * @property {string | undefined} [controllerAs]
240
+ * Controller alias.
241
+ * @property {boolean | { [boundProperty: string]: string } | undefined} [bindToController]
242
+ * Bindings to controller.
243
+ * @property {DirectiveLinkFn | DirectivePrePost | undefined} [link]
244
+ * Link function.
245
+ * @property {boolean | undefined} [multiElement]
246
+ * Multi-element directive flag.
247
+ * @property {number | undefined} [priority]
248
+ * Skip all directives on element
249
+ * @property {boolean | undefined} [terminal]
250
+ * Directive priority.
251
+ * @property {boolean | undefined} [replace]
252
+ * Deprecated: Replace flag.
253
+ * @property {string | string[] | { [controller: string]: string } | undefined} [require]
254
+ * Required controllers.
255
+ * @property {string | undefined} [restrict]
256
+ * Restriction mode.
257
+ * @property {boolean | { [boundProperty: string]: string } | undefined} [scope]
258
+ * Scope options.
259
+ * @property {string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined} [template]
260
+ * HTML template.
261
+ * @property {string | undefined} [templateNamespace]
262
+ * Template namespace.
263
+ * @property {string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined} [templateUrl]
264
+ * HTML template URL.
265
+ * @property {boolean | "element" | { [slot: string]: string } | undefined} [transclude]
266
+ * Transclusion options.
267
+ */
268
+
269
+ /**
270
+ * Factory function for creating directives.
271
+ *
272
+ *
273
+ * @typedef {(...args: any[]) => Directive | DirectiveLinkFn} DirectiveFactory
274
+ */
275
+
276
+ /**
277
+ * @typedef {Function} FilterFunction
278
+ * @property {boolean|undefined} [$stateful] By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.** See https://docs.angularjs.org/guide/filter#stateful-filters
279
+ */
280
+
281
+ /**
282
+ * @typedef {Function} FilterFactory
283
+ * @returns {FilterFunction}
284
+ */
285
+
286
+ /**
287
+ * Interface for a service provider class.
288
+ * @typedef {Object} ServiceProviderClass
289
+ * @property {Function} constructor - The constructor for the service provider.
290
+ * @param {...any} args - The arguments for the constructor.
291
+ * @returns {ServiceProvider}
292
+ */
293
+
294
+ /**
295
+ * Interface for a service provider factory function.
296
+ * @typedef {Function} ServiceProviderFactory
297
+ * @param {...any} args - The arguments for the factory function.
298
+ * @returns {ServiceProvider}
299
+ */
300
+
301
+ /**
302
+ * Interface for a service provider.
303
+ * @typedef {Object} ServiceProvider
304
+ * @property {*} $get - The $get property that represents a service instance or a factory function.
305
+ */
306
+
307
+ /**
308
+ *
309
+ * @typedef {Object} Module
310
+ * @description AngularJS module interface for registering components, services, providers, etc.
311
+ * @property {function(string, ComponentOptions): Module} component
312
+ * Use this method to register a component.
313
+ * @property {function({ [componentName: string]: ComponentOptions }): Module} component
314
+ * Use this method to register multiple components.
315
+ * @property {function(Function): Module} config
316
+ * Use this method to register work which needs to be performed on module loading.
317
+ * @property {function(any[]): Module} config
318
+ * Use this method to register work which needs to be performed on module loading.
319
+ * @property {function<T>(string, T): Module} constant
320
+ * Register a constant service with the $injector.
321
+ * @property {function(Object): Module} constant
322
+ * Register multiple constant services.
323
+ * @property {function(string, Injectable<ControllerConstructor>): Module} controller
324
+ * Register a controller with the $controller service.
325
+ * @property {function({ [name: string]: Injectable<ControllerConstructor>> }): Module} controller
326
+ * Register multiple controllers.
327
+ * @property {function(string, Injectable<DirectiveFactory>): Module} directive
328
+ * Register a directive with the compiler.
329
+ * @property {function(Object.<string, Injectable<DirectiveFactory>>): Module} directive
330
+ * Register multiple directives.
331
+ * @property {function(string, Injectable<Function>): Module} factory
332
+ * Register a service factory with the $injector.
333
+ * @property {function(Object.<string, Injectable<Function>>): Module} factory
334
+ * Register multiple service factories.
335
+ * @property {function(string, Injectable<FilterFactory>): Module} filter
336
+ * Register a filter service.
337
+ * @property {function(Object.<string, Injectable<FilterFactory>>): Module} filter
338
+ * Register multiple filter services.
339
+ * @property {function(string, ServiceProviderFactory): Module} provider
340
+ * Register a provider service factory.
341
+ * @property {function(string, ServiceProviderClass): Module} provider
342
+ * Register a provider service constructor.
343
+ * @property {function(string, any[]): Module} provider
344
+ * Register a provider service with inline annotated constructor.
345
+ * @property {function(Injectable<Function>): Module} run
346
+ * Register code to be run during module loading.
347
+ * @property {function(string, Injectable<Function>): Module} service
348
+ * Register a service constructor.
349
+ * @property {function(Object.<string, Injectable<Function>>): Module} service
350
+ * Register multiple service constructors.
351
+ * @property {function<T>(string, T): Module} value
352
+ * Register a value service with the $injector.
353
+ * @property {function(Object): Module} value
354
+ * Register multiple value services.
355
+ * @property {function(string, Injectable<Function>): Module} decorator
356
+ * Register a service decorator with the $injector.
357
+ * @property {string} name
358
+ * The name of the AngularJS module.
359
+ * @property {string[]} requires
360
+ * Array of module names that this module depends on.
361
+ */
362
+
363
+ /**
364
+ * @typedef {Object} FormController
365
+ * @property {boolean} $pristine - True if the form has not been modified.
366
+ * @property {boolean} $dirty - True if the form has been modified.
367
+ * @property {boolean} $valid - True if the form is valid.
368
+ * @property {boolean} $invalid - True if the form is invalid.
369
+ * @property {boolean} $submitted - True if the form has been submitted.
370
+ * @property {Object.<string, Array.<NgModelController|FormController>>} $error - An object containing arrays of controls with validation errors keyed by validation error keys.
371
+ * @property {string|undefined} [$name] - The name of the form.
372
+ * @property {Object.<string, Array.<NgModelController|FormController>>|undefined} [$pending] - An object containing arrays of controls that are pending validation, keyed by validation error keys.
373
+ * @property {function(NgModelController|FormController): void} $addControl - Adds a control to the form.
374
+ * @property {function(): ReadonlyArray.<NgModelController|FormController>} $getControls - Returns an array of all controls in the form.
375
+ * @property {function(NgModelController|FormController): void} $removeControl - Removes a control from the form.
376
+ * @property {function(string, boolean, NgModelController|FormController): void} $setValidity - Sets the validity of a control in the form.
377
+ * @property {function(): void} $setDirty - Marks the form as dirty.
378
+ * @property {function(): void} $setPristine - Marks the form as pristine.
379
+ * @property {function(): void} $commitViewValue - Commits the view value of all controls in the form.
380
+ * @property {function(): void} $rollbackViewValue - Rolls back the view value of all controls in the form.
381
+ * @property {function(): void} $setSubmitted - Marks the form as submitted.
382
+ * @property {function(): void} $setUntouched - Marks the form controls as untouched.
383
+ * @property {function(string): any} [name] - An indexer for additional properties.
384
+ */
385
+
386
+ /**
387
+ * @typedef {Object} NgModelController
388
+ * @property {function(): void} $render - Renders the view value.
389
+ * @property {function(string, boolean): void} $setValidity - Sets the validity state.
390
+ * @property {function(any, string=): void} $setViewValue - Sets the view value.
391
+ * @property {function(): void} $setPristine - Marks the control as pristine.
392
+ * @property {function(): void} $setDirty - Marks the control as dirty.
393
+ * @property {function(): void} $validate - Validates the control.
394
+ * @property {function(): void} $setTouched - Marks the control as touched.
395
+ * @property {function(): void} $setUntouched - Marks the control as untouched.
396
+ * @property {function(): void} $rollbackViewValue - Rolls back the view value.
397
+ * @property {function(): void} $commitViewValue - Commits the view value.
398
+ * @property {function(): void} $processModelValue - Processes the model value.
399
+ * @property {function(any): boolean} $isEmpty - Checks if the value is empty.
400
+ * @property {function(NgModelOptions): void} $overrideModelOptions - Overrides model options.
401
+ * @property {*} $viewValue - The current view value.
402
+ * @property {*} $modelValue - The current model value.
403
+ * @property {Array.<function(any, any): boolean>} $parsers - Array of parsers.
404
+ * @property {Array.<function(any): any>} $formatters - Array of formatters.
405
+ * @property {Array.<function(): any>} $viewChangeListeners - Array of view change listeners.
406
+ * @property {Object.<string, boolean>} $error - Validation errors.
407
+ * @property {string|undefined} [$name] - The name of the control.
408
+ * @property {boolean} $touched - True if the control has been touched.
409
+ * @property {boolean} $untouched - True if the control has not been touched.
410
+ * @property {Object.<string, function(any, any): boolean>} $validators - Synchronous validators.
411
+ * @property {Object.<string, function(any, any): Promise<any>>} $asyncValidators - Asynchronous validators.
412
+ * @property {Object.<string, boolean>|undefined} [$pending] - Pending validation.
413
+ * @property {boolean} $pristine - True if the control is pristine.
414
+ * @property {boolean} $dirty - True if the control is dirty.
415
+ * @property {boolean} $valid - True if the control is valid.
416
+ * @property {boolean} $invalid - True if the control is invalid.
417
+ */
418
+
419
+ /**
420
+ * @typedef {Object} NgModelOptions
421
+ * @property {string|undefined} [updateOn] - The event to update on.
422
+ * @property {number|Object.<string, number>|undefined} [debounce] - The debounce delay.
423
+ * @property {boolean|undefined} [allowInvalid] - Allows invalid models.
424
+ * @property {boolean|undefined} [getterSetter] - Indicates if getter/setter syntax is allowed.
425
+ * @property {string|undefined} [timezone] - The timezone.
426
+ * @property {string|undefined} [timeSecondsFormat] - The format for seconds in time and datetime-local inputs.
427
+ * @property {boolean|undefined} [timeStripZeroSeconds] - Indicates if zero seconds should be stripped.
428
+ */
429
+
430
+ /**
431
+ * @typedef {Object.<string, function(any, any): boolean>} ModelValidators
432
+ * @property {function(any, any): boolean} [index] - Validator function for each index.
433
+ */
434
+
435
+ /**
436
+ * @typedef {Object.<string, function(any, any): Promise<any>>} AsyncModelValidators
437
+ * @property {function(any, any): IPromise<any>} [index] - Async validator function for each index.
438
+ */
439
+
440
+ /**
441
+ * @typedef {Object} InjectorService
442
+ * @property {function(Function, boolean=): string[]} annotate - Annotate a function or an array of inline annotations.
443
+ * @property {function(string, string=): any} get - Get a service by name.
444
+ * @property {function(Function, any?): any} instantiate - Instantiate a type constructor with optional locals.
445
+ * @property {function(Injectable<Function | ((...args: any[]) => any)>, any=, any=): any} invoke - Invoke a function with optional context and locals.
446
+ * @property {function(Array<Module | string | Injectable<(...args: any[]) => void>>): void} loadNewModules - Add and load new modules to the injector.
447
+ * @property {Object.<string, Module>} modules - A map of all the modules loaded into the injector.
448
+ * @property {boolean} strictDi - Indicates if strict dependency injection is enforced.
11
449
  */
12
450
 
13
451
  export {};
package/tsconfig.json CHANGED
@@ -13,5 +13,5 @@
13
13
  "typeRoots": ["node_modules/@types"]
14
14
  },
15
15
  "include": ["./src/*.js", "./**/*.ts"],
16
- "exclude": ["**/*.test.js", "**/*.spec.js"]
16
+ "exclude": ["./types-back/**", "**/*.test.js", "**/*.spec.js"]
17
17
  }
@@ -51,5 +51,5 @@ export const ANIMATION_DELAY_PROP: string;
51
51
  export const ANIMATION_DURATION_PROP: string;
52
52
  export const TRANSITION_DELAY_PROP: string;
53
53
  export const TRANSITION_DURATION_PROP: string;
54
- export const ngMinErr: (arg0: string, arg1: string, ...arg2: any[]) => Error;
54
+ export const ngMinErr: (arg0: string, ...arg1: any[]) => Error;
55
55
  import { JQLite } from "../shared/jqlite/jqlite";
@@ -1,13 +1,11 @@
1
1
  /**
2
2
  * @constructor
3
- * @this {angular.ExceptionHandlerProvider}
3
+ * @this {ExceptionHandlerProvider}
4
4
  */
5
- export function $ExceptionHandlerProvider(this: import("../index").angular.ServiceProvider): void;
5
+ export function $ExceptionHandlerProvider(this: import("../types").ServiceProvider): void;
6
6
  export class $ExceptionHandlerProvider {
7
- $get: (string | (($log: import("../services/log").angular.LogService) => angular.ErrorHandler))[];
7
+ $get: (string | (($log: any) => ErrorHandler))[];
8
8
  }
9
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;
13
- }
10
+ export type ExceptionHandlerProvider = import("../types").ServiceProvider;
11
+ export type ErrorHandler = (exception: Error, cause?: string) => void;
@@ -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: import("../exception-handler").angular.ErrorHandler, $sce: any) => {
40
+ $get: (string | (($parse: any, $exceptionHandler: import("../exception-handler").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: import("../exception-handler").angular.ErrorHandler) => any))[];
10
+ $get: (string | (($rootScope: any, $exceptionHandler: import("../exception-handler").ErrorHandler) => any))[];
11
11
  /**
12
12
  * @ngdoc method
13
13
  * @name $qProvider#errorOnUnhandledRejections