blob: 565319c26af4293ec39f0dba1e3281b3cce05706 [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() {},
523 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400524
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500525 // private API
526 _flush: function() {},
527 _getRasterN32PremulSurface: function() {},
528 delete: function() {},
529 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500530
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500531 SkTextBlob: {
532 // public API (both C++ and JS bindings)
533 MakeFromRSXform: function() {},
534 MakeFromText: function() {},
535 MakeOnPath: function() {},
536 // private API (from C++ bindings)
537 _MakeFromRSXform: function() {},
538 _MakeFromText: function() {},
539 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500540
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500541 // These are defined in interface.js
542 SkVector: {
543 add: function() {},
544 sub: function() {},
545 dot: function() {},
546 cross: function() {},
547 normalize: function() {},
548 mulScalar: function() {},
549 length: function() {},
550 lengthSquared: function() {},
551 dist: function() {},
552 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400553
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500554 SkVertices: {
555 // public API (from C++ bindings)
556 bounds: function() {},
557 mode: function() {},
558 uniqueID: function() {},
559 vertexCount: function() {},
560 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400561
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500562 _SkVerticesBuilder: {
563 colors: function() {},
564 detach: function() {},
565 indices: function() {},
566 positions: function() {},
567 texCoords: function() {},
568 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400569
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500570 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400571
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500572 // Constants and Enums
573 gpu: {},
574 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400575
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500576 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400577 BLACK: {},
578 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500579 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400580 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500581 BLUE: {},
582 YELLOW: {},
583 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400584 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500585
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500586 MOVE_VERB: {},
587 LINE_VERB: {},
588 QUAD_VERB: {},
589 CONIC_VERB: {},
590 CUBIC_VERB: {},
591 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500592
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500593 NoDecoration: {},
594 UnderlineDecoration: {},
595 OverlineDecoration: {},
596 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400597
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500598 SaveLayerInitWithPrevious: {},
599 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400600
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500601 Affinity: {
602 Upstream: {},
603 Downstream: {},
604 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400605
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500606 AlphaType: {
607 Opaque: {},
608 Premul: {},
609 Unpremul: {},
610 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500611
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500612 BlendMode: {
613 Clear: {},
614 Src: {},
615 Dst: {},
616 SrcOver: {},
617 DstOver: {},
618 SrcIn: {},
619 DstIn: {},
620 SrcOut: {},
621 DstOut: {},
622 SrcATop: {},
623 DstATop: {},
624 Xor: {},
625 Plus: {},
626 Modulate: {},
627 Screen: {},
628 Overlay: {},
629 Darken: {},
630 Lighten: {},
631 ColorDodge: {},
632 ColorBurn: {},
633 HardLight: {},
634 SoftLight: {},
635 Difference: {},
636 Exclusion: {},
637 Multiply: {},
638 Hue: {},
639 Saturation: {},
640 Color: {},
641 Luminosity: {},
642 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500643
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 BlurStyle: {
645 Normal: {},
646 Solid: {},
647 Outer: {},
648 Inner: {},
649 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500650
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500651 ClipOp: {
652 Difference: {},
653 Intersect: {},
654 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500655
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500656 ColorType: {
657 Alpha_8: {},
658 RGB_565: {},
659 ARGB_4444: {},
660 RGBA_8888: {},
661 RGB_888x: {},
662 BGRA_8888: {},
663 RGBA_1010102: {},
664 RGB_101010x: {},
665 Gray_8: {},
666 RGBA_F16: {},
667 RGBA_F32: {},
668 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500669
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500670 FillType: {
671 Winding: {},
672 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500673 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400674
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500675 FilterQuality: {
676 None: {},
677 Low: {},
678 Medium: {},
679 High: {},
680 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500681
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500682 FontSlant: {
683 Upright: {},
684 Italic: {},
685 Oblique: {},
686 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400687
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500688 FontHinting: {
689 None: {},
690 Slight: {},
691 Normal: {},
692 Full: {},
693 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500694
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500695 FontWeight: {
696 Invisible: {},
697 Thin: {},
698 ExtraLight: {},
699 Light: {},
700 Normal: {},
701 Medium: {},
702 SemiBold: {},
703 Bold: {},
704 ExtraBold: {},
705 Black: {},
706 ExtraBlack: {},
707 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400708
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500709 FontWidth: {
710 UltraCondensed: {},
711 ExtraCondensed: {},
712 Condensed: {},
713 SemiCondensed: {},
714 Normal: {},
715 SemiExpanded: {},
716 Expanded: {},
717 ExtraExpanded: {},
718 UltraExpanded: {},
719 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400720
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500721 ImageFormat: {
722 PNG: {},
723 JPEG: {},
724 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300725
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500726 PaintStyle: {
727 Fill: {},
728 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500729 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500730
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500731 PathOp: {
732 Difference: {},
733 Intersect: {},
734 Union: {},
735 XOR: {},
736 ReverseDifference: {},
737 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500738
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500739 PointMode: {
740 Points: {},
741 Lines: {},
742 Polygon: {},
743 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500744
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500745 RectHeightStyle: {
746 Tight: {},
747 Max: {},
748 IncludeLineSpacingMiddle: {},
749 IncludeLineSpacingTop: {},
750 IncludeLineSpacingBottom: {},
751 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400752
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500753 RectWidthStyle: {
754 Tight: {},
755 Max: {},
756 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400757
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500758 StrokeCap: {
759 Butt: {},
760 Round: {},
761 Square: {},
762 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500763
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500764 StrokeJoin: {
765 Miter: {},
766 Round: {},
767 Bevel: {},
768 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500769
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500770 TextAlign: {
771 Left: {},
772 Right: {},
773 Center: {},
774 Justify: {},
775 Start: {},
776 End: {},
777 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400778
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500779 TextDirection: {
780 LTR: {},
781 RTL: {},
782 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400783
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500784 TileMode: {
785 Clamp: {},
786 Repeat: {},
787 Mirror: {},
788 Decal: {},
789 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500790
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500791 VertexMode: {
792 Triangles: {},
793 TrianglesStrip: {},
794 TriangleFan: {},
795 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500796
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500797 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400798
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500799 /**
800 * @type {Float32Array}
801 */
802 HEAPF32: {},
803 /**
804 * @type {Float64Array}
805 */
806 HEAPF64: {},
807 /**
808 * @type {Uint8Array}
809 */
810 HEAPU8: {},
811 /**
812 * @type {Uint16Array}
813 */
814 HEAPU16: {},
815 /**
816 * @type {Uint32Array}
817 */
818 HEAPU32: {},
819 /**
820 * @type {Int8Array}
821 */
822 HEAP8: {},
823 /**
824 * @type {Int16Array}
825 */
826 HEAP16: {},
827 /**
828 * @type {Int32Array}
829 */
830 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400831
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500832 _malloc: function() {},
833 _free: function() {},
834 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400835};
Kevin Lubick217056c2018-09-20 17:39:31 -0400836
Kevin Lubick006a6f32018-10-19 14:34:34 -0400837// Public API things that are newly declared in the JS should go here.
838// It's not enough to declare them above, because closure can still erase them
839// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400840CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
841
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500842CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400843CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400844CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500845CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500846CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500847CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300848CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400849CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400850CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400851CanvasKit.SkPath.prototype.conicTo = function() {};
852CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400853CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400854CanvasKit.SkPath.prototype.lineTo = function() {};
855CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400856CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400857CanvasKit.SkPath.prototype.op = function() {};
858CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400859CanvasKit.SkPath.prototype.rArcTo = function() {};
860CanvasKit.SkPath.prototype.rConicTo = function() {};
861CanvasKit.SkPath.prototype.rCubicTo = function() {};
862CanvasKit.SkPath.prototype.rLineTo = function() {};
863CanvasKit.SkPath.prototype.rMoveTo = function() {};
864CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400865CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400866CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400867CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400868CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400869CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400870
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500871CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400872
Kevin Lubick5b90b842018-10-17 07:57:18 -0400873CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400874CanvasKit.SkSurface.prototype.flush = function() {};
875CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800876CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400877CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400878
Alexander Khovansky3e119332018-11-15 02:01:19 +0300879CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400880CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300881
Kevin Lubick6bffe392020-04-02 15:24:15 -0400882CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400883CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400884CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500885CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500886CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400887CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
888CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
889CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400890CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500891/** @return {Uint8Array} */
892CanvasKit.SkCanvas.prototype.readPixels = function() {};
893CanvasKit.SkCanvas.prototype.writePixels = function() {};
894
Kevin Lubickddd0a332018-12-12 10:35:13 -0500895CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
896
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400897CanvasKit.SkFont.prototype.getWidths = function() {};
898
899CanvasKit.RSXFormBuilder.prototype.build = function() {};
900CanvasKit.RSXFormBuilder.prototype.delete = function() {};
901CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400902CanvasKit.RSXFormBuilder.prototype.set = function() {};
903
904CanvasKit.SkColorBuilder.prototype.build = function() {};
905CanvasKit.SkColorBuilder.prototype.delete = function() {};
906CanvasKit.SkColorBuilder.prototype.push = function() {};
907CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400908
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500909CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500910CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500911
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500912CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
913CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
914
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400915// Define StrokeOpts object
916var StrokeOpts = {};
917StrokeOpts.prototype.width;
918StrokeOpts.prototype.miter_limit;
919StrokeOpts.prototype.cap;
920StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500921StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400922
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500923// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500924var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500925HTMLCanvas.prototype.decodeImage = function() {};
926HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500927HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500928HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500929HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500930HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500931
932var CanvasRenderingContext2D = {};
933CanvasRenderingContext2D.prototype.addHitRegion = function() {};
934CanvasRenderingContext2D.prototype.arc = function() {};
935CanvasRenderingContext2D.prototype.arcTo = function() {};
936CanvasRenderingContext2D.prototype.beginPath = function() {};
937CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
938CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500939CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500940CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500941CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500942CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500943CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500944CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500945CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500946CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500947CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500948CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500949CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500950CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500951CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500952CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500953CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500954CanvasRenderingContext2D.prototype.isPointInPath = function() {};
955CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500956CanvasRenderingContext2D.prototype.lineTo = function() {};
957CanvasRenderingContext2D.prototype.measureText = function() {};
958CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500959CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500960CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
961CanvasRenderingContext2D.prototype.rect = function() {};
962CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
963CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500964CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500965CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500966CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500967CanvasRenderingContext2D.prototype.scale = function() {};
968CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500969CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500970CanvasRenderingContext2D.prototype.setTransform = function() {};
971CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500972CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500973CanvasRenderingContext2D.prototype.strokeText = function() {};
974CanvasRenderingContext2D.prototype.transform = function() {};
975CanvasRenderingContext2D.prototype.translate = function() {};
976
Kevin Lubicka40f8322018-12-17 16:01:36 -0500977var Path2D = {};
978Path2D.prototype.addPath = function() {};
979Path2D.prototype.arc = function() {};
980Path2D.prototype.arcTo = function() {};
981Path2D.prototype.bezierCurveTo = function() {};
982Path2D.prototype.closePath = function() {};
983Path2D.prototype.ellipse = function() {};
984Path2D.prototype.lineTo = function() {};
985Path2D.prototype.moveTo = function() {};
986Path2D.prototype.quadraticCurveTo = function() {};
987Path2D.prototype.rect = function() {};
988
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500989var LinearCanvasGradient = {};
990LinearCanvasGradient.prototype.addColorStop = function() {};
991var RadialCanvasGradient = {};
992RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500993var CanvasPattern = {};
994CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500995
Kevin Lubick52b9f372018-12-04 13:57:36 -0500996var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500997 /**
998 * @type {Uint8ClampedArray}
999 */
1000 data: {},
1001 height: {},
1002 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001003};
1004
Kevin Lubickd29edd72018-12-07 08:29:52 -05001005var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001006 a: {},
1007 b: {},
1008 c: {},
1009 d: {},
1010 e: {},
1011 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001012};
1013
Kevin Lubick217056c2018-09-20 17:39:31 -04001014// 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 -05001015function loadWebAssemblyModule() {};