You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/index.d.ts
+14-20Lines changed: 14 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@
28
28
/// <reference types="node" />
29
29
30
30
importtype{Duplex}from'node:stream';
31
+
import{ColorLike}from'@img/colour';
31
32
32
33
//#region Constructor functions
33
34
@@ -234,7 +235,7 @@ declare namespace sharp {
234
235
* @param tint Parsed by the color module.
235
236
* @returns A sharp instance that can be used to chain operations
236
237
*/
237
-
tint(tint: Colour|Color): Sharp;
238
+
tint(tint: ColorLike): Sharp;
238
239
239
240
/**
240
241
* Convert to 8-bit greyscale; 256 shades of grey.
@@ -1014,7 +1015,7 @@ declare namespace sharp {
1014
1015
/** @deprecated Use {@link SharpOptions.tiff} instead */
1015
1016
subifd?: number|undefined;
1016
1017
/** @deprecated Use {@link SharpOptions.pdf} instead */
1017
-
pdfBackground?: Colour|Color|undefined;
1018
+
pdfBackground?: ColorLike|undefined;
1018
1019
/** @deprecated Use {@link SharpOptions.openSlide} instead */
1019
1020
level?: number|undefined;
1020
1021
/** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default false) */
@@ -1073,7 +1074,7 @@ declare namespace sharp {
1073
1074
/** Number of bands, 3 for RGB, 4 for RGBA */
1074
1075
channels: CreateChannels;
1075
1076
/** Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. */
1076
-
background: Colour|Color;
1077
+
background: ColorLike;
1077
1078
/** Describes a noise to be created. */
1078
1079
noise?: Noise|undefined;
1079
1080
/** The height of each page/frame for animated images, must be an integral factor of the overall image height. */
@@ -1120,7 +1121,7 @@ declare namespace sharp {
1120
1121
/** Space between images, in pixels. */
1121
1122
shim?: number|undefined;
1122
1123
/** Background colour. */
1123
-
background?: Colour|Color|undefined;
1124
+
background?: ColorLike|undefined;
1124
1125
/** Horizontal alignment. */
1125
1126
halign?: HorizontalAlignment|undefined;
1126
1127
/** Vertical alignment. */
@@ -1141,7 +1142,7 @@ declare namespace sharp {
1141
1142
1142
1143
interfacePdfInputOptions{
1143
1144
/** Background colour to use when PDF is partially transparent. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick. */
1144
-
background?: Colour|Color|undefined;
1145
+
background?: ColorLike|undefined;
1145
1146
}
1146
1147
1147
1148
interfaceOpenSlideInputOptions{
@@ -1510,7 +1511,7 @@ declare namespace sharp {
1510
1511
1511
1512
interfaceRotateOptions{
1512
1513
/** parsed by the color module to extract values for red, green, blue and alpha. (optional, default "#000000") */
1513
-
background?: Colour|Color|undefined;
1514
+
background?: ColorLike|undefined;
1514
1515
}
1515
1516
1516
1517
typePrecision='integer'|'float'|'approximate';
@@ -1526,7 +1527,7 @@ declare namespace sharp {
1526
1527
1527
1528
interfaceFlattenOptions{
1528
1529
/** background colour, parsed by the color module, defaults to black. (optional, default {r:0,g:0,b:0}) */
1529
-
background?: Colour|Color|undefined;
1530
+
background?: ColorLike|undefined;
1530
1531
}
1531
1532
1532
1533
interfaceNegateOptions{
@@ -1551,7 +1552,7 @@ declare namespace sharp {
1551
1552
/** Position, gravity or strategy to use when fit is cover or contain. (optional, default 'centre') */
1552
1553
position?: number|string|undefined;
1553
1554
/** Background colour when using a fit of contain, parsed by the color module, defaults to black without transparency. (optional, default {r:0,g:0,b:0,alpha:1}) */
1554
-
background?: Colour|Color|undefined;
1555
+
background?: ColorLike|undefined;
1555
1556
/** The kernel to use for image reduction. (optional, default 'lanczos3') */
1556
1557
kernel?: keyofKernelEnum|undefined;
1557
1558
/** Do not enlarge if the width or height are already less than the specified dimensions, equivalent to GraphicsMagick's > geometry option. (optional, default false) */
@@ -1594,14 +1595,14 @@ declare namespace sharp {
1594
1595
/** single pixel count to right edge (optional, default 0) */
1595
1596
right?: number|undefined;
1596
1597
/** background colour, parsed by the color module, defaults to black without transparency. (optional, default {r:0,g:0,b:0,alpha:1}) */
1597
-
background?: Colour|Color|undefined;
1598
+
background?: ColorLike|undefined;
1598
1599
/** how the extension is done, one of: "background", "copy", "repeat", "mirror" (optional, default `'background'`) */
1599
1600
extendWith?: ExtendWith|undefined;
1600
1601
}
1601
1602
1602
1603
interfaceTrimOptions{
1603
1604
/** Background colour, parsed by the color module, defaults to that of the top-left pixel. (optional) */
1604
-
background?: Colour|Color|undefined;
1605
+
background?: ColorLike|undefined;
1605
1606
/** Allowed difference from the above colour, a positive number. (optional, default 10) */
1606
1607
threshold?: number|undefined;
1607
1608
/** Does the input more closely resemble line art (e.g. vector) rather than being photographic? (optional, default false) */
@@ -1617,15 +1618,8 @@ declare namespace sharp {
1617
1618
/** 1 for grayscale, 2 for grayscale + alpha, 3 for sRGB, 4 for CMYK or RGBA */
1618
1619
typeChannels=1|2|3|4;
1619
1620
1620
-
interfaceRGBA{
1621
-
r?: number|undefined;
1622
-
g?: number|undefined;
1623
-
b?: number|undefined;
1624
-
alpha?: number|undefined;
1625
-
}
1626
-
1627
-
typeColour=string|RGBA;
1628
-
typeColor=Colour;
1621
+
typeColour=ColorLike;
1622
+
typeColor=ColorLike;
1629
1623
1630
1624
interfaceKernel{
1631
1625
/** width of the kernel in pixels. */
@@ -1691,7 +1685,7 @@ declare namespace sharp {
1691
1685
/** Tile angle of rotation, must be a multiple of 90. (optional, default 0) */
1692
1686
angle?: number|undefined;
1693
1687
/** background colour, parsed by the color module, defaults to white without transparency. (optional, default {r:255,g:255,b:255,alpha:1}) */
1694
-
background?: string|RGBA|undefined;
1688
+
background?: ColorLike|undefined;
1695
1689
/** How deep to make the pyramid, possible values are "onepixel", "onetile" or "one" (default based on layout) */
1696
1690
depth?: string|undefined;
1697
1691
/** Threshold to skip tile generation, a value 0 - 255 for 8-bit images or 0 - 65535 for 16-bit images */
0 commit comments