Skip to content

Commit 0299739

Browse files
author
Corbin Crutchley
authored
Added missing plugins to the types (#863)
1 parent dbd094f commit 0299739

File tree

3 files changed

+63
-45
lines changed

3 files changed

+63
-45
lines changed

packages/jimp/types/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jimpInst.func();
1818
// Main Jimp export should already have all of these already applied
1919
Jimp.read('Test');
2020
Jimp.displace(Jimp, 2);
21+
Jimp.shadow((err, val, coords) => {});
2122
Jimp.resize(40, 40);
2223
// $ExpectType 0
2324
Jimp.PNG_FILTER_NONE;

packages/jimp/types/ts3.1/test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jimpInst.func();
1818
// Main Jimp export should already have all of these already applied
1919
Jimp.read('Test');
2020
Jimp.displace(Jimp, 2);
21+
Jimp.shadow((err, val, coords) => {});
22+
Jimp.fishEye({r: 12});
23+
Jimp.circle({radius: 12, x: 12, y: 12});
24+
2125
Jimp.resize(40, 40);
2226
// $ExpectType 0
2327
Jimp.PNG_FILTER_NONE;

packages/plugins/index.d.ts

Lines changed: 58 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,46 @@
1-
import dither from '@jimp/plugin-dither';
2-
import resize from '@jimp/plugin-resize';
31
import blit from '@jimp/plugin-blit';
4-
import rotate from '@jimp/plugin-rotate';
5-
import color from '@jimp/plugin-color';
6-
import print from '@jimp/plugin-print';
72
import blur from '@jimp/plugin-blur';
3+
import circle from '@jimp/plugin-circle';
4+
import color from '@jimp/plugin-color';
5+
import contain from '@jimp/plugin-contain';
6+
import cover from '@jimp/plugin-cover';
87
import crop from '@jimp/plugin-crop';
9-
import normalize from '@jimp/plugin-normalize';
10-
import invert from '@jimp/plugin-invert';
11-
import gaussian from '@jimp/plugin-gaussian';
8+
import displace from '@jimp/plugin-displace';
9+
import dither from '@jimp/plugin-dither';
10+
import fisheye from '@jimp/plugin-fisheye';
1211
import flip from '@jimp/plugin-flip';
12+
import gaussian from '@jimp/plugin-gaussian';
13+
import invert from '@jimp/plugin-invert';
1314
import mask from '@jimp/plugin-mask';
15+
import normalize from '@jimp/plugin-normalize';
16+
import print from '@jimp/plugin-print';
17+
import resize from '@jimp/plugin-resize';
18+
import rotate from '@jimp/plugin-rotate';
1419
import scale from '@jimp/plugin-scale';
15-
import displace from '@jimp/plugin-displace';
16-
import contain from '@jimp/plugin-contain';
17-
import cover from '@jimp/plugin-cover';
20+
import shadow from '@jimp/plugin-shadow';
21+
import threshold from '@jimp/plugin-threshold';
1822

19-
type DitherRet = ReturnType<typeof dither>
20-
type ResizeRet = ReturnType<typeof resize>
21-
type BlitRet = ReturnType<typeof blit>
22-
type RotateRet = ReturnType<typeof rotate>
23-
type ColorRet = ReturnType<typeof color>
24-
type PrintRet = ReturnType<typeof print>
25-
type BlurRet = ReturnType<typeof blur>
26-
type CropRet = ReturnType<typeof crop>
27-
type NormalizeRet = ReturnType<typeof normalize>
28-
type InvertRet = ReturnType<typeof invert>
29-
type GaussianRet = ReturnType<typeof gaussian>
30-
type FlipRet = ReturnType<typeof flip>
31-
type MaskRet = ReturnType<typeof mask>
32-
type ScaleRet = ReturnType<typeof scale>
33-
type DisplaceRet = ReturnType<typeof displace>
34-
type ContainRet = ReturnType<typeof contain>
35-
type CoverRet = ReturnType<typeof cover>
23+
type BlitRet = ReturnType<typeof blit>;
24+
type BlurRet = ReturnType<typeof blur>;
25+
type CircleRet = ReturnType<typeof circle>;
26+
type ColorRet = ReturnType<typeof color>;
27+
type ContainRet = ReturnType<typeof contain>;
28+
type CoverRet = ReturnType<typeof cover>;
29+
type CropRet = ReturnType<typeof crop>;
30+
type DisplaceRet = ReturnType<typeof displace>;
31+
type DitherRet = ReturnType<typeof dither>;
32+
type FlipRet = ReturnType<typeof flip>;
33+
type FisheyeRet = ReturnType<typeof fisheye>;
34+
type GaussianRet = ReturnType<typeof gaussian>;
35+
type InvertRet = ReturnType<typeof invert>;
36+
type MaskRet = ReturnType<typeof mask>;
37+
type NormalizeRet = ReturnType<typeof normalize>;
38+
type PrintRet = ReturnType<typeof print>;
39+
type ResizeRet = ReturnType<typeof resize>;
40+
type RotateRet = ReturnType<typeof rotate>;
41+
type ScaleRet = ReturnType<typeof scale>;
42+
type ShadowRet = ReturnType<typeof shadow>;
43+
type ThresholdRet = ReturnType<typeof threshold>;
3644

3745
/**
3846
* This is made union and not intersection to avoid issues with
@@ -42,22 +50,27 @@ type CoverRet = ReturnType<typeof cover>
4250
* In reality, this should be an intersection but our type data isn't
4351
* clever enough to figure out what's a class and what's not/etc
4452
*/
45-
type Plugins = DitherRet |
46-
ResizeRet |
47-
BlitRet |
48-
RotateRet |
49-
ColorRet |
50-
PrintRet |
51-
BlurRet |
52-
CropRet |
53-
NormalizeRet |
54-
InvertRet |
55-
GaussianRet |
56-
FlipRet |
57-
MaskRet |
58-
ScaleRet |
59-
DisplaceRet |
60-
ContainRet |
61-
CoverRet;
53+
type Plugins =
54+
| BlitRet
55+
| BlurRet
56+
| CircleRet
57+
| ColorRet
58+
| ContainRet
59+
| CoverRet
60+
| CropRet
61+
| DisplaceRet
62+
| DitherRet
63+
| FlipRet
64+
| FisheyeRet
65+
| GaussianRet
66+
| InvertRet
67+
| MaskRet
68+
| NormalizeRet
69+
| PrintRet
70+
| ResizeRet
71+
| RotateRet
72+
| ScaleRet
73+
| ShadowRet
74+
| ThresholdRet;
6275

6376
export default function(): Plugins;

0 commit comments

Comments
 (0)