add missing optional attributes parameter for getContext() and missing context attribute defs, thanks to @ander-nz

This commit is contained in:
Arthur Langereis
2015-10-06 14:50:10 +02:00
parent 8948c08197
commit b3d5f7e64a
+11 -1
View File
@@ -6,9 +6,19 @@
// These definitions go beyond those already defined in TS 1.6.2 stdlib
// All non-draft WebGL 1.0 extensions and prefixed extension names are
// covered.
// Some missing parameters for getContext and fields for
// WebGLContextAttributes are added as well, copied over from
// Shane Anderson's webgl interfaces.
interface WebGLContextAttributes {
preferLowPowerToHighPerformance?: boolean;
failIfMajorPerformanceCaveat?: boolean;
}
interface HTMLCanvasElement {
getContext(contextId: "webgl"): WebGLRenderingContext;
getContext(contextId: "experimental-webgl", attributes?: WebGLContextAttributes): WebGLRenderingContext;
getContext(contextId: "webgl", attributes?: WebGLContextAttributes): WebGLRenderingContext;
}
interface WebGLRenderingContext {