lib.wx.canvas.d.ts 90 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623
  1. /*! *****************************************************************************
  2. Copyright (c) 2024 Tencent, Inc. All rights reserved.
  3. Permission is hereby granted, free of charge, to any person obtaining a copy of
  4. this software and associated documentation files (the "Software"), to deal in
  5. the Software without restriction, including without limitation the rights to
  6. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  7. of the Software, and to permit persons to whom the Software is furnished to do
  8. so, subject to the following conditions:
  9. The above copyright notice and this permission notice shall be included in all
  10. copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17. SOFTWARE.
  18. ***************************************************************************** */
  19. /* eslint-disable @typescript-eslint/naming-convention */
  20. declare namespace WechatMiniprogram.CanvasRenderingContext {
  21. type CanvasDirection = 'inherit' | 'ltr' | 'rtl'
  22. type CanvasFillRule = 'evenodd' | 'nonzero'
  23. type CanvasFontKerning = 'auto' | 'none' | 'normal'
  24. type CanvasFontStretch =
  25. | 'condensed'
  26. | 'expanded'
  27. | 'extra-condensed'
  28. | 'extra-expanded'
  29. | 'normal'
  30. | 'semi-condensed'
  31. | 'semi-expanded'
  32. | 'ultra-condensed'
  33. | 'ultra-expanded'
  34. type CanvasFontVariantCaps =
  35. | 'all-petite-caps'
  36. | 'all-small-caps'
  37. | 'normal'
  38. | 'petite-caps'
  39. | 'small-caps'
  40. | 'titling-caps'
  41. | 'unicase'
  42. type CanvasLineCap = 'butt' | 'round' | 'square'
  43. type CanvasLineJoin = 'bevel' | 'miter' | 'round'
  44. type CanvasTextAlign = 'center' | 'end' | 'left' | 'right' | 'start'
  45. type CanvasTextBaseline =
  46. | 'alphabetic'
  47. | 'bottom'
  48. | 'hanging'
  49. | 'ideographic'
  50. | 'middle'
  51. | 'top'
  52. type CanvasTextRendering =
  53. | 'auto'
  54. | 'geometricPrecision'
  55. | 'optimizeLegibility'
  56. | 'optimizeSpeed'
  57. type GlobalCompositeOperation =
  58. | 'color'
  59. | 'color-burn'
  60. | 'color-dodge'
  61. | 'copy'
  62. | 'darken'
  63. | 'destination-atop'
  64. | 'destination-in'
  65. | 'destination-out'
  66. | 'destination-over'
  67. | 'difference'
  68. | 'exclusion'
  69. | 'hard-light'
  70. | 'hue'
  71. | 'lighten'
  72. | 'lighter'
  73. | 'luminosity'
  74. | 'multiply'
  75. | 'overlay'
  76. | 'saturation'
  77. | 'screen'
  78. | 'soft-light'
  79. | 'source-atop'
  80. | 'source-in'
  81. | 'source-out'
  82. | 'source-over'
  83. | 'xor'
  84. interface CanvasCompositing {
  85. globalAlpha: number
  86. globalCompositeOperation: GlobalCompositeOperation
  87. }
  88. type CanvasImageSource = VideoContext | Canvas | Image | OffscreenCanvas
  89. interface CanvasDrawImage {
  90. drawImage(image: CanvasImageSource, dx: number, dy: number): void
  91. drawImage(
  92. image: CanvasImageSource,
  93. dx: number,
  94. dy: number,
  95. dw: number,
  96. dh: number
  97. ): void
  98. drawImage(
  99. image: CanvasImageSource,
  100. sx: number,
  101. sy: number,
  102. sw: number,
  103. sh: number,
  104. dx: number,
  105. dy: number,
  106. dw: number,
  107. dh: number
  108. ): void
  109. }
  110. interface CanvasDrawPath {
  111. beginPath(): void
  112. clip(fillRule?: CanvasFillRule): void
  113. clip(path: Path2D, fillRule?: CanvasFillRule): void
  114. fill(fillRule?: CanvasFillRule): void
  115. fill(path: Path2D, fillRule?: CanvasFillRule): void
  116. isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean
  117. isPointInPath(
  118. path: Path2D,
  119. x: number,
  120. y: number,
  121. fillRule?: CanvasFillRule
  122. ): boolean
  123. isPointInStroke(x: number, y: number): boolean
  124. isPointInStroke(path: Path2D, x: number, y: number): boolean
  125. stroke(): void
  126. stroke(path: Path2D): void
  127. }
  128. interface CanvasFillStrokeStyles {
  129. fillStyle: string | CanvasGradient | CanvasPattern
  130. strokeStyle: string | CanvasGradient | CanvasPattern
  131. createConicGradient(
  132. startAngle: number,
  133. x: number,
  134. y: number
  135. ): CanvasGradient
  136. createLinearGradient(
  137. x0: number,
  138. y0: number,
  139. x1: number,
  140. y1: number
  141. ): CanvasGradient
  142. createPattern(
  143. image: CanvasImageSource,
  144. repetition: string | null
  145. ): CanvasPattern | null
  146. createRadialGradient(
  147. x0: number,
  148. y0: number,
  149. r0: number,
  150. x1: number,
  151. y1: number,
  152. r1: number
  153. ): CanvasGradient
  154. }
  155. interface CanvasFilters {
  156. filter: string
  157. }
  158. /** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */
  159. interface CanvasGradient {
  160. /**
  161. * 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.
  162. *
  163. * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed.
  164. */
  165. addColorStop(offset: number, color: string): void
  166. }
  167. type PredefinedColorSpace = 'display-p3' | 'srgb'
  168. interface ImageDataSettings {
  169. colorSpace?: PredefinedColorSpace
  170. }
  171. interface CanvasImageData {
  172. createImageData(
  173. sw: number,
  174. sh: number,
  175. settings?: ImageDataSettings
  176. ): ImageData
  177. createImageData(imagedata: ImageData): ImageData
  178. getImageData(
  179. sx: number,
  180. sy: number,
  181. sw: number,
  182. sh: number,
  183. settings?: ImageDataSettings
  184. ): ImageData
  185. putImageData(imagedata: ImageData, dx: number, dy: number): void
  186. putImageData(
  187. imagedata: ImageData,
  188. dx: number,
  189. dy: number,
  190. dirtyX: number,
  191. dirtyY: number,
  192. dirtyWidth: number,
  193. dirtyHeight: number
  194. ): void
  195. }
  196. type ImageSmoothingQuality = 'high' | 'low' | 'medium'
  197. interface CanvasImageSmoothing {
  198. imageSmoothingEnabled: boolean
  199. imageSmoothingQuality: ImageSmoothingQuality
  200. }
  201. interface CanvasPath {
  202. arc(
  203. x: number,
  204. y: number,
  205. radius: number,
  206. startAngle: number,
  207. endAngle: number,
  208. counterclockwise?: boolean
  209. ): void
  210. arcTo(
  211. x1: number,
  212. y1: number,
  213. x2: number,
  214. y2: number,
  215. radius: number
  216. ): void
  217. bezierCurveTo(
  218. cp1x: number,
  219. cp1y: number,
  220. cp2x: number,
  221. cp2y: number,
  222. x: number,
  223. y: number
  224. ): void
  225. closePath(): void
  226. ellipse(
  227. x: number,
  228. y: number,
  229. radiusX: number,
  230. radiusY: number,
  231. rotation: number,
  232. startAngle: number,
  233. endAngle: number,
  234. counterclockwise?: boolean
  235. ): void
  236. lineTo(x: number, y: number): void
  237. moveTo(x: number, y: number): void
  238. quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void
  239. rect(x: number, y: number, w: number, h: number): void
  240. roundRect(
  241. x: number,
  242. y: number,
  243. w: number,
  244. h: number,
  245. radii?: number | number[]
  246. ): void
  247. }
  248. interface CanvasPathDrawingStyles {
  249. lineCap: CanvasLineCap
  250. lineDashOffset: number
  251. lineJoin: CanvasLineJoin
  252. lineWidth: number
  253. miterLimit: number
  254. getLineDash(): number[]
  255. setLineDash(segments: number[]): void
  256. }
  257. interface DOMMatrix2DInit {
  258. a?: number
  259. b?: number
  260. c?: number
  261. d?: number
  262. e?: number
  263. f?: number
  264. m11?: number
  265. m12?: number
  266. m21?: number
  267. m22?: number
  268. m41?: number
  269. m42?: number
  270. }
  271. /** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */
  272. interface CanvasPattern {
  273. /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. */
  274. setTransform(transform?: DOMMatrix2DInit): void
  275. }
  276. interface CanvasRect {
  277. clearRect(x: number, y: number, w: number, h: number): void
  278. fillRect(x: number, y: number, w: number, h: number): void
  279. strokeRect(x: number, y: number, w: number, h: number): void
  280. }
  281. interface CanvasShadowStyles {
  282. shadowBlur: number
  283. shadowColor: string
  284. shadowOffsetX: number
  285. shadowOffsetY: number
  286. }
  287. interface CanvasState {
  288. restore(): void
  289. save(): void
  290. }
  291. /** The dimensions of a piece of text in the canvas, as created by the CanvasRenderingContext2D.measureText() method. */
  292. interface TextMetrics {
  293. /** Returns the measurement described below. */
  294. readonly actualBoundingBoxAscent: number
  295. /** Returns the measurement described below. */
  296. readonly actualBoundingBoxDescent: number
  297. /** Returns the measurement described below. */
  298. readonly actualBoundingBoxLeft: number
  299. /** Returns the measurement described below. */
  300. readonly actualBoundingBoxRight: number
  301. /** Returns the measurement described below. */
  302. readonly fontBoundingBoxAscent: number
  303. /** Returns the measurement described below. */
  304. readonly fontBoundingBoxDescent: number
  305. /** Returns the measurement described below. */
  306. readonly width: number
  307. }
  308. interface CanvasText {
  309. fillText(text: string, x: number, y: number, maxWidth?: number): void
  310. measureText(text: string): TextMetrics
  311. strokeText(text: string, x: number, y: number, maxWidth?: number): void
  312. }
  313. interface CanvasTextDrawingStyles {
  314. direction: CanvasDirection
  315. font: string
  316. fontKerning: CanvasFontKerning
  317. textAlign: CanvasTextAlign
  318. textBaseline: CanvasTextBaseline
  319. }
  320. interface DOMMatrixReadOnly {
  321. readonly a: number
  322. readonly b: number
  323. readonly c: number
  324. readonly d: number
  325. readonly e: number
  326. readonly f: number
  327. readonly is2D: boolean
  328. readonly isIdentity: boolean
  329. readonly m11: number
  330. readonly m12: number
  331. readonly m13: number
  332. readonly m14: number
  333. readonly m21: number
  334. readonly m22: number
  335. readonly m23: number
  336. readonly m24: number
  337. readonly m31: number
  338. readonly m32: number
  339. readonly m33: number
  340. readonly m34: number
  341. readonly m41: number
  342. readonly m42: number
  343. readonly m43: number
  344. readonly m44: number
  345. }
  346. interface CanvasTransform {
  347. getTransform(): DOMMatrixReadOnly
  348. resetTransform(): void
  349. rotate(angle: number): void
  350. scale(x: number, y: number): void
  351. setTransform(
  352. a: number,
  353. b: number,
  354. c: number,
  355. d: number,
  356. e: number,
  357. f: number
  358. ): void
  359. setTransform(transform?: DOMMatrix2DInit): void
  360. transform(
  361. a: number,
  362. b: number,
  363. c: number,
  364. d: number,
  365. e: number,
  366. f: number
  367. ): void
  368. translate(x: number, y: number): void
  369. }
  370. interface CanvasUserInterface {
  371. // drawFocusIfNeeded(element: Element): void;
  372. // drawFocusIfNeeded(path: Path2D, element: Element): void;
  373. }
  374. interface CanvasRenderingContext2DSettings {
  375. alpha?: boolean
  376. colorSpace?: PredefinedColorSpace
  377. desynchronized?: boolean
  378. willReadFrequently?: boolean
  379. }
  380. /** 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. */
  381. interface CanvasRenderingContext2D
  382. extends CanvasCompositing,
  383. CanvasDrawImage,
  384. CanvasDrawPath,
  385. CanvasFillStrokeStyles,
  386. CanvasFilters,
  387. CanvasImageData,
  388. CanvasImageSmoothing,
  389. CanvasPath,
  390. CanvasPathDrawingStyles,
  391. CanvasRect,
  392. CanvasShadowStyles,
  393. CanvasState,
  394. CanvasText,
  395. CanvasTextDrawingStyles,
  396. CanvasTransform,
  397. CanvasUserInterface {
  398. readonly canvas: Canvas
  399. getContextAttributes(): CanvasRenderingContext2DSettings
  400. }
  401. type GLbitfield = number
  402. type GLboolean = boolean
  403. type GLclampf = number
  404. type GLenum = number
  405. type GLfloat = number
  406. type GLint = number
  407. type GLint64 = number
  408. type GLintptr = number
  409. type GLsizei = number
  410. type GLsizeiptr = number
  411. type GLuint = number
  412. type GLuint64 = number
  413. interface WEBGL_color_buffer_float {
  414. readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum
  415. readonly RGBA32F_EXT: GLenum
  416. readonly UNSIGNED_NORMALIZED_EXT: GLenum
  417. }
  418. interface WEBGL_compressed_texture_astc {
  419. getSupportedProfiles(): string[]
  420. readonly COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum
  421. readonly COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum
  422. readonly COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum
  423. readonly COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum
  424. readonly COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum
  425. readonly COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum
  426. readonly COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum
  427. readonly COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum
  428. readonly COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum
  429. readonly COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum
  430. readonly COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum
  431. readonly COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum
  432. readonly COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum
  433. readonly COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum
  434. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum
  435. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum
  436. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum
  437. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum
  438. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum
  439. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum
  440. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum
  441. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum
  442. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum
  443. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum
  444. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum
  445. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum
  446. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum
  447. readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum
  448. }
  449. interface WEBGL_compressed_texture_etc {
  450. readonly COMPRESSED_R11_EAC: GLenum
  451. readonly COMPRESSED_RG11_EAC: GLenum
  452. readonly COMPRESSED_RGB8_ETC2: GLenum
  453. readonly COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum
  454. readonly COMPRESSED_RGBA8_ETC2_EAC: GLenum
  455. readonly COMPRESSED_SIGNED_R11_EAC: GLenum
  456. readonly COMPRESSED_SIGNED_RG11_EAC: GLenum
  457. readonly COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GLenum
  458. readonly COMPRESSED_SRGB8_ETC2: GLenum
  459. readonly COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GLenum
  460. }
  461. interface WEBGL_compressed_texture_etc1 {
  462. readonly COMPRESSED_RGB_ETC1_WEBGL: GLenum
  463. }
  464. /** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */
  465. interface WEBGL_compressed_texture_s3tc {
  466. readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum
  467. readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum
  468. readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum
  469. readonly COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum
  470. }
  471. interface WEBGL_compressed_texture_s3tc_srgb {
  472. readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum
  473. readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum
  474. readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum
  475. readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum
  476. }
  477. /** 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. */
  478. interface WEBGL_debug_renderer_info {
  479. readonly UNMASKED_RENDERER_WEBGL: GLenum
  480. readonly UNMASKED_VENDOR_WEBGL: GLenum
  481. }
  482. interface WEBGL_debug_shaders {
  483. getTranslatedShaderSource(shader: WebGLShader): string
  484. }
  485. /** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */
  486. interface WEBGL_depth_texture {
  487. readonly UNSIGNED_INT_24_8_WEBGL: GLenum
  488. }
  489. interface WEBGL_draw_buffers {
  490. drawBuffersWEBGL(buffers: GLenum[]): void
  491. readonly COLOR_ATTACHMENT0_WEBGL: GLenum
  492. readonly COLOR_ATTACHMENT10_WEBGL: GLenum
  493. readonly COLOR_ATTACHMENT11_WEBGL: GLenum
  494. readonly COLOR_ATTACHMENT12_WEBGL: GLenum
  495. readonly COLOR_ATTACHMENT13_WEBGL: GLenum
  496. readonly COLOR_ATTACHMENT14_WEBGL: GLenum
  497. readonly COLOR_ATTACHMENT15_WEBGL: GLenum
  498. readonly COLOR_ATTACHMENT1_WEBGL: GLenum
  499. readonly COLOR_ATTACHMENT2_WEBGL: GLenum
  500. readonly COLOR_ATTACHMENT3_WEBGL: GLenum
  501. readonly COLOR_ATTACHMENT4_WEBGL: GLenum
  502. readonly COLOR_ATTACHMENT5_WEBGL: GLenum
  503. readonly COLOR_ATTACHMENT6_WEBGL: GLenum
  504. readonly COLOR_ATTACHMENT7_WEBGL: GLenum
  505. readonly COLOR_ATTACHMENT8_WEBGL: GLenum
  506. readonly COLOR_ATTACHMENT9_WEBGL: GLenum
  507. readonly DRAW_BUFFER0_WEBGL: GLenum
  508. readonly DRAW_BUFFER10_WEBGL: GLenum
  509. readonly DRAW_BUFFER11_WEBGL: GLenum
  510. readonly DRAW_BUFFER12_WEBGL: GLenum
  511. readonly DRAW_BUFFER13_WEBGL: GLenum
  512. readonly DRAW_BUFFER14_WEBGL: GLenum
  513. readonly DRAW_BUFFER15_WEBGL: GLenum
  514. readonly DRAW_BUFFER1_WEBGL: GLenum
  515. readonly DRAW_BUFFER2_WEBGL: GLenum
  516. readonly DRAW_BUFFER3_WEBGL: GLenum
  517. readonly DRAW_BUFFER4_WEBGL: GLenum
  518. readonly DRAW_BUFFER5_WEBGL: GLenum
  519. readonly DRAW_BUFFER6_WEBGL: GLenum
  520. readonly DRAW_BUFFER7_WEBGL: GLenum
  521. readonly DRAW_BUFFER8_WEBGL: GLenum
  522. readonly DRAW_BUFFER9_WEBGL: GLenum
  523. readonly MAX_COLOR_ATTACHMENTS_WEBGL: GLenum
  524. readonly MAX_DRAW_BUFFERS_WEBGL: GLenum
  525. }
  526. interface WEBGL_lose_context {
  527. loseContext(): void
  528. restoreContext(): void
  529. }
  530. interface WEBGL_multi_draw {
  531. multiDrawArraysInstancedWEBGL(
  532. mode: GLenum,
  533. firstsList: Int32Array | GLint[],
  534. firstsOffset: GLuint,
  535. countsList: Int32Array | GLsizei[],
  536. countsOffset: GLuint,
  537. instanceCountsList: Int32Array | GLsizei[],
  538. instanceCountsOffset: GLuint,
  539. drawcount: GLsizei
  540. ): void
  541. multiDrawArraysWEBGL(
  542. mode: GLenum,
  543. firstsList: Int32Array | GLint[],
  544. firstsOffset: GLuint,
  545. countsList: Int32Array | GLsizei[],
  546. countsOffset: GLuint,
  547. drawcount: GLsizei
  548. ): void
  549. multiDrawElementsInstancedWEBGL(
  550. mode: GLenum,
  551. countsList: Int32Array | GLsizei[],
  552. countsOffset: GLuint,
  553. type: GLenum,
  554. offsetsList: Int32Array | GLsizei[],
  555. offsetsOffset: GLuint,
  556. instanceCountsList: Int32Array | GLsizei[],
  557. instanceCountsOffset: GLuint,
  558. drawcount: GLsizei
  559. ): void
  560. multiDrawElementsWEBGL(
  561. mode: GLenum,
  562. countsList: Int32Array | GLsizei[],
  563. countsOffset: GLuint,
  564. type: GLenum,
  565. offsetsList: Int32Array | GLsizei[],
  566. offsetsOffset: GLuint,
  567. drawcount: GLsizei
  568. ): void
  569. }
  570. type OverSampleType = '2x' | '4x' | 'none'
  571. interface WebGL2RenderingContext
  572. extends WebGL2RenderingContextBase,
  573. WebGL2RenderingContextOverloads,
  574. WebGLRenderingContextBase {}
  575. type Int32List = Int32Array | GLint[]
  576. type Uint32List = Uint32Array | GLuint[]
  577. interface WebGL2RenderingContextBase {
  578. beginQuery(target: GLenum, query: WebGLQuery): void
  579. beginTransformFeedback(primitiveMode: GLenum): void
  580. bindBufferBase(
  581. target: GLenum,
  582. index: GLuint,
  583. buffer: WebGLBuffer | null
  584. ): void
  585. bindBufferRange(
  586. target: GLenum,
  587. index: GLuint,
  588. buffer: WebGLBuffer | null,
  589. offset: GLintptr,
  590. size: GLsizeiptr
  591. ): void
  592. bindSampler(unit: GLuint, sampler: WebGLSampler | null): void
  593. bindTransformFeedback(
  594. target: GLenum,
  595. tf: WebGLTransformFeedback | null
  596. ): void
  597. bindVertexArray(array: WebGLVertexArrayObject | null): void
  598. blitFramebuffer(
  599. srcX0: GLint,
  600. srcY0: GLint,
  601. srcX1: GLint,
  602. srcY1: GLint,
  603. dstX0: GLint,
  604. dstY0: GLint,
  605. dstX1: GLint,
  606. dstY1: GLint,
  607. mask: GLbitfield,
  608. filter: GLenum
  609. ): void
  610. clearBufferfi(
  611. buffer: GLenum,
  612. drawbuffer: GLint,
  613. depth: GLfloat,
  614. stencil: GLint
  615. ): void
  616. clearBufferfv(
  617. buffer: GLenum,
  618. drawbuffer: GLint,
  619. values: Float32List,
  620. srcOffset?: GLuint
  621. ): void
  622. clearBufferiv(
  623. buffer: GLenum,
  624. drawbuffer: GLint,
  625. values: Int32List,
  626. srcOffset?: GLuint
  627. ): void
  628. clearBufferuiv(
  629. buffer: GLenum,
  630. drawbuffer: GLint,
  631. values: Uint32List,
  632. srcOffset?: GLuint
  633. ): void
  634. clientWaitSync(
  635. sync: WebGLSync,
  636. flags: GLbitfield,
  637. timeout: GLuint64
  638. ): GLenum
  639. compressedTexImage3D(
  640. target: GLenum,
  641. level: GLint,
  642. internalformat: GLenum,
  643. width: GLsizei,
  644. height: GLsizei,
  645. depth: GLsizei,
  646. border: GLint,
  647. imageSize: GLsizei,
  648. offset: GLintptr
  649. ): void
  650. compressedTexImage3D(
  651. target: GLenum,
  652. level: GLint,
  653. internalformat: GLenum,
  654. width: GLsizei,
  655. height: GLsizei,
  656. depth: GLsizei,
  657. border: GLint,
  658. srcData: ArrayBufferView,
  659. srcOffset?: GLuint,
  660. srcLengthOverride?: GLuint
  661. ): void
  662. compressedTexSubImage3D(
  663. target: GLenum,
  664. level: GLint,
  665. xoffset: GLint,
  666. yoffset: GLint,
  667. zoffset: GLint,
  668. width: GLsizei,
  669. height: GLsizei,
  670. depth: GLsizei,
  671. format: GLenum,
  672. imageSize: GLsizei,
  673. offset: GLintptr
  674. ): void
  675. compressedTexSubImage3D(
  676. target: GLenum,
  677. level: GLint,
  678. xoffset: GLint,
  679. yoffset: GLint,
  680. zoffset: GLint,
  681. width: GLsizei,
  682. height: GLsizei,
  683. depth: GLsizei,
  684. format: GLenum,
  685. srcData: ArrayBufferView,
  686. srcOffset?: GLuint,
  687. srcLengthOverride?: GLuint
  688. ): void
  689. copyBufferSubData(
  690. readTarget: GLenum,
  691. writeTarget: GLenum,
  692. readOffset: GLintptr,
  693. writeOffset: GLintptr,
  694. size: GLsizeiptr
  695. ): void
  696. copyTexSubImage3D(
  697. target: GLenum,
  698. level: GLint,
  699. xoffset: GLint,
  700. yoffset: GLint,
  701. zoffset: GLint,
  702. x: GLint,
  703. y: GLint,
  704. width: GLsizei,
  705. height: GLsizei
  706. ): void
  707. createQuery(): WebGLQuery | null
  708. createSampler(): WebGLSampler | null
  709. createTransformFeedback(): WebGLTransformFeedback | null
  710. createVertexArray(): WebGLVertexArrayObject | null
  711. deleteQuery(query: WebGLQuery | null): void
  712. deleteSampler(sampler: WebGLSampler | null): void
  713. deleteSync(sync: WebGLSync | null): void
  714. deleteTransformFeedback(tf: WebGLTransformFeedback | null): void
  715. deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void
  716. drawArraysInstanced(
  717. mode: GLenum,
  718. first: GLint,
  719. count: GLsizei,
  720. instanceCount: GLsizei
  721. ): void
  722. drawBuffers(buffers: GLenum[]): void
  723. drawElementsInstanced(
  724. mode: GLenum,
  725. count: GLsizei,
  726. type: GLenum,
  727. offset: GLintptr,
  728. instanceCount: GLsizei
  729. ): void
  730. drawRangeElements(
  731. mode: GLenum,
  732. start: GLuint,
  733. end: GLuint,
  734. count: GLsizei,
  735. type: GLenum,
  736. offset: GLintptr
  737. ): void
  738. endQuery(target: GLenum): void
  739. endTransformFeedback(): void
  740. fenceSync(condition: GLenum, flags: GLbitfield): WebGLSync | null
  741. framebufferTextureLayer(
  742. target: GLenum,
  743. attachment: GLenum,
  744. texture: WebGLTexture | null,
  745. level: GLint,
  746. layer: GLint
  747. ): void
  748. getActiveUniformBlockName(
  749. program: WebGLProgram,
  750. uniformBlockIndex: GLuint
  751. ): string | null
  752. getActiveUniformBlockParameter(
  753. program: WebGLProgram,
  754. uniformBlockIndex: GLuint,
  755. pname: GLenum
  756. ): any
  757. getActiveUniforms(
  758. program: WebGLProgram,
  759. uniformIndices: GLuint[],
  760. pname: GLenum
  761. ): any
  762. getBufferSubData(
  763. target: GLenum,
  764. srcByteOffset: GLintptr,
  765. dstBuffer: ArrayBufferView,
  766. dstOffset?: GLuint,
  767. length?: GLuint
  768. ): void
  769. getFragDataLocation(program: WebGLProgram, name: string): GLint
  770. getIndexedParameter(target: GLenum, index: GLuint): any
  771. getInternalformatParameter(
  772. target: GLenum,
  773. internalformat: GLenum,
  774. pname: GLenum
  775. ): any
  776. getQuery(target: GLenum, pname: GLenum): WebGLQuery | null
  777. getQueryParameter(query: WebGLQuery, pname: GLenum): any
  778. getSamplerParameter(sampler: WebGLSampler, pname: GLenum): any
  779. getSyncParameter(sync: WebGLSync, pname: GLenum): any
  780. getTransformFeedbackVarying(
  781. program: WebGLProgram,
  782. index: GLuint
  783. ): WebGLActiveInfo | null
  784. getUniformBlockIndex(
  785. program: WebGLProgram,
  786. uniformBlockName: string
  787. ): GLuint
  788. getUniformIndices(
  789. program: WebGLProgram,
  790. uniformNames: string[]
  791. ): GLuint[] | null
  792. invalidateFramebuffer(target: GLenum, attachments: GLenum[]): void
  793. invalidateSubFramebuffer(
  794. target: GLenum,
  795. attachments: GLenum[],
  796. x: GLint,
  797. y: GLint,
  798. width: GLsizei,
  799. height: GLsizei
  800. ): void
  801. isQuery(query: WebGLQuery | null): GLboolean
  802. isSampler(sampler: WebGLSampler | null): GLboolean
  803. isSync(sync: WebGLSync | null): GLboolean
  804. isTransformFeedback(tf: WebGLTransformFeedback | null): GLboolean
  805. isVertexArray(vertexArray: WebGLVertexArrayObject | null): GLboolean
  806. pauseTransformFeedback(): void
  807. readBuffer(src: GLenum): void
  808. renderbufferStorageMultisample(
  809. target: GLenum,
  810. samples: GLsizei,
  811. internalformat: GLenum,
  812. width: GLsizei,
  813. height: GLsizei
  814. ): void
  815. resumeTransformFeedback(): void
  816. samplerParameterf(
  817. sampler: WebGLSampler,
  818. pname: GLenum,
  819. param: GLfloat
  820. ): void
  821. samplerParameteri(
  822. sampler: WebGLSampler,
  823. pname: GLenum,
  824. param: GLint
  825. ): void
  826. texImage3D(
  827. target: GLenum,
  828. level: GLint,
  829. internalformat: GLint,
  830. width: GLsizei,
  831. height: GLsizei,
  832. depth: GLsizei,
  833. border: GLint,
  834. format: GLenum,
  835. type: GLenum,
  836. pboOffset: GLintptr
  837. ): void
  838. texImage3D(
  839. target: GLenum,
  840. level: GLint,
  841. internalformat: GLint,
  842. width: GLsizei,
  843. height: GLsizei,
  844. depth: GLsizei,
  845. border: GLint,
  846. format: GLenum,
  847. type: GLenum,
  848. source: TexImageSource
  849. ): void
  850. texImage3D(
  851. target: GLenum,
  852. level: GLint,
  853. internalformat: GLint,
  854. width: GLsizei,
  855. height: GLsizei,
  856. depth: GLsizei,
  857. border: GLint,
  858. format: GLenum,
  859. type: GLenum,
  860. srcData: ArrayBufferView | null
  861. ): void
  862. texImage3D(
  863. target: GLenum,
  864. level: GLint,
  865. internalformat: GLint,
  866. width: GLsizei,
  867. height: GLsizei,
  868. depth: GLsizei,
  869. border: GLint,
  870. format: GLenum,
  871. type: GLenum,
  872. srcData: ArrayBufferView,
  873. srcOffset: GLuint
  874. ): void
  875. texStorage2D(
  876. target: GLenum,
  877. levels: GLsizei,
  878. internalformat: GLenum,
  879. width: GLsizei,
  880. height: GLsizei
  881. ): void
  882. texStorage3D(
  883. target: GLenum,
  884. levels: GLsizei,
  885. internalformat: GLenum,
  886. width: GLsizei,
  887. height: GLsizei,
  888. depth: GLsizei
  889. ): void
  890. texSubImage3D(
  891. target: GLenum,
  892. level: GLint,
  893. xoffset: GLint,
  894. yoffset: GLint,
  895. zoffset: GLint,
  896. width: GLsizei,
  897. height: GLsizei,
  898. depth: GLsizei,
  899. format: GLenum,
  900. type: GLenum,
  901. pboOffset: GLintptr
  902. ): void
  903. texSubImage3D(
  904. target: GLenum,
  905. level: GLint,
  906. xoffset: GLint,
  907. yoffset: GLint,
  908. zoffset: GLint,
  909. width: GLsizei,
  910. height: GLsizei,
  911. depth: GLsizei,
  912. format: GLenum,
  913. type: GLenum,
  914. source: TexImageSource
  915. ): void
  916. texSubImage3D(
  917. target: GLenum,
  918. level: GLint,
  919. xoffset: GLint,
  920. yoffset: GLint,
  921. zoffset: GLint,
  922. width: GLsizei,
  923. height: GLsizei,
  924. depth: GLsizei,
  925. format: GLenum,
  926. type: GLenum,
  927. srcData: ArrayBufferView | null,
  928. srcOffset?: GLuint
  929. ): void
  930. transformFeedbackVaryings(
  931. program: WebGLProgram,
  932. varyings: string[],
  933. bufferMode: GLenum
  934. ): void
  935. uniform1ui(location: WebGLUniformLocation | null, v0: GLuint): void
  936. uniform1uiv(
  937. location: WebGLUniformLocation | null,
  938. data: Uint32List,
  939. srcOffset?: GLuint,
  940. srcLength?: GLuint
  941. ): void
  942. uniform2ui(
  943. location: WebGLUniformLocation | null,
  944. v0: GLuint,
  945. v1: GLuint
  946. ): void
  947. uniform2uiv(
  948. location: WebGLUniformLocation | null,
  949. data: Uint32List,
  950. srcOffset?: GLuint,
  951. srcLength?: GLuint
  952. ): void
  953. uniform3ui(
  954. location: WebGLUniformLocation | null,
  955. v0: GLuint,
  956. v1: GLuint,
  957. v2: GLuint
  958. ): void
  959. uniform3uiv(
  960. location: WebGLUniformLocation | null,
  961. data: Uint32List,
  962. srcOffset?: GLuint,
  963. srcLength?: GLuint
  964. ): void
  965. uniform4ui(
  966. location: WebGLUniformLocation | null,
  967. v0: GLuint,
  968. v1: GLuint,
  969. v2: GLuint,
  970. v3: GLuint
  971. ): void
  972. uniform4uiv(
  973. location: WebGLUniformLocation | null,
  974. data: Uint32List,
  975. srcOffset?: GLuint,
  976. srcLength?: GLuint
  977. ): void
  978. uniformBlockBinding(
  979. program: WebGLProgram,
  980. uniformBlockIndex: GLuint,
  981. uniformBlockBinding: GLuint
  982. ): void
  983. uniformMatrix2x3fv(
  984. location: WebGLUniformLocation | null,
  985. transpose: GLboolean,
  986. data: Float32List,
  987. srcOffset?: GLuint,
  988. srcLength?: GLuint
  989. ): void
  990. uniformMatrix2x4fv(
  991. location: WebGLUniformLocation | null,
  992. transpose: GLboolean,
  993. data: Float32List,
  994. srcOffset?: GLuint,
  995. srcLength?: GLuint
  996. ): void
  997. uniformMatrix3x2fv(
  998. location: WebGLUniformLocation | null,
  999. transpose: GLboolean,
  1000. data: Float32List,
  1001. srcOffset?: GLuint,
  1002. srcLength?: GLuint
  1003. ): void
  1004. uniformMatrix3x4fv(
  1005. location: WebGLUniformLocation | null,
  1006. transpose: GLboolean,
  1007. data: Float32List,
  1008. srcOffset?: GLuint,
  1009. srcLength?: GLuint
  1010. ): void
  1011. uniformMatrix4x2fv(
  1012. location: WebGLUniformLocation | null,
  1013. transpose: GLboolean,
  1014. data: Float32List,
  1015. srcOffset?: GLuint,
  1016. srcLength?: GLuint
  1017. ): void
  1018. uniformMatrix4x3fv(
  1019. location: WebGLUniformLocation | null,
  1020. transpose: GLboolean,
  1021. data: Float32List,
  1022. srcOffset?: GLuint,
  1023. srcLength?: GLuint
  1024. ): void
  1025. vertexAttribDivisor(index: GLuint, divisor: GLuint): void
  1026. vertexAttribI4i(
  1027. index: GLuint,
  1028. x: GLint,
  1029. y: GLint,
  1030. z: GLint,
  1031. w: GLint
  1032. ): void
  1033. vertexAttribI4iv(index: GLuint, values: Int32List): void
  1034. vertexAttribI4ui(
  1035. index: GLuint,
  1036. x: GLuint,
  1037. y: GLuint,
  1038. z: GLuint,
  1039. w: GLuint
  1040. ): void
  1041. vertexAttribI4uiv(index: GLuint, values: Uint32List): void
  1042. vertexAttribIPointer(
  1043. index: GLuint,
  1044. size: GLint,
  1045. type: GLenum,
  1046. stride: GLsizei,
  1047. offset: GLintptr
  1048. ): void
  1049. waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void
  1050. readonly ACTIVE_UNIFORM_BLOCKS: GLenum
  1051. readonly ALREADY_SIGNALED: GLenum
  1052. readonly ANY_SAMPLES_PASSED: GLenum
  1053. readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum
  1054. readonly COLOR: GLenum
  1055. readonly COLOR_ATTACHMENT1: GLenum
  1056. readonly COLOR_ATTACHMENT10: GLenum
  1057. readonly COLOR_ATTACHMENT11: GLenum
  1058. readonly COLOR_ATTACHMENT12: GLenum
  1059. readonly COLOR_ATTACHMENT13: GLenum
  1060. readonly COLOR_ATTACHMENT14: GLenum
  1061. readonly COLOR_ATTACHMENT15: GLenum
  1062. readonly COLOR_ATTACHMENT2: GLenum
  1063. readonly COLOR_ATTACHMENT3: GLenum
  1064. readonly COLOR_ATTACHMENT4: GLenum
  1065. readonly COLOR_ATTACHMENT5: GLenum
  1066. readonly COLOR_ATTACHMENT6: GLenum
  1067. readonly COLOR_ATTACHMENT7: GLenum
  1068. readonly COLOR_ATTACHMENT8: GLenum
  1069. readonly COLOR_ATTACHMENT9: GLenum
  1070. readonly COMPARE_REF_TO_TEXTURE: GLenum
  1071. readonly CONDITION_SATISFIED: GLenum
  1072. readonly COPY_READ_BUFFER: GLenum
  1073. readonly COPY_READ_BUFFER_BINDING: GLenum
  1074. readonly COPY_WRITE_BUFFER: GLenum
  1075. readonly COPY_WRITE_BUFFER_BINDING: GLenum
  1076. readonly CURRENT_QUERY: GLenum
  1077. readonly DEPTH: GLenum
  1078. readonly DEPTH24_STENCIL8: GLenum
  1079. readonly DEPTH32F_STENCIL8: GLenum
  1080. readonly DEPTH_COMPONENT24: GLenum
  1081. readonly DEPTH_COMPONENT32F: GLenum
  1082. readonly DRAW_BUFFER0: GLenum
  1083. readonly DRAW_BUFFER1: GLenum
  1084. readonly DRAW_BUFFER10: GLenum
  1085. readonly DRAW_BUFFER11: GLenum
  1086. readonly DRAW_BUFFER12: GLenum
  1087. readonly DRAW_BUFFER13: GLenum
  1088. readonly DRAW_BUFFER14: GLenum
  1089. readonly DRAW_BUFFER15: GLenum
  1090. readonly DRAW_BUFFER2: GLenum
  1091. readonly DRAW_BUFFER3: GLenum
  1092. readonly DRAW_BUFFER4: GLenum
  1093. readonly DRAW_BUFFER5: GLenum
  1094. readonly DRAW_BUFFER6: GLenum
  1095. readonly DRAW_BUFFER7: GLenum
  1096. readonly DRAW_BUFFER8: GLenum
  1097. readonly DRAW_BUFFER9: GLenum
  1098. readonly DRAW_FRAMEBUFFER: GLenum
  1099. readonly DRAW_FRAMEBUFFER_BINDING: GLenum
  1100. readonly DYNAMIC_COPY: GLenum
  1101. readonly DYNAMIC_READ: GLenum
  1102. readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum
  1103. readonly FLOAT_MAT2x3: GLenum
  1104. readonly FLOAT_MAT2x4: GLenum
  1105. readonly FLOAT_MAT3x2: GLenum
  1106. readonly FLOAT_MAT3x4: GLenum
  1107. readonly FLOAT_MAT4x2: GLenum
  1108. readonly FLOAT_MAT4x3: GLenum
  1109. readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum
  1110. readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum
  1111. readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum
  1112. readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum
  1113. readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum
  1114. readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum
  1115. readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum
  1116. readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum
  1117. readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum
  1118. readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum
  1119. readonly FRAMEBUFFER_DEFAULT: GLenum
  1120. readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum
  1121. readonly HALF_FLOAT: GLenum
  1122. readonly INTERLEAVED_ATTRIBS: GLenum
  1123. readonly INT_2_10_10_10_REV: GLenum
  1124. readonly INT_SAMPLER_2D: GLenum
  1125. readonly INT_SAMPLER_2D_ARRAY: GLenum
  1126. readonly INT_SAMPLER_3D: GLenum
  1127. readonly INT_SAMPLER_CUBE: GLenum
  1128. readonly INVALID_INDEX: GLenum
  1129. readonly MAX: GLenum
  1130. readonly MAX_3D_TEXTURE_SIZE: GLenum
  1131. readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum
  1132. readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum
  1133. readonly MAX_COLOR_ATTACHMENTS: GLenum
  1134. readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum
  1135. readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum
  1136. readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum
  1137. readonly MAX_DRAW_BUFFERS: GLenum
  1138. readonly MAX_ELEMENTS_INDICES: GLenum
  1139. readonly MAX_ELEMENTS_VERTICES: GLenum
  1140. readonly MAX_ELEMENT_INDEX: GLenum
  1141. readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum
  1142. readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum
  1143. readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum
  1144. readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum
  1145. readonly MAX_SAMPLES: GLenum
  1146. readonly MAX_SERVER_WAIT_TIMEOUT: GLenum
  1147. readonly MAX_TEXTURE_LOD_BIAS: GLenum
  1148. readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum
  1149. readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum
  1150. readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum
  1151. readonly MAX_UNIFORM_BLOCK_SIZE: GLenum
  1152. readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum
  1153. readonly MAX_VARYING_COMPONENTS: GLenum
  1154. readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum
  1155. readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum
  1156. readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum
  1157. readonly MIN: GLenum
  1158. readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum
  1159. readonly OBJECT_TYPE: GLenum
  1160. readonly PACK_ROW_LENGTH: GLenum
  1161. readonly PACK_SKIP_PIXELS: GLenum
  1162. readonly PACK_SKIP_ROWS: GLenum
  1163. readonly PIXEL_PACK_BUFFER: GLenum
  1164. readonly PIXEL_PACK_BUFFER_BINDING: GLenum
  1165. readonly PIXEL_UNPACK_BUFFER: GLenum
  1166. readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum
  1167. readonly QUERY_RESULT: GLenum
  1168. readonly QUERY_RESULT_AVAILABLE: GLenum
  1169. readonly R11F_G11F_B10F: GLenum
  1170. readonly R16F: GLenum
  1171. readonly R16I: GLenum
  1172. readonly R16UI: GLenum
  1173. readonly R32F: GLenum
  1174. readonly R32I: GLenum
  1175. readonly R32UI: GLenum
  1176. readonly R8: GLenum
  1177. readonly R8I: GLenum
  1178. readonly R8UI: GLenum
  1179. readonly R8_SNORM: GLenum
  1180. readonly RASTERIZER_DISCARD: GLenum
  1181. readonly READ_BUFFER: GLenum
  1182. readonly READ_FRAMEBUFFER: GLenum
  1183. readonly READ_FRAMEBUFFER_BINDING: GLenum
  1184. readonly RED: GLenum
  1185. readonly RED_INTEGER: GLenum
  1186. readonly RENDERBUFFER_SAMPLES: GLenum
  1187. readonly RG: GLenum
  1188. readonly RG16F: GLenum
  1189. readonly RG16I: GLenum
  1190. readonly RG16UI: GLenum
  1191. readonly RG32F: GLenum
  1192. readonly RG32I: GLenum
  1193. readonly RG32UI: GLenum
  1194. readonly RG8: GLenum
  1195. readonly RG8I: GLenum
  1196. readonly RG8UI: GLenum
  1197. readonly RG8_SNORM: GLenum
  1198. readonly RGB10_A2: GLenum
  1199. readonly RGB10_A2UI: GLenum
  1200. readonly RGB16F: GLenum
  1201. readonly RGB16I: GLenum
  1202. readonly RGB16UI: GLenum
  1203. readonly RGB32F: GLenum
  1204. readonly RGB32I: GLenum
  1205. readonly RGB32UI: GLenum
  1206. readonly RGB8: GLenum
  1207. readonly RGB8I: GLenum
  1208. readonly RGB8UI: GLenum
  1209. readonly RGB8_SNORM: GLenum
  1210. readonly RGB9_E5: GLenum
  1211. readonly RGBA16F: GLenum
  1212. readonly RGBA16I: GLenum
  1213. readonly RGBA16UI: GLenum
  1214. readonly RGBA32F: GLenum
  1215. readonly RGBA32I: GLenum
  1216. readonly RGBA32UI: GLenum
  1217. readonly RGBA8: GLenum
  1218. readonly RGBA8I: GLenum
  1219. readonly RGBA8UI: GLenum
  1220. readonly RGBA8_SNORM: GLenum
  1221. readonly RGBA_INTEGER: GLenum
  1222. readonly RGB_INTEGER: GLenum
  1223. readonly RG_INTEGER: GLenum
  1224. readonly SAMPLER_2D_ARRAY: GLenum
  1225. readonly SAMPLER_2D_ARRAY_SHADOW: GLenum
  1226. readonly SAMPLER_2D_SHADOW: GLenum
  1227. readonly SAMPLER_3D: GLenum
  1228. readonly SAMPLER_BINDING: GLenum
  1229. readonly SAMPLER_CUBE_SHADOW: GLenum
  1230. readonly SEPARATE_ATTRIBS: GLenum
  1231. readonly SIGNALED: GLenum
  1232. readonly SIGNED_NORMALIZED: GLenum
  1233. readonly SRGB: GLenum
  1234. readonly SRGB8: GLenum
  1235. readonly SRGB8_ALPHA8: GLenum
  1236. readonly STATIC_COPY: GLenum
  1237. readonly STATIC_READ: GLenum
  1238. readonly STENCIL: GLenum
  1239. readonly STREAM_COPY: GLenum
  1240. readonly STREAM_READ: GLenum
  1241. readonly SYNC_CONDITION: GLenum
  1242. readonly SYNC_FENCE: GLenum
  1243. readonly SYNC_FLAGS: GLenum
  1244. readonly SYNC_FLUSH_COMMANDS_BIT: GLenum
  1245. readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum
  1246. readonly SYNC_STATUS: GLenum
  1247. readonly TEXTURE_2D_ARRAY: GLenum
  1248. readonly TEXTURE_3D: GLenum
  1249. readonly TEXTURE_BASE_LEVEL: GLenum
  1250. readonly TEXTURE_BINDING_2D_ARRAY: GLenum
  1251. readonly TEXTURE_BINDING_3D: GLenum
  1252. readonly TEXTURE_COMPARE_FUNC: GLenum
  1253. readonly TEXTURE_COMPARE_MODE: GLenum
  1254. readonly TEXTURE_IMMUTABLE_FORMAT: GLenum
  1255. readonly TEXTURE_IMMUTABLE_LEVELS: GLenum
  1256. readonly TEXTURE_MAX_LEVEL: GLenum
  1257. readonly TEXTURE_MAX_LOD: GLenum
  1258. readonly TEXTURE_MIN_LOD: GLenum
  1259. readonly TEXTURE_WRAP_R: GLenum
  1260. readonly TIMEOUT_EXPIRED: GLenum
  1261. readonly TIMEOUT_IGNORED: GLint64
  1262. readonly TRANSFORM_FEEDBACK: GLenum
  1263. readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum
  1264. readonly TRANSFORM_FEEDBACK_BINDING: GLenum
  1265. readonly TRANSFORM_FEEDBACK_BUFFER: GLenum
  1266. readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum
  1267. readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum
  1268. readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum
  1269. readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum
  1270. readonly TRANSFORM_FEEDBACK_PAUSED: GLenum
  1271. readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum
  1272. readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum
  1273. readonly UNIFORM_ARRAY_STRIDE: GLenum
  1274. readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum
  1275. readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum
  1276. readonly UNIFORM_BLOCK_BINDING: GLenum
  1277. readonly UNIFORM_BLOCK_DATA_SIZE: GLenum
  1278. readonly UNIFORM_BLOCK_INDEX: GLenum
  1279. readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum
  1280. readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum
  1281. readonly UNIFORM_BUFFER: GLenum
  1282. readonly UNIFORM_BUFFER_BINDING: GLenum
  1283. readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum
  1284. readonly UNIFORM_BUFFER_SIZE: GLenum
  1285. readonly UNIFORM_BUFFER_START: GLenum
  1286. readonly UNIFORM_IS_ROW_MAJOR: GLenum
  1287. readonly UNIFORM_MATRIX_STRIDE: GLenum
  1288. readonly UNIFORM_OFFSET: GLenum
  1289. readonly UNIFORM_SIZE: GLenum
  1290. readonly UNIFORM_TYPE: GLenum
  1291. readonly UNPACK_IMAGE_HEIGHT: GLenum
  1292. readonly UNPACK_ROW_LENGTH: GLenum
  1293. readonly UNPACK_SKIP_IMAGES: GLenum
  1294. readonly UNPACK_SKIP_PIXELS: GLenum
  1295. readonly UNPACK_SKIP_ROWS: GLenum
  1296. readonly UNSIGNALED: GLenum
  1297. readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum
  1298. readonly UNSIGNED_INT_24_8: GLenum
  1299. readonly UNSIGNED_INT_2_10_10_10_REV: GLenum
  1300. readonly UNSIGNED_INT_5_9_9_9_REV: GLenum
  1301. readonly UNSIGNED_INT_SAMPLER_2D: GLenum
  1302. readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum
  1303. readonly UNSIGNED_INT_SAMPLER_3D: GLenum
  1304. readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum
  1305. readonly UNSIGNED_INT_VEC2: GLenum
  1306. readonly UNSIGNED_INT_VEC3: GLenum
  1307. readonly UNSIGNED_INT_VEC4: GLenum
  1308. readonly UNSIGNED_NORMALIZED: GLenum
  1309. readonly VERTEX_ARRAY_BINDING: GLenum
  1310. readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum
  1311. readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum
  1312. readonly WAIT_FAILED: GLenum
  1313. }
  1314. interface WebGL2RenderingContextOverloads {
  1315. bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void
  1316. bufferData(
  1317. target: GLenum,
  1318. srcData: BufferSource | null,
  1319. usage: GLenum
  1320. ): void
  1321. bufferData(
  1322. target: GLenum,
  1323. srcData: ArrayBufferView,
  1324. usage: GLenum,
  1325. srcOffset: GLuint,
  1326. length?: GLuint
  1327. ): void
  1328. bufferSubData(
  1329. target: GLenum,
  1330. dstByteOffset: GLintptr,
  1331. srcData: BufferSource
  1332. ): void
  1333. bufferSubData(
  1334. target: GLenum,
  1335. dstByteOffset: GLintptr,
  1336. srcData: ArrayBufferView,
  1337. srcOffset: GLuint,
  1338. length?: GLuint
  1339. ): void
  1340. compressedTexImage2D(
  1341. target: GLenum,
  1342. level: GLint,
  1343. internalformat: GLenum,
  1344. width: GLsizei,
  1345. height: GLsizei,
  1346. border: GLint,
  1347. imageSize: GLsizei,
  1348. offset: GLintptr
  1349. ): void
  1350. compressedTexImage2D(
  1351. target: GLenum,
  1352. level: GLint,
  1353. internalformat: GLenum,
  1354. width: GLsizei,
  1355. height: GLsizei,
  1356. border: GLint,
  1357. srcData: ArrayBufferView,
  1358. srcOffset?: GLuint,
  1359. srcLengthOverride?: GLuint
  1360. ): void
  1361. compressedTexSubImage2D(
  1362. target: GLenum,
  1363. level: GLint,
  1364. xoffset: GLint,
  1365. yoffset: GLint,
  1366. width: GLsizei,
  1367. height: GLsizei,
  1368. format: GLenum,
  1369. imageSize: GLsizei,
  1370. offset: GLintptr
  1371. ): void
  1372. compressedTexSubImage2D(
  1373. target: GLenum,
  1374. level: GLint,
  1375. xoffset: GLint,
  1376. yoffset: GLint,
  1377. width: GLsizei,
  1378. height: GLsizei,
  1379. format: GLenum,
  1380. srcData: ArrayBufferView,
  1381. srcOffset?: GLuint,
  1382. srcLengthOverride?: GLuint
  1383. ): void
  1384. readPixels(
  1385. x: GLint,
  1386. y: GLint,
  1387. width: GLsizei,
  1388. height: GLsizei,
  1389. format: GLenum,
  1390. type: GLenum,
  1391. dstData: ArrayBufferView | null
  1392. ): void
  1393. readPixels(
  1394. x: GLint,
  1395. y: GLint,
  1396. width: GLsizei,
  1397. height: GLsizei,
  1398. format: GLenum,
  1399. type: GLenum,
  1400. offset: GLintptr
  1401. ): void
  1402. readPixels(
  1403. x: GLint,
  1404. y: GLint,
  1405. width: GLsizei,
  1406. height: GLsizei,
  1407. format: GLenum,
  1408. type: GLenum,
  1409. dstData: ArrayBufferView,
  1410. dstOffset: GLuint
  1411. ): void
  1412. texImage2D(
  1413. target: GLenum,
  1414. level: GLint,
  1415. internalformat: GLint,
  1416. width: GLsizei,
  1417. height: GLsizei,
  1418. border: GLint,
  1419. format: GLenum,
  1420. type: GLenum,
  1421. pixels: ArrayBufferView | null
  1422. ): void
  1423. texImage2D(
  1424. target: GLenum,
  1425. level: GLint,
  1426. internalformat: GLint,
  1427. format: GLenum,
  1428. type: GLenum,
  1429. source: TexImageSource
  1430. ): void
  1431. texImage2D(
  1432. target: GLenum,
  1433. level: GLint,
  1434. internalformat: GLint,
  1435. width: GLsizei,
  1436. height: GLsizei,
  1437. border: GLint,
  1438. format: GLenum,
  1439. type: GLenum,
  1440. pboOffset: GLintptr
  1441. ): void
  1442. texImage2D(
  1443. target: GLenum,
  1444. level: GLint,
  1445. internalformat: GLint,
  1446. width: GLsizei,
  1447. height: GLsizei,
  1448. border: GLint,
  1449. format: GLenum,
  1450. type: GLenum,
  1451. source: TexImageSource
  1452. ): void
  1453. texImage2D(
  1454. target: GLenum,
  1455. level: GLint,
  1456. internalformat: GLint,
  1457. width: GLsizei,
  1458. height: GLsizei,
  1459. border: GLint,
  1460. format: GLenum,
  1461. type: GLenum,
  1462. srcData: ArrayBufferView,
  1463. srcOffset: GLuint
  1464. ): void
  1465. texSubImage2D(
  1466. target: GLenum,
  1467. level: GLint,
  1468. xoffset: GLint,
  1469. yoffset: GLint,
  1470. width: GLsizei,
  1471. height: GLsizei,
  1472. format: GLenum,
  1473. type: GLenum,
  1474. pixels: ArrayBufferView | null
  1475. ): void
  1476. texSubImage2D(
  1477. target: GLenum,
  1478. level: GLint,
  1479. xoffset: GLint,
  1480. yoffset: GLint,
  1481. format: GLenum,
  1482. type: GLenum,
  1483. source: TexImageSource
  1484. ): void
  1485. texSubImage2D(
  1486. target: GLenum,
  1487. level: GLint,
  1488. xoffset: GLint,
  1489. yoffset: GLint,
  1490. width: GLsizei,
  1491. height: GLsizei,
  1492. format: GLenum,
  1493. type: GLenum,
  1494. pboOffset: GLintptr
  1495. ): void
  1496. texSubImage2D(
  1497. target: GLenum,
  1498. level: GLint,
  1499. xoffset: GLint,
  1500. yoffset: GLint,
  1501. width: GLsizei,
  1502. height: GLsizei,
  1503. format: GLenum,
  1504. type: GLenum,
  1505. source: TexImageSource
  1506. ): void
  1507. texSubImage2D(
  1508. target: GLenum,
  1509. level: GLint,
  1510. xoffset: GLint,
  1511. yoffset: GLint,
  1512. width: GLsizei,
  1513. height: GLsizei,
  1514. format: GLenum,
  1515. type: GLenum,
  1516. srcData: ArrayBufferView,
  1517. srcOffset: GLuint
  1518. ): void
  1519. uniform1fv(
  1520. location: WebGLUniformLocation | null,
  1521. data: Float32List,
  1522. srcOffset?: GLuint,
  1523. srcLength?: GLuint
  1524. ): void
  1525. uniform1iv(
  1526. location: WebGLUniformLocation | null,
  1527. data: Int32List,
  1528. srcOffset?: GLuint,
  1529. srcLength?: GLuint
  1530. ): void
  1531. uniform2fv(
  1532. location: WebGLUniformLocation | null,
  1533. data: Float32List,
  1534. srcOffset?: GLuint,
  1535. srcLength?: GLuint
  1536. ): void
  1537. uniform2iv(
  1538. location: WebGLUniformLocation | null,
  1539. data: Int32List,
  1540. srcOffset?: GLuint,
  1541. srcLength?: GLuint
  1542. ): void
  1543. uniform3fv(
  1544. location: WebGLUniformLocation | null,
  1545. data: Float32List,
  1546. srcOffset?: GLuint,
  1547. srcLength?: GLuint
  1548. ): void
  1549. uniform3iv(
  1550. location: WebGLUniformLocation | null,
  1551. data: Int32List,
  1552. srcOffset?: GLuint,
  1553. srcLength?: GLuint
  1554. ): void
  1555. uniform4fv(
  1556. location: WebGLUniformLocation | null,
  1557. data: Float32List,
  1558. srcOffset?: GLuint,
  1559. srcLength?: GLuint
  1560. ): void
  1561. uniform4iv(
  1562. location: WebGLUniformLocation | null,
  1563. data: Int32List,
  1564. srcOffset?: GLuint,
  1565. srcLength?: GLuint
  1566. ): void
  1567. uniformMatrix2fv(
  1568. location: WebGLUniformLocation | null,
  1569. transpose: GLboolean,
  1570. data: Float32List,
  1571. srcOffset?: GLuint,
  1572. srcLength?: GLuint
  1573. ): void
  1574. uniformMatrix3fv(
  1575. location: WebGLUniformLocation | null,
  1576. transpose: GLboolean,
  1577. data: Float32List,
  1578. srcOffset?: GLuint,
  1579. srcLength?: GLuint
  1580. ): void
  1581. uniformMatrix4fv(
  1582. location: WebGLUniformLocation | null,
  1583. transpose: GLboolean,
  1584. data: Float32List,
  1585. srcOffset?: GLuint,
  1586. srcLength?: GLuint
  1587. ): void
  1588. }
  1589. /** Part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getActiveAttrib() and WebGLRenderingContext.getActiveUniform() methods. */
  1590. interface WebGLActiveInfo {
  1591. readonly name: string
  1592. readonly size: GLint
  1593. readonly type: GLenum
  1594. }
  1595. /** Part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */
  1596. interface WebGLBuffer {}
  1597. /** Part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */
  1598. interface WebGLFramebuffer {}
  1599. /** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */
  1600. interface WebGLProgram {}
  1601. interface WebGLQuery {}
  1602. /** Part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */
  1603. interface WebGLRenderbuffer {}
  1604. /** Provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of an HTML <canvas> element. */
  1605. interface WebGLRenderingContext
  1606. extends WebGLRenderingContextBase,
  1607. WebGLRenderingContextOverloads {}
  1608. /** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */
  1609. interface ANGLE_instanced_arrays {
  1610. drawArraysInstancedANGLE(
  1611. mode: GLenum,
  1612. first: GLint,
  1613. count: GLsizei,
  1614. primcount: GLsizei
  1615. ): void
  1616. drawElementsInstancedANGLE(
  1617. mode: GLenum,
  1618. count: GLsizei,
  1619. type: GLenum,
  1620. offset: GLintptr,
  1621. primcount: GLsizei
  1622. ): void
  1623. vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void
  1624. readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum
  1625. }
  1626. interface EXT_blend_minmax {
  1627. readonly MAX_EXT: GLenum
  1628. readonly MIN_EXT: GLenum
  1629. }
  1630. interface EXT_color_buffer_float {}
  1631. interface EXT_color_buffer_half_float {
  1632. readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum
  1633. readonly RGB16F_EXT: GLenum
  1634. readonly RGBA16F_EXT: GLenum
  1635. readonly UNSIGNED_NORMALIZED_EXT: GLenum
  1636. }
  1637. interface EXT_float_blend {}
  1638. /** The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. */
  1639. interface EXT_frag_depth {}
  1640. interface EXT_sRGB {
  1641. readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum
  1642. readonly SRGB8_ALPHA8_EXT: GLenum
  1643. readonly SRGB_ALPHA_EXT: GLenum
  1644. readonly SRGB_EXT: GLenum
  1645. }
  1646. interface EXT_shader_texture_lod {}
  1647. interface EXT_texture_compression_bptc {
  1648. readonly COMPRESSED_RGBA_BPTC_UNORM_EXT: GLenum
  1649. readonly COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: GLenum
  1650. readonly COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: GLenum
  1651. readonly COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: GLenum
  1652. }
  1653. interface EXT_texture_compression_rgtc {
  1654. readonly COMPRESSED_RED_GREEN_RGTC2_EXT: GLenum
  1655. readonly COMPRESSED_RED_RGTC1_EXT: GLenum
  1656. readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GLenum
  1657. readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: GLenum
  1658. }
  1659. /** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */
  1660. interface EXT_texture_filter_anisotropic {
  1661. readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum
  1662. readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum
  1663. }
  1664. interface EXT_texture_norm16 {
  1665. readonly R16_EXT: GLenum
  1666. readonly R16_SNORM_EXT: GLenum
  1667. readonly RG16_EXT: GLenum
  1668. readonly RG16_SNORM_EXT: GLenum
  1669. readonly RGB16_EXT: GLenum
  1670. readonly RGB16_SNORM_EXT: GLenum
  1671. readonly RGBA16_EXT: GLenum
  1672. readonly RGBA16_SNORM_EXT: GLenum
  1673. }
  1674. interface KHR_parallel_shader_compile {
  1675. readonly COMPLETION_STATUS_KHR: GLenum
  1676. }
  1677. interface OES_draw_buffers_indexed {
  1678. blendEquationSeparateiOES(
  1679. buf: GLuint,
  1680. modeRGB: GLenum,
  1681. modeAlpha: GLenum
  1682. ): void
  1683. blendEquationiOES(buf: GLuint, mode: GLenum): void
  1684. blendFuncSeparateiOES(
  1685. buf: GLuint,
  1686. srcRGB: GLenum,
  1687. dstRGB: GLenum,
  1688. srcAlpha: GLenum,
  1689. dstAlpha: GLenum
  1690. ): void
  1691. blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum): void
  1692. colorMaskiOES(
  1693. buf: GLuint,
  1694. r: GLboolean,
  1695. g: GLboolean,
  1696. b: GLboolean,
  1697. a: GLboolean
  1698. ): void
  1699. disableiOES(target: GLenum, index: GLuint): void
  1700. enableiOES(target: GLenum, index: GLuint): void
  1701. }
  1702. /** The OES_element_index_uint extension is part of the WebGL API and adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements(). */
  1703. interface OES_element_index_uint {}
  1704. interface OES_fbo_render_mipmap {}
  1705. /** The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth. */
  1706. interface OES_standard_derivatives {
  1707. readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum
  1708. }
  1709. /** The OES_texture_float extension is part of the WebGL API and exposes floating-point pixel types for textures. */
  1710. interface OES_texture_float {}
  1711. /** The OES_texture_float_linear extension is part of the WebGL API and allows linear filtering with floating-point pixel types for textures. */
  1712. interface OES_texture_float_linear {}
  1713. /** The OES_texture_half_float extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components. */
  1714. interface OES_texture_half_float {
  1715. readonly HALF_FLOAT_OES: GLenum
  1716. }
  1717. /** The OES_texture_half_float_linear extension is part of the WebGL API and allows linear filtering with half floating-point pixel types for textures. */
  1718. interface OES_texture_half_float_linear {}
  1719. interface OES_vertex_array_object {
  1720. bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void
  1721. createVertexArrayOES(): WebGLVertexArrayObjectOES | null
  1722. deleteVertexArrayOES(
  1723. arrayObject: WebGLVertexArrayObjectOES | null
  1724. ): void
  1725. isVertexArrayOES(
  1726. arrayObject: WebGLVertexArrayObjectOES | null
  1727. ): GLboolean
  1728. readonly VERTEX_ARRAY_BINDING_OES: GLenum
  1729. }
  1730. interface OVR_multiview2 {
  1731. framebufferTextureMultiviewOVR(
  1732. target: GLenum,
  1733. attachment: GLenum,
  1734. texture: WebGLTexture | null,
  1735. level: GLint,
  1736. baseViewIndex: GLint,
  1737. numViews: GLsizei
  1738. ): void
  1739. readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: GLenum
  1740. readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: GLenum
  1741. readonly FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: GLenum
  1742. readonly MAX_VIEWS_OVR: GLenum
  1743. }
  1744. type WebGLPowerPreference = 'default' | 'high-performance' | 'low-power'
  1745. interface WebGLContextAttributes {
  1746. alpha?: boolean
  1747. antialias?: boolean
  1748. depth?: boolean
  1749. desynchronized?: boolean
  1750. failIfMajorPerformanceCaveat?: boolean
  1751. powerPreference?: WebGLPowerPreference
  1752. premultipliedAlpha?: boolean
  1753. preserveDrawingBuffer?: boolean
  1754. stencil?: boolean
  1755. }
  1756. interface WebGLRenderingContextBase {
  1757. readonly canvas: Canvas
  1758. readonly drawingBufferHeight: GLsizei
  1759. readonly drawingBufferWidth: GLsizei
  1760. activeTexture(texture: GLenum): void
  1761. attachShader(program: WebGLProgram, shader: WebGLShader): void
  1762. bindAttribLocation(
  1763. program: WebGLProgram,
  1764. index: GLuint,
  1765. name: string
  1766. ): void
  1767. bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void
  1768. bindFramebuffer(
  1769. target: GLenum,
  1770. framebuffer: WebGLFramebuffer | null
  1771. ): void
  1772. bindRenderbuffer(
  1773. target: GLenum,
  1774. renderbuffer: WebGLRenderbuffer | null
  1775. ): void
  1776. bindTexture(target: GLenum, texture: WebGLTexture | null): void
  1777. blendColor(
  1778. red: GLclampf,
  1779. green: GLclampf,
  1780. blue: GLclampf,
  1781. alpha: GLclampf
  1782. ): void
  1783. blendEquation(mode: GLenum): void
  1784. blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum): void
  1785. blendFunc(sfactor: GLenum, dfactor: GLenum): void
  1786. blendFuncSeparate(
  1787. srcRGB: GLenum,
  1788. dstRGB: GLenum,
  1789. srcAlpha: GLenum,
  1790. dstAlpha: GLenum
  1791. ): void
  1792. checkFramebufferStatus(target: GLenum): GLenum
  1793. clear(mask: GLbitfield): void
  1794. clearColor(
  1795. red: GLclampf,
  1796. green: GLclampf,
  1797. blue: GLclampf,
  1798. alpha: GLclampf
  1799. ): void
  1800. clearDepth(depth: GLclampf): void
  1801. clearStencil(s: GLint): void
  1802. colorMask(
  1803. red: GLboolean,
  1804. green: GLboolean,
  1805. blue: GLboolean,
  1806. alpha: GLboolean
  1807. ): void
  1808. compileShader(shader: WebGLShader): void
  1809. copyTexImage2D(
  1810. target: GLenum,
  1811. level: GLint,
  1812. internalformat: GLenum,
  1813. x: GLint,
  1814. y: GLint,
  1815. width: GLsizei,
  1816. height: GLsizei,
  1817. border: GLint
  1818. ): void
  1819. copyTexSubImage2D(
  1820. target: GLenum,
  1821. level: GLint,
  1822. xoffset: GLint,
  1823. yoffset: GLint,
  1824. x: GLint,
  1825. y: GLint,
  1826. width: GLsizei,
  1827. height: GLsizei
  1828. ): void
  1829. createBuffer(): WebGLBuffer | null
  1830. createFramebuffer(): WebGLFramebuffer | null
  1831. createProgram(): WebGLProgram | null
  1832. createRenderbuffer(): WebGLRenderbuffer | null
  1833. createShader(type: GLenum): WebGLShader | null
  1834. createTexture(): WebGLTexture | null
  1835. cullFace(mode: GLenum): void
  1836. deleteBuffer(buffer: WebGLBuffer | null): void
  1837. deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void
  1838. deleteProgram(program: WebGLProgram | null): void
  1839. deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void
  1840. deleteShader(shader: WebGLShader | null): void
  1841. deleteTexture(texture: WebGLTexture | null): void
  1842. depthFunc(func: GLenum): void
  1843. depthMask(flag: GLboolean): void
  1844. depthRange(zNear: GLclampf, zFar: GLclampf): void
  1845. detachShader(program: WebGLProgram, shader: WebGLShader): void
  1846. disable(cap: GLenum): void
  1847. disableVertexAttribArray(index: GLuint): void
  1848. drawArrays(mode: GLenum, first: GLint, count: GLsizei): void
  1849. drawElements(
  1850. mode: GLenum,
  1851. count: GLsizei,
  1852. type: GLenum,
  1853. offset: GLintptr
  1854. ): void
  1855. enable(cap: GLenum): void
  1856. enableVertexAttribArray(index: GLuint): void
  1857. finish(): void
  1858. flush(): void
  1859. framebufferRenderbuffer(
  1860. target: GLenum,
  1861. attachment: GLenum,
  1862. renderbuffertarget: GLenum,
  1863. renderbuffer: WebGLRenderbuffer | null
  1864. ): void
  1865. framebufferTexture2D(
  1866. target: GLenum,
  1867. attachment: GLenum,
  1868. textarget: GLenum,
  1869. texture: WebGLTexture | null,
  1870. level: GLint
  1871. ): void
  1872. frontFace(mode: GLenum): void
  1873. generateMipmap(target: GLenum): void
  1874. getActiveAttrib(
  1875. program: WebGLProgram,
  1876. index: GLuint
  1877. ): WebGLActiveInfo | null
  1878. getActiveUniform(
  1879. program: WebGLProgram,
  1880. index: GLuint
  1881. ): WebGLActiveInfo | null
  1882. getAttachedShaders(program: WebGLProgram): WebGLShader[] | null
  1883. getAttribLocation(program: WebGLProgram, name: string): GLint
  1884. getBufferParameter(target: GLenum, pname: GLenum): any
  1885. getContextAttributes(): WebGLContextAttributes | null
  1886. getError(): GLenum
  1887. getExtension(
  1888. extensionName: 'ANGLE_instanced_arrays'
  1889. ): ANGLE_instanced_arrays | null
  1890. getExtension(extensionName: 'EXT_blend_minmax'): EXT_blend_minmax | null
  1891. getExtension(
  1892. extensionName: 'EXT_color_buffer_float'
  1893. ): EXT_color_buffer_float | null
  1894. getExtension(
  1895. extensionName: 'EXT_color_buffer_half_float'
  1896. ): EXT_color_buffer_half_float | null
  1897. getExtension(extensionName: 'EXT_float_blend'): EXT_float_blend | null
  1898. getExtension(extensionName: 'EXT_frag_depth'): EXT_frag_depth | null
  1899. getExtension(extensionName: 'EXT_sRGB'): EXT_sRGB | null
  1900. getExtension(
  1901. extensionName: 'EXT_shader_texture_lod'
  1902. ): EXT_shader_texture_lod | null
  1903. getExtension(
  1904. extensionName: 'EXT_texture_compression_bptc'
  1905. ): EXT_texture_compression_bptc | null
  1906. getExtension(
  1907. extensionName: 'EXT_texture_compression_rgtc'
  1908. ): EXT_texture_compression_rgtc | null
  1909. getExtension(
  1910. extensionName: 'EXT_texture_filter_anisotropic'
  1911. ): EXT_texture_filter_anisotropic | null
  1912. getExtension(
  1913. extensionName: 'KHR_parallel_shader_compile'
  1914. ): KHR_parallel_shader_compile | null
  1915. getExtension(
  1916. extensionName: 'OES_element_index_uint'
  1917. ): OES_element_index_uint | null
  1918. getExtension(
  1919. extensionName: 'OES_fbo_render_mipmap'
  1920. ): OES_fbo_render_mipmap | null
  1921. getExtension(
  1922. extensionName: 'OES_standard_derivatives'
  1923. ): OES_standard_derivatives | null
  1924. getExtension(
  1925. extensionName: 'OES_texture_float'
  1926. ): OES_texture_float | null
  1927. getExtension(
  1928. extensionName: 'OES_texture_float_linear'
  1929. ): OES_texture_float_linear | null
  1930. getExtension(
  1931. extensionName: 'OES_texture_half_float'
  1932. ): OES_texture_half_float | null
  1933. getExtension(
  1934. extensionName: 'OES_texture_half_float_linear'
  1935. ): OES_texture_half_float_linear | null
  1936. getExtension(
  1937. extensionName: 'OES_vertex_array_object'
  1938. ): OES_vertex_array_object | null
  1939. getExtension(extensionName: 'OVR_multiview2'): OVR_multiview2 | null
  1940. getExtension(
  1941. extensionName: 'WEBGL_color_buffer_float'
  1942. ): WEBGL_color_buffer_float | null
  1943. getExtension(
  1944. extensionName: 'WEBGL_compressed_texture_astc'
  1945. ): WEBGL_compressed_texture_astc | null
  1946. getExtension(
  1947. extensionName: 'WEBGL_compressed_texture_etc'
  1948. ): WEBGL_compressed_texture_etc | null
  1949. getExtension(
  1950. extensionName: 'WEBGL_compressed_texture_etc1'
  1951. ): WEBGL_compressed_texture_etc1 | null
  1952. getExtension(
  1953. extensionName: 'WEBGL_compressed_texture_s3tc'
  1954. ): WEBGL_compressed_texture_s3tc | null
  1955. getExtension(
  1956. extensionName: 'WEBGL_compressed_texture_s3tc_srgb'
  1957. ): WEBGL_compressed_texture_s3tc_srgb | null
  1958. getExtension(
  1959. extensionName: 'WEBGL_debug_renderer_info'
  1960. ): WEBGL_debug_renderer_info | null
  1961. getExtension(
  1962. extensionName: 'WEBGL_debug_shaders'
  1963. ): WEBGL_debug_shaders | null
  1964. getExtension(
  1965. extensionName: 'WEBGL_depth_texture'
  1966. ): WEBGL_depth_texture | null
  1967. getExtension(
  1968. extensionName: 'WEBGL_draw_buffers'
  1969. ): WEBGL_draw_buffers | null
  1970. getExtension(
  1971. extensionName: 'WEBGL_lose_context'
  1972. ): WEBGL_lose_context | null
  1973. getExtension(extensionName: 'WEBGL_multi_draw'): WEBGL_multi_draw | null
  1974. getExtension(name: string): any
  1975. getFramebufferAttachmentParameter(
  1976. target: GLenum,
  1977. attachment: GLenum,
  1978. pname: GLenum
  1979. ): any
  1980. getParameter(pname: GLenum): any
  1981. getProgramInfoLog(program: WebGLProgram): string | null
  1982. getProgramParameter(program: WebGLProgram, pname: GLenum): any
  1983. getRenderbufferParameter(target: GLenum, pname: GLenum): any
  1984. getShaderInfoLog(shader: WebGLShader): string | null
  1985. getShaderParameter(shader: WebGLShader, pname: GLenum): any
  1986. getShaderPrecisionFormat(
  1987. shadertype: GLenum,
  1988. precisiontype: GLenum
  1989. ): WebGLShaderPrecisionFormat | null
  1990. getShaderSource(shader: WebGLShader): string | null
  1991. getSupportedExtensions(): string[] | null
  1992. getTexParameter(target: GLenum, pname: GLenum): any
  1993. getUniform(program: WebGLProgram, location: WebGLUniformLocation): any
  1994. getUniformLocation(
  1995. program: WebGLProgram,
  1996. name: string
  1997. ): WebGLUniformLocation | null
  1998. getVertexAttrib(index: GLuint, pname: GLenum): any
  1999. getVertexAttribOffset(index: GLuint, pname: GLenum): GLintptr
  2000. hint(target: GLenum, mode: GLenum): void
  2001. isBuffer(buffer: WebGLBuffer | null): GLboolean
  2002. isContextLost(): boolean
  2003. isEnabled(cap: GLenum): GLboolean
  2004. isFramebuffer(framebuffer: WebGLFramebuffer | null): GLboolean
  2005. isProgram(program: WebGLProgram | null): GLboolean
  2006. isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): GLboolean
  2007. isShader(shader: WebGLShader | null): GLboolean
  2008. isTexture(texture: WebGLTexture | null): GLboolean
  2009. lineWidth(width: GLfloat): void
  2010. linkProgram(program: WebGLProgram): void
  2011. pixelStorei(pname: GLenum, param: GLint | GLboolean): void
  2012. polygonOffset(factor: GLfloat, units: GLfloat): void
  2013. renderbufferStorage(
  2014. target: GLenum,
  2015. internalformat: GLenum,
  2016. width: GLsizei,
  2017. height: GLsizei
  2018. ): void
  2019. sampleCoverage(value: GLclampf, invert: GLboolean): void
  2020. scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void
  2021. shaderSource(shader: WebGLShader, source: string): void
  2022. stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void
  2023. stencilFuncSeparate(
  2024. face: GLenum,
  2025. func: GLenum,
  2026. ref: GLint,
  2027. mask: GLuint
  2028. ): void
  2029. stencilMask(mask: GLuint): void
  2030. stencilMaskSeparate(face: GLenum, mask: GLuint): void
  2031. stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void
  2032. stencilOpSeparate(
  2033. face: GLenum,
  2034. fail: GLenum,
  2035. zfail: GLenum,
  2036. zpass: GLenum
  2037. ): void
  2038. texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void
  2039. texParameteri(target: GLenum, pname: GLenum, param: GLint): void
  2040. uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void
  2041. uniform1i(location: WebGLUniformLocation | null, x: GLint): void
  2042. uniform2f(
  2043. location: WebGLUniformLocation | null,
  2044. x: GLfloat,
  2045. y: GLfloat
  2046. ): void
  2047. uniform2i(
  2048. location: WebGLUniformLocation | null,
  2049. x: GLint,
  2050. y: GLint
  2051. ): void
  2052. uniform3f(
  2053. location: WebGLUniformLocation | null,
  2054. x: GLfloat,
  2055. y: GLfloat,
  2056. z: GLfloat
  2057. ): void
  2058. uniform3i(
  2059. location: WebGLUniformLocation | null,
  2060. x: GLint,
  2061. y: GLint,
  2062. z: GLint
  2063. ): void
  2064. uniform4f(
  2065. location: WebGLUniformLocation | null,
  2066. x: GLfloat,
  2067. y: GLfloat,
  2068. z: GLfloat,
  2069. w: GLfloat
  2070. ): void
  2071. uniform4i(
  2072. location: WebGLUniformLocation | null,
  2073. x: GLint,
  2074. y: GLint,
  2075. z: GLint,
  2076. w: GLint
  2077. ): void
  2078. useProgram(program: WebGLProgram | null): void
  2079. validateProgram(program: WebGLProgram): void
  2080. vertexAttrib1f(index: GLuint, x: GLfloat): void
  2081. vertexAttrib1fv(index: GLuint, values: Float32List): void
  2082. vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void
  2083. vertexAttrib2fv(index: GLuint, values: Float32List): void
  2084. vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void
  2085. vertexAttrib3fv(index: GLuint, values: Float32List): void
  2086. vertexAttrib4f(
  2087. index: GLuint,
  2088. x: GLfloat,
  2089. y: GLfloat,
  2090. z: GLfloat,
  2091. w: GLfloat
  2092. ): void
  2093. vertexAttrib4fv(index: GLuint, values: Float32List): void
  2094. vertexAttribPointer(
  2095. index: GLuint,
  2096. size: GLint,
  2097. type: GLenum,
  2098. normalized: GLboolean,
  2099. stride: GLsizei,
  2100. offset: GLintptr
  2101. ): void
  2102. viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void
  2103. readonly ACTIVE_ATTRIBUTES: GLenum
  2104. readonly ACTIVE_TEXTURE: GLenum
  2105. readonly ACTIVE_UNIFORMS: GLenum
  2106. readonly ALIASED_LINE_WIDTH_RANGE: GLenum
  2107. readonly ALIASED_POINT_SIZE_RANGE: GLenum
  2108. readonly ALPHA: GLenum
  2109. readonly ALPHA_BITS: GLenum
  2110. readonly ALWAYS: GLenum
  2111. readonly ARRAY_BUFFER: GLenum
  2112. readonly ARRAY_BUFFER_BINDING: GLenum
  2113. readonly ATTACHED_SHADERS: GLenum
  2114. readonly BACK: GLenum
  2115. readonly BLEND: GLenum
  2116. readonly BLEND_COLOR: GLenum
  2117. readonly BLEND_DST_ALPHA: GLenum
  2118. readonly BLEND_DST_RGB: GLenum
  2119. readonly BLEND_EQUATION: GLenum
  2120. readonly BLEND_EQUATION_ALPHA: GLenum
  2121. readonly BLEND_EQUATION_RGB: GLenum
  2122. readonly BLEND_SRC_ALPHA: GLenum
  2123. readonly BLEND_SRC_RGB: GLenum
  2124. readonly BLUE_BITS: GLenum
  2125. readonly BOOL: GLenum
  2126. readonly BOOL_VEC2: GLenum
  2127. readonly BOOL_VEC3: GLenum
  2128. readonly BOOL_VEC4: GLenum
  2129. readonly BROWSER_DEFAULT_WEBGL: GLenum
  2130. readonly BUFFER_SIZE: GLenum
  2131. readonly BUFFER_USAGE: GLenum
  2132. readonly BYTE: GLenum
  2133. readonly CCW: GLenum
  2134. readonly CLAMP_TO_EDGE: GLenum
  2135. readonly COLOR_ATTACHMENT0: GLenum
  2136. readonly COLOR_BUFFER_BIT: GLenum
  2137. readonly COLOR_CLEAR_VALUE: GLenum
  2138. readonly COLOR_WRITEMASK: GLenum
  2139. readonly COMPILE_STATUS: GLenum
  2140. readonly COMPRESSED_TEXTURE_FORMATS: GLenum
  2141. readonly CONSTANT_ALPHA: GLenum
  2142. readonly CONSTANT_COLOR: GLenum
  2143. readonly CONTEXT_LOST_WEBGL: GLenum
  2144. readonly CULL_FACE: GLenum
  2145. readonly CULL_FACE_MODE: GLenum
  2146. readonly CURRENT_PROGRAM: GLenum
  2147. readonly CURRENT_VERTEX_ATTRIB: GLenum
  2148. readonly CW: GLenum
  2149. readonly DECR: GLenum
  2150. readonly DECR_WRAP: GLenum
  2151. readonly DELETE_STATUS: GLenum
  2152. readonly DEPTH_ATTACHMENT: GLenum
  2153. readonly DEPTH_BITS: GLenum
  2154. readonly DEPTH_BUFFER_BIT: GLenum
  2155. readonly DEPTH_CLEAR_VALUE: GLenum
  2156. readonly DEPTH_COMPONENT: GLenum
  2157. readonly DEPTH_COMPONENT16: GLenum
  2158. readonly DEPTH_FUNC: GLenum
  2159. readonly DEPTH_RANGE: GLenum
  2160. readonly DEPTH_STENCIL: GLenum
  2161. readonly DEPTH_STENCIL_ATTACHMENT: GLenum
  2162. readonly DEPTH_TEST: GLenum
  2163. readonly DEPTH_WRITEMASK: GLenum
  2164. readonly DITHER: GLenum
  2165. readonly DONT_CARE: GLenum
  2166. readonly DST_ALPHA: GLenum
  2167. readonly DST_COLOR: GLenum
  2168. readonly DYNAMIC_DRAW: GLenum
  2169. readonly ELEMENT_ARRAY_BUFFER: GLenum
  2170. readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum
  2171. readonly EQUAL: GLenum
  2172. readonly FASTEST: GLenum
  2173. readonly FLOAT: GLenum
  2174. readonly FLOAT_MAT2: GLenum
  2175. readonly FLOAT_MAT3: GLenum
  2176. readonly FLOAT_MAT4: GLenum
  2177. readonly FLOAT_VEC2: GLenum
  2178. readonly FLOAT_VEC3: GLenum
  2179. readonly FLOAT_VEC4: GLenum
  2180. readonly FRAGMENT_SHADER: GLenum
  2181. readonly FRAMEBUFFER: GLenum
  2182. readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum
  2183. readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum
  2184. readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum
  2185. readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum
  2186. readonly FRAMEBUFFER_BINDING: GLenum
  2187. readonly FRAMEBUFFER_COMPLETE: GLenum
  2188. readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum
  2189. readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum
  2190. readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum
  2191. readonly FRAMEBUFFER_UNSUPPORTED: GLenum
  2192. readonly FRONT: GLenum
  2193. readonly FRONT_AND_BACK: GLenum
  2194. readonly FRONT_FACE: GLenum
  2195. readonly FUNC_ADD: GLenum
  2196. readonly FUNC_REVERSE_SUBTRACT: GLenum
  2197. readonly FUNC_SUBTRACT: GLenum
  2198. readonly GENERATE_MIPMAP_HINT: GLenum
  2199. readonly GEQUAL: GLenum
  2200. readonly GREATER: GLenum
  2201. readonly GREEN_BITS: GLenum
  2202. readonly HIGH_FLOAT: GLenum
  2203. readonly HIGH_INT: GLenum
  2204. readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum
  2205. readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum
  2206. readonly INCR: GLenum
  2207. readonly INCR_WRAP: GLenum
  2208. readonly INT: GLenum
  2209. readonly INT_VEC2: GLenum
  2210. readonly INT_VEC3: GLenum
  2211. readonly INT_VEC4: GLenum
  2212. readonly INVALID_ENUM: GLenum
  2213. readonly INVALID_FRAMEBUFFER_OPERATION: GLenum
  2214. readonly INVALID_OPERATION: GLenum
  2215. readonly INVALID_VALUE: GLenum
  2216. readonly INVERT: GLenum
  2217. readonly KEEP: GLenum
  2218. readonly LEQUAL: GLenum
  2219. readonly LESS: GLenum
  2220. readonly LINEAR: GLenum
  2221. readonly LINEAR_MIPMAP_LINEAR: GLenum
  2222. readonly LINEAR_MIPMAP_NEAREST: GLenum
  2223. readonly LINES: GLenum
  2224. readonly LINE_LOOP: GLenum
  2225. readonly LINE_STRIP: GLenum
  2226. readonly LINE_WIDTH: GLenum
  2227. readonly LINK_STATUS: GLenum
  2228. readonly LOW_FLOAT: GLenum
  2229. readonly LOW_INT: GLenum
  2230. readonly LUMINANCE: GLenum
  2231. readonly LUMINANCE_ALPHA: GLenum
  2232. readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum
  2233. readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum
  2234. readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum
  2235. readonly MAX_RENDERBUFFER_SIZE: GLenum
  2236. readonly MAX_TEXTURE_IMAGE_UNITS: GLenum
  2237. readonly MAX_TEXTURE_SIZE: GLenum
  2238. readonly MAX_VARYING_VECTORS: GLenum
  2239. readonly MAX_VERTEX_ATTRIBS: GLenum
  2240. readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum
  2241. readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum
  2242. readonly MAX_VIEWPORT_DIMS: GLenum
  2243. readonly MEDIUM_FLOAT: GLenum
  2244. readonly MEDIUM_INT: GLenum
  2245. readonly MIRRORED_REPEAT: GLenum
  2246. readonly NEAREST: GLenum
  2247. readonly NEAREST_MIPMAP_LINEAR: GLenum
  2248. readonly NEAREST_MIPMAP_NEAREST: GLenum
  2249. readonly NEVER: GLenum
  2250. readonly NICEST: GLenum
  2251. readonly NONE: GLenum
  2252. readonly NOTEQUAL: GLenum
  2253. readonly NO_ERROR: GLenum
  2254. readonly ONE: GLenum
  2255. readonly ONE_MINUS_CONSTANT_ALPHA: GLenum
  2256. readonly ONE_MINUS_CONSTANT_COLOR: GLenum
  2257. readonly ONE_MINUS_DST_ALPHA: GLenum
  2258. readonly ONE_MINUS_DST_COLOR: GLenum
  2259. readonly ONE_MINUS_SRC_ALPHA: GLenum
  2260. readonly ONE_MINUS_SRC_COLOR: GLenum
  2261. readonly OUT_OF_MEMORY: GLenum
  2262. readonly PACK_ALIGNMENT: GLenum
  2263. readonly POINTS: GLenum
  2264. readonly POLYGON_OFFSET_FACTOR: GLenum
  2265. readonly POLYGON_OFFSET_FILL: GLenum
  2266. readonly POLYGON_OFFSET_UNITS: GLenum
  2267. readonly RED_BITS: GLenum
  2268. readonly RENDERBUFFER: GLenum
  2269. readonly RENDERBUFFER_ALPHA_SIZE: GLenum
  2270. readonly RENDERBUFFER_BINDING: GLenum
  2271. readonly RENDERBUFFER_BLUE_SIZE: GLenum
  2272. readonly RENDERBUFFER_DEPTH_SIZE: GLenum
  2273. readonly RENDERBUFFER_GREEN_SIZE: GLenum
  2274. readonly RENDERBUFFER_HEIGHT: GLenum
  2275. readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum
  2276. readonly RENDERBUFFER_RED_SIZE: GLenum
  2277. readonly RENDERBUFFER_STENCIL_SIZE: GLenum
  2278. readonly RENDERBUFFER_WIDTH: GLenum
  2279. readonly RENDERER: GLenum
  2280. readonly REPEAT: GLenum
  2281. readonly REPLACE: GLenum
  2282. readonly RGB: GLenum
  2283. readonly RGB565: GLenum
  2284. readonly RGB5_A1: GLenum
  2285. readonly RGBA: GLenum
  2286. readonly RGBA4: GLenum
  2287. readonly SAMPLER_2D: GLenum
  2288. readonly SAMPLER_CUBE: GLenum
  2289. readonly SAMPLES: GLenum
  2290. readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum
  2291. readonly SAMPLE_BUFFERS: GLenum
  2292. readonly SAMPLE_COVERAGE: GLenum
  2293. readonly SAMPLE_COVERAGE_INVERT: GLenum
  2294. readonly SAMPLE_COVERAGE_VALUE: GLenum
  2295. readonly SCISSOR_BOX: GLenum
  2296. readonly SCISSOR_TEST: GLenum
  2297. readonly SHADER_TYPE: GLenum
  2298. readonly SHADING_LANGUAGE_VERSION: GLenum
  2299. readonly SHORT: GLenum
  2300. readonly SRC_ALPHA: GLenum
  2301. readonly SRC_ALPHA_SATURATE: GLenum
  2302. readonly SRC_COLOR: GLenum
  2303. readonly STATIC_DRAW: GLenum
  2304. readonly STENCIL_ATTACHMENT: GLenum
  2305. readonly STENCIL_BACK_FAIL: GLenum
  2306. readonly STENCIL_BACK_FUNC: GLenum
  2307. readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum
  2308. readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum
  2309. readonly STENCIL_BACK_REF: GLenum
  2310. readonly STENCIL_BACK_VALUE_MASK: GLenum
  2311. readonly STENCIL_BACK_WRITEMASK: GLenum
  2312. readonly STENCIL_BITS: GLenum
  2313. readonly STENCIL_BUFFER_BIT: GLenum
  2314. readonly STENCIL_CLEAR_VALUE: GLenum
  2315. readonly STENCIL_FAIL: GLenum
  2316. readonly STENCIL_FUNC: GLenum
  2317. readonly STENCIL_INDEX8: GLenum
  2318. readonly STENCIL_PASS_DEPTH_FAIL: GLenum
  2319. readonly STENCIL_PASS_DEPTH_PASS: GLenum
  2320. readonly STENCIL_REF: GLenum
  2321. readonly STENCIL_TEST: GLenum
  2322. readonly STENCIL_VALUE_MASK: GLenum
  2323. readonly STENCIL_WRITEMASK: GLenum
  2324. readonly STREAM_DRAW: GLenum
  2325. readonly SUBPIXEL_BITS: GLenum
  2326. readonly TEXTURE: GLenum
  2327. readonly TEXTURE0: GLenum
  2328. readonly TEXTURE1: GLenum
  2329. readonly TEXTURE10: GLenum
  2330. readonly TEXTURE11: GLenum
  2331. readonly TEXTURE12: GLenum
  2332. readonly TEXTURE13: GLenum
  2333. readonly TEXTURE14: GLenum
  2334. readonly TEXTURE15: GLenum
  2335. readonly TEXTURE16: GLenum
  2336. readonly TEXTURE17: GLenum
  2337. readonly TEXTURE18: GLenum
  2338. readonly TEXTURE19: GLenum
  2339. readonly TEXTURE2: GLenum
  2340. readonly TEXTURE20: GLenum
  2341. readonly TEXTURE21: GLenum
  2342. readonly TEXTURE22: GLenum
  2343. readonly TEXTURE23: GLenum
  2344. readonly TEXTURE24: GLenum
  2345. readonly TEXTURE25: GLenum
  2346. readonly TEXTURE26: GLenum
  2347. readonly TEXTURE27: GLenum
  2348. readonly TEXTURE28: GLenum
  2349. readonly TEXTURE29: GLenum
  2350. readonly TEXTURE3: GLenum
  2351. readonly TEXTURE30: GLenum
  2352. readonly TEXTURE31: GLenum
  2353. readonly TEXTURE4: GLenum
  2354. readonly TEXTURE5: GLenum
  2355. readonly TEXTURE6: GLenum
  2356. readonly TEXTURE7: GLenum
  2357. readonly TEXTURE8: GLenum
  2358. readonly TEXTURE9: GLenum
  2359. readonly TEXTURE_2D: GLenum
  2360. readonly TEXTURE_BINDING_2D: GLenum
  2361. readonly TEXTURE_BINDING_CUBE_MAP: GLenum
  2362. readonly TEXTURE_CUBE_MAP: GLenum
  2363. readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum
  2364. readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum
  2365. readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum
  2366. readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum
  2367. readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum
  2368. readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum
  2369. readonly TEXTURE_MAG_FILTER: GLenum
  2370. readonly TEXTURE_MIN_FILTER: GLenum
  2371. readonly TEXTURE_WRAP_S: GLenum
  2372. readonly TEXTURE_WRAP_T: GLenum
  2373. readonly TRIANGLES: GLenum
  2374. readonly TRIANGLE_FAN: GLenum
  2375. readonly TRIANGLE_STRIP: GLenum
  2376. readonly UNPACK_ALIGNMENT: GLenum
  2377. readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum
  2378. readonly UNPACK_FLIP_Y_WEBGL: GLenum
  2379. readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum
  2380. readonly UNSIGNED_BYTE: GLenum
  2381. readonly UNSIGNED_INT: GLenum
  2382. readonly UNSIGNED_SHORT: GLenum
  2383. readonly UNSIGNED_SHORT_4_4_4_4: GLenum
  2384. readonly UNSIGNED_SHORT_5_5_5_1: GLenum
  2385. readonly UNSIGNED_SHORT_5_6_5: GLenum
  2386. readonly VALIDATE_STATUS: GLenum
  2387. readonly VENDOR: GLenum
  2388. readonly VERSION: GLenum
  2389. readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum
  2390. readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum
  2391. readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum
  2392. readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum
  2393. readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum
  2394. readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum
  2395. readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum
  2396. readonly VERTEX_SHADER: GLenum
  2397. readonly VIEWPORT: GLenum
  2398. readonly ZERO: GLenum
  2399. }
  2400. type BufferSource = ArrayBufferView | ArrayBuffer
  2401. type Float32List = Float32Array | GLfloat[]
  2402. type TexImageSource =
  2403. | Image
  2404. | ImageData
  2405. | Canvas
  2406. | OffscreenCanvas
  2407. | VideoContext
  2408. interface WebGLRenderingContextOverloads {
  2409. bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void
  2410. bufferData(
  2411. target: GLenum,
  2412. data: BufferSource | null,
  2413. usage: GLenum
  2414. ): void
  2415. bufferSubData(
  2416. target: GLenum,
  2417. offset: GLintptr,
  2418. data: BufferSource
  2419. ): void
  2420. compressedTexImage2D(
  2421. target: GLenum,
  2422. level: GLint,
  2423. internalformat: GLenum,
  2424. width: GLsizei,
  2425. height: GLsizei,
  2426. border: GLint,
  2427. data: ArrayBufferView
  2428. ): void
  2429. compressedTexSubImage2D(
  2430. target: GLenum,
  2431. level: GLint,
  2432. xoffset: GLint,
  2433. yoffset: GLint,
  2434. width: GLsizei,
  2435. height: GLsizei,
  2436. format: GLenum,
  2437. data: ArrayBufferView
  2438. ): void
  2439. readPixels(
  2440. x: GLint,
  2441. y: GLint,
  2442. width: GLsizei,
  2443. height: GLsizei,
  2444. format: GLenum,
  2445. type: GLenum,
  2446. pixels: ArrayBufferView | null
  2447. ): void
  2448. texImage2D(
  2449. target: GLenum,
  2450. level: GLint,
  2451. internalformat: GLint,
  2452. width: GLsizei,
  2453. height: GLsizei,
  2454. border: GLint,
  2455. format: GLenum,
  2456. type: GLenum,
  2457. pixels: ArrayBufferView | null
  2458. ): void
  2459. texImage2D(
  2460. target: GLenum,
  2461. level: GLint,
  2462. internalformat: GLint,
  2463. format: GLenum,
  2464. type: GLenum,
  2465. source: TexImageSource
  2466. ): void
  2467. texSubImage2D(
  2468. target: GLenum,
  2469. level: GLint,
  2470. xoffset: GLint,
  2471. yoffset: GLint,
  2472. width: GLsizei,
  2473. height: GLsizei,
  2474. format: GLenum,
  2475. type: GLenum,
  2476. pixels: ArrayBufferView | null
  2477. ): void
  2478. texSubImage2D(
  2479. target: GLenum,
  2480. level: GLint,
  2481. xoffset: GLint,
  2482. yoffset: GLint,
  2483. format: GLenum,
  2484. type: GLenum,
  2485. source: TexImageSource
  2486. ): void
  2487. uniform1fv(location: WebGLUniformLocation | null, v: Float32List): void
  2488. uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void
  2489. uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void
  2490. uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void
  2491. uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void
  2492. uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void
  2493. uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void
  2494. uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void
  2495. uniformMatrix2fv(
  2496. location: WebGLUniformLocation | null,
  2497. transpose: GLboolean,
  2498. value: Float32List
  2499. ): void
  2500. uniformMatrix3fv(
  2501. location: WebGLUniformLocation | null,
  2502. transpose: GLboolean,
  2503. value: Float32List
  2504. ): void
  2505. uniformMatrix4fv(
  2506. location: WebGLUniformLocation | null,
  2507. transpose: GLboolean,
  2508. value: Float32List
  2509. ): void
  2510. }
  2511. interface WebGLSampler {}
  2512. /** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */
  2513. interface WebGLShader {}
  2514. /** Part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getShaderPrecisionFormat() method. */
  2515. interface WebGLShaderPrecisionFormat {
  2516. readonly precision: GLint
  2517. readonly rangeMax: GLint
  2518. readonly rangeMin: GLint
  2519. }
  2520. interface WebGLSync {}
  2521. /** Part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */
  2522. interface WebGLTexture {}
  2523. interface WebGLTransformFeedback {}
  2524. /** Part of the WebGL API and represents the location of a uniform variable in a shader program. */
  2525. interface WebGLUniformLocation {}
  2526. interface WebGLVertexArrayObject {}
  2527. interface WebGLVertexArrayObjectOES {}
  2528. }