blob: e71acf085145e228aa507a167d147b32e231c232 [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 Lubickc1d08982020-04-06 13:52:15 -0400199 _getLocalToCamera: function() {},
200 _getLocalToDevice: function() {},
201 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400202 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 _readPixels: function() {},
204 _writePixels: function() {},
205 delete: function() {},
206 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400207
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 SkColorFilter: {
209 // public API (from C++ bindings and JS interface)
210 MakeBlend: function() {},
211 MakeCompose: function() {},
212 MakeLerp: function() {},
213 MakeLinearToSRGBGamma: function() {},
214 MakeMatrix: function() {},
215 MakeSRGBToLinearGamma: function() {},
216 // private API (from C++ bindings)
217 _makeMatrix: function() {},
218 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400219
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500220 SkColorMatrix: {
221 concat: function() {},
222 identity: function() {},
223 postTranslate: function() {},
224 rotated: function() {},
225 scaled: function() {},
226 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400227
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500228 SkContourMeasureIter: {
229 next: function() {},
230 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500231
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500232 SkContourMeasure: {
233 getPosTan: function() {},
234 getSegment: function() {},
235 isClosed: function() {},
236 length: function() {},
237 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500238
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500239 SkFont: {
240 // public API (from C++ bindings)
241 getScaleX: function() {},
242 getSize: function() {},
243 getSkewX: function() {},
244 getTypeface: function() {},
245 measureText: function() {},
246 setHinting: function() {},
247 setLinearMetrics: function() {},
248 setScaleX: function() {},
249 setSize: function() {},
250 setSkewX: function() {},
251 setSubpixel: function() {},
252 setTypeface: function() {},
253 // private API (from C++ bindings)
254 _getWidths: function() {},
255 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500256
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500257 SkFontMgr: {
258 // public API (from C++ and JS bindings)
259 FromData: function() {},
260 RefDefault: function() {},
261 countFamilies: function() {},
262 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500263
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500264 // private API
265 _makeTypefaceFromData: function() {},
266 _fromData: function() {},
267 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500268
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500269 SkImage: {
270 // public API (from C++ bindings)
271 height: function() {},
272 width: function() {},
273 // private API
274 _encodeToData: function() {},
275 _encodeToDataWithFormat: function() {},
276 _makeShader: function() {},
277 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400278
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500279 SkImageFilter: {
280 MakeBlur: function() {},
281 MakeColorFilter: function() {},
282 MakeCompose: function() {},
283 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400284
285 // private API
286 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500287 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400288
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500289 // These are defined in interface.js
290 SkM44: {
291 identity: function() {},
292 invert: function() {},
293 multiply: function() {},
294 rotatedUnitSinCos: function() {},
295 rotated: function() {},
296 scaled: function() {},
297 translated: function() {},
298 lookat: function() {},
299 perspective: function() {},
300 rc: function() {},
301 transpose: function() {},
302 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500303
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500304 SkMatrix: {
305 identity: function() {},
306 invert: function() {},
307 mapPoints: function() {},
308 multiply: function() {},
309 rotated: function() {},
310 scaled: function() {},
311 skewed: function() {},
312 translated: function() {},
313 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500314
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500315 SkMaskFilter: {
316 MakeBlur: function() {},
317 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400318
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500319 SkPaint: {
320 // public API (from C++ bindings)
321 /** @return {CanvasKit.SkPaint} */
322 copy: function() {},
323 getBlendMode: function() {},
324 getColor: function() {},
325 getFilterQuality: function() {},
326 getStrokeCap: function() {},
327 getStrokeJoin: function() {},
328 getStrokeMiter: function() {},
329 getStrokeWidth: function() {},
330 setAntiAlias: function() {},
331 setBlendMode: function() {},
332 setColor: function() {},
333 setFilterQuality: function() {},
334 setImageFilter: function() {},
335 setMaskFilter: function() {},
336 setPathEffect: function() {},
337 setShader: function() {},
338 setStrokeCap: function() {},
339 setStrokeJoin: function() {},
340 setStrokeMiter: function() {},
341 setStrokeWidth: function() {},
342 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500343
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500344 // Private API
345 delete: function() {},
346 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500347
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500348 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400349 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500350 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400351 MakeDiscrete: function() {},
352
353 // Private C++ API
354 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500355 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500356
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500357 SkParticleEffect: {
358 // public API (from C++ bindings)
359 draw: function() {},
360 getEffectUniform: function() {},
361 getEffectUniformCount: function() {},
362 getEffectUniformFloatCount: function() {},
363 getEffectUniformName: function() {},
364 getParticleUniformCount: function() {},
365 getParticleUniformFloatCount: function() {},
366 getParticleUniformName: function() {},
367 getParticleUniform: function() {},
368 setPosition: function() {},
369 setRate: function() {},
370 start: function() {},
371 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500372
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500373 // private API (from C++ bindings)
374 _effectUniformPtr: function() {},
375 _particleUniformPtr: function() {},
376 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500377
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500378 SkPath: {
379 // public API (from C++ bindings)
380 computeTightBounds: function() {},
381 contains: function() {},
382 /** @return {CanvasKit.SkPath} */
383 copy: function() {},
384 countPoints: function() {},
385 equals: function() {},
386 getBounds: function() {},
387 getFillType: function() {},
388 getPoint: function() {},
389 isEmpty: function() {},
390 isVolatile: function() {},
391 reset: function() {},
392 rewind: function() {},
393 setFillType: function() {},
394 setIsVolatile: function() {},
395 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400396
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500397 // private API
398 _addArc: function() {},
399 _addOval: function() {},
400 _addPath: function() {},
401 _addRect: function() {},
402 _addPoly: function() {},
403 _addRoundRect: function() {},
404 _arc: function() {},
405 _arcTo: function() {},
406 _close: function() {},
407 _conicTo: function() {},
408 _cubicTo: function() {},
409 _dash: function() {},
410 _lineTo: function() {},
411 _moveTo: function() {},
412 _op: function() {},
413 _quadTo: function() {},
414 _rArcTo: function() {},
415 _rConicTo: function() {},
416 _rCubicTo: function() {},
417 _rLineTo: function() {},
418 _rMoveTo: function() {},
419 _rQuadTo: function() {},
420 _rect: function() {},
421 _simplify: function() {},
422 _stroke: function() {},
423 _transform: function() {},
424 _trim: function() {},
425 delete: function() {},
426 dump: function() {},
427 dumpHex: function() {},
428 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400429
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500430 SkPathMeasure: {
431 getLength: function() {},
432 getSegment: function() {},
433 getPosTan: function() {},
434 isClosed: function() {},
435 nextContour: function() {},
436 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400437
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500438 SkPicture: {
439 serialize: function() {},
440 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400441
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500442 SkPictureRecorder: {
443 beginRecording: function() {},
444 finishRecordingAsPicture: function() {},
445 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400446
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500447 SkRect: {
448 fLeft: {},
449 fTop: {},
450 fRight: {},
451 fBottom: {},
452 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400453
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500454 SkRRect: {
455 rect: {},
456 rx1: {},
457 ry1: {},
458 rx2: {},
459 ry2: {},
460 rx3: {},
461 ry3: {},
462 rx4: {},
463 ry4: {},
464 },
Kevin Lubick62836902019-12-09 09:04:26 -0500465
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500466 SkShader: {
467 Blend: function() {},
468 Color: function() {},
469 Empty: function() {},
470 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400471 MakeLinearGradient: function() {},
472 MakeRadialGradient: function() {},
473 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700474 MakeSweepGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500475 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400476
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500477 SkSurface: {
478 // public API (from C++ bindings)
479 /** @return {CanvasKit.SkCanvas} */
480 getCanvas: function() {},
481 /** @return {CanvasKit.SkImage} */
482 makeImageSnapshot: function() {},
483 makeSurface: function() {},
484 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400485
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500486 // private API
487 _flush: function() {},
488 _getRasterN32PremulSurface: function() {},
489 delete: function() {},
490 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500491
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500492 SkTextBlob: {
493 // public API (both C++ and JS bindings)
494 MakeFromRSXform: function() {},
495 MakeFromText: function() {},
496 MakeOnPath: function() {},
497 // private API (from C++ bindings)
498 _MakeFromRSXform: function() {},
499 _MakeFromText: function() {},
500 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500501
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500502 // These are defined in interface.js
503 SkVector: {
504 add: function() {},
505 sub: function() {},
506 dot: function() {},
507 cross: function() {},
508 normalize: function() {},
509 mulScalar: function() {},
510 length: function() {},
511 lengthSquared: function() {},
512 dist: function() {},
513 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400514
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500515 SkVertices: {
516 // public API (from C++ bindings)
517 bounds: function() {},
518 mode: function() {},
519 uniqueID: function() {},
520 vertexCount: function() {},
521 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400522
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500523 _SkVerticesBuilder: {
524 colors: function() {},
525 detach: function() {},
526 indices: function() {},
527 positions: function() {},
528 texCoords: function() {},
529 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400530
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500531 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400532
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500533 // Constants and Enums
534 gpu: {},
535 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400536
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500537 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400538 BLACK: {},
539 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500540 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400541 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500542 BLUE: {},
543 YELLOW: {},
544 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400545 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500546
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500547 MOVE_VERB: {},
548 LINE_VERB: {},
549 QUAD_VERB: {},
550 CONIC_VERB: {},
551 CUBIC_VERB: {},
552 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500553
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500554 NoDecoration: {},
555 UnderlineDecoration: {},
556 OverlineDecoration: {},
557 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400558
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500559 SaveLayerInitWithPrevious: {},
560 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400561
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500562 Affinity: {
563 Upstream: {},
564 Downstream: {},
565 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400566
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500567 AlphaType: {
568 Opaque: {},
569 Premul: {},
570 Unpremul: {},
571 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500572
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500573 BlendMode: {
574 Clear: {},
575 Src: {},
576 Dst: {},
577 SrcOver: {},
578 DstOver: {},
579 SrcIn: {},
580 DstIn: {},
581 SrcOut: {},
582 DstOut: {},
583 SrcATop: {},
584 DstATop: {},
585 Xor: {},
586 Plus: {},
587 Modulate: {},
588 Screen: {},
589 Overlay: {},
590 Darken: {},
591 Lighten: {},
592 ColorDodge: {},
593 ColorBurn: {},
594 HardLight: {},
595 SoftLight: {},
596 Difference: {},
597 Exclusion: {},
598 Multiply: {},
599 Hue: {},
600 Saturation: {},
601 Color: {},
602 Luminosity: {},
603 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500604
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500605 BlurStyle: {
606 Normal: {},
607 Solid: {},
608 Outer: {},
609 Inner: {},
610 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500611
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500612 ClipOp: {
613 Difference: {},
614 Intersect: {},
615 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500616
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500617 ColorType: {
618 Alpha_8: {},
619 RGB_565: {},
620 ARGB_4444: {},
621 RGBA_8888: {},
622 RGB_888x: {},
623 BGRA_8888: {},
624 RGBA_1010102: {},
625 RGB_101010x: {},
626 Gray_8: {},
627 RGBA_F16: {},
628 RGBA_F32: {},
629 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500630
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500631 FillType: {
632 Winding: {},
633 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500634 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400635
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500636 FilterQuality: {
637 None: {},
638 Low: {},
639 Medium: {},
640 High: {},
641 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500642
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500643 FontSlant: {
644 Upright: {},
645 Italic: {},
646 Oblique: {},
647 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400648
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500649 FontHinting: {
650 None: {},
651 Slight: {},
652 Normal: {},
653 Full: {},
654 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500655
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500656 FontWeight: {
657 Invisible: {},
658 Thin: {},
659 ExtraLight: {},
660 Light: {},
661 Normal: {},
662 Medium: {},
663 SemiBold: {},
664 Bold: {},
665 ExtraBold: {},
666 Black: {},
667 ExtraBlack: {},
668 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400669
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500670 FontWidth: {
671 UltraCondensed: {},
672 ExtraCondensed: {},
673 Condensed: {},
674 SemiCondensed: {},
675 Normal: {},
676 SemiExpanded: {},
677 Expanded: {},
678 ExtraExpanded: {},
679 UltraExpanded: {},
680 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400681
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500682 ImageFormat: {
683 PNG: {},
684 JPEG: {},
685 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300686
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500687 PaintStyle: {
688 Fill: {},
689 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500690 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500691
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 PathOp: {
693 Difference: {},
694 Intersect: {},
695 Union: {},
696 XOR: {},
697 ReverseDifference: {},
698 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500699
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 PointMode: {
701 Points: {},
702 Lines: {},
703 Polygon: {},
704 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500705
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500706 RectHeightStyle: {
707 Tight: {},
708 Max: {},
709 IncludeLineSpacingMiddle: {},
710 IncludeLineSpacingTop: {},
711 IncludeLineSpacingBottom: {},
712 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400713
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500714 RectWidthStyle: {
715 Tight: {},
716 Max: {},
717 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400718
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500719 StrokeCap: {
720 Butt: {},
721 Round: {},
722 Square: {},
723 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 StrokeJoin: {
726 Miter: {},
727 Round: {},
728 Bevel: {},
729 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500730
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500731 TextAlign: {
732 Left: {},
733 Right: {},
734 Center: {},
735 Justify: {},
736 Start: {},
737 End: {},
738 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400739
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500740 TextDirection: {
741 LTR: {},
742 RTL: {},
743 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400744
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500745 TileMode: {
746 Clamp: {},
747 Repeat: {},
748 Mirror: {},
749 Decal: {},
750 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500751
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500752 VertexMode: {
753 Triangles: {},
754 TrianglesStrip: {},
755 TriangleFan: {},
756 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500757
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500758 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400759
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500760 /**
761 * @type {Float32Array}
762 */
763 HEAPF32: {},
764 /**
765 * @type {Float64Array}
766 */
767 HEAPF64: {},
768 /**
769 * @type {Uint8Array}
770 */
771 HEAPU8: {},
772 /**
773 * @type {Uint16Array}
774 */
775 HEAPU16: {},
776 /**
777 * @type {Uint32Array}
778 */
779 HEAPU32: {},
780 /**
781 * @type {Int8Array}
782 */
783 HEAP8: {},
784 /**
785 * @type {Int16Array}
786 */
787 HEAP16: {},
788 /**
789 * @type {Int32Array}
790 */
791 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400792
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500793 _malloc: function() {},
794 _free: function() {},
795 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400796};
Kevin Lubick217056c2018-09-20 17:39:31 -0400797
Kevin Lubick006a6f32018-10-19 14:34:34 -0400798// Public API things that are newly declared in the JS should go here.
799// It's not enough to declare them above, because closure can still erase them
800// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400801CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
802
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500803CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400804CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400805CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500806CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500807CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500808CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300809CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400810CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400811CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400812CanvasKit.SkPath.prototype.conicTo = function() {};
813CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400814CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400815CanvasKit.SkPath.prototype.lineTo = function() {};
816CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400817CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400818CanvasKit.SkPath.prototype.op = function() {};
819CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400820CanvasKit.SkPath.prototype.rArcTo = function() {};
821CanvasKit.SkPath.prototype.rConicTo = function() {};
822CanvasKit.SkPath.prototype.rCubicTo = function() {};
823CanvasKit.SkPath.prototype.rLineTo = function() {};
824CanvasKit.SkPath.prototype.rMoveTo = function() {};
825CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400826CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400827CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400828CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400829CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400830CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400831
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500832CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400833
Kevin Lubick5b90b842018-10-17 07:57:18 -0400834CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400835CanvasKit.SkSurface.prototype.flush = function() {};
836CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800837CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400838CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400839
Alexander Khovansky3e119332018-11-15 02:01:19 +0300840CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400841CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300842
Kevin Lubick6bffe392020-04-02 15:24:15 -0400843CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400844CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400845CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500846CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500847CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400848CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
849CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
850CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400851CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500852/** @return {Uint8Array} */
853CanvasKit.SkCanvas.prototype.readPixels = function() {};
854CanvasKit.SkCanvas.prototype.writePixels = function() {};
855
Kevin Lubickddd0a332018-12-12 10:35:13 -0500856CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
857
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400858CanvasKit.SkFont.prototype.getWidths = function() {};
859
860CanvasKit.RSXFormBuilder.prototype.build = function() {};
861CanvasKit.RSXFormBuilder.prototype.delete = function() {};
862CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400863CanvasKit.RSXFormBuilder.prototype.set = function() {};
864
865CanvasKit.SkColorBuilder.prototype.build = function() {};
866CanvasKit.SkColorBuilder.prototype.delete = function() {};
867CanvasKit.SkColorBuilder.prototype.push = function() {};
868CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400869
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500870CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500871CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500872
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500873CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
874CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
875
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400876// Define StrokeOpts object
877var StrokeOpts = {};
878StrokeOpts.prototype.width;
879StrokeOpts.prototype.miter_limit;
880StrokeOpts.prototype.cap;
881StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500882StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400883
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500884// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500885var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500886HTMLCanvas.prototype.decodeImage = function() {};
887HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500888HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500889HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500890HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500891HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500892
893var CanvasRenderingContext2D = {};
894CanvasRenderingContext2D.prototype.addHitRegion = function() {};
895CanvasRenderingContext2D.prototype.arc = function() {};
896CanvasRenderingContext2D.prototype.arcTo = function() {};
897CanvasRenderingContext2D.prototype.beginPath = function() {};
898CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
899CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500900CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500901CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500902CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500903CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500904CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500905CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500906CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500907CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500908CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500909CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500910CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500911CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500912CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500913CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500914CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500915CanvasRenderingContext2D.prototype.isPointInPath = function() {};
916CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500917CanvasRenderingContext2D.prototype.lineTo = function() {};
918CanvasRenderingContext2D.prototype.measureText = function() {};
919CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500920CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500921CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
922CanvasRenderingContext2D.prototype.rect = function() {};
923CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
924CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500925CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500926CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500927CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500928CanvasRenderingContext2D.prototype.scale = function() {};
929CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500930CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500931CanvasRenderingContext2D.prototype.setTransform = function() {};
932CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500933CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500934CanvasRenderingContext2D.prototype.strokeText = function() {};
935CanvasRenderingContext2D.prototype.transform = function() {};
936CanvasRenderingContext2D.prototype.translate = function() {};
937
Kevin Lubicka40f8322018-12-17 16:01:36 -0500938var Path2D = {};
939Path2D.prototype.addPath = function() {};
940Path2D.prototype.arc = function() {};
941Path2D.prototype.arcTo = function() {};
942Path2D.prototype.bezierCurveTo = function() {};
943Path2D.prototype.closePath = function() {};
944Path2D.prototype.ellipse = function() {};
945Path2D.prototype.lineTo = function() {};
946Path2D.prototype.moveTo = function() {};
947Path2D.prototype.quadraticCurveTo = function() {};
948Path2D.prototype.rect = function() {};
949
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500950var LinearCanvasGradient = {};
951LinearCanvasGradient.prototype.addColorStop = function() {};
952var RadialCanvasGradient = {};
953RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500954var CanvasPattern = {};
955CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500956
Kevin Lubick52b9f372018-12-04 13:57:36 -0500957var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500958 /**
959 * @type {Uint8ClampedArray}
960 */
961 data: {},
962 height: {},
963 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -0500964};
965
Kevin Lubickd29edd72018-12-07 08:29:52 -0500966var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500967 a: {},
968 b: {},
969 c: {},
970 d: {},
971 e: {},
972 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500973};
974
Kevin Lubick217056c2018-09-20 17:39:31 -0400975// 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 -0500976function loadWebAssemblyModule() {};