Skip to content

Commit eaef778

Browse files
committed
fix(types): '@types/dragula' was a devDependency, not present in published version, closes #876
1 parent 291036d commit eaef778

File tree

3 files changed

+13
-28
lines changed

3 files changed

+13
-28
lines changed

modules/ng2-dragula/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"watch": "chokidar 'src/**/*.ts' 'src/**/*.html' 'src/**/*.scss' -c 'yarn build'"
3737
},
3838
"dependencies": {
39-
"dragula": "^3.7.2"
39+
"dragula": "^3.7.2",
40+
"@types/dragula": "^2.1.33"
4041
},
4142
"peerDependencies": {
4243
"@angular/core": ">=6.0.0",
@@ -50,7 +51,6 @@
5051
"@angular/core": "^6.0.4",
5152
"@angular/language-service": "^6.0.4",
5253
"@compodoc/compodoc": "^1.1.3",
53-
"@types/dragula": "2.1.29",
5454
"@types/jasmine": "~2.8.6",
5555
"@types/jasminewd2": "~2.0.3",
5656
"@types/node": "~10.5.0",
+8-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
1-
// import { DragulaOptions as OriginalOptions } from 'dragula';
1+
import { DragulaOptions as OriginalOptions } from 'dragula';
22

3-
// the copy prop in @types/dragula are just booleans, which is severely limiting.
4-
// and it doesn't have copySortSource.
5-
// TODO: PR this against @types/dragula
6-
export interface DragulaOptions<T = any> {
3+
/* Use this instead of the DragulaOptions from '@types/dragula'. */
4+
export interface DragulaOptions<T = any> extends OriginalOptions {
75

8-
// note: it's possible you could wrap DragulaOptions such that
9-
// the important functions would get model data included.
10-
// that wouldn't be a breaking change if you appended the args to the callbacks.
11-
12-
/* from @types/dragula */
13-
containers?: Element[];
14-
isContainer?: (el?: Element) => boolean;
15-
moves?: (el?: Element, container?: Element, handle?: Element) => boolean;
16-
accepts?: (el?: Element, target?: Element, source?: Element, sibling?: Element) => boolean;
17-
invalid?: (el?: Element, target?: Element) => boolean;
18-
direction?: string;
19-
revertOnSpill?: boolean;
20-
removeOnSpill?: boolean;
21-
delay?: boolean | number;
22-
mirrorContainer?: Element;
23-
24-
/* modifications */
25-
copy?: boolean | ((el: Element, source: Element) => boolean);
266
copySortSource?: boolean | ((el: Element, source: Element) => boolean);
277

8+
/** You must provide this if you are using `copy` with `[dragulaModel]`. It
9+
* is responsible for cloning a model item. Your implementation should
10+
* ensure `x !== copyItem(x)` -- so you must create a *new* object.
11+
**/
2812
copyItem?: (item: T) => T;
13+
2914
}

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@
266266
semver "^5.3.0"
267267
semver-intersect "^1.1.2"
268268

269-
"@types/[email protected].29":
270-
version "2.1.29"
271-
resolved "https://registry.yarnpkg.com/@types/dragula/-/dragula-2.1.29.tgz#77d688c03b77c654f9754474165fe7d17bb4373b"
269+
"@types/dragula@^2.1.33":
270+
version "2.1.33"
271+
resolved "https://registry.yarnpkg.com/@types/dragula/-/dragula-2.1.33.tgz#63a694bd8a5fb7bfa570778a12a069be98462919"
272272

273273
274274
version "0.0.39"

0 commit comments

Comments
 (0)