blob: 6add3d4a7962c86215494c1855bbe6d902a63942 [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
Kevin Lubicke70af512020-05-14 14:50:54 -040074 // Defined by emscripten.
75 createContext:function() {},
76
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050077 // private API (i.e. things declared in the bindings that we use
78 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040079 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 _MakeImage: function() {},
81 _MakeLinearGradientShader: function() {},
82 _MakePathFromCmds: function() {},
83 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070084 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050085 _MakeManagedAnimation: function() {},
86 _MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050087 _MakeSkPicture: function() {},
88 _MakeSkVertices: function() {},
89 _MakeTwoPointConicalGradientShader: function() {},
90 _decodeAnimatedImage: function() {},
91 _decodeImage: function() {},
92 _drawShapedText: function() {},
93 _getRasterDirectSurface: function() {},
94 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040095
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050096 // The testing object is meant to expose internal functions
97 // for more fine-grained testing, e.g. parseColor
98 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050099
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500100 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -0400101
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500102 GrContext: {
103 // public API (from C++ bindings)
104 getResourceCacheLimitBytes: function() {},
105 getResourceCacheUsageBytes: function() {},
106 releaseResourcesAndAbandonContext: function() {},
107 setResourceCacheLimitBytes: function() {},
108 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400109
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400110 ManagedAnimation: {
111 prototype: {
112 setColor: function() {},
113 },
114 },
115
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500116 Paragraph: {
117 // public API (from C++ bindings)
118 didExceedMaxLines: function() {},
119 getAlphabeticBaseline: function() {},
120 getGlyphPositionAtCoordinate: function() {},
121 getHeight: function() {},
122 getIdeographicBaseline: function() {},
123 getLongestLine: function() {},
124 getMaxIntrinsicWidth: function() {},
125 getMaxWidth: function() {},
126 getMinIntrinsicWidth: function() {},
127 getWordBoundary: function() {},
128 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400129
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500130 // private API
131 /** @return {Float32Array} */
132 _getRectsForRange: function() {},
133 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400134
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400135 ParagraphBuilder: {
136 Make: function() {},
137 addText: function() {},
138 build: function() {},
139 pop: function() {},
140
141 prototype: {
142 pushStyle: function() {},
143 },
144
145 // private API
146 _Make: function() {},
147 _pushStyle: function() {},
148 },
149
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500150 SkRuntimeEffect: {
151 // public API (from C++ bindings)
152 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500153
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500154 // private API
155 _makeShader: function() {},
156 _makeShaderWithChildren: function() {},
157 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500158
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500159 ParagraphStyle: function() {},
160 RSXFormBuilder: function() {},
161 SkColorBuilder: function() {},
162 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400163
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500164 ShapedText: {
165 // public API (from C++ bindings)
166 getBounds: function() {},
167 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500168
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500169 SkAnimatedImage: {
170 // public API (from C++ bindings)
171 decodeNextFrame: function() {},
172 getFrameCount: function() {},
173 getRepetitionCount: function() {},
174 height: function() {},
175 reset: function() {},
176 width: function() {},
177 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400178
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500179 SkCanvas: {
180 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500181 clipPath: function() {},
182 clipRRect: function() {},
183 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500184 drawAnimatedImage: function() {},
185 drawArc: function() {},
186 drawCircle: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500187 drawDRRect: function() {},
188 drawImage: function() {},
189 drawImageNine: function() {},
190 drawImageRect: function() {},
191 drawLine: function() {},
192 drawOval: function() {},
193 drawPaint: function() {},
194 drawParagraph: function() {},
195 drawPath: function() {},
196 drawPicture: function() {},
197 drawRRect: function() {},
198 drawRect: function() {},
199 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500200 drawText: function() {},
201 drawTextBlob: function() {},
202 drawVertices: function() {},
203 flush: function() {},
204 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400206 markCTM: function() {},
207 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 restore: function() {},
209 restoreToCount: function() {},
210 rotate: function() {},
211 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000212 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500213 scale: function() {},
214 skew: function() {},
215 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400216
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400217 prototype: {
218 clear: function() {},
219 drawColor: function() {},
220 drawShadow: function() {},
221 },
222
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500223 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400224 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400225 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500226 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400227 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500228 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400229 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500230 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400231 _getLocalToCamera: function() {},
232 _getLocalToDevice: function() {},
233 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400234 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400235 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500236 _readPixels: function() {},
237 _writePixels: function() {},
238 delete: function() {},
239 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400240
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500241 SkColorFilter: {
242 // public API (from C++ bindings and JS interface)
243 MakeBlend: function() {},
244 MakeCompose: function() {},
245 MakeLerp: function() {},
246 MakeLinearToSRGBGamma: function() {},
247 MakeMatrix: function() {},
248 MakeSRGBToLinearGamma: function() {},
249 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400250 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500251 _makeMatrix: function() {},
252 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400253
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500254 SkColorMatrix: {
255 concat: function() {},
256 identity: function() {},
257 postTranslate: function() {},
258 rotated: function() {},
259 scaled: function() {},
260 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400261
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400262 SkColorSpace: {
263 Equals: function() {},
264 SRGB: {},
265 DISPLAY_P3: {},
266 ADOBE_RGB: {},
267 // private API (from C++ bindings)
268 _MakeSRGB: function() {},
269 _MakeDisplayP3: function() {},
270 _MakeAdobeRGB: function() {},
271 },
272
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500273 SkContourMeasureIter: {
274 next: function() {},
275 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500276
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500277 SkContourMeasure: {
278 getPosTan: function() {},
279 getSegment: function() {},
280 isClosed: function() {},
281 length: function() {},
282 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500283
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500284 SkFont: {
285 // public API (from C++ bindings)
286 getScaleX: function() {},
287 getSize: function() {},
288 getSkewX: function() {},
289 getTypeface: function() {},
290 measureText: function() {},
291 setHinting: function() {},
292 setLinearMetrics: function() {},
293 setScaleX: function() {},
294 setSize: function() {},
295 setSkewX: function() {},
296 setSubpixel: function() {},
297 setTypeface: function() {},
298 // private API (from C++ bindings)
299 _getWidths: function() {},
300 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500301
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500302 SkFontMgr: {
303 // public API (from C++ and JS bindings)
304 FromData: function() {},
305 RefDefault: function() {},
306 countFamilies: function() {},
307 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500308
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500309 // private API
310 _makeTypefaceFromData: function() {},
311 _fromData: function() {},
312 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500313
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500314 SkImage: {
315 // public API (from C++ bindings)
316 height: function() {},
317 width: function() {},
318 // private API
319 _encodeToData: function() {},
320 _encodeToDataWithFormat: function() {},
321 _makeShader: function() {},
322 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400323
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500324 SkImageFilter: {
325 MakeBlur: function() {},
326 MakeColorFilter: function() {},
327 MakeCompose: function() {},
328 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400329
330 // private API
331 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500332 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400333
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500334 // These are defined in interface.js
335 SkM44: {
336 identity: function() {},
337 invert: function() {},
338 multiply: function() {},
339 rotatedUnitSinCos: function() {},
340 rotated: function() {},
341 scaled: function() {},
342 translated: function() {},
343 lookat: function() {},
344 perspective: function() {},
345 rc: function() {},
346 transpose: function() {},
347 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500348
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500349 SkMatrix: {
350 identity: function() {},
351 invert: function() {},
352 mapPoints: function() {},
353 multiply: function() {},
354 rotated: function() {},
355 scaled: function() {},
356 skewed: function() {},
357 translated: function() {},
358 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500359
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500360 SkMaskFilter: {
361 MakeBlur: function() {},
362 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400363
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500364 SkPaint: {
365 // public API (from C++ bindings)
366 /** @return {CanvasKit.SkPaint} */
367 copy: function() {},
368 getBlendMode: function() {},
369 getColor: function() {},
370 getFilterQuality: function() {},
371 getStrokeCap: function() {},
372 getStrokeJoin: function() {},
373 getStrokeMiter: function() {},
374 getStrokeWidth: function() {},
375 setAntiAlias: function() {},
376 setBlendMode: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500377 setFilterQuality: function() {},
378 setImageFilter: function() {},
379 setMaskFilter: function() {},
380 setPathEffect: function() {},
381 setShader: function() {},
382 setStrokeCap: function() {},
383 setStrokeJoin: function() {},
384 setStrokeMiter: function() {},
385 setStrokeWidth: function() {},
386 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500387
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400388 prototype: {
389 setColor: function() {},
390 },
391
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500392 // Private API
393 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400394 _getColor: function() {},
395 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500396 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500397
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500398 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400399 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500400 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400401 MakeDiscrete: function() {},
402
403 // Private C++ API
404 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500405 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500406
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 SkParticleEffect: {
408 // public API (from C++ bindings)
409 draw: function() {},
410 getEffectUniform: function() {},
411 getEffectUniformCount: function() {},
412 getEffectUniformFloatCount: function() {},
413 getEffectUniformName: function() {},
414 getParticleUniformCount: function() {},
415 getParticleUniformFloatCount: function() {},
416 getParticleUniformName: function() {},
417 getParticleUniform: function() {},
418 setPosition: function() {},
419 setRate: function() {},
420 start: function() {},
421 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500422
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500423 // private API (from C++ bindings)
424 _effectUniformPtr: function() {},
425 _particleUniformPtr: function() {},
426 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500427
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500428 SkPath: {
429 // public API (from C++ bindings)
430 computeTightBounds: function() {},
431 contains: function() {},
432 /** @return {CanvasKit.SkPath} */
433 copy: function() {},
434 countPoints: function() {},
435 equals: function() {},
436 getBounds: function() {},
437 getFillType: function() {},
438 getPoint: function() {},
439 isEmpty: function() {},
440 isVolatile: function() {},
441 reset: function() {},
442 rewind: function() {},
443 setFillType: function() {},
444 setIsVolatile: function() {},
445 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400446
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500447 // private API
448 _addArc: function() {},
449 _addOval: function() {},
450 _addPath: function() {},
451 _addRect: function() {},
452 _addPoly: function() {},
453 _addRoundRect: function() {},
454 _arc: function() {},
455 _arcTo: function() {},
456 _close: function() {},
457 _conicTo: function() {},
458 _cubicTo: function() {},
459 _dash: function() {},
460 _lineTo: function() {},
461 _moveTo: function() {},
462 _op: function() {},
463 _quadTo: function() {},
464 _rArcTo: function() {},
465 _rConicTo: function() {},
466 _rCubicTo: function() {},
467 _rLineTo: function() {},
468 _rMoveTo: function() {},
469 _rQuadTo: function() {},
470 _rect: function() {},
471 _simplify: function() {},
472 _stroke: function() {},
473 _transform: function() {},
474 _trim: function() {},
475 delete: function() {},
476 dump: function() {},
477 dumpHex: function() {},
478 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400479
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500480 SkPathMeasure: {
481 getLength: function() {},
482 getSegment: function() {},
483 getPosTan: function() {},
484 isClosed: function() {},
485 nextContour: function() {},
486 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400487
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500488 SkPicture: {
489 serialize: function() {},
490 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400491
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500492 SkPictureRecorder: {
493 beginRecording: function() {},
494 finishRecordingAsPicture: function() {},
495 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400496
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500497 SkRect: {
498 fLeft: {},
499 fTop: {},
500 fRight: {},
501 fBottom: {},
502 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400503
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500504 SkRRect: {
505 rect: {},
506 rx1: {},
507 ry1: {},
508 rx2: {},
509 ry2: {},
510 rx3: {},
511 ry3: {},
512 rx4: {},
513 ry4: {},
514 },
Kevin Lubick62836902019-12-09 09:04:26 -0500515
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500516 SkShader: {
517 Blend: function() {},
518 Color: function() {},
519 Empty: function() {},
520 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400521 MakeLinearGradient: function() {},
522 MakeRadialGradient: function() {},
523 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700524 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400525
526 // private API (from C++ bindings)
527 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500528 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400529
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500530 SkSurface: {
531 // public API (from C++ bindings)
532 /** @return {CanvasKit.SkCanvas} */
533 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400534 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500535 /** @return {CanvasKit.SkImage} */
536 makeImageSnapshot: function() {},
537 makeSurface: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400538 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500539 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400540
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500541 // private API
542 _flush: function() {},
543 _getRasterN32PremulSurface: function() {},
544 delete: function() {},
545 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500546
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500547 SkTextBlob: {
548 // public API (both C++ and JS bindings)
549 MakeFromRSXform: function() {},
550 MakeFromText: function() {},
551 MakeOnPath: function() {},
552 // private API (from C++ bindings)
553 _MakeFromRSXform: function() {},
554 _MakeFromText: function() {},
555 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500556
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500557 // These are defined in interface.js
558 SkVector: {
559 add: function() {},
560 sub: function() {},
561 dot: function() {},
562 cross: function() {},
563 normalize: function() {},
564 mulScalar: function() {},
565 length: function() {},
566 lengthSquared: function() {},
567 dist: function() {},
568 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400569
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500570 SkVertices: {
571 // public API (from C++ bindings)
572 bounds: function() {},
573 mode: function() {},
574 uniqueID: function() {},
575 vertexCount: function() {},
576 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400577
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500578 _SkVerticesBuilder: {
579 colors: function() {},
580 detach: function() {},
581 indices: function() {},
582 positions: function() {},
583 texCoords: function() {},
584 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400585
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500586 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400587
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500588 // Constants and Enums
589 gpu: {},
590 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400591
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500592 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400593 BLACK: {},
594 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500595 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400596 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500597 BLUE: {},
598 YELLOW: {},
599 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400600 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500601
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500602 MOVE_VERB: {},
603 LINE_VERB: {},
604 QUAD_VERB: {},
605 CONIC_VERB: {},
606 CUBIC_VERB: {},
607 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500608
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500609 NoDecoration: {},
610 UnderlineDecoration: {},
611 OverlineDecoration: {},
612 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400613
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500614 SaveLayerInitWithPrevious: {},
615 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400616
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500617 Affinity: {
618 Upstream: {},
619 Downstream: {},
620 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400621
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500622 AlphaType: {
623 Opaque: {},
624 Premul: {},
625 Unpremul: {},
626 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500627
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500628 BlendMode: {
629 Clear: {},
630 Src: {},
631 Dst: {},
632 SrcOver: {},
633 DstOver: {},
634 SrcIn: {},
635 DstIn: {},
636 SrcOut: {},
637 DstOut: {},
638 SrcATop: {},
639 DstATop: {},
640 Xor: {},
641 Plus: {},
642 Modulate: {},
643 Screen: {},
644 Overlay: {},
645 Darken: {},
646 Lighten: {},
647 ColorDodge: {},
648 ColorBurn: {},
649 HardLight: {},
650 SoftLight: {},
651 Difference: {},
652 Exclusion: {},
653 Multiply: {},
654 Hue: {},
655 Saturation: {},
656 Color: {},
657 Luminosity: {},
658 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500659
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500660 BlurStyle: {
661 Normal: {},
662 Solid: {},
663 Outer: {},
664 Inner: {},
665 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500666
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500667 ClipOp: {
668 Difference: {},
669 Intersect: {},
670 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500671
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500672 ColorType: {
673 Alpha_8: {},
674 RGB_565: {},
675 ARGB_4444: {},
676 RGBA_8888: {},
677 RGB_888x: {},
678 BGRA_8888: {},
679 RGBA_1010102: {},
680 RGB_101010x: {},
681 Gray_8: {},
682 RGBA_F16: {},
683 RGBA_F32: {},
684 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500685
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500686 FillType: {
687 Winding: {},
688 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500689 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400690
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500691 FilterQuality: {
692 None: {},
693 Low: {},
694 Medium: {},
695 High: {},
696 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500697
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500698 FontSlant: {
699 Upright: {},
700 Italic: {},
701 Oblique: {},
702 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400703
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 FontHinting: {
705 None: {},
706 Slight: {},
707 Normal: {},
708 Full: {},
709 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500710
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 FontWeight: {
712 Invisible: {},
713 Thin: {},
714 ExtraLight: {},
715 Light: {},
716 Normal: {},
717 Medium: {},
718 SemiBold: {},
719 Bold: {},
720 ExtraBold: {},
721 Black: {},
722 ExtraBlack: {},
723 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 FontWidth: {
726 UltraCondensed: {},
727 ExtraCondensed: {},
728 Condensed: {},
729 SemiCondensed: {},
730 Normal: {},
731 SemiExpanded: {},
732 Expanded: {},
733 ExtraExpanded: {},
734 UltraExpanded: {},
735 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400736
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500737 ImageFormat: {
738 PNG: {},
739 JPEG: {},
740 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300741
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500742 PaintStyle: {
743 Fill: {},
744 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500745 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500746
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500747 PathOp: {
748 Difference: {},
749 Intersect: {},
750 Union: {},
751 XOR: {},
752 ReverseDifference: {},
753 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500754
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500755 PointMode: {
756 Points: {},
757 Lines: {},
758 Polygon: {},
759 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500760
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500761 RectHeightStyle: {
762 Tight: {},
763 Max: {},
764 IncludeLineSpacingMiddle: {},
765 IncludeLineSpacingTop: {},
766 IncludeLineSpacingBottom: {},
767 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400768
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500769 RectWidthStyle: {
770 Tight: {},
771 Max: {},
772 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400773
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500774 StrokeCap: {
775 Butt: {},
776 Round: {},
777 Square: {},
778 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500779
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500780 StrokeJoin: {
781 Miter: {},
782 Round: {},
783 Bevel: {},
784 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500785
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500786 TextAlign: {
787 Left: {},
788 Right: {},
789 Center: {},
790 Justify: {},
791 Start: {},
792 End: {},
793 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400794
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500795 TextDirection: {
796 LTR: {},
797 RTL: {},
798 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400799
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500800 TileMode: {
801 Clamp: {},
802 Repeat: {},
803 Mirror: {},
804 Decal: {},
805 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500806
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500807 VertexMode: {
808 Triangles: {},
809 TrianglesStrip: {},
810 TriangleFan: {},
811 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500812
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500813 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400814
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500815 /**
816 * @type {Float32Array}
817 */
818 HEAPF32: {},
819 /**
820 * @type {Float64Array}
821 */
822 HEAPF64: {},
823 /**
824 * @type {Uint8Array}
825 */
826 HEAPU8: {},
827 /**
828 * @type {Uint16Array}
829 */
830 HEAPU16: {},
831 /**
832 * @type {Uint32Array}
833 */
834 HEAPU32: {},
835 /**
836 * @type {Int8Array}
837 */
838 HEAP8: {},
839 /**
840 * @type {Int16Array}
841 */
842 HEAP16: {},
843 /**
844 * @type {Int32Array}
845 */
846 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400847
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500848 _malloc: function() {},
849 _free: function() {},
850 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400851};
Kevin Lubick217056c2018-09-20 17:39:31 -0400852
Kevin Lubick006a6f32018-10-19 14:34:34 -0400853// Public API things that are newly declared in the JS should go here.
854// It's not enough to declare them above, because closure can still erase them
855// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400856CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
857
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500858CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400859CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400860CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500861CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500862CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500863CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300864CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400865CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400866CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400867CanvasKit.SkPath.prototype.conicTo = function() {};
868CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400869CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400870CanvasKit.SkPath.prototype.lineTo = function() {};
871CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400872CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400873CanvasKit.SkPath.prototype.op = function() {};
874CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400875CanvasKit.SkPath.prototype.rArcTo = function() {};
876CanvasKit.SkPath.prototype.rConicTo = function() {};
877CanvasKit.SkPath.prototype.rCubicTo = function() {};
878CanvasKit.SkPath.prototype.rLineTo = function() {};
879CanvasKit.SkPath.prototype.rMoveTo = function() {};
880CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400881CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400882CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400883CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400884CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400885CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400886
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500887CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400888
Kevin Lubick5b90b842018-10-17 07:57:18 -0400889CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400890CanvasKit.SkSurface.prototype.flush = function() {};
891CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800892CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400893CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400894
Alexander Khovansky3e119332018-11-15 02:01:19 +0300895CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400896CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300897
Kevin Lubick6bffe392020-04-02 15:24:15 -0400898CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400899CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400900CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500901CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500902CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400903CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
904CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
905CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400906CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500907/** @return {Uint8Array} */
908CanvasKit.SkCanvas.prototype.readPixels = function() {};
909CanvasKit.SkCanvas.prototype.writePixels = function() {};
910
Kevin Lubickddd0a332018-12-12 10:35:13 -0500911CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
912
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400913CanvasKit.SkFont.prototype.getWidths = function() {};
914
915CanvasKit.RSXFormBuilder.prototype.build = function() {};
916CanvasKit.RSXFormBuilder.prototype.delete = function() {};
917CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400918CanvasKit.RSXFormBuilder.prototype.set = function() {};
919
920CanvasKit.SkColorBuilder.prototype.build = function() {};
921CanvasKit.SkColorBuilder.prototype.delete = function() {};
922CanvasKit.SkColorBuilder.prototype.push = function() {};
923CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400924
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500925CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500926CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500927
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500928CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
929CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
930
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400931// Define StrokeOpts object
932var StrokeOpts = {};
933StrokeOpts.prototype.width;
934StrokeOpts.prototype.miter_limit;
935StrokeOpts.prototype.cap;
936StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500937StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400938
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500939// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500940var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500941HTMLCanvas.prototype.decodeImage = function() {};
942HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500943HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500944HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500945HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500946HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500947
948var CanvasRenderingContext2D = {};
949CanvasRenderingContext2D.prototype.addHitRegion = function() {};
950CanvasRenderingContext2D.prototype.arc = function() {};
951CanvasRenderingContext2D.prototype.arcTo = function() {};
952CanvasRenderingContext2D.prototype.beginPath = function() {};
953CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
954CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500955CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500956CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500957CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500958CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500959CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500960CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500961CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500962CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500963CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500964CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500965CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500966CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500967CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500968CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500969CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500970CanvasRenderingContext2D.prototype.isPointInPath = function() {};
971CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500972CanvasRenderingContext2D.prototype.lineTo = function() {};
973CanvasRenderingContext2D.prototype.measureText = function() {};
974CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500975CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500976CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
977CanvasRenderingContext2D.prototype.rect = function() {};
978CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
979CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500980CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500981CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500982CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500983CanvasRenderingContext2D.prototype.scale = function() {};
984CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500985CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500986CanvasRenderingContext2D.prototype.setTransform = function() {};
987CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500988CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500989CanvasRenderingContext2D.prototype.strokeText = function() {};
990CanvasRenderingContext2D.prototype.transform = function() {};
991CanvasRenderingContext2D.prototype.translate = function() {};
992
Kevin Lubicka40f8322018-12-17 16:01:36 -0500993var Path2D = {};
994Path2D.prototype.addPath = function() {};
995Path2D.prototype.arc = function() {};
996Path2D.prototype.arcTo = function() {};
997Path2D.prototype.bezierCurveTo = function() {};
998Path2D.prototype.closePath = function() {};
999Path2D.prototype.ellipse = function() {};
1000Path2D.prototype.lineTo = function() {};
1001Path2D.prototype.moveTo = function() {};
1002Path2D.prototype.quadraticCurveTo = function() {};
1003Path2D.prototype.rect = function() {};
1004
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001005var LinearCanvasGradient = {};
1006LinearCanvasGradient.prototype.addColorStop = function() {};
1007var RadialCanvasGradient = {};
1008RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001009var CanvasPattern = {};
1010CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001011
Kevin Lubick52b9f372018-12-04 13:57:36 -05001012var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001013 /**
1014 * @type {Uint8ClampedArray}
1015 */
1016 data: {},
1017 height: {},
1018 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001019};
1020
Kevin Lubickd29edd72018-12-07 08:29:52 -05001021var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001022 a: {},
1023 b: {},
1024 c: {},
1025 d: {},
1026 e: {},
1027 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001028};
1029
Kevin Lubick217056c2018-09-20 17:39:31 -04001030// 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 -05001031function loadWebAssemblyModule() {};