<commit_before># NativeScript Effects

A NativeScript plugin that adds commonly used animation effects to views. This includes the nativescript-animation-spring as one of the effects so no need to get that plugin if you get this one.

## Installation

```
$ tns plugin add nativescript-effects
```

This command automatically installs the necessary files, as well as stores nativescript-effects as a dependency in your project's `package.json` file.


## Usage

To use the animation effects plugin you must first `require()` its module. After you `require()` the module you have access to its APIs.

``` js
var tnsfx = require('nativescript-effects');
```

Then get a reference to the view you want to animate and call one of the functions listed below. This view can be any child of the NativeScript View class such as Button, Label, etc.

```js
var myLabel = page.getViewById('lblMessage');
myLabel.fadeIn()
       .then(function(){
           myLabel.fadeOut(10000);
       });

```

## API

All extensions listed below return a Promise that will call it's ```then``` function once finished successfully.

----
## .fadeIn([duration])
Description: *Display the view by fading it to opaque.*

**duration** (default: 400)
Type: Number or String <br/>
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.

----
## .fadeOut([duration])
Description: *Hide the view by fading it to transparent.*

**duration** (default: 400)
Type: Number or String <br/>
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.


----<commit_msg>Updated the README with tip for TypeScript definitions<commit_after># NativeScript Effects

A NativeScript plugin that adds commonly used animation effects to views. This includes the nativescript-animation-spring as one of the effects so no need to get that plugin if you get this one.

## Installation

```
$ tns plugin add nativescript-effects
```

This command automatically installs the necessary files, as well as stores nativescript-effects as a dependency in your project's `package.json` file.


## Usage

To use the animation effects plugin you must first `require()` its module. After you `require()` the module you have access to its APIs.

``` js
var tnsfx = require('nativescript-effects');
```

Then get a reference to the view you want to animate and call one of the functions listed below. This view can be any child of the NativeScript View class such as Button, Label, etc.

```js
var myLabel = page.getViewById('lblMessage');
myLabel.fadeIn()
       .then(function(){
           myLabel.fadeOut(10000);
       });

```
### TypeScript
To avoid type checking errors, you must additionally configure TypeScript to recognize the method extensions to `View`. Simply add the following line to `references.d.ts` in the root of your project:
```typescript
/// <reference path="./node_modules/nativescript-effects/tns-effects.d.ts" />
```

## API

All extensions listed below return a Promise that will call it's ```then``` function once finished successfully.

----
## .fadeIn([duration])
Description: *Display the view by fading it to opaque.*

**duration** (default: 400)
Type: Number or String <br/>
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.

----
## .fadeOut([duration])
Description: *Hide the view by fading it to transparent.*

**duration** (default: 400)
Type: Number or String <br/>
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.


----
{'fraction_non_alphanumeric': 0.096661281637049, 'fraction_numerical': 0.0059235325794291865, 'mean_word_length': 4.166898470097357, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6375767', 'n_tokens_mistral': 1030, 'n_tokens_neox': 941, 'n_words': 495}