@types/gl-shader
TypeScript icon, indicating that this package has built-in type declarations

4.2.5 • Public • Published

Installation

npm install --save @types/gl-shader

Summary

This package contains type definitions for gl-shader (https://github.com/stackgl/gl-shader).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gl-shader.

index.d.ts

interface Parameter {
    type: string;
    name: string;
}

interface Attribute {
    location: number[] | number;
    pointer(type?: number, normalized?: boolean, stride?: number, offset?: number): number;
}

declare class Shader {
    readonly gl: WebGLRenderingContext;
    readonly program: WebGLProgram;
    readonly vertShader: WebGLShader;
    readonly fragShader: WebGLShader;
    readonly attributes: { [key: string]: Attribute & any[] };

    uniforms: { [key: string]: any };

    constructor(gl: WebGLRenderingContext);

    bind(): void;
    dispose(): void;

    update(vertex: string, fragment: string, uniforms?: Parameter[], attributes?: Parameter[]): void;
    update(obj: { vertex: string; fragment: string; uniforms: Parameter[]; attributes: Parameter[] }): void;
}

declare function createShader(
    gl: WebGLRenderingContext,
    vertex: string,
    fragment: string,
    uniforms?: Parameter[],
    attributes?: Parameter[],
): Shader;

declare function createShader(
    gl: WebGLRenderingContext,
    options: {
        vertex: string;
        fragment: string;
        uniforms?: Parameter[] | undefined;
        attributes?: Parameter[] | undefined;
    },
): Shader;

export = createShader;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by .

Readme

Keywords

none

Package Sidebar

Install

npm i @types/gl-shader

Weekly Downloads

591

Version

4.2.5

License

MIT

Unpacked Size

4.78 kB

Total Files

5

Last publish

Collaborators

  • types