-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
71 lines (64 loc) · 1.52 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
type PracticeDate = `${number}-${number}-${number}-${hours}-${minutes}`;
interface PracticeItem {
folder: string;
label: string;
preview?: string;
date: PracticeDate;
}
// webgl util function types
type GetWebGlContext = (canvas: HTMLCanvasElement | null | undefined) => WebGLRenderingContext | null;
type CreateShader = (
gl: WebGLRenderingContext,
type: "VERTEX_SHADER" | "FRAGMENT_SHADER",
source: string
) => WebGLShader;
type CreateProgram = (
gl: WebGLRenderingContext,
vertexShader: WebGLShader,
fragmentShader: WebGLShader
) => WebGLProgram;
type PracticeItems = Array<PracticeItem>;
type WebGLCanvasInit = (context: WebGLRenderingContext) => void;
interface WebGLProgramInitData {
gl: WebGLRenderingContext;
program: WebGLProgram;
attr: { [key: string]: number };
uniform: { [key: string]: WebGLUniformLocation | null };
buffer: {
[key: string]: WebGLBuffer | null;
};
texture?: {
[key: string]: HTMLImageElement;
};
customInputs?: {
[key: string]: any;
};
}
// prettier-ignore
type KernelMatrix3x3 = [
number, number, number,
number, number, number,
number, number, number,
];
type ImageKernelName =
| "normal"
| "gaussianBlur"
| "gaussianBlur2"
| "gaussianBlur3"
| "unsharpen"
| "sharpness"
| "sharpen"
| "edgeDetect"
| "edgeDetect2"
| "edgeDetect3"
| "edgeDetect4"
| "edgeDetect5"
| "edgeDetect6"
| "sobelHorizontal"
| "sobelVertical"
| "previtHorizontal"
| "previtVertical"
| "boxBlur"
| "triangleBlur"
| "emboss";
type ImageKernels = { [key in ImageKernelName]: KernelMatrix3x3 };