1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import {
|
11 | Jimp as JimpType,
|
12 | Bitmap,
|
13 | RGB,
|
14 | RGBA,
|
15 | UnionToIntersection,
|
16 | GetPluginVal,
|
17 | GetPluginConst,
|
18 | GetPluginEncoders,
|
19 | GetPluginDecoders,
|
20 | JimpConstructors,
|
21 | } from "@jimp/core";
|
22 | import typeFn from "@jimp/types";
|
23 | import pluginFn from "@jimp/plugins";
|
24 |
|
25 | type Types = ReturnType<typeof typeFn>;
|
26 | type Plugins = ReturnType<typeof pluginFn>;
|
27 |
|
28 | type IntersectedPluginTypes = UnionToIntersection<
|
29 | GetPluginVal<Types> | GetPluginVal<Plugins>
|
30 | >;
|
31 |
|
32 | type IntersectedPluginConsts = UnionToIntersection<
|
33 | GetPluginConst<Types> | GetPluginConst<Plugins>
|
34 | >;
|
35 |
|
36 | type IntersectedPluginEncoders = UnionToIntersection<
|
37 | GetPluginEncoders<Types> | GetPluginEncoders<Plugins>
|
38 | >;
|
39 |
|
40 | type IntersectedPluginDecoders = UnionToIntersection<
|
41 | GetPluginDecoders<Types> | GetPluginDecoders<Plugins>
|
42 | >;
|
43 |
|
44 | type Jimp = JimpType & IntersectedPluginTypes;
|
45 |
|
46 | declare const Jimp: JimpConstructors &
|
47 | IntersectedPluginConsts & {
|
48 | prototype: Jimp;
|
49 | encoders: IntersectedPluginEncoders;
|
50 | decoders: IntersectedPluginDecoders;
|
51 | };
|
52 |
|
53 | export = Jimp;
|