Skip to content

Commit

Permalink
feat(animation): Add API declaration to the package
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Mar 30, 2016
1 parent 56c35d8 commit 5cb2690
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
68 changes: 68 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<a name="Slide"></a>

## Slide ⇐ <code>Animation</code>
Animation that animates sliding of the shapes.

**Kind**: global class
**Extends:** <code>Animation</code>
**Since**: 1.0.0

* [Slide](#Slide) ⇐ <code>Animation</code>
* [new Slide([options])](#new_Slide_new)
* [.getDirection()](#Slide+getDirection) ⇒ <code>String</code>
* [.setDirection(direction)](#Slide+setDirection) ⇒ <code>[Slide](#Slide)</code>
* [.animate(shape)](#Slide+animate) ⇒ <code>Promise</code>
* [.toObject()](#Slide+toObject) ⇒ <code>Object</code>

<a name="new_Slide_new"></a>

### new Slide([options])
Create Slide animation instance.


| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Options object |
| [options.direction] | <code>String</code> | Direction of the animation |

**Example**
```js
Slide.create({
direction: 'inLeft'
}).animate(someShapeInstance);
```
<a name="Slide+getDirection"></a>

### slide.getDirection() ⇒ <code>String</code>
Get direction of the animation.

**Kind**: instance method of <code>[Slide](#Slide)</code>
<a name="Slide+setDirection"></a>

### slide.setDirection(direction) ⇒ <code>[Slide](#Slide)</code>
Set new direction of the animation.

**Kind**: instance method of <code>[Slide](#Slide)</code>

| Param | Type |
| --- | --- |
| direction | <code>String</code> |

<a name="Slide+animate"></a>

### slide.animate(shape) ⇒ <code>Promise</code>
Main method that calls when shape need to be animated.

**Kind**: instance method of <code>[Slide](#Slide)</code>
**Fulfil**: <code>Shape</code> When animation is done, fulfils with the Shape instance

| Param | Type |
| --- | --- |
| shape | <code>Shape</code> |

<a name="Slide+toObject"></a>

### slide.toObject() ⇒ <code>Object</code>
Serializes animation to Object representation.

**Kind**: instance method of <code>[Slide](#Slide)</code>
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"clean": "rm -rf ./lib",
"compile": "npm run clean; babel src --out-dir lib",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"docs": "npm run compile; jsdoc2md \"lib/**/*.js\" > API.md",
"prepublish": "npm run compile",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"test": "babel-node ./node_modules/.bin/isparta cover _mocha"
Expand All @@ -32,6 +33,7 @@
"coveralls": "2.11.9",
"cz-conventional-changelog": "1.1.5",
"isparta": "4.0.0",
"jsdoc-to-markdown": "1.3.3",
"kittik-cursor": "4.1.0",
"kittik-shape-rectangle": "2.1.0",
"mocha": "2.4.5",
Expand Down

0 comments on commit 5cb2690

Please sign in to comment.