UNPKG

miniprogram-api-typings

Version:

Type definitions for APIs of Wechat Mini Program in TypeScript

1,464 lines (1,413 loc) 92.6 kB
/*! ***************************************************************************** Copyright (c) 2025 Tencent, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ***************************************************************************** */ /* eslint-disable @typescript-eslint/naming-convention */ declare namespace WechatMiniprogram.CanvasRenderingContext { type CanvasDirection = 'inherit' | 'ltr' | 'rtl' type CanvasFillRule = 'evenodd' | 'nonzero' type CanvasFontKerning = 'auto' | 'none' | 'normal' type CanvasFontStretch = | 'condensed' | 'expanded' | 'extra-condensed' | 'extra-expanded' | 'normal' | 'semi-condensed' | 'semi-expanded' | 'ultra-condensed' | 'ultra-expanded' type CanvasFontVariantCaps = | 'all-petite-caps' | 'all-small-caps' | 'normal' | 'petite-caps' | 'small-caps' | 'titling-caps' | 'unicase' type CanvasLineCap = 'butt' | 'round' | 'square' type CanvasLineJoin = 'bevel' | 'miter' | 'round' type CanvasTextAlign = 'center' | 'end' | 'left' | 'right' | 'start' type CanvasTextBaseline = | 'alphabetic' | 'bottom' | 'hanging' | 'ideographic' | 'middle' | 'top' type CanvasTextRendering = | 'auto' | 'geometricPrecision' | 'optimizeLegibility' | 'optimizeSpeed' type GlobalCompositeOperation = | 'color' | 'color-burn' | 'color-dodge' | 'copy' | 'darken' | 'destination-atop' | 'destination-in' | 'destination-out' | 'destination-over' | 'difference' | 'exclusion' | 'hard-light' | 'hue' | 'lighten' | 'lighter' | 'luminosity' | 'multiply' | 'overlay' | 'saturation' | 'screen' | 'soft-light' | 'source-atop' | 'source-in' | 'source-out' | 'source-over' | 'xor' interface CanvasCompositing { globalAlpha: number globalCompositeOperation: GlobalCompositeOperation } type CanvasImageSource = VideoContext | Canvas | Image | OffscreenCanvas interface CanvasDrawImage { drawImage(image: CanvasImageSource, dx: number, dy: number): void drawImage( image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number ): void drawImage( image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number ): void } interface CanvasDrawPath { beginPath(): void clip(fillRule?: CanvasFillRule): void clip(path: Path2D, fillRule?: CanvasFillRule): void fill(fillRule?: CanvasFillRule): void fill(path: Path2D, fillRule?: CanvasFillRule): void isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean isPointInPath( path: Path2D, x: number, y: number, fillRule?: CanvasFillRule ): boolean isPointInStroke(x: number, y: number): boolean isPointInStroke(path: Path2D, x: number, y: number): boolean stroke(): void stroke(path: Path2D): void } interface CanvasFillStrokeStyles { fillStyle: string | CanvasGradient | CanvasPattern strokeStyle: string | CanvasGradient | CanvasPattern createConicGradient( startAngle: number, x: number, y: number ): CanvasGradient createLinearGradient( x0: number, y0: number, x1: number, y1: number ): CanvasGradient createPattern( image: CanvasImageSource, repetition: string | null ): CanvasPattern | null createRadialGradient( x0: number, y0: number, r0: number, x1: number, y1: number, r1: number ): CanvasGradient } interface CanvasFilters { filter: string } /** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */ interface CanvasGradient { /** * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. * * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed. */ addColorStop(offset: number, color: string): void } type PredefinedColorSpace = 'display-p3' | 'srgb' interface ImageDataSettings { colorSpace?: PredefinedColorSpace } interface CanvasImageData { createImageData( sw: number, sh: number, settings?: ImageDataSettings ): ImageData createImageData(imagedata: ImageData): ImageData getImageData( sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings ): ImageData putImageData(imagedata: ImageData, dx: number, dy: number): void putImageData( imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number ): void } type ImageSmoothingQuality = 'high' | 'low' | 'medium' interface CanvasImageSmoothing { imageSmoothingEnabled: boolean imageSmoothingQuality: ImageSmoothingQuality } interface CanvasPath { arc( x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean ): void arcTo( x1: number, y1: number, x2: number, y2: number, radius: number ): void bezierCurveTo( cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number ): void closePath(): void ellipse( x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean ): void lineTo(x: number, y: number): void moveTo(x: number, y: number): void quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void rect(x: number, y: number, w: number, h: number): void roundRect( x: number, y: number, w: number, h: number, radii?: number | number[] ): void } interface CanvasPathDrawingStyles { lineCap: CanvasLineCap lineDashOffset: number lineJoin: CanvasLineJoin lineWidth: number miterLimit: number getLineDash(): number[] setLineDash(segments: number[]): void } interface DOMMatrix2DInit { a?: number b?: number c?: number d?: number e?: number f?: number m11?: number m12?: number m21?: number m22?: number m41?: number m42?: number } /** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */ interface CanvasPattern { /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. */ setTransform(transform?: DOMMatrix2DInit): void } interface CanvasRect { clearRect(x: number, y: number, w: number, h: number): void fillRect(x: number, y: number, w: number, h: number): void strokeRect(x: number, y: number, w: number, h: number): void } interface CanvasShadowStyles { shadowBlur: number shadowColor: string shadowOffsetX: number shadowOffsetY: number } interface CanvasState { restore(): void save(): void } /** The dimensions of a piece of text in the canvas, as created by the CanvasRenderingContext2D.measureText() method. */ interface TextMetrics { /** Returns the measurement described below. */ readonly actualBoundingBoxAscent: number /** Returns the measurement described below. */ readonly actualBoundingBoxDescent: number /** Returns the measurement described below. */ readonly actualBoundingBoxLeft: number /** Returns the measurement described below. */ readonly actualBoundingBoxRight: number /** Returns the measurement described below. */ readonly fontBoundingBoxAscent: number /** Returns the measurement described below. */ readonly fontBoundingBoxDescent: number /** Returns the measurement described below. */ readonly width: number } interface CanvasText { fillText(text: string, x: number, y: number, maxWidth?: number): void measureText(text: string): TextMetrics strokeText(text: string, x: number, y: number, maxWidth?: number): void } interface CanvasTextDrawingStyles { direction: CanvasDirection font: string fontKerning: CanvasFontKerning textAlign: CanvasTextAlign textBaseline: CanvasTextBaseline } interface DOMMatrixReadOnly { readonly a: number readonly b: number readonly c: number readonly d: number readonly e: number readonly f: number readonly is2D: boolean readonly isIdentity: boolean readonly m11: number readonly m12: number readonly m13: number readonly m14: number readonly m21: number readonly m22: number readonly m23: number readonly m24: number readonly m31: number readonly m32: number readonly m33: number readonly m34: number readonly m41: number readonly m42: number readonly m43: number readonly m44: number } interface CanvasTransform { getTransform(): DOMMatrixReadOnly resetTransform(): void rotate(angle: number): void scale(x: number, y: number): void setTransform( a: number, b: number, c: number, d: number, e: number, f: number ): void setTransform(transform?: DOMMatrix2DInit): void transform( a: number, b: number, c: number, d: number, e: number, f: number ): void translate(x: number, y: number): void } interface CanvasUserInterface { // drawFocusIfNeeded(element: Element): void; // drawFocusIfNeeded(path: Path2D, element: Element): void; } interface CanvasRenderingContext2DSettings { alpha?: boolean colorSpace?: PredefinedColorSpace desynchronized?: boolean willReadFrequently?: boolean } /** The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a <canvas> element. It is used for drawing shapes, text, images, and other objects. */ interface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface { readonly canvas: Canvas getContextAttributes(): CanvasRenderingContext2DSettings } type GLbitfield = number type GLboolean = boolean type GLclampf = number type GLenum = number type GLfloat = number type GLint = number type GLint64 = number type GLintptr = number type GLsizei = number type GLsizeiptr = number type GLuint = number type GLuint64 = number interface WEBGL_color_buffer_float { readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum readonly RGBA32F_EXT: GLenum readonly UNSIGNED_NORMALIZED_EXT: GLenum } interface WEBGL_compressed_texture_astc { getSupportedProfiles(): string[] readonly COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum readonly COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum } interface WEBGL_compressed_texture_etc { readonly COMPRESSED_R11_EAC: GLenum readonly COMPRESSED_RG11_EAC: GLenum readonly COMPRESSED_RGB8_ETC2: GLenum readonly COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum readonly COMPRESSED_RGBA8_ETC2_EAC: GLenum readonly COMPRESSED_SIGNED_R11_EAC: GLenum readonly COMPRESSED_SIGNED_RG11_EAC: GLenum readonly COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GLenum readonly COMPRESSED_SRGB8_ETC2: GLenum readonly COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum } interface WEBGL_compressed_texture_etc1 { readonly COMPRESSED_RGB_ETC1_WEBGL: GLenum } /** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */ interface WEBGL_compressed_texture_s3tc { readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum readonly COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum } interface WEBGL_compressed_texture_s3tc_srgb { readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum } /** The WEBGL_debug_renderer_info extension is part of the WebGL API and exposes two constants with information about the graphics driver for debugging purposes. */ interface WEBGL_debug_renderer_info { readonly UNMASKED_RENDERER_WEBGL: GLenum readonly UNMASKED_VENDOR_WEBGL: GLenum } interface WEBGL_debug_shaders { getTranslatedShaderSource(shader: WebGLShader): string } /** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */ interface WEBGL_depth_texture { readonly UNSIGNED_INT_24_8_WEBGL: GLenum } interface WEBGL_draw_buffers { drawBuffersWEBGL(buffers: GLenum[]): void readonly COLOR_ATTACHMENT0_WEBGL: GLenum readonly COLOR_ATTACHMENT10_WEBGL: GLenum readonly COLOR_ATTACHMENT11_WEBGL: GLenum readonly COLOR_ATTACHMENT12_WEBGL: GLenum readonly COLOR_ATTACHMENT13_WEBGL: GLenum readonly COLOR_ATTACHMENT14_WEBGL: GLenum readonly COLOR_ATTACHMENT15_WEBGL: GLenum readonly COLOR_ATTACHMENT1_WEBGL: GLenum readonly COLOR_ATTACHMENT2_WEBGL: GLenum readonly COLOR_ATTACHMENT3_WEBGL: GLenum readonly COLOR_ATTACHMENT4_WEBGL: GLenum readonly COLOR_ATTACHMENT5_WEBGL: GLenum readonly COLOR_ATTACHMENT6_WEBGL: GLenum readonly COLOR_ATTACHMENT7_WEBGL: GLenum readonly COLOR_ATTACHMENT8_WEBGL: GLenum readonly COLOR_ATTACHMENT9_WEBGL: GLenum readonly DRAW_BUFFER0_WEBGL: GLenum readonly DRAW_BUFFER10_WEBGL: GLenum readonly DRAW_BUFFER11_WEBGL: GLenum readonly DRAW_BUFFER12_WEBGL: GLenum readonly DRAW_BUFFER13_WEBGL: GLenum readonly DRAW_BUFFER14_WEBGL: GLenum readonly DRAW_BUFFER15_WEBGL: GLenum readonly DRAW_BUFFER1_WEBGL: GLenum readonly DRAW_BUFFER2_WEBGL: GLenum readonly DRAW_BUFFER3_WEBGL: GLenum readonly DRAW_BUFFER4_WEBGL: GLenum readonly DRAW_BUFFER5_WEBGL: GLenum readonly DRAW_BUFFER6_WEBGL: GLenum readonly DRAW_BUFFER7_WEBGL: GLenum readonly DRAW_BUFFER8_WEBGL: GLenum readonly DRAW_BUFFER9_WEBGL: GLenum readonly MAX_COLOR_ATTACHMENTS_WEBGL: GLenum readonly MAX_DRAW_BUFFERS_WEBGL: GLenum } interface WEBGL_lose_context { loseContext(): void restoreContext(): void } interface WEBGL_multi_draw { multiDrawArraysInstancedWEBGL( mode: GLenum, firstsList: Int32Array | GLint[], firstsOffset: GLuint, countsList: Int32Array | GLsizei[], countsOffset: GLuint, instanceCountsList: Int32Array | GLsizei[], instanceCountsOffset: GLuint, drawcount: GLsizei ): void multiDrawArraysWEBGL( mode: GLenum, firstsList: Int32Array | GLint[], firstsOffset: GLuint, countsList: Int32Array | GLsizei[], countsOffset: GLuint, drawcount: GLsizei ): void multiDrawElementsInstancedWEBGL( mode: GLenum, countsList: Int32Array | GLsizei[], countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | GLsizei[], offsetsOffset: GLuint, instanceCountsList: Int32Array | GLsizei[], instanceCountsOffset: GLuint, drawcount: GLsizei ): void multiDrawElementsWEBGL( mode: GLenum, countsList: Int32Array | GLsizei[], countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | GLsizei[], offsetsOffset: GLuint, drawcount: GLsizei ): void } type OverSampleType = '2x' | '4x' | 'none' interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase {} type Int32List = Int32Array | GLint[] type Uint32List = Uint32Array | GLuint[] interface WebGL2RenderingContextBase { beginQuery(target: GLenum, query: WebGLQuery): void beginTransformFeedback(primitiveMode: GLenum): void bindBufferBase( target: GLenum, index: GLuint, buffer: WebGLBuffer | null ): void bindBufferRange( target: GLenum, index: GLuint, buffer: WebGLBuffer | null, offset: GLintptr, size: GLsizeiptr ): void bindSampler(unit: GLuint, sampler: WebGLSampler | null): void bindTransformFeedback( target: GLenum, tf: WebGLTransformFeedback | null ): void bindVertexArray(array: WebGLVertexArrayObject | null): void blitFramebuffer( srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum ): void clearBufferfi( buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint ): void clearBufferfv( buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset?: GLuint ): void clearBufferiv( buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset?: GLuint ): void clearBufferuiv( buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset?: GLuint ): void clientWaitSync( sync: WebGLSync, flags: GLbitfield, timeout: GLuint64 ): GLenum compressedTexImage3D( target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr ): void compressedTexImage3D( target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint ): void compressedTexSubImage3D( target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr ): void compressedTexSubImage3D( target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint ): void copyBufferSubData( readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr ): void copyTexSubImage3D( target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei ): void createQuery(): WebGLQuery | null createSampler(): WebGLSampler | null createTransformFeedback(): WebGLTransformFeedback | null createVertexArray(): WebGLVertexArrayObject | null deleteQuery(query: WebGLQuery | null): void deleteSampler(sampler: WebGLSampler | null): void deleteSync(sync: WebGLSync | null): void deleteTransformFeedback(tf: WebGLTransformFeedback | null): void deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void drawArraysInstanced( mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei ): void drawBuffers(buffers: GLenum[]): void drawElementsInstanced( mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei ): void drawRangeElements( mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr ): void endQuery(target: GLenum): void endTransformFeedback(): void fenceSync(condition: GLenum, flags: GLbitfield): WebGLSync | null framebufferTextureLayer( target: GLenum, attachment: GLenum, texture: WebGLTexture | null, level: GLint, layer: GLint ): void getActiveUniformBlockName( program: WebGLProgram, uniformBlockIndex: GLuint ): string | null getActiveUniformBlockParameter( program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum ): any getActiveUniforms( program: WebGLProgram, uniformIndices: GLuint[], pname: GLenum ): any getBufferSubData( target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset?: GLuint, length?: GLuint ): void getFragDataLocation(program: WebGLProgram, name: string): GLint getIndexedParameter(target: GLenum, index: GLuint): any getInternalformatParameter( target: GLenum, internalformat: GLenum, pname: GLenum ): any getQuery(target: GLenum, pname: GLenum): WebGLQuery | null getQueryParameter(query: WebGLQuery, pname: GLenum): any getSamplerParameter(sampler: WebGLSampler, pname: GLenum): any getSyncParameter(sync: WebGLSync, pname: GLenum): any getTransformFeedbackVarying( program: WebGLProgram, index: GLuint ): WebGLActiveInfo | null getUniformBlockIndex( program: WebGLProgram, uniformBlockName: string ): GLuint getUniformIndices( program: WebGLProgram, uniformNames: string[] ): GLuint[] | null invalidateFramebuffer(target: GLenum, attachments: GLenum[]): void invalidateSubFramebuffer( target: GLenum, attachments: GLenum[], x: GLint, y: GLint, width: GLsizei, height: GLsizei ): void isQuery(query: WebGLQuery | null): GLboolean isSampler(sampler: WebGLSampler | null): GLboolean isSync(sync: WebGLSync | null): GLboolean isTransformFeedback(tf: WebGLTransformFeedback | null): GLboolean isVertexArray(vertexArray: WebGLVertexArrayObject | null): GLboolean pauseTransformFeedback(): void readBuffer(src: GLenum): void renderbufferStorageMultisample( target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei ): void resumeTransformFeedback(): void samplerParameterf( sampler: WebGLSampler, pname: GLenum, param: GLfloat ): void samplerParameteri( sampler: WebGLSampler, pname: GLenum, param: GLint ): void texImage3D( target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr ): void texImage3D( target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource ): void texImage3D( target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView | null ): void texImage3D( target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint ): void texStorage2D( target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei ): void texStorage3D( target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei ): void texSubImage3D( target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr ): void texSubImage3D( target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource ): void texSubImage3D( target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView | null, srcOffset?: GLuint ): void transformFeedbackVaryings( program: WebGLProgram, varyings: string[], bufferMode: GLenum ): void uniform1ui(location: WebGLUniformLocation | null, v0: GLuint): void uniform1uiv( location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniform2ui( location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint ): void uniform2uiv( location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniform3ui( location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint ): void uniform3uiv( location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniform4ui( location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint ): void uniform4uiv( location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniformBlockBinding( program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint ): void uniformMatrix2x3fv( location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniformMatrix2x4fv( location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniformMatrix3x2fv( location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniformMatrix3x4fv( location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniformMatrix4x2fv( location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint ): void uniformMatrix4x3fv( location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint ): void vertexAttribDivisor(index: GLuint, divisor: GLuint): void vertexAttribI4i( index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint ): void vertexAttribI4iv(index: GLuint, values: Int32List): void vertexAttribI4ui( index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint ): void vertexAttribI4uiv(index: GLuint, values: Uint32List): void vertexAttribIPointer( index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr ): void waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void readonly ACTIVE_UNIFORM_BLOCKS: GLenum readonly ALREADY_SIGNALED: GLenum readonly ANY_SAMPLES_PASSED: GLenum readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum readonly COLOR: GLenum readonly COLOR_ATTACHMENT1: GLenum readonly COLOR_ATTACHMENT10: GLenum readonly COLOR_ATTACHMENT11: GLenum readonly COLOR_ATTACHMENT12: GLenum readonly COLOR_ATTACHMENT13: GLenum readonly COLOR_ATTACHMENT14: GLenum readonly COLOR_ATTACHMENT15: GLenum readonly COLOR_ATTACHMENT2: GLenum readonly COLOR_ATTACHMENT3: GLenum readonly COLOR_ATTACHMENT4: GLenum readonly COLOR_ATTACHMENT5: GLenum readonly COLOR_ATTACHMENT6: GLenum readonly COLOR_ATTACHMENT7: GLenum readonly COLOR_ATTACHMENT8: GLenum readonly COLOR_ATTACHMENT9: GLenum readonly COMPARE_REF_TO_TEXTURE: GLenum readonly CONDITION_SATISFIED: GLenum readonly COPY_READ_BUFFER: GLenum readonly COPY_READ_BUFFER_BINDING: GLenum readonly COPY_WRITE_BUFFER: GLenum readonly COPY_WRITE_BUFFER_BINDING: GLenum readonly CURRENT_QUERY: GLenum readonly DEPTH: GLenum readonly DEPTH24_STENCIL8: GLenum readonly DEPTH32F_STENCIL8: GLenum readonly DEPTH_COMPONENT24: GLenum readonly DEPTH_COMPONENT32F: GLenum readonly DRAW_BUFFER0: GLenum readonly DRAW_BUFFER1: GLenum readonly DRAW_BUFFER10: GLenum readonly DRAW_BUFFER11: GLenum readonly DRAW_BUFFER12: GLenum readonly DRAW_BUFFER13: GLenum readonly DRAW_BUFFER14: GLenum readonly DRAW_BUFFER15: GLenum readonly DRAW_BUFFER2: GLenum readonly DRAW_BUFFER3: GLenum readonly DRAW_BUFFER4: GLenum readonly DRAW_BUFFER5: GLenum readonly DRAW_BUFFER6: GLenum readonly DRAW_BUFFER7: GLenum readonly DRAW_BUFFER8: GLenum readonly DRAW_BUFFER9: GLenum readonly DRAW_FRAMEBUFFER: GLenum readonly DRAW_FRAMEBUFFER_BINDING: GLenum readonly DYNAMIC_COPY: GLenum readonly DYNAMIC_READ: GLenum readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum readonly FLOAT_MAT2x3: GLenum readonly FLOAT_MAT2x4: GLenum readonly FLOAT_MAT3x2: GLenum readonly FLOAT_MAT3x4: GLenum readonly FLOAT_MAT4x2: GLenum readonly FLOAT_MAT4x3: GLenum readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum readonly FRAMEBUFFER_DEFAULT: GLenum readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum readonly HALF_FLOAT: GLenum readonly INTERLEAVED_ATTRIBS: GLenum readonly INT_2_10_10_10_REV: GLenum readonly INT_SAMPLER_2D: GLenum readonly INT_SAMPLER_2D_ARRAY: GLenum readonly INT_SAMPLER_3D: GLenum readonly INT_SAMPLER_CUBE: GLenum readonly INVALID_INDEX: GLenum readonly MAX: GLenum readonly MAX_3D_TEXTURE_SIZE: GLenum readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum readonly MAX_COLOR_ATTACHMENTS: GLenum readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum readonly MAX_DRAW_BUFFERS: GLenum readonly MAX_ELEMENTS_INDICES: GLenum readonly MAX_ELEMENTS_VERTICES: GLenum readonly MAX_ELEMENT_INDEX: GLenum readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum readonly MAX_SAMPLES: GLenum readonly MAX_SERVER_WAIT_TIMEOUT: GLenum readonly MAX_TEXTURE_LOD_BIAS: GLenum readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum readonly MAX_UNIFORM_BLOCK_SIZE: GLenum readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum readonly MAX_VARYING_COMPONENTS: GLenum readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum readonly MIN: GLenum readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum readonly OBJECT_TYPE: GLenum readonly PACK_ROW_LENGTH: GLenum readonly PACK_SKIP_PIXELS: GLenum readonly PACK_SKIP_ROWS: GLenum readonly PIXEL_PACK_BUFFER: GLenum readonly PIXEL_PACK_BUFFER_BINDING: GLenum readonly PIXEL_UNPACK_BUFFER: GLenum readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum readonly QUERY_RESULT: GLenum readonly QUERY_RESULT_AVAILABLE: GLenum readonly R11F_G11F_B10F: GLenum readonly R16F: GLenum readonly R16I: GLenum readonly R16UI: GLenum readonly R32F: GLenum readonly R32I: GLenum readonly R32UI: GLenum readonly R8: GLenum readonly R8I: GLenum readonly R8UI: GLenum readonly R8_SNORM: GLenum readonly RASTERIZER_DISCARD: GLenum readonly READ_BUFFER: GLenum readonly READ_FRAMEBUFFER: GLenum readonly READ_FRAMEBUFFER_BINDING: GLenum readonly RED: GLenum readonly RED_INTEGER: GLenum readonly RENDERBUFFER_SAMPLES: GLenum readonly RG: GLenum readonly RG16F: GLenum readonly RG16I: GLenum readonly RG16UI: GLenum readonly RG32F: GLenum readonly RG32I: GLenum readonly RG32UI: GLenum readonly RG8: GLenum readonly RG8I: GLenum readonly RG8UI: GLenum readonly RG8_SNORM: GLenum readonly RGB10_A2: GLenum readonly RGB10_A2UI: GLenum readonly RGB16F: GLenum readonly RGB16I: GLenum readonly RGB16UI: GLenum readonly RGB32F: GLenum readonly RGB32I: GLenum readonly RGB32UI: GLenum readonly RGB8: GLenum readonly RGB8I: GLenum readonly RGB8UI: GLenum readonly RGB8_SNORM: GLenum readonly RGB9_E5: GLenum readonly RGBA16F: GLenum readonly RGBA16I: GLenum readonly RGBA16UI: GLenum readonly RGBA32F: GLenum readonly RGBA32I: GLenum readonly RGBA32UI: GLenum readonly RGBA8: GLenum readonly RGBA8I: GLenum readonly RGBA8UI: GLenum readonly RGBA8_SNORM: GLenum readonly RGBA_INTEGER: GLenum readonly RGB_INTEGER: GLenum readonly RG_INTEGER: GLenum readonly SAMPLER_2D_ARRAY: GLenum readonly SAMPLER_2D_ARRAY_SHADOW: GLenum readonly SAMPLER_2D_SHADOW: GLenum readonly SAMPLER_3D: GLenum readonly SAMPLER_BINDING: GLenum readonly SAMPLER_CUBE_SHADOW: GLenum readonly SEPARATE_ATTRIBS: GLenum readonly SIGNALED: GLenum readonly SIGNED_NORMALIZED: GLenum readonly SRGB: GLenum readonly SRGB8: GLenum readonly SRGB8_ALPHA8: GLenum readonly STATIC_COPY: GLenum readonly STATIC_READ: GLenum readonly STENCIL: GLenum readonly STREAM_COPY: GLenum readonly STREAM_READ: GLenum readonly SYNC_CONDITION: GLenum readonly SYNC_FENCE: GLenum readonly SYNC_FLAGS: GLenum readonly SYNC_FLUSH_COMMANDS_BIT: GLenum readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum readonly SYNC_STATUS: GLenum readonly TEXTURE_2D_ARRAY: GLenum readonly TEXTURE_3D: GLenum readonly TEXTURE_BASE_LEVEL: GLenum readonly TEXTURE_BINDING_2D_ARRAY: GLenum readonly TEXTURE_BINDING_3D: GLenum readonly TEXTURE_COMPARE_FUNC: GLenum readonly TEXTURE_COMPARE_MODE: GLenum readonly TEXTURE_IMMUTABLE_FORMAT: GLenum readonly TEXTURE_IMMUTABLE_LEVELS: GLenum readonly TEXTURE_MAX_LEVEL: GLenum readonly TEXTURE_MAX_LOD: GLenum readonly TEXTURE_MIN_LOD: GLenum readonly TEXTURE_WRAP_R: GLenum readonly TIMEOUT_EXPIRED: GLenum readonly TIMEOUT_IGNORED: GLint64 readonly TRANSFORM_FEEDBACK: GLenum readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum readonly TRANSFORM_FEEDBACK_BINDING: GLenum readonly TRANSFORM_FEEDBACK_BUFFER: GLenum readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum readonly TRANSFORM_FEEDBACK_PAUSED: GLenum readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum readonly UNIFORM_ARRAY_STRIDE: GLenum readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum readonly UNIFORM_BLOCK_BINDING: GLenum readonly UNIFORM_BLOCK_DATA_SIZE: GLenum readonly UNIFORM_BLOCK_INDEX: GLenum readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum readonly UNIFORM_BUFFER: GLenum readonly UNIFORM_BUFFER_BINDING: GLenum readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum readonly UNIFORM_BUFFER_SIZE: GLenum readonly UNIFORM_BUFFER_START: GLenum readonly UNIFORM_IS_ROW_MAJOR: GLenum readonly UNIFORM_MATRIX_STRIDE: GLenum readonly UNIFORM_OFFSET: GLenum readonly UNIFORM_SIZE: GLenum readonly UNIFORM_TYPE: GLenum readonly UNPACK_IMAGE_HEIGHT: GLenum readonly UNPACK_ROW_LENGTH: GLenum readonly UNPACK_SKIP_IMAGES: GLenum readonly UNPACK_SKIP_PIXELS: GLenum readonly UNPACK_SKIP_ROWS: GLenum readonly UNSIGNALED: GLenum readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum readonly UNSIGNED_INT_24_8: GLenum readonly UNSIGNED_INT_2_10_10_10_REV: GLenum readonly UNSIGNED_INT_5_9_9_9_REV: GLenum readonly UNSIGNED_INT_SAMPLER_2D: GLenum readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum readonly UNSIGNED_INT_SAMPLER_3D: GLenum readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum readonly UNSIGNED_INT_VEC2: GLenum readonly UNSIGNED_INT_VEC3: GLenum readonly UNSIGNED_INT_VEC4: GLenum readonly UNSIGNED_NORMALIZED: GLenum readonly VERTEX_ARRAY_BINDING: GLenum readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum readonly WAIT_FAILED: GLenum } interface WebGL2RenderingContextOverloads { bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void bufferData( target: GLenum, srcData: BufferSource | null, usage: GLenum ): void bufferData( target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length?: GLuint ): void bufferSubData( target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource ): void bufferSubData( target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length?: GLuint ): void compressedTexImage2D( target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr ): void compressedTexImage2D( target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint ): void compressedTexSubImage2D( target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr ): void compressedTexSubImage2D( target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint ): void readPixels( x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView | null ): void readPixels( x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr ): void readPixels( x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint ): void texImage2D( ta