-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): '@types/dragula' was a devDependency, not present in publ…
…ished version, closes #876
- Loading branch information
1 parent
291036d
commit eaef778
Showing
3 changed files
with
13 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,14 @@ | ||
// import { DragulaOptions as OriginalOptions } from 'dragula'; | ||
import { DragulaOptions as OriginalOptions } from 'dragula'; | ||
|
||
// the copy prop in @types/dragula are just booleans, which is severely limiting. | ||
// and it doesn't have copySortSource. | ||
// TODO: PR this against @types/dragula | ||
export interface DragulaOptions<T = any> { | ||
/* Use this instead of the DragulaOptions from '@types/dragula'. */ | ||
export interface DragulaOptions<T = any> extends OriginalOptions { | ||
|
||
// note: it's possible you could wrap DragulaOptions such that | ||
// the important functions would get model data included. | ||
// that wouldn't be a breaking change if you appended the args to the callbacks. | ||
|
||
/* from @types/dragula */ | ||
containers?: Element[]; | ||
isContainer?: (el?: Element) => boolean; | ||
moves?: (el?: Element, container?: Element, handle?: Element) => boolean; | ||
accepts?: (el?: Element, target?: Element, source?: Element, sibling?: Element) => boolean; | ||
invalid?: (el?: Element, target?: Element) => boolean; | ||
direction?: string; | ||
revertOnSpill?: boolean; | ||
removeOnSpill?: boolean; | ||
delay?: boolean | number; | ||
mirrorContainer?: Element; | ||
|
||
/* modifications */ | ||
copy?: boolean | ((el: Element, source: Element) => boolean); | ||
copySortSource?: boolean | ((el: Element, source: Element) => boolean); | ||
|
||
/** You must provide this if you are using `copy` with `[dragulaModel]`. It | ||
* is responsible for cloning a model item. Your implementation should | ||
* ensure `x !== copyItem(x)` -- so you must create a *new* object. | ||
**/ | ||
copyItem?: (item: T) => T; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters