mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #31408 from sjx233/gl
Add type definitions for gl 4.1
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import createContext = require("gl");
|
||||
|
||||
createContext(0, 0); // $ExpectType WebGLRenderingContext & StackGLExtension
|
||||
createContext(0, 0, { preserveDrawingBuffer: true }); // $ExpectType WebGLRenderingContext & StackGLExtension
|
||||
createContext(0, 0).getExtension("STACKGL_resize_drawingbuffer"); // $ExpectType STACKGL_resize_drawingbuffer | null
|
||||
createContext(0, 0).getExtension("STACKGL_destroy_context"); // $ExpectType STACKGL_destroy_context | null
|
||||
createContext(0, 0).getExtension("STACKGL_resize_drawingbuffer")!.resize(0, 0); // $ExpectType void
|
||||
createContext(0, 0).getExtension("STACKGL_destroy_context")!.destroy(); // $ExpectType void
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for gl 4.1
|
||||
// Project: https://github.com/stackgl/headless-gl#readme
|
||||
// Definitions by: sjx233 <https://github.com/sjx233>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface StackGLExtension {
|
||||
getExtension(extensionName: "STACKGL_resize_drawingbuffer"): STACKGL_resize_drawingbuffer | null;
|
||||
getExtension(extensionName: "STACKGL_destroy_context"): STACKGL_destroy_context | null;
|
||||
}
|
||||
|
||||
interface STACKGL_resize_drawingbuffer {
|
||||
resize(width: GLint, height: GLint): void;
|
||||
}
|
||||
|
||||
interface STACKGL_destroy_context {
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
declare function createContext(width: number, height: number, options?: WebGLContextAttributes): WebGLRenderingContext & StackGLExtension;
|
||||
|
||||
export = createContext;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gl-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user