blob: 7b62777927cbe384f48ffe19c2b737e114f067fc [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050063 computeTonalColors: function() {},
64 currentContext: function() {},
65 getColorComponents: function() {},
66 getDecodeCacheLimitBytes: function() {},
67 getDecodeCacheUsageBytes: function() {},
68 getSkDataBytes: function() {},
69 multiplyByAlpha: function() {},
70 parseColorString: function() {},
71 setCurrentContext: function() {},
72 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040073
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050074 // private API (i.e. things declared in the bindings that we use
75 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040076 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050077 _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 Nifong1bedbeb2020-05-04 16:46:17 -0400107 ManagedAnimation: {
108 prototype: {
109 setColor: function() {},
110 },
111 },
112
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500113 Paragraph: {
114 // public API (from C++ bindings)
115 didExceedMaxLines: function() {},
116 getAlphabeticBaseline: function() {},
117 getGlyphPositionAtCoordinate: function() {},
118 getHeight: function() {},
119 getIdeographicBaseline: function() {},
120 getLongestLine: function() {},
121 getMaxIntrinsicWidth: function() {},
122 getMaxWidth: function() {},
123 getMinIntrinsicWidth: function() {},
124 getWordBoundary: function() {},
125 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400126
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500127 // private API
128 /** @return {Float32Array} */
129 _getRectsForRange: function() {},
130 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400131
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400132 ParagraphBuilder: {
133 Make: function() {},
134 addText: function() {},
135 build: function() {},
136 pop: function() {},
137
138 prototype: {
139 pushStyle: function() {},
140 },
141
142 // private API
143 _Make: function() {},
144 _pushStyle: function() {},
145 },
146
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500147 SkRuntimeEffect: {
148 // public API (from C++ bindings)
149 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500150
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500151 // private API
152 _makeShader: function() {},
153 _makeShaderWithChildren: function() {},
154 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500155
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500156 ParagraphStyle: function() {},
157 RSXFormBuilder: function() {},
158 SkColorBuilder: function() {},
159 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400160
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500161 ShapedText: {
162 // public API (from C++ bindings)
163 getBounds: function() {},
164 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500165
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500166 SkAnimatedImage: {
167 // public API (from C++ bindings)
168 decodeNextFrame: function() {},
169 getFrameCount: function() {},
170 getRepetitionCount: function() {},
171 height: function() {},
172 reset: function() {},
173 width: function() {},
174 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400175
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500176 SkCanvas: {
177 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500178 clipPath: function() {},
179 clipRRect: function() {},
180 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500181 drawAnimatedImage: function() {},
182 drawArc: function() {},
183 drawCircle: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500184 drawDRRect: function() {},
185 drawImage: function() {},
186 drawImageNine: function() {},
187 drawImageRect: function() {},
188 drawLine: function() {},
189 drawOval: function() {},
190 drawPaint: function() {},
191 drawParagraph: function() {},
192 drawPath: function() {},
193 drawPicture: function() {},
194 drawRRect: function() {},
195 drawRect: function() {},
196 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500197 drawText: function() {},
198 drawTextBlob: function() {},
199 drawVertices: function() {},
200 flush: function() {},
201 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500202 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400203 markCTM: function() {},
204 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 restore: function() {},
206 restoreToCount: function() {},
207 rotate: function() {},
208 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000209 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500210 scale: function() {},
211 skew: function() {},
212 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400213
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400214 prototype: {
215 clear: function() {},
216 drawColor: function() {},
217 drawShadow: function() {},
218 },
219
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500220 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400221 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400222 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500223 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400224 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500225 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400226 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500227 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400228 _getLocalToCamera: function() {},
229 _getLocalToDevice: function() {},
230 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400231 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400232 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500233 _readPixels: function() {},
234 _writePixels: function() {},
235 delete: function() {},
236 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400237
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500238 SkColorFilter: {
239 // public API (from C++ bindings and JS interface)
240 MakeBlend: function() {},
241 MakeCompose: function() {},
242 MakeLerp: function() {},
243 MakeLinearToSRGBGamma: function() {},
244 MakeMatrix: function() {},
245 MakeSRGBToLinearGamma: function() {},
246 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400247 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500248 _makeMatrix: function() {},
249 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400250
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500251 SkColorMatrix: {
252 concat: function() {},
253 identity: function() {},
254 postTranslate: function() {},
255 rotated: function() {},
256 scaled: function() {},
257 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400258
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500259 SkContourMeasureIter: {
260 next: function() {},
261 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500262
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500263 SkContourMeasure: {
264 getPosTan: function() {},
265 getSegment: function() {},
266 isClosed: function() {},
267 length: function() {},
268 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500269
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500270 SkFont: {
271 // public API (from C++ bindings)
272 getScaleX: function() {},
273 getSize: function() {},
274 getSkewX: function() {},
275 getTypeface: function() {},
276 measureText: function() {},
277 setHinting: function() {},
278 setLinearMetrics: function() {},
279 setScaleX: function() {},
280 setSize: function() {},
281 setSkewX: function() {},
282 setSubpixel: function() {},
283 setTypeface: function() {},
284 // private API (from C++ bindings)
285 _getWidths: function() {},
286 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500287
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500288 SkFontMgr: {
289 // public API (from C++ and JS bindings)
290 FromData: function() {},
291 RefDefault: function() {},
292 countFamilies: function() {},
293 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500294
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500295 // private API
296 _makeTypefaceFromData: function() {},
297 _fromData: function() {},
298 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500299
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500300 SkImage: {
301 // public API (from C++ bindings)
302 height: function() {},
303 width: function() {},
304 // private API
305 _encodeToData: function() {},
306 _encodeToDataWithFormat: function() {},
307 _makeShader: function() {},
308 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400309
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500310 SkImageFilter: {
311 MakeBlur: function() {},
312 MakeColorFilter: function() {},
313 MakeCompose: function() {},
314 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400315
316 // private API
317 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500318 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400319
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500320 // These are defined in interface.js
321 SkM44: {
322 identity: function() {},
323 invert: function() {},
324 multiply: function() {},
325 rotatedUnitSinCos: function() {},
326 rotated: function() {},
327 scaled: function() {},
328 translated: function() {},
329 lookat: function() {},
330 perspective: function() {},
331 rc: function() {},
332 transpose: function() {},
333 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500334
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500335 SkMatrix: {
336 identity: function() {},
337 invert: function() {},
338 mapPoints: function() {},
339 multiply: function() {},
340 rotated: function() {},
341 scaled: function() {},
342 skewed: function() {},
343 translated: function() {},
344 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500345
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500346 SkMaskFilter: {
347 MakeBlur: function() {},
348 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400349
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500350 SkPaint: {
351 // public API (from C++ bindings)
352 /** @return {CanvasKit.SkPaint} */
353 copy: function() {},
354 getBlendMode: function() {},
355 getColor: function() {},
356 getFilterQuality: function() {},
357 getStrokeCap: function() {},
358 getStrokeJoin: function() {},
359 getStrokeMiter: function() {},
360 getStrokeWidth: function() {},
361 setAntiAlias: function() {},
362 setBlendMode: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500363 setFilterQuality: function() {},
364 setImageFilter: function() {},
365 setMaskFilter: function() {},
366 setPathEffect: function() {},
367 setShader: function() {},
368 setStrokeCap: function() {},
369 setStrokeJoin: function() {},
370 setStrokeMiter: function() {},
371 setStrokeWidth: function() {},
372 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500373
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400374 prototype: {
375 setColor: function() {},
376 },
377
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500378 // Private API
379 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400380 _getColor: function() {},
381 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500382 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500383
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500384 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400385 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500386 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400387 MakeDiscrete: function() {},
388
389 // Private C++ API
390 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500391 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500392
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500393 SkParticleEffect: {
394 // public API (from C++ bindings)
395 draw: function() {},
396 getEffectUniform: function() {},
397 getEffectUniformCount: function() {},
398 getEffectUniformFloatCount: function() {},
399 getEffectUniformName: function() {},
400 getParticleUniformCount: function() {},
401 getParticleUniformFloatCount: function() {},
402 getParticleUniformName: function() {},
403 getParticleUniform: function() {},
404 setPosition: function() {},
405 setRate: function() {},
406 start: function() {},
407 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500408
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500409 // private API (from C++ bindings)
410 _effectUniformPtr: function() {},
411 _particleUniformPtr: function() {},
412 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500413
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500414 SkPath: {
415 // public API (from C++ bindings)
416 computeTightBounds: function() {},
417 contains: function() {},
418 /** @return {CanvasKit.SkPath} */
419 copy: function() {},
420 countPoints: function() {},
421 equals: function() {},
422 getBounds: function() {},
423 getFillType: function() {},
424 getPoint: function() {},
425 isEmpty: function() {},
426 isVolatile: function() {},
427 reset: function() {},
428 rewind: function() {},
429 setFillType: function() {},
430 setIsVolatile: function() {},
431 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400432
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500433 // private API
434 _addArc: function() {},
435 _addOval: function() {},
436 _addPath: function() {},
437 _addRect: function() {},
438 _addPoly: function() {},
439 _addRoundRect: function() {},
440 _arc: function() {},
441 _arcTo: function() {},
442 _close: function() {},
443 _conicTo: function() {},
444 _cubicTo: function() {},
445 _dash: function() {},
446 _lineTo: function() {},
447 _moveTo: function() {},
448 _op: function() {},
449 _quadTo: function() {},
450 _rArcTo: function() {},
451 _rConicTo: function() {},
452 _rCubicTo: function() {},
453 _rLineTo: function() {},
454 _rMoveTo: function() {},
455 _rQuadTo: function() {},
456 _rect: function() {},
457 _simplify: function() {},
458 _stroke: function() {},
459 _transform: function() {},
460 _trim: function() {},
461 delete: function() {},
462 dump: function() {},
463 dumpHex: function() {},
464 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400465
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500466 SkPathMeasure: {
467 getLength: function() {},
468 getSegment: function() {},
469 getPosTan: function() {},
470 isClosed: function() {},
471 nextContour: function() {},
472 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400473
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500474 SkPicture: {
475 serialize: function() {},
476 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400477
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500478 SkPictureRecorder: {
479 beginRecording: function() {},
480 finishRecordingAsPicture: function() {},
481 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400482
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500483 SkRect: {
484 fLeft: {},
485 fTop: {},
486 fRight: {},
487 fBottom: {},
488 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400489
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500490 SkRRect: {
491 rect: {},
492 rx1: {},
493 ry1: {},
494 rx2: {},
495 ry2: {},
496 rx3: {},
497 ry3: {},
498 rx4: {},
499 ry4: {},
500 },
Kevin Lubick62836902019-12-09 09:04:26 -0500501
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500502 SkShader: {
503 Blend: function() {},
504 Color: function() {},
505 Empty: function() {},
506 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400507 MakeLinearGradient: function() {},
508 MakeRadialGradient: function() {},
509 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700510 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400511
512 // private API (from C++ bindings)
513 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500514 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400515
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500516 SkSurface: {
517 // public API (from C++ bindings)
518 /** @return {CanvasKit.SkCanvas} */
519 getCanvas: function() {},
520 /** @return {CanvasKit.SkImage} */
521 makeImageSnapshot: function() {},
522 makeSurface: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400523 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500524 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400525
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500526 // private API
527 _flush: function() {},
528 _getRasterN32PremulSurface: function() {},
529 delete: function() {},
530 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500531
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500532 SkTextBlob: {
533 // public API (both C++ and JS bindings)
534 MakeFromRSXform: function() {},
535 MakeFromText: function() {},
536 MakeOnPath: function() {},
537 // private API (from C++ bindings)
538 _MakeFromRSXform: function() {},
539 _MakeFromText: function() {},
540 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500541
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500542 // These are defined in interface.js
543 SkVector: {
544 add: function() {},
545 sub: function() {},
546 dot: function() {},
547 cross: function() {},
548 normalize: function() {},
549 mulScalar: function() {},
550 length: function() {},
551 lengthSquared: function() {},
552 dist: function() {},
553 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400554
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500555 SkVertices: {
556 // public API (from C++ bindings)
557 bounds: function() {},
558 mode: function() {},
559 uniqueID: function() {},
560 vertexCount: function() {},
561 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400562
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500563 _SkVerticesBuilder: {
564 colors: function() {},
565 detach: function() {},
566 indices: function() {},
567 positions: function() {},
568 texCoords: function() {},
569 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400570
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500571 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400572
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500573 // Constants and Enums
574 gpu: {},
575 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400576
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500577 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400578 BLACK: {},
579 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500580 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400581 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500582 BLUE: {},
583 YELLOW: {},
584 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400585 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500586
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500587 MOVE_VERB: {},
588 LINE_VERB: {},
589 QUAD_VERB: {},
590 CONIC_VERB: {},
591 CUBIC_VERB: {},
592 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500593
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500594 NoDecoration: {},
595 UnderlineDecoration: {},
596 OverlineDecoration: {},
597 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400598
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500599 SaveLayerInitWithPrevious: {},
600 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400601
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500602 Affinity: {
603 Upstream: {},
604 Downstream: {},
605 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400606
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500607 AlphaType: {
608 Opaque: {},
609 Premul: {},
610 Unpremul: {},
611 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500612
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500613 BlendMode: {
614 Clear: {},
615 Src: {},
616 Dst: {},
617 SrcOver: {},
618 DstOver: {},
619 SrcIn: {},
620 DstIn: {},
621 SrcOut: {},
622 DstOut: {},
623 SrcATop: {},
624 DstATop: {},
625 Xor: {},
626 Plus: {},
627 Modulate: {},
628 Screen: {},
629 Overlay: {},
630 Darken: {},
631 Lighten: {},
632 ColorDodge: {},
633 ColorBurn: {},
634 HardLight: {},
635 SoftLight: {},
636 Difference: {},
637 Exclusion: {},
638 Multiply: {},
639 Hue: {},
640 Saturation: {},
641 Color: {},
642 Luminosity: {},
643 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500644
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500645 BlurStyle: {
646 Normal: {},
647 Solid: {},
648 Outer: {},
649 Inner: {},
650 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500651
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500652 ClipOp: {
653 Difference: {},
654 Intersect: {},
655 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500656
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500657 ColorType: {
658 Alpha_8: {},
659 RGB_565: {},
660 ARGB_4444: {},
661 RGBA_8888: {},
662 RGB_888x: {},
663 BGRA_8888: {},
664 RGBA_1010102: {},
665 RGB_101010x: {},
666 Gray_8: {},
667 RGBA_F16: {},
668 RGBA_F32: {},
669 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500670
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500671 FillType: {
672 Winding: {},
673 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500674 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400675
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500676 FilterQuality: {
677 None: {},
678 Low: {},
679 Medium: {},
680 High: {},
681 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500682
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 FontSlant: {
684 Upright: {},
685 Italic: {},
686 Oblique: {},
687 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400688
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500689 FontHinting: {
690 None: {},
691 Slight: {},
692 Normal: {},
693 Full: {},
694 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500695
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500696 FontWeight: {
697 Invisible: {},
698 Thin: {},
699 ExtraLight: {},
700 Light: {},
701 Normal: {},
702 Medium: {},
703 SemiBold: {},
704 Bold: {},
705 ExtraBold: {},
706 Black: {},
707 ExtraBlack: {},
708 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400709
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500710 FontWidth: {
711 UltraCondensed: {},
712 ExtraCondensed: {},
713 Condensed: {},
714 SemiCondensed: {},
715 Normal: {},
716 SemiExpanded: {},
717 Expanded: {},
718 ExtraExpanded: {},
719 UltraExpanded: {},
720 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400721
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500722 ImageFormat: {
723 PNG: {},
724 JPEG: {},
725 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300726
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500727 PaintStyle: {
728 Fill: {},
729 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500731
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500732 PathOp: {
733 Difference: {},
734 Intersect: {},
735 Union: {},
736 XOR: {},
737 ReverseDifference: {},
738 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500739
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500740 PointMode: {
741 Points: {},
742 Lines: {},
743 Polygon: {},
744 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500745
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500746 RectHeightStyle: {
747 Tight: {},
748 Max: {},
749 IncludeLineSpacingMiddle: {},
750 IncludeLineSpacingTop: {},
751 IncludeLineSpacingBottom: {},
752 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400753
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500754 RectWidthStyle: {
755 Tight: {},
756 Max: {},
757 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400758
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500759 StrokeCap: {
760 Butt: {},
761 Round: {},
762 Square: {},
763 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500764
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500765 StrokeJoin: {
766 Miter: {},
767 Round: {},
768 Bevel: {},
769 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500770
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500771 TextAlign: {
772 Left: {},
773 Right: {},
774 Center: {},
775 Justify: {},
776 Start: {},
777 End: {},
778 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400779
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500780 TextDirection: {
781 LTR: {},
782 RTL: {},
783 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400784
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500785 TileMode: {
786 Clamp: {},
787 Repeat: {},
788 Mirror: {},
789 Decal: {},
790 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500791
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500792 VertexMode: {
793 Triangles: {},
794 TrianglesStrip: {},
795 TriangleFan: {},
796 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500797
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500798 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400799
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500800 /**
801 * @type {Float32Array}
802 */
803 HEAPF32: {},
804 /**
805 * @type {Float64Array}
806 */
807 HEAPF64: {},
808 /**
809 * @type {Uint8Array}
810 */
811 HEAPU8: {},
812 /**
813 * @type {Uint16Array}
814 */
815 HEAPU16: {},
816 /**
817 * @type {Uint32Array}
818 */
819 HEAPU32: {},
820 /**
821 * @type {Int8Array}
822 */
823 HEAP8: {},
824 /**
825 * @type {Int16Array}
826 */
827 HEAP16: {},
828 /**
829 * @type {Int32Array}
830 */
831 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400832
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500833 _malloc: function() {},
834 _free: function() {},
835 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400836};
Kevin Lubick217056c2018-09-20 17:39:31 -0400837
Kevin Lubick006a6f32018-10-19 14:34:34 -0400838// Public API things that are newly declared in the JS should go here.
839// It's not enough to declare them above, because closure can still erase them
840// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400841CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
842
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500843CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400844CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400845CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500846CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500847CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500848CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300849CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400850CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400851CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400852CanvasKit.SkPath.prototype.conicTo = function() {};
853CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400854CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400855CanvasKit.SkPath.prototype.lineTo = function() {};
856CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400857CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400858CanvasKit.SkPath.prototype.op = function() {};
859CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400860CanvasKit.SkPath.prototype.rArcTo = function() {};
861CanvasKit.SkPath.prototype.rConicTo = function() {};
862CanvasKit.SkPath.prototype.rCubicTo = function() {};
863CanvasKit.SkPath.prototype.rLineTo = function() {};
864CanvasKit.SkPath.prototype.rMoveTo = function() {};
865CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400866CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400867CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400868CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400869CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400870CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400871
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500872CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400873
Kevin Lubick5b90b842018-10-17 07:57:18 -0400874CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400875CanvasKit.SkSurface.prototype.flush = function() {};
876CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800877CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400878CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400879
Alexander Khovansky3e119332018-11-15 02:01:19 +0300880CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400881CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300882
Kevin Lubick6bffe392020-04-02 15:24:15 -0400883CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400884CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400885CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500886CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500887CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400888CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
889CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
890CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400891CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500892/** @return {Uint8Array} */
893CanvasKit.SkCanvas.prototype.readPixels = function() {};
894CanvasKit.SkCanvas.prototype.writePixels = function() {};
895
Kevin Lubickddd0a332018-12-12 10:35:13 -0500896CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
897
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400898CanvasKit.SkFont.prototype.getWidths = function() {};
899
900CanvasKit.RSXFormBuilder.prototype.build = function() {};
901CanvasKit.RSXFormBuilder.prototype.delete = function() {};
902CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400903CanvasKit.RSXFormBuilder.prototype.set = function() {};
904
905CanvasKit.SkColorBuilder.prototype.build = function() {};
906CanvasKit.SkColorBuilder.prototype.delete = function() {};
907CanvasKit.SkColorBuilder.prototype.push = function() {};
908CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400909
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500910CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500911CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500912
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500913CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
914CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
915
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400916// Define StrokeOpts object
917var StrokeOpts = {};
918StrokeOpts.prototype.width;
919StrokeOpts.prototype.miter_limit;
920StrokeOpts.prototype.cap;
921StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500922StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400923
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500924// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500925var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500926HTMLCanvas.prototype.decodeImage = function() {};
927HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500928HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500929HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500930HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500931HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500932
933var CanvasRenderingContext2D = {};
934CanvasRenderingContext2D.prototype.addHitRegion = function() {};
935CanvasRenderingContext2D.prototype.arc = function() {};
936CanvasRenderingContext2D.prototype.arcTo = function() {};
937CanvasRenderingContext2D.prototype.beginPath = function() {};
938CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
939CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500940CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500941CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500942CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500943CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500944CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500945CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500946CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500947CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500948CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500949CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500950CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500951CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500952CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500953CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500954CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500955CanvasRenderingContext2D.prototype.isPointInPath = function() {};
956CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500957CanvasRenderingContext2D.prototype.lineTo = function() {};
958CanvasRenderingContext2D.prototype.measureText = function() {};
959CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500960CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500961CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
962CanvasRenderingContext2D.prototype.rect = function() {};
963CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
964CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500965CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500966CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500967CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500968CanvasRenderingContext2D.prototype.scale = function() {};
969CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500970CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500971CanvasRenderingContext2D.prototype.setTransform = function() {};
972CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500973CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500974CanvasRenderingContext2D.prototype.strokeText = function() {};
975CanvasRenderingContext2D.prototype.transform = function() {};
976CanvasRenderingContext2D.prototype.translate = function() {};
977
Kevin Lubicka40f8322018-12-17 16:01:36 -0500978var Path2D = {};
979Path2D.prototype.addPath = function() {};
980Path2D.prototype.arc = function() {};
981Path2D.prototype.arcTo = function() {};
982Path2D.prototype.bezierCurveTo = function() {};
983Path2D.prototype.closePath = function() {};
984Path2D.prototype.ellipse = function() {};
985Path2D.prototype.lineTo = function() {};
986Path2D.prototype.moveTo = function() {};
987Path2D.prototype.quadraticCurveTo = function() {};
988Path2D.prototype.rect = function() {};
989
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500990var LinearCanvasGradient = {};
991LinearCanvasGradient.prototype.addColorStop = function() {};
992var RadialCanvasGradient = {};
993RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500994var CanvasPattern = {};
995CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500996
Kevin Lubick52b9f372018-12-04 13:57:36 -0500997var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500998 /**
999 * @type {Uint8ClampedArray}
1000 */
1001 data: {},
1002 height: {},
1003 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001004};
1005
Kevin Lubickd29edd72018-12-07 08:29:52 -05001006var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001007 a: {},
1008 b: {},
1009 c: {},
1010 d: {},
1011 e: {},
1012 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001013};
1014
Kevin Lubick217056c2018-09-20 17:39:31 -04001015// 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 -05001016function loadWebAssemblyModule() {};