-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.d.ts
50 lines (46 loc) · 1.81 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* Represents a type that can be null or undefined.
*/
type Maybe = null | undefined
declare module 'rgbaster' {
/**
* Analyzes the colors in an image.
* @param imageSrc - The source of the image to analyze.
* @param options - Optional settings for the analysis.
* @returns A promise that resolves to the analysis result.
*/
export default function analyze(
imageSrc: string,
options?: { scale?: number; ignore?: string[] }
): Promise<any>
}
declare module 'colorthief' {
/**
* Class for extracting colors from an image.
*/
export default class ColorThief {
/**
* Gets the dominant color from an image.
* @param sourceImage - The source image. Can be an HTMLImageElement or a string (path to the image when run in Node).
* @param quality - Optional. Determines how many pixels are skipped before the next one is sampled. Defaults to 10.
* @returns A promise that resolves to an array of three integers representing red, green, and blue values.
*/
getColor(
sourceImage: HTMLImageElement | string,
quality?: number
): Promise<[number, number, number]>
/**
* Gets a color palette from an image.
* @param sourceImage - The source image. Can be an HTMLImageElement or a string (path to the image when run in Node).
* @param colorCount - Optional. Determines the size of the returned palette. Defaults to 10.
* @param quality - Optional. Determines how many pixels are skipped before the next one is sampled. Defaults to 10.
* @returns A promise that resolves to an array of colors, each color itself an array of three integers.
*/
getPalette(
sourceImage: HTMLImageElement | string,
colorCount?: number,
quality?: number
): Promise<Array<[number, number, number]>>
}
}
declare module 'sanitize-html'