-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.d.ts
More file actions
36 lines (25 loc) · 739 Bytes
/
index.d.ts
File metadata and controls
36 lines (25 loc) · 739 Bytes
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
declare const Buffer
type ColorString = string
type ColorArr = number[]
type RGBA = ColorString | ColorArr
declare class NodePnglib {
constructor(
width: number,
height: number,
/** Color depth of the png, default to 8. */
depth?: number,
/** For example: [1, 1, 1, 1], 'blue', 'transparent' or 'rgba(1, 1, 1, 1)', default to [0, 0, 0, 0]. */
backgroundColor?: RGBA
)
index(x: number, y: number): number
color(rgba: RGBA)
setBgColor(rgba: RGBA): number
setPixel(x: number, y: number, rgba: RGBA): void
getBase64(): string
getBuffer(): Buffer
deflate(): Buffer
}
declare namespace NodePnglib {
export type Color = RGBA
}
export = NodePnglib