# @types/webgl2

> TypeScript definitions for webgl2

Latest version **0.0.12** (published 2025-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/webgl2
pnpm add @types/webgl2
yarn add @types/webgl2
bun add @types/webgl2
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.12 |
| Published | 2025-11-17 |
| First published | 2017-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51441 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/webgl2
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webgl2
- npm.io page: https://npm.io/package/@types/webgl2

## Recent versions

- 0.0.12 (latest) — 2025-11-17
- 0.0.11 (ts5.1) — 2024-01-30
- 0.0.10 (ts4.5) — 2023-11-07
- 0.0.7 (ts4.2) — 2023-01-24
- 0.0.6 (ts3.8) — 2021-03-12
- 0.0.5 (ts2.8) — 2019-07-11
- 0.0.9 — 2023-10-18
- 0.0.8 — 2023-09-25
- 0.0.4 — 2018-04-26
- 0.0.3 — 2018-03-09
- 0.0.2 — 2017-08-21
- 0.0.1 — 2017-04-19
- 0.0.0 — 2017-03-21

## README

# Installation
> `npm install --save @types/webgl2`

# Summary
This package contains type definitions for webgl2 (https://www.khronos.org/registry/webgl/specs/latest/2.0/).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webgl2.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webgl2/index.d.ts)
````ts
interface HTMLCanvasElement extends HTMLElement {
    getContext(
        contextId: "webgl2" | "experimental-webgl2",
        contextAttributes?: WebGLContextAttributes,
    ): WebGL2RenderingContext | null;
}

interface ImageBitmap {
    readonly width: number;
    readonly height: number;
    close(): void;
}

interface WebGLQuery {
}

declare var WebGLQuery: {
    prototype: WebGLQuery;
    new(): WebGLQuery;
};

interface WebGLSampler {
}

declare var WebGLSampler: {
    prototype: WebGLSampler;
    new(): WebGLSampler;
};

interface WebGLSync {
}

declare var WebGLSync: {
    prototype: WebGLSync;
    new(): WebGLSync;
};

interface WebGLTransformFeedback {
}

declare var WebGLTransformFeedback: {
    prototype: WebGLTransformFeedback;
    new(): WebGLTransformFeedback;
};

interface WebGLVertexArrayObject {
}

declare var WebGLVertexArrayObject: {
    prototype: WebGLVertexArrayObject;
    new(): WebGLVertexArrayObject;
};

````

### Additional Details
 * Last updated: Mon, 17 Nov 2025 21:33:59 GMT
 * Dependencies: none

# Credits
These definitions were written by [Nico Kemnitz](https://github.com/nkemnitz), and [Adrian Blumer](https://github.com/karhu).

---
_Source: https://npm.io/package/@types/webgl2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
