Skip to content

Commit

Permalink
Merge pull request #407 from bahung1221/master
Browse files Browse the repository at this point in the history
Add TypeScript types for SortAnimation and update correct CDN link README
  • Loading branch information
tsov authored Jul 14, 2020
2 parents 9af30e7 + aeb0a87 commit 6bcc42e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ declare module '@shopify/draggable' {
mirror?: MirrorOptions;
scrollable?: ScrollableOptions;
swapAnimation?: SwapAnimationOptions;
sortAnimation?: SortAnimationOptions;
}

export class Draggable<EventListType = DraggableEventNames> {
Expand Down Expand Up @@ -510,9 +511,23 @@ declare module '@shopify/draggable' {
protected detach(): void;
}

/**
* SortAnimation
*/
export interface SortAnimationOptions {
duration?: number;
easingFunction?: string;
}

class SortAnimation extends AbstractPlugin {
protected attach(): void;
protected detach(): void;
}

export const Plugins: {
Collidable: typeof Collidable,
SwapAnimation: typeof SwapAnimation,
SortAnimation: typeof SortAnimation,
ResizeMirror: typeof ResizeMirror,
Snappable: typeof Snappable,
};
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/SortAnimation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import SortAnimation from '@shopify/draggable/lib/plugins/sort-animation';
```

```html
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.8/lib/plugins.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.10/lib/plugins.js"></script>
```

```html
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.8/lib/plugins/sort-animation.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.10/lib/plugins/sort-animation.js"></script>
```

### API
Expand Down

0 comments on commit 6bcc42e

Please sign in to comment.