blob: 24c474298cc785480fd66fd2bdcbe4d411e33290 [file] [log] [blame]
Kevin Lubick217056c2018-09-20 17:39:31 -04001/*
2 * This externs file prevents the Closure JS compiler from minifying away
3 * names of objects created by Emscripten.
4 * Basically, by defining empty objects and functions here, Closure will
5 * know not to rename them. This is needed because of our pre-js files,
6 * that is, the JS we hand-write to bundle into the output. That JS will be
7 * hit by the closure compiler and thus needs to know about what functions
8 * have special names and should not be minified.
9 *
10 * Emscripten does not support automatically generating an externs file, so we
11 * do it by hand. The general process is to write some JS code, and then put any
12 * calls to CanvasKit or related things in here. Running ./compile.sh and then
13 * looking at the minified results or running the Release trybot should
14 * verify nothing was missed. Optionally, looking directly at the minified
15 * pathkit.js can be useful when developing locally.
16 *
17 * Docs:
18 * https://github.com/cljsjs/packages/wiki/Creating-Externs
19 * https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System
20 *
21 * Example externs:
22 * https://github.com/google/closure-compiler/tree/master/externs
23 */
24
25var CanvasKit = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050026 // public API (i.e. things we declare in the pre-js file or in the cpp bindings)
27 Color: function() {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -040028 Color4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050029 /** @return {CanvasKit.SkRect} */
30 LTRBRect: function() {},
31 /** @return {CanvasKit.SkRect} */
32 XYWHRect: function() {},
33 /** @return {CanvasKit.SkRRect} */
34 RRectXY: function() {},
35 /** @return {ImageData} */
36 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050037
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050038 GetWebGLContext: function() {},
39 MakeBlurMaskFilter: function() {},
40 MakeCanvas: function() {},
41 MakeCanvasSurface: function() {},
42 MakeGrContext: function() {},
43 /** @return {CanvasKit.SkAnimatedImage} */
44 MakeAnimatedImageFromEncoded: function() {},
45 /** @return {CanvasKit.SkImage} */
46 MakeImage: function() {},
47 /** @return {CanvasKit.SkImage} */
48 MakeImageFromEncoded: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050049 MakeOnScreenGLSurface: function() {},
50 MakePathFromCmds: function() {},
51 MakePathFromOp: function() {},
52 MakePathFromSVGString: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050053 MakeRenderTarget: function() {},
54 MakeSkPicture: function() {},
55 MakeSWCanvasSurface: function() {},
56 MakeManagedAnimation: function() {},
57 MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050058 MakeSkVertices: function() {},
59 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 MakeWebGLCanvasSurface: function() {},
61 /** @return {TypedArray} */
62 Malloc: function() {},
63 /** @return {TonalColors} */
64 computeTonalColors: function() {},
65 currentContext: function() {},
66 getColorComponents: function() {},
67 getDecodeCacheLimitBytes: function() {},
68 getDecodeCacheUsageBytes: function() {},
69 getSkDataBytes: function() {},
70 multiplyByAlpha: function() {},
71 parseColorString: function() {},
72 setCurrentContext: function() {},
73 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040074
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050075 // private API (i.e. things declared in the bindings that we use
76 // in the pre-js file)
77 _MakeImage: function() {},
78 _MakeLinearGradientShader: function() {},
79 _MakePathFromCmds: function() {},
80 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070081 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050082 _MakeManagedAnimation: function() {},
83 _MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050084 _MakeSkPicture: function() {},
85 _MakeSkVertices: function() {},
86 _MakeTwoPointConicalGradientShader: function() {},
87 _decodeAnimatedImage: function() {},
88 _decodeImage: function() {},
89 _drawShapedText: function() {},
90 _getRasterDirectSurface: function() {},
91 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040092
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050093 // The testing object is meant to expose internal functions
94 // for more fine-grained testing, e.g. parseColor
95 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050096
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050097 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -040098
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050099 GrContext: {
100 // public API (from C++ bindings)
101 getResourceCacheLimitBytes: function() {},
102 getResourceCacheUsageBytes: function() {},
103 releaseResourcesAndAbandonContext: function() {},
104 setResourceCacheLimitBytes: function() {},
105 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400106
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500107 Paragraph: {
108 // public API (from C++ bindings)
109 didExceedMaxLines: function() {},
110 getAlphabeticBaseline: function() {},
111 getGlyphPositionAtCoordinate: function() {},
112 getHeight: function() {},
113 getIdeographicBaseline: function() {},
114 getLongestLine: function() {},
115 getMaxIntrinsicWidth: function() {},
116 getMaxWidth: function() {},
117 getMinIntrinsicWidth: function() {},
118 getWordBoundary: function() {},
119 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400120
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500121 // private API
122 /** @return {Float32Array} */
123 _getRectsForRange: function() {},
124 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400125
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500126 SkRuntimeEffect: {
127 // public API (from C++ bindings)
128 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500129
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500130 // private API
131 _makeShader: function() {},
132 _makeShaderWithChildren: function() {},
133 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500134
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500135 ParagraphStyle: function() {},
136 RSXFormBuilder: function() {},
137 SkColorBuilder: function() {},
138 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400139
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500140 ShapedText: {
141 // public API (from C++ bindings)
142 getBounds: function() {},
143 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500144
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500145 SkAnimatedImage: {
146 // public API (from C++ bindings)
147 decodeNextFrame: function() {},
148 getFrameCount: function() {},
149 getRepetitionCount: function() {},
150 height: function() {},
151 reset: function() {},
152 width: function() {},
153 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400154
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500155 SkCanvas: {
156 // public API (from C++ bindings)
157 clear: function() {},
158 clipPath: function() {},
159 clipRRect: function() {},
160 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500161 drawAnimatedImage: function() {},
162 drawArc: function() {},
163 drawCircle: function() {},
164 drawColor: function() {},
165 drawDRRect: function() {},
166 drawImage: function() {},
167 drawImageNine: function() {},
168 drawImageRect: function() {},
169 drawLine: function() {},
170 drawOval: function() {},
171 drawPaint: function() {},
172 drawParagraph: function() {},
173 drawPath: function() {},
174 drawPicture: function() {},
175 drawRRect: function() {},
176 drawRect: function() {},
177 drawRoundRect: function() {},
178 drawShadow: function() {},
179 drawText: function() {},
180 drawTextBlob: function() {},
181 drawVertices: function() {},
182 flush: function() {},
183 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500184 makeSurface: function() {},
185 restore: function() {},
186 restoreToCount: function() {},
187 rotate: function() {},
188 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000189 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500190 scale: function() {},
191 skew: function() {},
192 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400193
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500194 // private API
Kevin Lubick6bffe392020-04-02 15:24:15 -0400195 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500196 _drawAtlas: function() {},
197 _drawPoints: function() {},
198 _drawSimpleText: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400199 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500200 _readPixels: function() {},
201 _writePixels: function() {},
202 delete: function() {},
203 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400204
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 SkColorFilter: {
206 // public API (from C++ bindings and JS interface)
207 MakeBlend: function() {},
208 MakeCompose: function() {},
209 MakeLerp: function() {},
210 MakeLinearToSRGBGamma: function() {},
211 MakeMatrix: function() {},
212 MakeSRGBToLinearGamma: function() {},
213 // private API (from C++ bindings)
214 _makeMatrix: function() {},
215 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400216
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500217 SkColorMatrix: {
218 concat: function() {},
219 identity: function() {},
220 postTranslate: function() {},
221 rotated: function() {},
222 scaled: function() {},
223 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400224
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500225 SkContourMeasureIter: {
226 next: function() {},
227 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500228
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500229 SkContourMeasure: {
230 getPosTan: function() {},
231 getSegment: function() {},
232 isClosed: function() {},
233 length: function() {},
234 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500235
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500236 SkFont: {
237 // public API (from C++ bindings)
238 getScaleX: function() {},
239 getSize: function() {},
240 getSkewX: function() {},
241 getTypeface: function() {},
242 measureText: function() {},
243 setHinting: function() {},
244 setLinearMetrics: function() {},
245 setScaleX: function() {},
246 setSize: function() {},
247 setSkewX: function() {},
248 setSubpixel: function() {},
249 setTypeface: function() {},
250 // private API (from C++ bindings)
251 _getWidths: function() {},
252 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500253
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500254 SkFontMgr: {
255 // public API (from C++ and JS bindings)
256 FromData: function() {},
257 RefDefault: function() {},
258 countFamilies: function() {},
259 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500260
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500261 // private API
262 _makeTypefaceFromData: function() {},
263 _fromData: function() {},
264 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500265
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500266 SkImage: {
267 // public API (from C++ bindings)
268 height: function() {},
269 width: function() {},
270 // private API
271 _encodeToData: function() {},
272 _encodeToDataWithFormat: function() {},
273 _makeShader: function() {},
274 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400275
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500276 SkImageFilter: {
277 MakeBlur: function() {},
278 MakeColorFilter: function() {},
279 MakeCompose: function() {},
280 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400281
282 // private API
283 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500284 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400285
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500286 // These are defined in interface.js
287 SkM44: {
288 identity: function() {},
289 invert: function() {},
290 multiply: function() {},
291 rotatedUnitSinCos: function() {},
292 rotated: function() {},
293 scaled: function() {},
294 translated: function() {},
295 lookat: function() {},
296 perspective: function() {},
297 rc: function() {},
298 transpose: function() {},
299 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500300
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500301 SkMatrix: {
302 identity: function() {},
303 invert: function() {},
304 mapPoints: function() {},
305 multiply: function() {},
306 rotated: function() {},
307 scaled: function() {},
308 skewed: function() {},
309 translated: function() {},
310 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500311
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500312 SkMaskFilter: {
313 MakeBlur: function() {},
314 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400315
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500316 SkPaint: {
317 // public API (from C++ bindings)
318 /** @return {CanvasKit.SkPaint} */
319 copy: function() {},
320 getBlendMode: function() {},
321 getColor: function() {},
322 getFilterQuality: function() {},
323 getStrokeCap: function() {},
324 getStrokeJoin: function() {},
325 getStrokeMiter: function() {},
326 getStrokeWidth: function() {},
327 setAntiAlias: function() {},
328 setBlendMode: function() {},
329 setColor: function() {},
330 setFilterQuality: function() {},
331 setImageFilter: function() {},
332 setMaskFilter: function() {},
333 setPathEffect: function() {},
334 setShader: function() {},
335 setStrokeCap: function() {},
336 setStrokeJoin: function() {},
337 setStrokeMiter: function() {},
338 setStrokeWidth: function() {},
339 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500340
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500341 // Private API
342 delete: function() {},
343 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500344
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500345 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400346 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500347 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400348 MakeDiscrete: function() {},
349
350 // Private C++ API
351 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500352 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500353
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500354 SkParticleEffect: {
355 // public API (from C++ bindings)
356 draw: function() {},
357 getEffectUniform: function() {},
358 getEffectUniformCount: function() {},
359 getEffectUniformFloatCount: function() {},
360 getEffectUniformName: function() {},
361 getParticleUniformCount: function() {},
362 getParticleUniformFloatCount: function() {},
363 getParticleUniformName: function() {},
364 getParticleUniform: function() {},
365 setPosition: function() {},
366 setRate: function() {},
367 start: function() {},
368 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500369
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500370 // private API (from C++ bindings)
371 _effectUniformPtr: function() {},
372 _particleUniformPtr: function() {},
373 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500374
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500375 SkPath: {
376 // public API (from C++ bindings)
377 computeTightBounds: function() {},
378 contains: function() {},
379 /** @return {CanvasKit.SkPath} */
380 copy: function() {},
381 countPoints: function() {},
382 equals: function() {},
383 getBounds: function() {},
384 getFillType: function() {},
385 getPoint: function() {},
386 isEmpty: function() {},
387 isVolatile: function() {},
388 reset: function() {},
389 rewind: function() {},
390 setFillType: function() {},
391 setIsVolatile: function() {},
392 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400393
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500394 // private API
395 _addArc: function() {},
396 _addOval: function() {},
397 _addPath: function() {},
398 _addRect: function() {},
399 _addPoly: function() {},
400 _addRoundRect: function() {},
401 _arc: function() {},
402 _arcTo: function() {},
403 _close: function() {},
404 _conicTo: function() {},
405 _cubicTo: function() {},
406 _dash: function() {},
407 _lineTo: function() {},
408 _moveTo: function() {},
409 _op: function() {},
410 _quadTo: function() {},
411 _rArcTo: function() {},
412 _rConicTo: function() {},
413 _rCubicTo: function() {},
414 _rLineTo: function() {},
415 _rMoveTo: function() {},
416 _rQuadTo: function() {},
417 _rect: function() {},
418 _simplify: function() {},
419 _stroke: function() {},
420 _transform: function() {},
421 _trim: function() {},
422 delete: function() {},
423 dump: function() {},
424 dumpHex: function() {},
425 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400426
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500427 SkPathMeasure: {
428 getLength: function() {},
429 getSegment: function() {},
430 getPosTan: function() {},
431 isClosed: function() {},
432 nextContour: function() {},
433 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400434
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500435 SkPicture: {
436 serialize: function() {},
437 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400438
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500439 SkPictureRecorder: {
440 beginRecording: function() {},
441 finishRecordingAsPicture: function() {},
442 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400443
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500444 SkRect: {
445 fLeft: {},
446 fTop: {},
447 fRight: {},
448 fBottom: {},
449 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400450
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500451 SkRRect: {
452 rect: {},
453 rx1: {},
454 ry1: {},
455 rx2: {},
456 ry2: {},
457 rx3: {},
458 ry3: {},
459 rx4: {},
460 ry4: {},
461 },
Kevin Lubick62836902019-12-09 09:04:26 -0500462
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500463 SkShader: {
464 Blend: function() {},
465 Color: function() {},
466 Empty: function() {},
467 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400468 MakeLinearGradient: function() {},
469 MakeRadialGradient: function() {},
470 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700471 MakeSweepGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500472 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400473
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500474 SkSurface: {
475 // public API (from C++ bindings)
476 /** @return {CanvasKit.SkCanvas} */
477 getCanvas: function() {},
478 /** @return {CanvasKit.SkImage} */
479 makeImageSnapshot: function() {},
480 makeSurface: function() {},
481 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400482
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500483 // private API
484 _flush: function() {},
485 _getRasterN32PremulSurface: function() {},
486 delete: function() {},
487 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500488
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500489 SkTextBlob: {
490 // public API (both C++ and JS bindings)
491 MakeFromRSXform: function() {},
492 MakeFromText: function() {},
493 MakeOnPath: function() {},
494 // private API (from C++ bindings)
495 _MakeFromRSXform: function() {},
496 _MakeFromText: function() {},
497 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500498
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500499 // These are defined in interface.js
500 SkVector: {
501 add: function() {},
502 sub: function() {},
503 dot: function() {},
504 cross: function() {},
505 normalize: function() {},
506 mulScalar: function() {},
507 length: function() {},
508 lengthSquared: function() {},
509 dist: function() {},
510 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400511
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500512 SkVertices: {
513 // public API (from C++ bindings)
514 bounds: function() {},
515 mode: function() {},
516 uniqueID: function() {},
517 vertexCount: function() {},
518 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400519
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500520 _SkVerticesBuilder: {
521 colors: function() {},
522 detach: function() {},
523 indices: function() {},
524 positions: function() {},
525 texCoords: function() {},
526 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400527
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500528 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400529
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500530 // Constants and Enums
531 gpu: {},
532 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400533
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500534 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400535 BLACK: {},
536 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500537 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400538 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500539 BLUE: {},
540 YELLOW: {},
541 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400542 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500543
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500544 MOVE_VERB: {},
545 LINE_VERB: {},
546 QUAD_VERB: {},
547 CONIC_VERB: {},
548 CUBIC_VERB: {},
549 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500550
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500551 NoDecoration: {},
552 UnderlineDecoration: {},
553 OverlineDecoration: {},
554 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400555
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500556 SaveLayerInitWithPrevious: {},
557 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400558
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500559 Affinity: {
560 Upstream: {},
561 Downstream: {},
562 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400563
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500564 AlphaType: {
565 Opaque: {},
566 Premul: {},
567 Unpremul: {},
568 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500569
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500570 BlendMode: {
571 Clear: {},
572 Src: {},
573 Dst: {},
574 SrcOver: {},
575 DstOver: {},
576 SrcIn: {},
577 DstIn: {},
578 SrcOut: {},
579 DstOut: {},
580 SrcATop: {},
581 DstATop: {},
582 Xor: {},
583 Plus: {},
584 Modulate: {},
585 Screen: {},
586 Overlay: {},
587 Darken: {},
588 Lighten: {},
589 ColorDodge: {},
590 ColorBurn: {},
591 HardLight: {},
592 SoftLight: {},
593 Difference: {},
594 Exclusion: {},
595 Multiply: {},
596 Hue: {},
597 Saturation: {},
598 Color: {},
599 Luminosity: {},
600 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500601
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500602 BlurStyle: {
603 Normal: {},
604 Solid: {},
605 Outer: {},
606 Inner: {},
607 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500608
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500609 ClipOp: {
610 Difference: {},
611 Intersect: {},
612 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500613
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500614 ColorType: {
615 Alpha_8: {},
616 RGB_565: {},
617 ARGB_4444: {},
618 RGBA_8888: {},
619 RGB_888x: {},
620 BGRA_8888: {},
621 RGBA_1010102: {},
622 RGB_101010x: {},
623 Gray_8: {},
624 RGBA_F16: {},
625 RGBA_F32: {},
626 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500627
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500628 FillType: {
629 Winding: {},
630 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500631 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400632
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 FilterQuality: {
634 None: {},
635 Low: {},
636 Medium: {},
637 High: {},
638 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500639
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500640 FontSlant: {
641 Upright: {},
642 Italic: {},
643 Oblique: {},
644 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400645
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500646 FontHinting: {
647 None: {},
648 Slight: {},
649 Normal: {},
650 Full: {},
651 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500652
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 FontWeight: {
654 Invisible: {},
655 Thin: {},
656 ExtraLight: {},
657 Light: {},
658 Normal: {},
659 Medium: {},
660 SemiBold: {},
661 Bold: {},
662 ExtraBold: {},
663 Black: {},
664 ExtraBlack: {},
665 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400666
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500667 FontWidth: {
668 UltraCondensed: {},
669 ExtraCondensed: {},
670 Condensed: {},
671 SemiCondensed: {},
672 Normal: {},
673 SemiExpanded: {},
674 Expanded: {},
675 ExtraExpanded: {},
676 UltraExpanded: {},
677 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400678
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 ImageFormat: {
680 PNG: {},
681 JPEG: {},
682 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300683
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500684 PaintStyle: {
685 Fill: {},
686 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500687 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500688
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500689 PathOp: {
690 Difference: {},
691 Intersect: {},
692 Union: {},
693 XOR: {},
694 ReverseDifference: {},
695 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500696
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500697 PointMode: {
698 Points: {},
699 Lines: {},
700 Polygon: {},
701 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500702
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500703 RectHeightStyle: {
704 Tight: {},
705 Max: {},
706 IncludeLineSpacingMiddle: {},
707 IncludeLineSpacingTop: {},
708 IncludeLineSpacingBottom: {},
709 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400710
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 RectWidthStyle: {
712 Tight: {},
713 Max: {},
714 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400715
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500716 StrokeCap: {
717 Butt: {},
718 Round: {},
719 Square: {},
720 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500721
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500722 StrokeJoin: {
723 Miter: {},
724 Round: {},
725 Bevel: {},
726 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500727
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500728 TextAlign: {
729 Left: {},
730 Right: {},
731 Center: {},
732 Justify: {},
733 Start: {},
734 End: {},
735 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400736
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500737 TextDirection: {
738 LTR: {},
739 RTL: {},
740 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400741
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500742 TileMode: {
743 Clamp: {},
744 Repeat: {},
745 Mirror: {},
746 Decal: {},
747 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500748
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500749 VertexMode: {
750 Triangles: {},
751 TrianglesStrip: {},
752 TriangleFan: {},
753 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500754
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500755 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400756
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500757 /**
758 * @type {Float32Array}
759 */
760 HEAPF32: {},
761 /**
762 * @type {Float64Array}
763 */
764 HEAPF64: {},
765 /**
766 * @type {Uint8Array}
767 */
768 HEAPU8: {},
769 /**
770 * @type {Uint16Array}
771 */
772 HEAPU16: {},
773 /**
774 * @type {Uint32Array}
775 */
776 HEAPU32: {},
777 /**
778 * @type {Int8Array}
779 */
780 HEAP8: {},
781 /**
782 * @type {Int16Array}
783 */
784 HEAP16: {},
785 /**
786 * @type {Int32Array}
787 */
788 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400789
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500790 _malloc: function() {},
791 _free: function() {},
792 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400793};
Kevin Lubick217056c2018-09-20 17:39:31 -0400794
Kevin Lubick006a6f32018-10-19 14:34:34 -0400795// Public API things that are newly declared in the JS should go here.
796// It's not enough to declare them above, because closure can still erase them
797// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400798CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
799
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500800CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400801CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400802CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500803CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500804CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500805CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300806CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400807CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400808CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400809CanvasKit.SkPath.prototype.conicTo = function() {};
810CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400811CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400812CanvasKit.SkPath.prototype.lineTo = function() {};
813CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400814CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400815CanvasKit.SkPath.prototype.op = function() {};
816CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400817CanvasKit.SkPath.prototype.rArcTo = function() {};
818CanvasKit.SkPath.prototype.rConicTo = function() {};
819CanvasKit.SkPath.prototype.rCubicTo = function() {};
820CanvasKit.SkPath.prototype.rLineTo = function() {};
821CanvasKit.SkPath.prototype.rMoveTo = function() {};
822CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400823CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400824CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400825CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400826CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400827CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400828
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500829CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400830
Kevin Lubick5b90b842018-10-17 07:57:18 -0400831CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400832CanvasKit.SkSurface.prototype.flush = function() {};
833CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800834CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400835CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400836
Alexander Khovansky3e119332018-11-15 02:01:19 +0300837CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400838CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300839
Kevin Lubick6bffe392020-04-02 15:24:15 -0400840CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400841CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500842CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500843CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400844CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500845/** @return {Uint8Array} */
846CanvasKit.SkCanvas.prototype.readPixels = function() {};
847CanvasKit.SkCanvas.prototype.writePixels = function() {};
848
Kevin Lubickddd0a332018-12-12 10:35:13 -0500849CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
850
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400851CanvasKit.SkFont.prototype.getWidths = function() {};
852
853CanvasKit.RSXFormBuilder.prototype.build = function() {};
854CanvasKit.RSXFormBuilder.prototype.delete = function() {};
855CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400856CanvasKit.RSXFormBuilder.prototype.set = function() {};
857
858CanvasKit.SkColorBuilder.prototype.build = function() {};
859CanvasKit.SkColorBuilder.prototype.delete = function() {};
860CanvasKit.SkColorBuilder.prototype.push = function() {};
861CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400862
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500863CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500864CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500865
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500866CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
867CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
868
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400869// Define StrokeOpts object
870var StrokeOpts = {};
871StrokeOpts.prototype.width;
872StrokeOpts.prototype.miter_limit;
873StrokeOpts.prototype.cap;
874StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500875StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400876
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500877// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500878var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500879HTMLCanvas.prototype.decodeImage = function() {};
880HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500881HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500882HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500883HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500884HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500885
886var CanvasRenderingContext2D = {};
887CanvasRenderingContext2D.prototype.addHitRegion = function() {};
888CanvasRenderingContext2D.prototype.arc = function() {};
889CanvasRenderingContext2D.prototype.arcTo = function() {};
890CanvasRenderingContext2D.prototype.beginPath = function() {};
891CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
892CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500893CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500894CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500895CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500896CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500897CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500898CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500899CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500900CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500901CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500902CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500903CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500904CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500905CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500906CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500907CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500908CanvasRenderingContext2D.prototype.isPointInPath = function() {};
909CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500910CanvasRenderingContext2D.prototype.lineTo = function() {};
911CanvasRenderingContext2D.prototype.measureText = function() {};
912CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500913CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500914CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
915CanvasRenderingContext2D.prototype.rect = function() {};
916CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
917CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500918CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500919CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500920CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500921CanvasRenderingContext2D.prototype.scale = function() {};
922CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500923CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500924CanvasRenderingContext2D.prototype.setTransform = function() {};
925CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500926CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500927CanvasRenderingContext2D.prototype.strokeText = function() {};
928CanvasRenderingContext2D.prototype.transform = function() {};
929CanvasRenderingContext2D.prototype.translate = function() {};
930
Kevin Lubicka40f8322018-12-17 16:01:36 -0500931var Path2D = {};
932Path2D.prototype.addPath = function() {};
933Path2D.prototype.arc = function() {};
934Path2D.prototype.arcTo = function() {};
935Path2D.prototype.bezierCurveTo = function() {};
936Path2D.prototype.closePath = function() {};
937Path2D.prototype.ellipse = function() {};
938Path2D.prototype.lineTo = function() {};
939Path2D.prototype.moveTo = function() {};
940Path2D.prototype.quadraticCurveTo = function() {};
941Path2D.prototype.rect = function() {};
942
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500943var LinearCanvasGradient = {};
944LinearCanvasGradient.prototype.addColorStop = function() {};
945var RadialCanvasGradient = {};
946RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500947var CanvasPattern = {};
948CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500949
Kevin Lubick52b9f372018-12-04 13:57:36 -0500950var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500951 /**
952 * @type {Uint8ClampedArray}
953 */
954 data: {},
955 height: {},
956 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -0500957};
958
Kevin Lubickd29edd72018-12-07 08:29:52 -0500959var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500960 a: {},
961 b: {},
962 c: {},
963 d: {},
964 e: {},
965 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500966};
967
Kevin Lubick217056c2018-09-20 17:39:31 -0400968// Not sure why this is needed - might be a bug in emsdk that this isn't properly declared.
Kevin Lubick6fccc9d2018-11-20 15:55:10 -0500969function loadWebAssemblyModule() {};