@angular-wave/angular.ts 0.0.56 → 0.0.58

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.
@@ -1,7 +1,3 @@
1
- export function CoreAnimateJsProvider(): void;
2
- export class CoreAnimateJsProvider {
3
- $get: () => void;
4
- }
5
1
  export function CoreAnimateQueueProvider(): void;
6
2
  export class CoreAnimateQueueProvider {
7
3
  $get: (string | (($$AnimateRunner: any, $rootScope: any) => {
@@ -12,6 +8,7 @@ export class CoreAnimateQueueProvider {
12
8
  push(element: any, event: any, options: any, domOperation: any): any;
13
9
  }))[];
14
10
  }
11
+ export function domInsert(element: any, parentElement: any, afterElement: any): void;
15
12
  export function AnimateProvider($provide: any): void;
16
13
  export class AnimateProvider {
17
14
  constructor($provide: any);
@@ -117,10 +114,7 @@ export class AnimateProvider {
117
114
  $get: (string | (($$animateQueue: any) => {
118
115
  /**
119
116
  *
120
- * @ngdoc method
121
- * @name $animate#on
122
- * @kind function
123
- * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)
117
+ * Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)
124
118
  * has fired on the given element or among any of its children. Once the listener is fired, the provided callback
125
119
  * is fired with the following params:
126
120
  *
@@ -168,11 +162,7 @@ export class AnimateProvider {
168
162
  */
169
163
  on: any;
170
164
  /**
171
- *
172
- * @ngdoc method
173
- * @name $animate#off
174
- * @kind function
175
- * @description Deregisters an event listener based on the event which has been associated with the provided element. This method
165
+ * Deregisters an event listener based on the event which has been associated with the provided element. This method
176
166
  * can be used in three different ways depending on the arguments:
177
167
  *
178
168
  * ```js
@@ -198,17 +188,14 @@ export class AnimateProvider {
198
188
  */
199
189
  off: any;
200
190
  /**
201
- * @ngdoc method
202
- * @name $animate#pin
203
- * @kind function
204
- * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists
205
- * outside of the DOM structure of the AngularJS application. By doing so, any animation triggered via `$animate` can be issued on the
206
- * element despite being outside the realm of the application or within another application. Say for example if the application
207
- * was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated
208
- * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind
209
- * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.
191
+ * Associates the provided element with a host parent element to allow the element to be animated even if it exists
192
+ * outside of the DOM structure of the AngularJS application. By doing so, any animation triggered via `$animate` can be issued on the
193
+ * element despite being outside the realm of the application or within another application. Say for example if the application
194
+ * was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated
195
+ * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind
196
+ * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.
210
197
  *
211
- * Note that this feature is only active when the `ngAnimate` module is used.
198
+ * Note that this feature is only active when the `ngAnimate` module is used.
212
199
  *
213
200
  * @param {Element} element the external element that will be pinned
214
201
  * @param {Element} parentElement the host parent element that will be associated with the external element
@@ -245,14 +232,11 @@ export class AnimateProvider {
245
232
  */
246
233
  enabled: any;
247
234
  /**
248
- * @ngdoc method
249
- * @name $animate#cancel
250
- * @kind function
251
- * @description Cancels the provided animation and applies the end state of the animation.
235
+ * Cancels the provided animation and applies the end state of the animation.
252
236
  * Note that this does not cancel the underlying operation, e.g. the setting of classes or
253
237
  * adding the element to the DOM.
254
238
  *
255
- * @param {animationRunner} animationRunner An animation runner returned by an $animate function.
239
+ * @param {import('./animate-runner').AnimateRunner} runner An animation runner returned by an $animate function.
256
240
  *
257
241
  * @example
258
242
  <example module="animationExample" deps="angular-animate.js" animations="true" name="animate-cancel">
@@ -316,157 +300,89 @@ export class AnimateProvider {
316
300
  </file>
317
301
  </example>
318
302
  */
319
- cancel(runner: any): void;
303
+ cancel(runner: import("./animate-runner").AnimateRunner): void;
320
304
  /**
321
- *
322
- * @ngdoc method
323
- * @name $animate#enter
324
- * @kind function
325
- * @description Inserts the element into the DOM either after the `after` element (if provided) or
326
- * as the first child within the `parent` element and then triggers an animation.
327
- * A promise is returned that will be resolved during the next digest once the animation
328
- * has completed.
329
- *
330
- * @param {Element} element the element which will be inserted into the DOM
331
- * @param {Element} parent the parent element which will append the element as
332
- * a child (so long as the after element is not present)
333
- * @param {Element=} after the sibling element after which the element will be appended
334
- * @param {object=} options an optional collection of options/styles that will be applied to the element.
335
- * The object can have the following properties:
336
- *
337
- * - **addClass** - `{string}` - space-separated CSS classes to add to element
338
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
339
- * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
340
- * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
341
- *
342
- * @return {Runner} the animation runner
305
+ * Inserts the element into the DOM either after the `after` element (if provided) or
306
+ * as the first child within the `parent` element and then triggers an animation.
307
+ * A promise is returned that will be resolved during the next digest once the animation
308
+ * has completed.
309
+ *
310
+ * @param {JQLite} element - the element which will be inserted into the DOM
311
+ * @param {JQLite} parent - the parent element which will append the element as a child (so long as the after element is not present)
312
+ * @param {JQLite} after - after the sibling element after which the element will be appended
313
+ * @param {AnimationOptions} [options] - an optional collection of options/styles that will be applied to the element.
314
+ * @returns {import('./animate-runner').AnimateRunner} the animation runner
343
315
  */
344
- enter(element: Element, parent: Element, after?: Element | undefined, options?: object | undefined): Runner;
316
+ enter(element: JQLite, parent: JQLite, after: JQLite, options?: AnimationOptions): import("./animate-runner").AnimateRunner;
345
317
  /**
346
- *
347
- * @ngdoc method
348
- * @name $animate#move
349
- * @kind function
350
- * @description Inserts (moves) the element into its new position in the DOM either after
351
- * the `after` element (if provided) or as the first child within the `parent` element
352
- * and then triggers an animation. A promise is returned that will be resolved
353
- * during the next digest once the animation has completed.
354
- *
355
- * @param {Element} element the element which will be moved into the new DOM position
356
- * @param {Element} parent the parent element which will append the element as
357
- * a child (so long as the after element is not present)
358
- * @param {Element=} after the sibling element after which the element will be appended
359
- * @param {object=} options an optional collection of options/styles that will be applied to the element.
360
- * The object can have the following properties:
361
- *
362
- * - **addClass** - `{string}` - space-separated CSS classes to add to element
363
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
364
- * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
365
- * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
366
- *
367
- * @return {Runner} the animation runner
318
+ * Inserts (moves) the element into its new position in the DOM either after
319
+ * the `after` element (if provided) or as the first child within the `parent` element
320
+ * and then triggers an animation. A promise is returned that will be resolved
321
+ * during the next digest once the animation has completed.
322
+ *
323
+ * @param {JQLite} element - the element which will be inserted into the DOM
324
+ * @param {JQLite} parent - the parent element which will append the element as a child (so long as the after element is not present)
325
+ * @param {JQLite} after - after the sibling element after which the element will be appended
326
+ * @param {AnimationOptions} [options] - an optional collection of options/styles that will be applied to the element.
327
+ * @returns {import('./animate-runner').AnimateRunner} the animation runner
368
328
  */
369
- move(element: Element, parent: Element, after?: Element | undefined, options?: object | undefined): Runner;
329
+ move(element: JQLite, parent: JQLite, after: JQLite, options?: AnimationOptions): import("./animate-runner").AnimateRunner;
370
330
  /**
371
- * @ngdoc method
372
- * @name $animate#leave
373
- * @kind function
374
- * @description Triggers an animation and then removes the element from the DOM.
331
+ * Triggers an animation and then removes the element from the DOM.
375
332
  * When the function is called a promise is returned that will be resolved during the next
376
333
  * digest once the animation has completed.
377
334
  *
378
- * @param {Element} element the element which will be removed from the DOM
379
- * @param {object=} options an optional collection of options/styles that will be applied to the element.
380
- * The object can have the following properties:
381
- *
382
- * - **addClass** - `{string}` - space-separated CSS classes to add to element
383
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
384
- * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
385
- * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
386
- *
387
- * @return {Runner} the animation runner
335
+ * @param {JQLite} element the element which will be removed from the DOM
336
+ * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element.
337
+ * @returns {import('./animate-runner').AnimateRunner} the animation runner
388
338
  */
389
- leave(element: Element, options?: object | undefined): Runner;
339
+ leave(element: JQLite, options?: AnimationOptions): import("./animate-runner").AnimateRunner;
390
340
  /**
391
- * @ngdoc method
392
- * @name $animate#addClass
393
- * @kind function
394
- *
395
- * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
396
- * execution, the addClass operation will only be handled after the next digest and it will not trigger an
397
- * animation if element already contains the CSS class or if the class is removed at a later step.
398
- * Note that class-based animations are treated differently compared to structural animations
399
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
400
- * depending if CSS or JavaScript animations are used.
401
- *
402
- * @param {Element} element the element which the CSS classes will be applied to
341
+ * Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
342
+ * execution, the addClass operation will only be handled after the next digest and it will not trigger an
343
+ * animation if element already contains the CSS class or if the class is removed at a later step.
344
+ * Note that class-based animations are treated differently compared to structural animations
345
+ * (like enter, move and leave) since the CSS classes may be added/removed at different points
346
+ * depending if CSS or JavaScript animations are used.
347
+ *
348
+ * @param {JQLite} element the element which the CSS classes will be applied to
403
349
  * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
404
- * @param {object=} options an optional collection of options/styles that will be applied to the element.
405
- * The object can have the following properties:
406
- *
407
- * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
408
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
409
- * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
410
- *
411
- * @return {Runner} animationRunner the animation runner
350
+ * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element.
351
+ * @return {import('./animate-runner').AnimateRunner}} animationRunner the animation runner
412
352
  */
413
- addClass(element: Element, className: string, options?: object | undefined): Runner;
353
+ addClass(element: JQLite, className: string, options?: AnimationOptions): import("./animate-runner").AnimateRunner;
414
354
  /**
415
- * @ngdoc method
416
- * @name $animate#removeClass
417
- * @kind function
418
- *
419
- * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
420
- * execution, the removeClass operation will only be handled after the next digest and it will not trigger an
421
- * animation if element does not contain the CSS class or if the class is added at a later step.
422
- * Note that class-based animations are treated differently compared to structural animations
423
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
424
- * depending if CSS or JavaScript animations are used.
425
- *
426
- * @param {Element} element the element which the CSS classes will be applied to
355
+ * Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
356
+ * execution, the removeClass operation will only be handled after the next digest and it will not trigger an
357
+ * animation if element does not contain the CSS class or if the class is added at a later step.
358
+ * Note that class-based animations are treated differently compared to structural animations
359
+ * (like enter, move and leave) since the CSS classes may be added/removed at different points
360
+ * depending if CSS or JavaScript animations are used.
361
+ *
362
+ * @param {JQLite} element the element which the CSS classes will be applied to
427
363
  * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
428
- * @param {object=} options an optional collection of options/styles that will be applied to the element.
429
- * The object can have the following properties:
430
- *
431
- * - **addClass** - `{string}` - space-separated CSS classes to add to element
432
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
433
- * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
434
- *
435
- * @return {Runner} the animation runner
364
+ * @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element. *
365
+ * @return {import('./animate-runner').AnimateRunner} animationRunner the animation runner
436
366
  */
437
- removeClass(element: Element, className: string, options?: object | undefined): Runner;
367
+ removeClass(element: JQLite, className: string, options?: AnimationOptions): import("./animate-runner").AnimateRunner;
438
368
  /**
439
- * @ngdoc method
440
- * @name $animate#setClass
441
- * @kind function
442
- *
443
- * @description Performs both the addition and removal of a CSS classes on an element and (during the process)
444
- * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
445
- * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has
446
- * passed. Note that class-based animations are treated differently compared to structural animations
447
- * (like enter, move and leave) since the CSS classes may be added/removed at different points
448
- * depending if CSS or JavaScript animations are used.
369
+ * Performs both the addition and removal of a CSS classes on an element and (during the process)
370
+ * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
371
+ * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has
372
+ * passed. Note that class-based animations are treated differently compared to structural animations
373
+ * (like enter, move and leave) since the CSS classes may be added/removed at different points
374
+ * depending if CSS or JavaScript animations are used.
449
375
  *
450
376
  * @param {Element} element the element which the CSS classes will be applied to
451
377
  * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)
452
378
  * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
453
379
  * @param {object=} options an optional collection of options/styles that will be applied to the element.
454
- * The object can have the following properties:
455
- *
456
- * - **addClass** - `{string}` - space-separated CSS classes to add to element
457
- * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
458
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
459
- * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
460
380
  *
461
- * @return {Runner} the animation runner
381
+ * @return {import('./animate-runner').AnimateRunner} the animation runner
462
382
  */
463
- setClass(element: Element, add: string, remove: string, options?: object | undefined): Runner;
383
+ setClass(element: Element, add: string, remove: string, options?: object | undefined): import("./animate-runner").AnimateRunner;
464
384
  /**
465
- * @ngdoc method
466
- * @name $animate#animate
467
- * @kind function
468
- *
469
- * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
385
+ * Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
470
386
  * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take
471
387
  * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and
472
388
  * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding
@@ -484,26 +400,31 @@ export class AnimateProvider {
484
400
  * }
485
401
  * });
486
402
  * ```
487
- *
488
- * @param {Element} element the element which the CSS styles will be applied to
489
- * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.
490
- * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.
491
- * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If
492
- * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.
493
- * (Note that if no animation is detected then this value will not be applied to the element.)
494
- * @param {object=} options an optional collection of options/styles that will be applied to the element.
495
- * The object can have the following properties:
496
- *
497
- * - **addClass** - `{string}` - space-separated CSS classes to add to element
498
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
499
- * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
500
- * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
501
- *
502
- * @return {Runner} the animation runner
403
+ * @return {import('./animate-runner').AnimateRunner} the animation runner
503
404
  */
504
- animate(element: Element, from: object, to: object, className?: string | undefined, options?: object | undefined): Runner;
405
+ animate(element: any, from: any, to: any, className: any, options: any): import("./animate-runner").AnimateRunner;
505
406
  }))[];
506
407
  }
507
408
  export namespace AnimateProvider {
508
409
  let $inject: string[];
509
410
  }
411
+ export type AnimationMethod = "enter" | "leave" | "move" | "addClass" | "setClass" | "removeClass";
412
+ export type AnimationOptions = {
413
+ /**
414
+ * - space-separated CSS classes to add to element
415
+ */
416
+ addClass: string;
417
+ /**
418
+ * - CSS properties & values at the beginning of animation. Must have matching `to`
419
+ */
420
+ from: any;
421
+ /**
422
+ * - space-separated CSS classes to remove from element
423
+ */
424
+ removeClass: string;
425
+ /**
426
+ * - CSS properties & values at end of animation. Must have matching `from`
427
+ */
428
+ to: string;
429
+ };
430
+ import { JQLite } from "../../shared/jqlite/jqlite";
@@ -1,8 +1,10 @@
1
- export const ngIfDirective: (string | (($animate: any) => {
2
- multiElement: boolean;
3
- transclude: string;
4
- priority: number;
5
- terminal: boolean;
6
- restrict: string;
7
- link($scope: any, $element: any, $attr: any, ctrl: any, $transclude: any): void;
8
- }))[];
1
+ /**
2
+ *
3
+ * TODO // Add type for animate service
4
+ * @param {*} $animate
5
+ * @returns {import("../../types").Directive}
6
+ */
7
+ export function ngIfDirective($animate: any): import("../../types").Directive;
8
+ export namespace ngIfDirective {
9
+ let $inject: string[];
10
+ }
@@ -193,10 +193,10 @@ export function removeElement(element: Element, keepData?: boolean): void;
193
193
  export function startingTag(elementStr: string): string;
194
194
  /**
195
195
  * Return the DOM siblings between the first and last node in the given array.
196
- * @param {Array} nodes An array-like object
196
+ * @param {JQLite|Array} nodes An array-like object
197
197
  * @returns {JQLite} the inputted object or a JQLite collection containing the nodes
198
198
  */
199
- export function getBlockNodes(nodes: any[]): JQLite;
199
+ export function getBlockNodes(nodes: JQLite | any[]): JQLite;
200
200
  export function getBooleanAttrName(element: any, name: any): any;
201
201
  /**
202
202
  * Takes an array of elements, calls any `$destroy` event handlers, removes any data in cache, and finally removes any
@@ -542,5 +542,11 @@ export function mergeClasses(a: any, b: any): any;
542
542
  * @param name Name to normalize
543
543
  */
544
544
  export function directiveNormalize(name: any): any;
545
+ /**
546
+ * Whether element should be animated
547
+ * @param {Node} node
548
+ * @returns {boolean}
549
+ */
550
+ export function hasAnimate(node: Node): boolean;
545
551
  export const ngAttrPrefixes: string[];
546
552
  export const minErrConfig: {};