@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
package/types/index.d.ts CHANGED
@@ -1,6 +1,304 @@
1
+ /**
2
+ * @typedef {Object} angular.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
+ * @typedef {Function|Array<string|Function>} angular.Injectable
9
+ * @description Represents a type that can be injected, either as a function or an array of strings/functions.
10
+ * @template T
11
+ */
12
+ /**
13
+ * @typedef {Object} angular.ComponentOptions
14
+ * @description Component definition object (a simplified directive definition object)
15
+ * @property {string | angular.angular.Injectable<angular.ControllerConstructor>> | undefined} [controller]
16
+ * Controller constructor function or name of a registered controller.
17
+ * Use array form for dependencies (necessary with strictDi).
18
+ * @property {string | undefined} [controllerAs]
19
+ * Identifier name for the controller published to its scope (default: '$ctrl').
20
+ * @property {string | angular.angular.Injectable<(...args: any[]) => string> | undefined} [template]
21
+ * HTML template string or function returning an HTML template.
22
+ * If a function, injects $element and $attrs.
23
+ * Use array form for dependencies (necessary with strictDi).
24
+ * @property {string | angular.angular.Injectable<(...args: any[]) => string> | undefined} [templateUrl]
25
+ * Path or function returning a path to an HTML template.
26
+ * If a function, injects $element and $attrs.
27
+ * Use array form for dependencies (necessary with strictDi).
28
+ * @property {{ [boundProperty: string]: string } | undefined} [bindings]
29
+ * DOM attribute bindings to component properties.
30
+ * Component properties are bound to the controller, not the scope.
31
+ * @property {boolean | { [slot: string]: string } | undefined} [transclude]
32
+ * Whether transclusion is enabled. Disabled by default.
33
+ * @property {{ [controller: string]: string } | undefined} [require]
34
+ * Requires controllers of other directives, binding them to this component's controller.
35
+ * Keys specify property names under which required controllers (object values) are bound.
36
+ * Required controllers available before $onInit method execution.
37
+ */
38
+ /**
39
+ * @typedef {Function} angular.ControllerConstructor
40
+ * @description Controller constructor type for AngularJS. Note: Instead of classes, plain functions are often used as controller constructors, especially in examples.
41
+ * @param {...any} args Arguments passed to the controller constructor.
42
+ * @returns {void | angular.Controller} Returns nothing or an instance of IController.
43
+ */
44
+ /**
45
+ * @typedef {Object} angular.OnChangesObject
46
+ * @description Object representing changes in one-way bound properties.
47
+ * Keys are the names of the bound properties that have changed, and values are instances of IChangesObject.
48
+ * @property {angular.ChangesObject<any>} property - Represents a changed property.
49
+ */
50
+ /**
51
+ * @typedef {Object} angular.ChangesObject
52
+ * @description Object representing changes in a property.
53
+ * @property {*} currentValue - Current value of the property.
54
+ * @property {*} previousValue - Previous value of the property.
55
+ * @property {function(): boolean} isFirstChange - Function to check if it's the first change of the property.
56
+ */
57
+ /**
58
+ * @typedef {Object} angular.Controller
59
+ * @description Interface representing the lifecycle hooks for AngularJS directive controllers.
60
+ * @see {@link https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks}
61
+ * @see {@link https://docs.angularjs.org/guide/component}
62
+ *
63
+ * @property {function(): void} [$onInit]
64
+ * Called on each controller after all the controllers on an element have been constructed and had their bindings
65
+ * initialized (and before the pre & post linking functions for the directives on this element). This is a good
66
+ * place to put initialization code for your controller.
67
+ *
68
+ * @property {function(): void} [$doCheck]
69
+ * Called on each turn of the digest cycle. Provides an opportunity to detect and act on changes.
70
+ * Any actions that you wish to take in response to the changes that you detect must be invoked from this hook;
71
+ * implementing this has no effect on when `$onChanges` is called. For example, this hook could be useful if you wish
72
+ * to perform a deep equality check, or to check a `Date` object, changes to which would not be detected by Angular's
73
+ * change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; if detecting changes,
74
+ * you must store the previous value(s) for comparison to the current values.
75
+ *
76
+ * @property {function(angular.OnChangesObject): void} [$onChanges]
77
+ * Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
78
+ * properties that have changed, and the values are an {@link IChangesObject} object of the form
79
+ * { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
80
+ * cloning the bound value to prevent accidental mutation of the outer value.
81
+ *
82
+ * @property {function(): void} [$onDestroy]
83
+ * Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
84
+ * watches and event handlers.
85
+ *
86
+ * @property {function(): void} [$postLink]
87
+ * Called after this controller's element and its children have been linked. Similar to the post-link function this
88
+ * hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain
89
+ * templateUrl directives will not have been compiled and linked since they are waiting for their template to load
90
+ * asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered
91
+ * analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
92
+ * different in Angular 1 there is no direct mapping and care should be taken when upgrading.
93
+ *
94
+ * @property {*} [s: string]
95
+ * IController implementations frequently do not implement any of its methods.
96
+ * A string indexer indicates to TypeScript not to issue a weak type error in this case.
97
+ */
98
+ /**
99
+ * @typedef {Object.<string, any>} angular.Attributes
100
+ *
101
+ * @property {(name: string) => string} $normalize
102
+ * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form.
103
+ * Also there is special case for Moz prefix starting with upper case letter.
104
+ *
105
+ * @property {(newClasses: string, oldClasses: string) => void} $updateClass
106
+ * Adds and removes the appropriate CSS class values to the element based on the difference between
107
+ * the new and old CSS class values (specified as newClasses and oldClasses).
108
+ *
109
+ * @property {(key: string, value: any) => void} $set
110
+ * Set DOM element attribute value.
111
+ *
112
+ * @property {<T>(name: string, fn: (value?: T) => any) => Function} $observe
113
+ * Observes an interpolated attribute.
114
+ * The observer function will be invoked once during the next $digest
115
+ * following compilation. The observer is then invoked whenever the
116
+ * interpolated value changes.
117
+ *
118
+ * @property {Object.<string, string>} $attr
119
+ * A map of DOM element attribute names to the normalized name. This is needed
120
+ * to do reverse lookup from normalized name back to actual name.
121
+ * @see http://docs.angularjs.org/api/ng/type/$compile.directive.Attributes
122
+ */
123
+ /**
124
+ * @typedef {import('./core/scope/scope').Scope} TScope
125
+ */
126
+ /**
127
+ * @typedef {import('./shared/jqlite/jqlite').JQLite} TElement
128
+ */
129
+ /**
130
+ * @typedef {angular.Attributes} TAttributes
131
+ */
132
+ /**
133
+ * @typedef {angular.DirectiveController} TController
134
+ */
135
+ /**
136
+ * @typedef {angular.Controller | angular.Controller[] | { [key: string]: angular.Controller }} angular.DirectiveController
137
+ * @description Represents a directive controller, which can be:
138
+ * - A single instance of {@link angular.Controller}
139
+ * - An array of {@link angular.Controller}
140
+ * - An object where keys are string identifiers and values are {@link angular.Controller}
141
+ */
142
+ /**
143
+ * @template [S=import('./core/scope/scope').Scope]
144
+ * @template {TScope} S - The type of the directive's scope.
145
+ *
146
+ * @template [T=import('./shared/jqlite/jqlite').JQLite]
147
+ * @template {TElement} T - The type of the directive's element.
148
+ *
149
+ * @template [A=angular.Attributes]
150
+ * @template {TAttributes} A - The type of the directive's attributes.
151
+ *
152
+ * @template [C=angular.Controller]
153
+ * @template {TController} C - The type of the directive's controller.
154
+ */
155
+ /**
156
+ * Compile function for an AngularJS directive.
157
+ *
158
+ * @template TScope
159
+ * @template TElement
160
+ * @template TAttributes
161
+ * @template TController
162
+ * @callback angular.DirectiveCompileFn
163
+ * @param {TElement} templateElement - The template element.
164
+ * @param {TAttributes} templateAttributes - The template attributes.
165
+ * @param {angular.TranscludeFunction} transclude - @deprecated The transclude function. Note: The transclude function that is passed to the compile function is deprecated,
166
+ * as it e.g. does not know about the right outer scope. Please use the transclude function
167
+ * that is passed to the link function instead.
168
+ * @returns {void | angular.DirectiveLinkFn<S, T, A, C> | angular.DirectivePrePost<S, T, A, C>} Returns void, angular.DirectiveLinkFn, or angular.DirectivePrePost.
169
+ */
170
+ /**
171
+ * Link function for an AngularJS directive.
172
+ *
173
+ * @template TScope
174
+ * @template TElement
175
+ * @template TAttributes
176
+ * @template TController
177
+ * @callback angular.DirectiveLinkFn
178
+ * @param {TScope} scope
179
+ * @param {TElement} instanceElement
180
+ * @param {TAttributes} instanceAttributes
181
+ * @param {TController} [controller]
182
+ * @param {angular.TranscludeFunction} [transclude]
183
+ * @returns {void}
184
+ */
185
+ /**
186
+ * @callback angular.CloneAttachFunction
187
+ * @param {JQLite} [clonedElement]
188
+ * @param {Scope} [scope] // Let's hint but not force cloneAttachFn's signature
189
+ * @returns {any}
190
+ */
191
+ /**
192
+ * This corresponds to $transclude passed to controllers and to the transclude function passed to link functions.
193
+ * https://docs.angularjs.org/api/ng/service/$compile#-controller-
194
+ * http://teropa.info/blog/2015/06/09/transclusion.html
195
+ *
196
+ * @typedef {Object} angular.TranscludeFunction
197
+ * @property {function(TScope, angular.CloneAttachFunction, JQLite=, string=): JQLite} transcludeWithScope
198
+ * @property {function(angular.CloneAttachFunction=, JQLite=, string=): JQLite} transcludeWithoutScope
199
+ * @property {function(string): boolean} isSlotFilled - Returns true if the specified slot contains content (i.e., one or more DOM nodes)
200
+ */
201
+ /**
202
+ * @typedef {function(TScope, angular.CloneAttachFunction, JQLite=, string=): JQLite} transcludeWithScope
203
+ */
204
+ /**
205
+ * @typedef {function(angular.CloneAttachFunction=, JQLite=, string=): JQLite} transcludeWithoutScope
206
+ */
207
+ /**
208
+ * Represents the pre and post linking functions of a directive.
209
+ *
210
+ * @template TScope The type of scope associated with the directive.
211
+ * @template TElement The type of element that the directive matches.
212
+ * @template TAttributes The type of attributes of the directive.
213
+ * @template TController The type of controller associated with the directive.
214
+ *
215
+ * @typedef {Object} angular.DirectivePrePost
216
+ * @property {angular.DirectiveLinkFn<S, T, A, C> | undefined} [pre]
217
+ * The pre-linking function of the directive.
218
+ * @property {angular.DirectiveLinkFn<S, T, A, C> | undefined} [post]
219
+ * The post-linking function of the directive.
220
+ */
221
+ /**
222
+ * Directive definition object.
223
+ *
224
+ * @template TScope - The type of the directive's scope.
225
+ * @template TElement - The type of the directive's element.
226
+ * @template TAttributes - The type of the directive's attributes.
227
+ * @template TController - The type of the directive's controller.
228
+ *
229
+ * @typedef {Object} angular.Directive
230
+ * @property {angular.DirectiveCompileFn<S, T, A, C> | undefined} [compile]
231
+ * Compile function for the directive.
232
+ * @property {string | angular.Injectable<angular.ControllerConstructor> | undefined} [controller]
233
+ * Controller constructor or name.
234
+ * @property {string | undefined} [controllerAs]
235
+ * Controller alias.
236
+ * @property {boolean | { [boundProperty: string]: string } | undefined} [bindToController]
237
+ * Bindings to controller.
238
+ * @property {angular.DirectiveLinkFn<S, T, A, C> | angular.DirectivePrePost<S, T, A, C> | undefined} [link]
239
+ * Link function.
240
+ * @property {boolean | undefined} [multiElement]
241
+ * Multi-element directive flag.
242
+ * @property {number | undefined} [priority]
243
+ * Directive priority.
244
+ * @property {boolean | undefined} [replace]
245
+ * Deprecated: Replace flag.
246
+ * @property {string | string[] | { [controller: string]: string } | undefined} [require]
247
+ * Required controllers.
248
+ * @property {string | undefined} [restrict]
249
+ * Restriction mode.
250
+ * @property {boolean | { [boundProperty: string]: string } | undefined} [scope]
251
+ * Scope options.
252
+ * @property {string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined} [template]
253
+ * HTML template.
254
+ * @property {string | undefined} [templateNamespace]
255
+ * Template namespace.
256
+ * @property {string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined} [templateUrl]
257
+ * HTML template URL.
258
+ * @property {boolean | "element" | { [slot: string]: string } | undefined} [transclude]
259
+ * Transclusion options.
260
+ */
261
+ /**
262
+ * Factory function for creating directives.
263
+ *
264
+ * @template TScope - The type of the directive's scope.
265
+ * @template TElement - The type of the directive's element.
266
+ * @template TAttributes - The type of the directive's attributes.
267
+ * @template TController - The type of the directive's controller.
268
+ *
269
+ * @typedef {(...args: any[]) => angular.Directive<S, T, A, C> | angular.DirectiveLinkFn<S, T, A, C>} angular.DirectiveFactory
270
+ */
271
+ /**
272
+ * @typedef {Function} angular.FilterFunction
273
+ * @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
274
+ */
275
+ /**
276
+ * @typedef {Function} angular.FilterFactory
277
+ * @returns {angular.FilterFunction}
278
+ */
279
+ /**
280
+ * Interface for a service provider class.
281
+ * @typedef {Object} angular.ServiceProviderClass
282
+ * @property {Function} constructor - The constructor for the service provider.
283
+ * @param {...any} args - The arguments for the constructor.
284
+ * @returns {angular.ServiceProvider}
285
+ */
286
+ /**
287
+ * Interface for a service provider factory function.
288
+ * @typedef {Function} angular.ServiceProviderFactory
289
+ * @param {...any} args - The arguments for the factory function.
290
+ * @returns {angular.ServiceProvider}
291
+ */
292
+ /**
293
+ * Interface for a service provider.
294
+ * @typedef {Object} angular.ServiceProvider
295
+ * @property {*} $get - The $get property that represents a service instance or a factory function.
296
+ */
297
+ /** @type {angular.ServiceProvider} */
298
+ export const ServiceProvider: angular.ServiceProvider;
1
299
  export namespace angular {
2
300
  type BootstrapConfig = any;
3
- type Injectable<T> = Function | Array<string | Function>;
301
+ type Injectable<T_1> = Function | Array<string | Function>;
4
302
  type ComponentOptions = any;
5
303
  type ControllerConstructor = Function;
6
304
  type OnChangesObject = any;
@@ -9,14 +307,31 @@ export namespace angular {
9
307
  type Attributes = {
10
308
  [x: string]: any;
11
309
  };
310
+ type DirectiveController = angular.Controller | angular.Controller[] | {
311
+ [key: string]: angular.Controller;
312
+ };
12
313
  /**
13
314
  * Compile function for an AngularJS directive.
14
315
  */
15
- type DirectiveCompileFn<TScope, TElement, TAttributes, TController> = (templateElement: TElement, templateAttributes: TAttributes, transclude: ITranscludeFunction) => any;
316
+ type DirectiveCompileFn<TScope, TElement, TAttributes, TController> = (templateElement: TElement, templateAttributes: TAttributes, transclude: angular.TranscludeFunction) => any;
16
317
  /**
17
318
  * Link function for an AngularJS directive.
18
319
  */
19
- type DirectiveLinkFn<TScope, TElement, TAttributes, TController> = (scope: TScope, instanceElement: TElement, instanceAttributes: TAttributes, controller?: TController, transclude?: ITranscludeFunction) => void;
320
+ type DirectiveLinkFn<TScope, TElement, TAttributes, TController> = (scope: TScope, instanceElement: TElement, instanceAttributes: TAttributes, controller?: TController, transclude?: angular.TranscludeFunction) => void;
321
+ type CloneAttachFunction = (clonedElement?: JQLite, scope?: Scope) => any;
322
+ /**
323
+ * This corresponds to $transclude passed to controllers and to the transclude function passed to link functions.
324
+ * https://docs.angularjs.org/api/ng/service/$compile#-controller-
325
+ * http://teropa.info/blog/2015/06/09/transclusion.html
326
+ */
327
+ type TranscludeFunction = {
328
+ transcludeWithScope: (arg0: TScope, arg1: angular.CloneAttachFunction, arg2: JQLite | undefined, arg3: string | undefined) => JQLite;
329
+ transcludeWithoutScope: (arg0: angular.CloneAttachFunction | undefined, arg1: JQLite | undefined, arg2: string | undefined) => JQLite;
330
+ /**
331
+ * - Returns true if the specified slot contains content (i.e., one or more DOM nodes)
332
+ */
333
+ isSlotFilled: (arg0: string) => boolean;
334
+ };
20
335
  /**
21
336
  * Represents the pre and post linking functions of a directive.
22
337
  */
@@ -24,94 +339,364 @@ export namespace angular {
24
339
  /**
25
340
  * The pre-linking function of the directive.
26
341
  */
27
- pre?: angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController> | undefined;
342
+ pre?: angular.DirectiveLinkFn<S, T, A, C> | undefined;
28
343
  /**
29
344
  * The post-linking function of the directive.
30
345
  */
31
- post?: angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController> | undefined;
346
+ post?: angular.DirectiveLinkFn<S, T, A, C> | undefined;
32
347
  };
33
- type Module = any;
34
- }
35
- export type TScope = import("./core/scope/scope").Scope;
36
- export type TElement = import("./shared/jqlite/jqlite").JQLite;
37
- export type TAttributes = angular.Attributes;
38
- export type IDirectiveController = angular.Controller | angular.Controller[] | {
39
- [key: string]: angular.Controller;
40
- };
41
- /**
42
- * Directive definition object.
43
- */
44
- export type IDirective<TScope, TElement, TAttributes, TController> = {
45
- /**
46
- * Compile function for the directive.
47
- */
48
- compile?: angular.DirectiveCompileFn<TScope, TElement, TAttributes, TController> | undefined;
49
- /**
50
- * Controller constructor or name.
51
- */
52
- controller?: string | angular.Injectable<angular.ControllerConstructor> | undefined;
53
- /**
54
- * Controller alias.
55
- */
56
- controllerAs?: string | undefined;
57
348
  /**
58
- * Bindings to controller.
349
+ * Directive definition object.
59
350
  */
60
- bindToController?: boolean | {
61
- [boundProperty: string]: string;
62
- } | undefined;
63
- /**
64
- * Link function.
65
- */
66
- link?: angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController> | angular.DirectivePrePost<TScope, TElement, TAttributes, TController> | undefined;
67
- /**
68
- * Multi-element directive flag.
69
- */
70
- multiElement?: boolean | undefined;
71
- /**
72
- * Directive priority.
73
- */
74
- priority?: number | undefined;
75
- /**
76
- * Deprecated: Replace flag.
77
- */
78
- replace?: boolean | undefined;
79
- /**
80
- * Required controllers.
81
- */
82
- require?: string | string[] | {
83
- [controller: string]: string;
84
- } | undefined;
85
- /**
86
- * Restriction mode.
87
- */
88
- restrict?: string | undefined;
89
- /**
90
- * Scope options.
91
- */
92
- scope?: boolean | {
93
- [boundProperty: string]: string;
94
- } | undefined;
351
+ type Directive<TScope, TElement, TAttributes, TController> = {
352
+ /**
353
+ * Compile function for the directive.
354
+ */
355
+ compile?: angular.DirectiveCompileFn<S, T, A, C> | undefined;
356
+ /**
357
+ * Controller constructor or name.
358
+ */
359
+ controller?: string | angular.Injectable<angular.ControllerConstructor> | undefined;
360
+ /**
361
+ * Controller alias.
362
+ */
363
+ controllerAs?: string | undefined;
364
+ /**
365
+ * Bindings to controller.
366
+ */
367
+ bindToController?: boolean | {
368
+ [boundProperty: string]: string;
369
+ } | undefined;
370
+ /**
371
+ * Link function.
372
+ */
373
+ link?: angular.DirectiveLinkFn<S, T, A, C> | angular.DirectivePrePost<S, T, A, C> | undefined;
374
+ /**
375
+ * Multi-element directive flag.
376
+ */
377
+ multiElement?: boolean | undefined;
378
+ /**
379
+ * Directive priority.
380
+ */
381
+ priority?: number | undefined;
382
+ /**
383
+ * Deprecated: Replace flag.
384
+ */
385
+ replace?: boolean | undefined;
386
+ /**
387
+ * Required controllers.
388
+ */
389
+ require?: string | string[] | {
390
+ [controller: string]: string;
391
+ } | undefined;
392
+ /**
393
+ * Restriction mode.
394
+ */
395
+ restrict?: string | undefined;
396
+ /**
397
+ * Scope options.
398
+ */
399
+ scope?: boolean | {
400
+ [boundProperty: string]: string;
401
+ } | undefined;
402
+ /**
403
+ * HTML template.
404
+ */
405
+ template?: string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined;
406
+ /**
407
+ * Template namespace.
408
+ */
409
+ templateNamespace?: string | undefined;
410
+ /**
411
+ * HTML template URL.
412
+ */
413
+ templateUrl?: string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined;
414
+ /**
415
+ * Transclusion options.
416
+ */
417
+ transclude?: boolean | "element" | {
418
+ [slot: string]: string;
419
+ } | undefined;
420
+ };
95
421
  /**
96
- * HTML template.
422
+ * Factory function for creating directives.
97
423
  */
98
- template?: string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined;
424
+ type DirectiveFactory<TScope, TElement, TAttributes, TController> = (...args: any[]) => angular.Directive<S, T, A, C> | angular.DirectiveLinkFn<S, T, A, C>;
425
+ type FilterFunction = Function;
426
+ type FilterFactory = Function;
99
427
  /**
100
- * Template namespace.
428
+ * Interface for a service provider class.
101
429
  */
102
- templateNamespace?: string | undefined;
430
+ type ServiceProviderClass = {
431
+ /**
432
+ * - The constructor for the service provider.
433
+ */
434
+ constructor: Function;
435
+ };
103
436
  /**
104
- * HTML template URL.
437
+ * Interface for a service provider factory function.
105
438
  */
106
- templateUrl?: string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined;
439
+ type ServiceProviderFactory = Function;
107
440
  /**
108
- * Transclusion options.
441
+ * Interface for a service provider.
109
442
  */
110
- transclude?: boolean | "element" | {
111
- [slot: string]: string;
112
- } | undefined;
443
+ type ServiceProvider = {
444
+ /**
445
+ * - The $get property that represents a service instance or a factory function.
446
+ */
447
+ $get: any;
448
+ };
449
+ type Module = any;
450
+ type FormController = {
451
+ /**
452
+ * - True if the form has not been modified.
453
+ */
454
+ $pristine: boolean;
455
+ /**
456
+ * - True if the form has been modified.
457
+ */
458
+ $dirty: boolean;
459
+ /**
460
+ * - True if the form is valid.
461
+ */
462
+ $valid: boolean;
463
+ /**
464
+ * - True if the form is invalid.
465
+ */
466
+ $invalid: boolean;
467
+ /**
468
+ * - True if the form has been submitted.
469
+ */
470
+ $submitted: boolean;
471
+ /**
472
+ * - An object containing arrays of controls with validation errors keyed by validation error keys.
473
+ */
474
+ $error: {
475
+ [x: string]: Array<angular.NgModelController | angular.FormController>;
476
+ };
477
+ /**
478
+ * - The name of the form.
479
+ */
480
+ $name?: string | undefined;
481
+ /**
482
+ * - An object containing arrays of controls that are pending validation, keyed by validation error keys.
483
+ */
484
+ $pending?: {
485
+ [x: string]: Array<angular.NgModelController | angular.FormController>;
486
+ } | undefined;
487
+ /**
488
+ * - Adds a control to the form.
489
+ */
490
+ $addControl: (arg0: angular.NgModelController | angular.FormController) => void;
491
+ /**
492
+ * - Returns an array of all controls in the form.
493
+ */
494
+ $getControls: () => ReadonlyArray<angular.NgModelController | angular.FormController>;
495
+ /**
496
+ * - Removes a control from the form.
497
+ */
498
+ $removeControl: (arg0: angular.NgModelController | angular.FormController) => void;
499
+ /**
500
+ * - Sets the validity of a control in the form.
501
+ */
502
+ $setValidity: (arg0: string, arg1: boolean, arg2: angular.NgModelController | angular.FormController) => void;
503
+ /**
504
+ * - Marks the form as dirty.
505
+ */
506
+ $setDirty: () => void;
507
+ /**
508
+ * - Marks the form as pristine.
509
+ */
510
+ $setPristine: () => void;
511
+ /**
512
+ * - Commits the view value of all controls in the form.
513
+ */
514
+ $commitViewValue: () => void;
515
+ /**
516
+ * - Rolls back the view value of all controls in the form.
517
+ */
518
+ $rollbackViewValue: () => void;
519
+ /**
520
+ * - Marks the form as submitted.
521
+ */
522
+ $setSubmitted: () => void;
523
+ /**
524
+ * - Marks the form controls as untouched.
525
+ */
526
+ $setUntouched: () => void;
527
+ /**
528
+ * - An indexer for additional properties.
529
+ */
530
+ name?: (arg0: string) => any;
531
+ };
532
+ type NgModelController = {
533
+ /**
534
+ * - Renders the view value.
535
+ */
536
+ $render: () => void;
537
+ /**
538
+ * - Sets the validity state.
539
+ */
540
+ $setValidity: (arg0: string, arg1: boolean) => void;
541
+ /**
542
+ * - Sets the view value.
543
+ */
544
+ $setViewValue: (arg0: any, arg1: string | undefined) => void;
545
+ /**
546
+ * - Marks the control as pristine.
547
+ */
548
+ $setPristine: () => void;
549
+ /**
550
+ * - Marks the control as dirty.
551
+ */
552
+ $setDirty: () => void;
553
+ /**
554
+ * - Validates the control.
555
+ */
556
+ $validate: () => void;
557
+ /**
558
+ * - Marks the control as touched.
559
+ */
560
+ $setTouched: () => void;
561
+ /**
562
+ * - Marks the control as untouched.
563
+ */
564
+ $setUntouched: () => void;
565
+ /**
566
+ * - Rolls back the view value.
567
+ */
568
+ $rollbackViewValue: () => void;
569
+ /**
570
+ * - Commits the view value.
571
+ */
572
+ $commitViewValue: () => void;
573
+ /**
574
+ * - Processes the model value.
575
+ */
576
+ $processModelValue: () => void;
577
+ /**
578
+ * - Checks if the value is empty.
579
+ */
580
+ $isEmpty: (arg0: any) => boolean;
581
+ /**
582
+ * - Overrides model options.
583
+ */
584
+ $overrideModelOptions: (arg0: angular.NgModelOptions) => void;
585
+ /**
586
+ * - The current view value.
587
+ */
588
+ $viewValue: any;
589
+ /**
590
+ * - The current model value.
591
+ */
592
+ $modelValue: any;
593
+ /**
594
+ * - Array of parsers.
595
+ */
596
+ $parsers: Array<(arg0: any, arg1: any) => boolean>;
597
+ /**
598
+ * - Array of formatters.
599
+ */
600
+ $formatters: Array<(arg0: any) => any>;
601
+ /**
602
+ * - Array of view change listeners.
603
+ */
604
+ $viewChangeListeners: Array<() => any>;
605
+ /**
606
+ * - Validation errors.
607
+ */
608
+ $error: {
609
+ [x: string]: boolean;
610
+ };
611
+ /**
612
+ * - The name of the control.
613
+ */
614
+ $name?: string | undefined;
615
+ /**
616
+ * - True if the control has been touched.
617
+ */
618
+ $touched: boolean;
619
+ /**
620
+ * - True if the control has not been touched.
621
+ */
622
+ $untouched: boolean;
623
+ /**
624
+ * - Synchronous validators.
625
+ */
626
+ $validators: {
627
+ [x: string]: (arg0: any, arg1: any) => boolean;
628
+ };
629
+ /**
630
+ * - Asynchronous validators.
631
+ */
632
+ $asyncValidators: {
633
+ [x: string]: (arg0: any, arg1: any) => angular.Promise<any>;
634
+ };
635
+ /**
636
+ * - Pending validation.
637
+ */
638
+ $pending?: {
639
+ [x: string]: boolean;
640
+ } | undefined;
641
+ /**
642
+ * - True if the control is pristine.
643
+ */
644
+ $pristine: boolean;
645
+ /**
646
+ * - True if the control is dirty.
647
+ */
648
+ $dirty: boolean;
649
+ /**
650
+ * - True if the control is valid.
651
+ */
652
+ $valid: boolean;
653
+ /**
654
+ * - True if the control is invalid.
655
+ */
656
+ $invalid: boolean;
657
+ };
658
+ type NgModelOptions = {
659
+ /**
660
+ * - The event to update on.
661
+ */
662
+ updateOn?: string | undefined;
663
+ /**
664
+ * - The debounce delay.
665
+ */
666
+ debounce?: number | {
667
+ [x: string]: number;
668
+ } | undefined;
669
+ /**
670
+ * - Allows invalid models.
671
+ */
672
+ allowInvalid?: boolean | undefined;
673
+ /**
674
+ * - Indicates if getter/setter syntax is allowed.
675
+ */
676
+ getterSetter?: boolean | undefined;
677
+ /**
678
+ * - The timezone.
679
+ */
680
+ timezone?: string | undefined;
681
+ /**
682
+ * - The format for seconds in time and datetime-local inputs.
683
+ */
684
+ timeSecondsFormat?: string | undefined;
685
+ /**
686
+ * - Indicates if zero seconds should be stripped.
687
+ */
688
+ timeStripZeroSeconds?: boolean | undefined;
689
+ };
690
+ }
691
+ export type TScope = import("./core/scope/scope").Scope;
692
+ export type TElement = import("./shared/jqlite/jqlite").JQLite;
693
+ export type TAttributes = angular.Attributes;
694
+ export type TController = angular.DirectiveController;
695
+ export type transcludeWithScope = (arg0: TScope, arg1: angular.CloneAttachFunction, arg2: JQLite | undefined, arg3: string | undefined) => JQLite;
696
+ export type transcludeWithoutScope = (arg0: angular.CloneAttachFunction | undefined, arg1: JQLite | undefined, arg2: string | undefined) => JQLite;
697
+ export type IModelValidators = {
698
+ [x: string]: (arg0: any, arg1: any) => boolean;
699
+ };
700
+ export type IAsyncModelValidators = {
701
+ [x: string]: (arg0: any, arg1: any) => IPromise<any>;
113
702
  };
114
- /**
115
- * Factory function for creating directives.
116
- */
117
- export type IDirectiveFactory<TScope, TElement, TAttributes, TController> = (...args: any[]) => IDirective<TScope, TElement, TAttributes, TController> | angular.DirectiveLinkFn<TScope, TElement, TAttributes, TController>;