Merge pull request #407 from bahung1221/master

Add TypeScript types for SortAnimation and update correct CDN link README
This commit is contained in:
Max Hoffmann 2020-07-14 10:49:07 -04:00 committed by GitHub
commit 6bcc42e182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

15
index.d.ts vendored
View File

@ -172,6 +172,7 @@ declare module '@shopify/draggable' {
mirror?: MirrorOptions;
scrollable?: ScrollableOptions;
swapAnimation?: SwapAnimationOptions;
sortAnimation?: SortAnimationOptions;
}
export class Draggable<EventListType = DraggableEventNames> {
@ -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,
};

View File

@ -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