forked from mikeseven/node-webgl
-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathindex.d.ts
44 lines (36 loc) · 1.43 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
declare namespace createContext {
interface STACKGL_destroy_context {
destroy(): void;
}
interface STACKGL_resize_drawingbuffer {
resize(width: GLint, height: GLint): void;
}
interface StackGLExtension {
getExtension(extensionName: "STACKGL_destroy_context"): STACKGL_destroy_context | null;
getExtension(extensionName: "STACKGL_resize_drawingbuffer"): STACKGL_resize_drawingbuffer | null;
}
const WebGLRenderingContext: WebGLRenderingContext & StackGLExtension & {
new(): WebGLRenderingContext & StackGLExtension;
prototype: WebGLRenderingContext & StackGLExtension;
};
const WebGL2RenderingContext: WebGL2RenderingContext & StackGLExtension & {
new(): WebGL2RenderingContext & StackGLExtension;
prototype: WebGL2RenderingContext & StackGLExtension;
};
}
declare function createContext(
width: number,
height: number,
options?: WebGLContextAttributes & { createWebGL2Context?: false },
): WebGLRenderingContext & createContext.StackGLExtension;
declare function createContext(
width: number,
height: number,
options: WebGLContextAttributes & { createWebGL2Context: true }
): WebGL2RenderingContext & createContext.StackGLExtension;
declare function createContext(
width: number,
height: number,
options?: WebGLContextAttributes & { createWebGL2Context?: boolean }
): (WebGLRenderingContext | WebGL2RenderingContext) & createContext.StackGLExtension;
export = createContext;