-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgifenc.d.ts
More file actions
53 lines (47 loc) · 1.26 KB
/
gifenc.d.ts
File metadata and controls
53 lines (47 loc) · 1.26 KB
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
51
52
53
declare module "gifenc" {
export type GifPaletteColor =
| [number, number, number]
| [number, number, number, number];
export type GifPalette = GifPaletteColor[];
export interface GIFEncoderOptions {
auto?: boolean;
initialCapacity?: number;
}
export interface GIFFrameOptions {
delay?: number;
dispose?: number;
first?: boolean;
palette?: GifPalette;
repeat?: number;
transparent?: boolean;
transparentIndex?: number;
}
export interface QuantizeOptions {
clearAlpha?: boolean;
clearAlphaColor?: number;
clearAlphaThreshold?: number;
format?: "rgb565" | "rgb444" | "rgba4444";
oneBitAlpha?: boolean | number;
}
export interface GIFEncoderResult {
bytes(): Uint8Array;
finish(): void;
writeFrame(
index: Uint8Array,
width: number,
height: number,
opts?: GIFFrameOptions,
): void;
}
export function GIFEncoder(options?: GIFEncoderOptions): GIFEncoderResult;
export function applyPalette(
rgba: Uint8Array | Uint8ClampedArray,
palette: GifPalette,
format?: "rgb565" | "rgb444" | "rgba4444",
): Uint8Array;
export function quantize(
rgba: Uint8Array | Uint8ClampedArray,
maxColors: number,
options?: QuantizeOptions,
): GifPalette;
}