mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
SortableJS: fix GroupOptions.pull and GroupOptions.put types (#43363)
* fix GroupOptions.pull and GroupOptions.put types * add params to tests Co-authored-by: Daniel Greuel <daniel.greuel@msidata.com>
This commit is contained in:
parent
9bc40339dd
commit
8c6769fb4a
4
types/sortablejs/index.d.ts
vendored
4
types/sortablejs/index.d.ts
vendored
@ -182,11 +182,11 @@ declare namespace Sortable {
|
||||
/**
|
||||
* ability to move from the list. clone — copy the item, rather than move.
|
||||
*/
|
||||
pull?: PullResult | ((to: Sortable, from: Sortable) => PullResult);
|
||||
pull?: PullResult | ((to: Sortable, from: Sortable, dragEl: HTMLElement, event: SortableEvent) => PullResult);
|
||||
/**
|
||||
* whether elements can be added from other lists, or an array of group names from which elements can be taken.
|
||||
*/
|
||||
put?: PutResult | ((to: Sortable) => PullResult);
|
||||
put?: PutResult | ((to: Sortable, from: Sortable, dragEl: HTMLElement, event: SortableEvent) => PutResult);
|
||||
/**
|
||||
* a canonical version of pull, created by Sortable
|
||||
*/
|
||||
|
||||
@ -325,7 +325,7 @@ Sortable.create(simpleList, {
|
||||
group: {
|
||||
name: 'bar',
|
||||
put: ['qux'],
|
||||
pull: function (to, from) {
|
||||
pull: function (to, from, dragEl, event) {
|
||||
return from.el.children.length > 2 || 'clone';
|
||||
}
|
||||
},
|
||||
@ -335,7 +335,7 @@ Sortable.create(simpleList, {
|
||||
Sortable.create(simpleList, {
|
||||
group: {
|
||||
name: 'qux',
|
||||
put: function (to) {
|
||||
put: function (to, from, dragEl, event) {
|
||||
return to.el.children.length < 4;
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user