@angular-wave/angular.ts 0.0.61 → 0.0.63

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.
package/types/loader.d.ts CHANGED
@@ -139,7 +139,10 @@
139
139
  </file>
140
140
  </example>
141
141
  */
142
- export function angularInit(element: any): void;
142
+ /**
143
+ * @param {Element|Document} element
144
+ */
145
+ export function angularInit(element: Element | Document): void;
143
146
  /**
144
147
  * @ngdoc type
145
148
  * @name import('./types').Module
@@ -149,34 +152,6 @@ export function angularInit(element: any): void;
149
152
  * Interface for configuring AngularJS {@link angular.module modules}.
150
153
  */
151
154
  export function setupModuleLoader(window: any): any;
152
- /**
153
- * @ngdoc function
154
- * @name angular.errorHandlingConfig
155
- * @module ng
156
- * @kind function
157
- *
158
- * @description
159
- * Configure several aspects of error handling in AngularJS if used as a setter or return the
160
- * current configuration if used as a getter. The following options are supported:
161
- *
162
- * - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.
163
- *
164
- * Omitted or undefined options will leave the corresponding configuration values unchanged.
165
- *
166
- * @param {Object=} config - The configuration object. May only contain the options that need to be
167
- * updated. Supported keys:
168
- *
169
- * * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a
170
- * non-positive or non-numeric value, removes the max depth limit.
171
- * Default: 5
172
- *
173
- * * `urlErrorParamsEnabled` **{Boolean}** - Specifies whether the generated error url will
174
- * contain the parameters of the thrown error. Disabling the parameters can be useful if the
175
- * generated error url is very long.
176
- *
177
- * Default: true. When used without argument, it returns the current value.
178
- */
179
- export function errorHandlingConfig(config?: any | undefined): {};
180
155
  /**
181
156
  * @type {string} `version` from `package.json`, injected by Rollup plugin
182
157
  */
@@ -185,7 +160,6 @@ export const VERSION: string;
185
160
  * Configuration option for AngularTS bootstrap process.
186
161
  *
187
162
  * @typedef {Object} AngularBootstrapConfig
188
- * @property {boolean} debugInfoEnabled - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
189
163
  * @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`.
190
164
  */
191
165
  /**
@@ -196,160 +170,86 @@ export class Angular {
196
170
  cache: Map<number, import("./core/cache/cache").ExpandoStore>;
197
171
  /** @type {string} */
198
172
  version: string;
199
- /** @type {bind} */
200
- bind: typeof bind;
201
- /** @type {equals} */
202
- equals: typeof equals;
203
173
  /** @type {typeof import('./shared/jqlite/jqlite').JQLite} */
204
174
  element: typeof import("./shared/jqlite/jqlite").JQLite;
205
- /** @type {extend} */
206
- extend: typeof extend;
207
- /** @type {forEach} */
208
- forEach: typeof forEach;
209
- /** @type {fromJson} */
210
- fromJson: typeof fromJson;
211
- /** @type {toJson} */
212
- toJson: typeof toJson;
213
- /** @type {identity} */
214
- identity: typeof identity;
215
- /** @type {isDate} */
216
- isDate: typeof isDate;
217
- /** @type {isDefined} */
218
- isDefined: typeof isDefined;
219
- /** @type {isElement} */
220
- isElement: typeof isElement;
221
- /** @type {isFunction} */
222
- isFunction: typeof isFunction;
223
- /** @type {isNumber} */
224
- isNumber: typeof isNumber;
225
- /** @type {isObject} */
226
- isObject: typeof isObject;
227
- /** @type {isString} */
228
- isString: typeof isString;
229
- /** @type {isUndefined} */
230
- isUndefined: typeof isUndefined;
231
- /** @type {merge} */
232
- merge: typeof merge;
233
- /** @type {errorHandlingConfig} */
234
- errorHandlingConfig: typeof errorHandlingConfig;
175
+ /** @type {!Array<string|any>} */
176
+ bootsrappedModules: Array<string | any>;
235
177
  /** @type {Function} */
236
178
  doBootstrap: Function;
237
179
  /**
238
- * @module angular
239
- * @function bootstrap
240
-
241
- * @description
242
- * Use this function to manually start up AngularJS application.
243
- *
244
- * For more information, see the {@link guide/bootstrap Bootstrap guide}.
245
- *
246
- * AngularJS will detect if it has been loaded into the browser more than once and only allow the
247
- * first loaded script to be bootstrapped and will report a warning to the browser console for
248
- * each of the subsequent scripts. This prevents strange results in applications, where otherwise
249
- * multiple instances of AngularJS try to work on the DOM.
250
- *
251
- * <div class="alert alert-warning">
252
- * **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.
253
- * They must use {@link ng.directive:ngApp ngApp}.
254
- * </div>
255
- *
256
- * <div class="alert alert-warning">
257
- * **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},
258
- * such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.
259
- * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
260
- * causing animations to stop working and making the injector inaccessible from outside the app.
261
- * </div>
262
- *
263
- * ```html
264
- * <!doctype html>
265
- * <html>
266
- * <body>
267
- * <div ng-controller="WelcomeController">
268
- * {{greeting}}
269
- * </div>
270
- *
271
- * <script src="angular.js"></script>
272
- * <script>
273
- * let app = angular.module('demo', [])
274
- * .controller('WelcomeController', function($scope) {
275
- * $scope.greeting = 'Welcome!';
276
- * });
277
- * angular.bootstrap(document, ['demo']);
278
- * </script>
279
- * </body>
280
- * </html>
281
- * ```
282
- *
283
- * @param {string | Element | Document} element DOM element which is the root of AngularJS application.
284
- * @param {Array<string | Function | any[]>=} modules an array of modules to load into the application.
285
- * Each item in the array should be the name of a predefined module or a (DI annotated)
286
- * function that will be invoked by the injector as a `config` block.
287
- * See: {@link angular.module modules}
288
- * @param {AngularBootstrapConfig} [config] an object for defining configuration options for the application. The
289
- * following keys are supported:
290
- *
291
- * * `strictDi` - disable automatic function annotation for the application. This is meant to
292
- * assist in finding bugs which break minified code. Defaults to `false`.
293
- *
294
- * @returns {any} InjectorService - Returns the newly created injector for this app.
295
- */
296
- bootstrap(element: string | Element | Document, modules?: Array<string | Function | any[]> | undefined, config?: AngularBootstrapConfig): any;
297
- resumeBootstrap(extraModules: any): any;
298
- /**
180
+ * Configure several aspects of error handling if used as a setter or return the
181
+ * current configuration if used as a getter.
299
182
  *
300
- * @param {any[]} modules
301
- * @param {boolean?} strictDi
302
- * @returns {angular.auto.IInjectorService}
183
+ * Omitted or undefined options will leave the corresponding configuration values unchanged.
184
+ *
185
+ * @param {import('./shared/utils').ErrorHandlingConfig} [config]
186
+ * @returns {import('./shared/utils').ErrorHandlingConfig}
303
187
  */
304
- injector(modules: any[], strictDi: boolean | null): angular.auto.IInjectorService;
188
+ errorHandlingConfig(config?: import("./shared/utils").ErrorHandlingConfig): import("./shared/utils").ErrorHandlingConfig;
305
189
  /**
190
+ * Use this function to manually start up AngularJS application.
306
191
  *
307
- * The `angular.module` is a global place for creating, registering and retrieving AngularJS
308
- * modules.
309
- * All modules (AngularJS core or 3rd party) that should be available to an application must be
310
- * registered using this mechanism.
192
+ * For more information, see the {@link guide/bootstrap Bootstrap guide}.
311
193
  *
312
- * Passing one argument retrieves an existing {@link import('./types').Module},
313
- * whereas passing more than one argument creates a new {@link import('./types').Module}
194
+ * AngularJS will detect if it has been loaded into the browser more than once and only allow the
195
+ * first loaded script to be bootstrapped and will report a warning to the browser console for
196
+ * each of the subsequent scripts. This prevents strange results in applications, where otherwise
197
+ * multiple instances of AngularJS try to work on the DOM.
314
198
  *
199
+ * <div class="alert alert-warning">
200
+ * **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.
201
+ * They must use {@link ng.directive:ngApp ngApp}.
202
+ * </div>
315
203
  *
316
- * # Module
204
+ * <div class="alert alert-warning">
205
+ * **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},
206
+ * such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.
207
+ * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
208
+ * causing animations to stop working and making the injector inaccessible from outside the app.
209
+ * </div>
317
210
  *
318
- * A module is a collection of services, directives, controllers, filters, and configuration information.
319
- * `angular.module` is used to configure the {@link auto.$injector $injector}.
211
+ * ```html
212
+ * <!doctype html>
213
+ * <html>
214
+ * <body>
215
+ * <div ng-controller="WelcomeController">
216
+ * {{greeting}}
217
+ * </div>
320
218
  *
321
- * ```js
322
- * // Create a new module
323
- * let myModule = angular.module('myModule', []);
324
- *
325
- * // register a new service
326
- * myModule.value('appName', 'MyCoolApp');
327
- *
328
- * // configure existing services inside initialization blocks.
329
- * myModule.config(['$locationProvider', function($locationProvider) {
330
- * // Configure existing providers
331
- * $locationProvider.hashPrefix('!');
332
- * }]);
219
+ * <script src="angular.js"></script>
220
+ * <script>
221
+ * let app = angular.module('demo', [])
222
+ * .controller('WelcomeController', function($scope) {
223
+ * $scope.greeting = 'Welcome!';
224
+ * });
225
+ * angular.bootstrap(document, ['demo']);
226
+ * </script>
227
+ * </body>
228
+ * </html>
333
229
  * ```
334
230
  *
335
- * Then you can create an injector and load your modules like this:
231
+ * @param {string | Element | Document} element DOM element which is the root of AngularJS application.
232
+ * @param {Array<String|any>} [modules] an array of modules to load into the application.
233
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
234
+ * function that will be invoked by the injector as a `config` block.
235
+ * See: {@link angular.module modules}
236
+ * @param {AngularBootstrapConfig} [config] an object for defining configuration options for the application. The
237
+ * following keys are supported:
336
238
  *
337
- * ```js
338
- * let injector = angular.injector(['ng', 'myModule'])
339
- * ```
239
+ * * `strictDi` - disable automatic function annotation for the application. This is meant to
240
+ * assist in finding bugs which break minified code. Defaults to `false`.
340
241
  *
341
- * However it's more likely that you'll just use
342
- * {@link ng.directive:ngApp ngApp} or
343
- * {@link angular.bootstrap} to simplify this process for you.
242
+ * @returns {any} InjectorService - Returns the newly created injector for this app.
243
+ */
244
+ bootstrap(element: string | Element | Document, modules?: Array<string | any>, config?: AngularBootstrapConfig): any;
245
+ resumeBootstrap(extraModules: any): any;
246
+ /**
344
247
  *
345
- * @param {!string} name The name of the module to create or retrieve.
346
- * @param {!Array.<string>=} requires If specified then new module is being created. If
347
- * unspecified then the module is being retrieved for further configuration.
348
- * @param {Function=} configFn Optional configuration function for the module. Same as
349
- * {@link import('./types').Module#config Module#config()}.
350
- * @returns {import('./types').Module} new module with the {@link import('./types').Module} api.
248
+ * @param {any[]} modules
249
+ * @param {boolean?} strictDi
250
+ * @returns {import("./types").InjectorService}
351
251
  */
352
- module(name: string, requires?: Array<string> | undefined, configFn?: Function | undefined): import("./types").Module;
252
+ injector(modules: any[], strictDi: boolean | null): import("./types").InjectorService;
353
253
  /**
354
254
  * @module angular
355
255
  * @function reloadWithDebugInfo
@@ -366,28 +266,8 @@ export class Angular {
366
266
  * Configuration option for AngularTS bootstrap process.
367
267
  */
368
268
  export type AngularBootstrapConfig = {
369
- /**
370
- * - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
371
- */
372
- debugInfoEnabled: boolean;
373
269
  /**
374
270
  * - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
375
271
  */
376
272
  strictDi?: boolean;
377
273
  };
378
- import { bind } from "./shared/utils";
379
- import { equals } from "./shared/utils";
380
- import { extend } from "./shared/utils";
381
- import { forEach } from "./shared/utils";
382
- import { fromJson } from "./shared/utils";
383
- import { toJson } from "./shared/utils";
384
- import { identity } from "./shared/utils";
385
- import { isDate } from "./shared/utils";
386
- import { isDefined } from "./shared/utils";
387
- import { isElement } from "./shared/utils";
388
- import { isFunction } from "./shared/utils";
389
- import { isNumber } from "./shared/utils";
390
- import { isObject } from "./shared/utils";
391
- import { isString } from "./shared/utils";
392
- import { isUndefined } from "./shared/utils";
393
- import { merge } from "./shared/utils";
@@ -75,7 +75,7 @@ export class StateProvider {
75
75
  * let result = {},
76
76
  * views = parent(state);
77
77
  *
78
- * angular.forEach(views, function (config, name) {
78
+ * forEach(views, function (config, name) {
79
79
  * let autoName = (state.name + '.' + name).replace('.', '/');
80
80
  * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
81
81
  * result[name] = config;
@@ -2,19 +2,19 @@
2
2
  * JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
3
3
  * and execution of chain functions.
4
4
  *
5
- * @param {string|Element|Comment|Document|Window|JQLite|ArrayLike<Element>|(() => void)} element
5
+ * @param {string|Node|JQLite|ArrayLike<Element>|(() => void)} element
6
6
  * @returns {JQLite}
7
7
  */
8
- export function JQLite(element: string | Element | Comment | Document | Window | JQLite | ArrayLike<Element> | (() => void)): JQLite;
8
+ export function JQLite(element: string | Node | JQLite | ArrayLike<Element> | (() => void)): JQLite;
9
9
  export class JQLite {
10
10
  /**
11
11
  * JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
12
12
  * and execution of chain functions.
13
13
  *
14
- * @param {string|Element|Comment|Document|Window|JQLite|ArrayLike<Element>|(() => void)} element
14
+ * @param {string|Node|JQLite|ArrayLike<Element>|(() => void)} element
15
15
  * @returns {JQLite}
16
16
  */
17
- constructor(element: string | Element | Comment | Document | Window | JQLite | ArrayLike<Element> | (() => void));
17
+ constructor(element: string | Node | JQLite | ArrayLike<Element> | (() => void));
18
18
  /**
19
19
  * Remove all child nodes of the set of matched elements from the DOM and clears CACHE data, associated with the node.
20
20
  * @returns {JQLite} The current instance of JQLite.
@@ -101,7 +101,7 @@ export class JQLite {
101
101
  * @returns {JQLite|any} - The retrieved data if acting as a getter. Otherwise, returns undefined.
102
102
  */
103
103
  data(key: string | any, value?: any): JQLite | any;
104
- replaceWith(arg1: any): void | JQLite;
104
+ replaceWith(arg1: any): this;
105
105
  children(): JQLite;
106
106
  /**
107
107
  * @param {string} node
@@ -182,7 +182,7 @@ export function snakeCase(name: any, separator: any): any;
182
182
  ```js
183
183
  let values = {name: 'misko', gender: 'male'};
184
184
  let log = [];
185
- angular.forEach(values, function(value, key) {
185
+ forEach(values, function(value, key) {
186
186
  this.push(key + ': ' + value);
187
187
  }, log);
188
188
  expect(log).toEqual(['name: misko', 'gender: male']);
@@ -266,12 +266,6 @@ export function isNumberNaN(num: any): boolean;
266
266
  * @returns {Object}
267
267
  */
268
268
  export function inherit(parent: any, extra: any): any;
269
- /**
270
- *
271
- * @param {*} value to be returned.
272
- * @returns {*} the value passed in.
273
- */
274
- export function identity(value: any): any;
275
269
  /**
276
270
  * @param {*} value
277
271
  * @returns {() => *}
@@ -496,6 +490,11 @@ export function shallowCopy(src: any, dst: any): any;
496
490
  */
497
491
  export function assertArg(arg: any, name: any, reason: any): any;
498
492
  export function assertArgFn(arg: any, name: any, acceptArrayAnnotation: any): any;
493
+ /**
494
+ * @param {ErrorHandlingConfig} [config]
495
+ * @returns {ErrorHandlingConfig}
496
+ */
497
+ export function errorHandlingConfig(config?: ErrorHandlingConfig): ErrorHandlingConfig;
499
498
  /**
500
499
  * This object provides a utility for producing rich Error messages within
501
500
  * AngularJS. It can be called as follows:
@@ -549,4 +548,18 @@ export function directiveNormalize(name: any): any;
549
548
  */
550
549
  export function hasAnimate(node: Node): boolean;
551
550
  export const ngAttrPrefixes: string[];
552
- export const minErrConfig: {};
551
+ /**
552
+ * Error configuration object. May only contain the options that need to be updated.
553
+ */
554
+ export type ErrorHandlingConfig = {
555
+ /**
556
+ * - The max depth for stringifying objects. Setting to a
557
+ * non-positive or non-numeric value removes the max depth limit. Default: 5.
558
+ */
559
+ objectMaxDepth?: number | undefined;
560
+ /**
561
+ * - Specifies whether the generated error URL will
562
+ * contain the parameters of the thrown error. Default: true. When used without argument, it returns the current value.
563
+ */
564
+ urlErrorParamsEnabled?: boolean | undefined;
565
+ };
package/types/types.d.ts CHANGED
@@ -429,15 +429,15 @@ export type InjectorService = {
429
429
  /**
430
430
  * - Add and load new modules to the injector.
431
431
  */
432
- loadNewModules: (arg0: Array<Module | string | Injectable<(...args: any[]) => void>>) => void;
432
+ loadNewModules?: (arg0: Array<Module | string | Injectable<(...args: any[]) => void>>) => void;
433
433
  /**
434
434
  * - A map of all the modules loaded into the injector.
435
435
  */
436
- modules: {
436
+ modules?: {
437
437
  [x: string]: Module;
438
438
  };
439
439
  /**
440
440
  * - Indicates if strict dependency injection is enforced.
441
441
  */
442
- strictDi: boolean;
442
+ strictDi?: boolean;
443
443
  };