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