blob: 62245d02b510fac62cda682e5a746f2671c3428f [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 = {
Kevin Lubick39284662020-02-20 10:29:55 -050026 // public API (i.e. things we declare in the pre-js file or in the cpp bindings)
Kevin Lubick006a6f32018-10-19 14:34:34 -040027 Color: function() {},
28 /** @return {CanvasKit.SkRect} */
29 LTRBRect: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050030 /** @return {CanvasKit.SkRect} */
31 XYWHRect: function() {},
Kevin Lubick7d644e12019-09-11 14:22:22 -040032 /** @return {CanvasKit.SkRRect} */
33 RRectXY: function() {},
Kevin Lubick52b9f372018-12-04 13:57:36 -050034 /** @return {ImageData} */
35 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050036
37 GetWebGLContext: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050038 MakeBlurMaskFilter: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040039 MakeCanvas: function() {},
40 MakeCanvasSurface: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050041 MakeGrContext: function() {},
Kevin Lubick6b921b72019-09-18 16:18:17 -040042 /** @return {CanvasKit.SkAnimatedImage} */
43 MakeAnimatedImageFromEncoded: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050044 /** @return {CanvasKit.SkImage} */
Kevin Lubickeda0b432019-12-02 08:26:48 -050045 MakeImage: function() {},
46 /** @return {CanvasKit.SkImage} */
Kevin Lubick0a1293c2018-12-03 12:31:04 -050047 MakeImageFromEncoded: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050048 /** @return {LinearCanvasGradient} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040049 MakeLinearGradientShader: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050050 MakeOnScreenGLSurface: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -050051 MakePathFromCmds: function() {},
Kevin Lubicka40f8322018-12-17 16:01:36 -050052 MakePathFromOp: function() {},
53 MakePathFromSVGString: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050054 MakeRadialGradientShader: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050055 MakeRenderTarget: function() {},
Kevin Lubicka4f218d2020-01-14 08:39:09 -050056 MakeSkPicture: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050057 MakeSWCanvasSurface: function() {},
Kevin Lubickf5ea37f2019-02-28 10:06:18 -050058 MakeManagedAnimation: function() {},
Brian Osman2a490bc2019-11-27 13:36:40 -050059 MakeParticles: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040060 MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040061 MakeSkVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040062 MakeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050063 /** @return {RadialCanvasGradient} */
64 MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050065 MakeWebGLCanvasSurface: function() {},
Kevin Lubicke25df6c2019-10-22 09:04:32 -040066 /** @return {TypedArray} */
67 Malloc: function() {},
Kevin Lubick50f377e2019-09-11 15:23:00 -040068 /** @return {TonalColors} */
69 computeTonalColors: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040070 currentContext: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050071 getColorComponents: function() {},
Florin Malita0d603d82019-11-25 13:45:28 -050072 getDecodeCacheLimitBytes: function() {},
73 getDecodeCacheUsageBytes: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050074 getSkDataBytes: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050075 multiplyByAlpha: function() {},
Kevin Lubick39284662020-02-20 10:29:55 -050076 parseColorString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040077 setCurrentContext: function() {},
Florin Malita0d603d82019-11-25 13:45:28 -050078 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040079
80 // private API (i.e. things declared in the bindings that we use
81 // in the pre-js file)
Kevin Lubick52b9f372018-12-04 13:57:36 -050082 _MakeImage: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040083 _MakeLinearGradientShader: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -050084 _MakePathFromCmds: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040085 _MakeRadialGradientShader: function() {},
Kevin Lubickf5ea37f2019-02-28 10:06:18 -050086 _MakeManagedAnimation: function() {},
Brian Osman2a490bc2019-11-27 13:36:40 -050087 _MakeParticles: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040088 _MakeSkDashPathEffect: function() {},
Kevin Lubicka4f218d2020-01-14 08:39:09 -050089 _MakeSkPicture: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040090 _MakeSkVertices: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050091 _MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick6b921b72019-09-18 16:18:17 -040092 _decodeAnimatedImage: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050093 _decodeImage: function() {},
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -050094 _drawShapedText: function() {},
Kevin Lubickea905ec2018-11-30 14:05:58 -050095 _getRasterDirectSurface: function() {},
Kevin Lubick134be1d2018-10-30 15:05:04 -040096 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040097
Kevin Lubick1a05fce2018-11-20 12:51:16 -050098 // The testing object is meant to expose internal functions
99 // for more fine-grained testing, e.g. parseColor
100 _testing: {},
101
Kevin Lubick217056c2018-09-20 17:39:31 -0400102 // Objects and properties on CanvasKit
103
Kevin Lubickcd544662019-03-22 15:41:36 -0400104 GrContext: {
105 // public API (from C++ bindings)
106 getResourceCacheLimitBytes: function() {},
107 getResourceCacheUsageBytes: function() {},
108 setResourceCacheLimitBytes: function() {},
109 },
110
Kevin Lubick369f6a52019-10-03 11:22:08 -0400111 Paragraph: {
112 // public API (from C++ bindings)
Kevin Lubick04912672019-11-15 14:48:55 -0500113 didExceedMaxLines: function() {},
114 getAlphabeticBaseline: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400115 getGlyphPositionAtCoordinate: function() {},
Kevin Lubick04912672019-11-15 14:48:55 -0500116 getHeight: function() {},
117 getIdeographicBaseline: function() {},
118 getLongestLine: function() {},
119 getMaxIntrinsicWidth: function() {},
120 getMaxWidth: function() {},
121 getMinIntrinsicWidth: function() {},
122 getWordBoundary: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400123 layout: function() {},
124
125 // private API
126 /** @return {Float32Array} */
127 _getRectsForRange: function() {},
128 },
129
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500130 SkRuntimeEffect: {
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500131 // public API (from C++ bindings)
Brian Osman93de1622019-12-26 08:43:05 -0500132 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500133
134 // private API
Brian Osman93de1622019-12-26 08:43:05 -0500135 _makeShader: function() {},
Kevin Lubickecd87622020-02-22 07:37:33 -0500136 _makeShaderWithChildren: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500137 },
138
Kevin Lubick369f6a52019-10-03 11:22:08 -0400139 ParagraphStyle: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400140 RSXFormBuilder: function() {},
Kevin Lubickee91c072019-03-29 10:39:52 -0400141 SkColorBuilder: function() {},
142 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400143
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500144 ShapedText: {
145 // public API (from C++ bindings)
146 getBounds: function() {},
147 },
148
Kevin Lubick6b921b72019-09-18 16:18:17 -0400149 SkAnimatedImage: {
150 // public API (from C++ bindings)
Kevin Lubick6b921b72019-09-18 16:18:17 -0400151 decodeNextFrame: function() {},
Kevin Lubick47bd9f12019-11-08 06:55:15 -0800152 getFrameCount: function() {},
153 getRepetitionCount: function() {},
154 height: function() {},
155 reset: function() {},
156 width: function() {},
Kevin Lubick6b921b72019-09-18 16:18:17 -0400157 },
158
Kevin Lubick006a6f32018-10-19 14:34:34 -0400159 SkCanvas: {
160 // public API (from C++ bindings)
161 clear: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500162 clipPath: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400163 clipRRect: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -0500164 clipRect: function() {},
165 concat: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400166 drawAnimatedImage: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500167 drawArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400168 drawCircle: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400169 drawColor: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400170 drawDRRect: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500171 drawImage: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500172 drawImageNine: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500173 drawImageRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500174 drawLine: function() {},
175 drawOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400176 drawPaint: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400177 drawParagraph: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400178 drawPath: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400179 drawPicture: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400180 drawRRect: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500181 drawRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500182 drawRoundRect: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500183 drawShadow: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500184 drawText: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500185 drawTextBlob: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500186 drawVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400187 flush: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400188 getSaveCount: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -0500189 getTotalMatrix: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500190 makeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500191 restore: function() {},
Kevin Lubickb3574c92019-03-06 08:25:36 -0500192 restoreToCount: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400193 rotate: function() {},
194 save: function() {},
Kevin Lubickb3574c92019-03-06 08:25:36 -0500195 saveLayer: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400196 scale: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400197 skew: function() {},
198 translate: function() {},
199
200 // private API
Kevin Lubickee91c072019-03-29 10:39:52 -0400201 _drawAtlas: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500202 _drawPoints: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500203 _drawSimpleText: function() {},
Kevin Lubick52b9f372018-12-04 13:57:36 -0500204 _readPixels: function() {},
205 _writePixels: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400206 delete: function() {},
207 },
208
Kevin Lubickd3729342019-09-12 11:11:25 -0400209 SkColorFilter: {
210 // public API (from C++ bindings and JS interface)
211 MakeBlend: function() {},
212 MakeCompose: function() {},
213 MakeLerp: function() {},
214 MakeLinearToSRGBGamma: function() {},
215 MakeMatrix: function() {},
216 MakeSRGBToLinearGamma: function() {},
217 // private API (from C++ bindings)
218 _makeMatrix: function() {},
219 },
220
221 SkColorMatrix: {
222 concat: function() {},
223 identity: function() {},
224 postTranslate: function() {},
225 rotated: function() {},
226 scaled: function() {},
227 },
228
Kevin Lubicke59c1672019-11-20 14:17:53 -0500229 SkContourMeasureIter: {
230 next: function() {},
231 },
232
233 SkContourMeasure: {
234 getPosTan: function() {},
235 getSegment: function() {},
236 isClosed: function() {},
237 length: function() {},
238 },
239
Kevin Lubick35ac0382019-01-02 15:13:57 -0500240 SkFont: {
241 // public API (from C++ bindings)
242 getScaleX: function() {},
243 getSize: function() {},
244 getSkewX: function() {},
245 getTypeface: function() {},
246 measureText: function() {},
247 setScaleX: function() {},
248 setSize: function() {},
249 setSkewX: function() {},
250 setTypeface: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400251 // private API (from C++ bindings)
252 _getWidths: function() {},
Kevin Lubick35ac0382019-01-02 15:13:57 -0500253 },
254
Kevin Lubickddd0a332018-12-12 10:35:13 -0500255 SkFontMgr: {
Kevin Lubick61887c72019-09-26 13:20:50 -0400256 // public API (from C++ and JS bindings)
257 FromData: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500258 RefDefault: function() {},
259 countFamilies: function() {},
Kevin Lubick486aecf2020-01-15 13:49:53 -0500260 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500261
262 // private API
263 _makeTypefaceFromData: function() {},
Kevin Lubick61887c72019-09-26 13:20:50 -0400264 _fromData: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500265 },
266
Kevin Lubick006a6f32018-10-19 14:34:34 -0400267 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500268 // public API (from C++ bindings)
269 height: function() {},
270 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300271 // private API
272 _encodeToData: function() {},
273 _encodeToDataWithFormat: function() {},
Kevin Lubicka064c282019-04-04 09:28:53 -0400274 _makeShader: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400275 },
276
Kevin Lubick15b40232019-10-29 09:55:39 -0400277 SkImageFilter: {
278 MakeBlur: function() {},
279 MakeColorFilter: function() {},
280 MakeCompose: function() {},
Kevin Lubickd2677192019-11-15 14:13:20 -0500281 MakeMatrixTransform: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400282 },
283
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500284 // These are defined in interface.js
285 SkM44: {
286 identity: function() {},
287 invert: function() {},
288 multiply: function() {},
289 rotatedUnitSinCos: function() {},
290 rotated: function() {},
291 scaled: function() {},
292 translated: function() {},
293 lookat: function() {},
294 perspective: function() {},
295 rc: function() {},
296 },
297
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500298 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500299 identity: function() {},
Kevin Lubickf3555182019-03-14 10:55:10 -0400300 invert: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500301 mapPoints: function() {},
302 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500303 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500304 scaled: function() {},
305 skewed: function() {},
306 translated: function() {},
307 },
308
Kevin Lubick15b40232019-10-29 09:55:39 -0400309 SkMaskFilter: {
310 MakeBlur: function() {},
311 },
312
Kevin Lubickb9db3902018-11-26 11:47:54 -0500313 SkPaint: {
314 // public API (from C++ bindings)
315 /** @return {CanvasKit.SkPaint} */
316 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500317 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500318 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500319 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500320 getStrokeCap: function() {},
321 getStrokeJoin: function() {},
322 getStrokeMiter: function() {},
323 getStrokeWidth: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500324 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500325 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500326 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500327 setFilterQuality: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400328 setImageFilter: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500329 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500330 setPathEffect: function() {},
331 setShader: function() {},
332 setStrokeCap: function() {},
333 setStrokeJoin: function() {},
334 setStrokeMiter: function() {},
335 setStrokeWidth: function() {},
336 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500337
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500338 // private API
Kevin Lubickb9db3902018-11-26 11:47:54 -0500339 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500340 },
341
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500342 SkParticleEffect: {
343 // public API (from C++ bindings)
344 draw: function() {},
345 getEffectUniform: function() {},
346 getEffectUniformCount: function() {},
347 getEffectUniformFloatCount: function() {},
348 getEffectUniformName: function() {},
349 getParticleUniformCount: function() {},
350 getParticleUniformFloatCount: function() {},
351 getParticleUniformName: function() {},
352 getParticleUniform: function() {},
353 setPosition: function() {},
354 setRate: function() {},
355 start: function() {},
356 update: function() {},
357
358 // private API (from C++ bindings)
359 _effectUniformPtr: function() {},
360 _particleUniformPtr: function() {},
361 },
362
Kevin Lubick006a6f32018-10-19 14:34:34 -0400363 SkPath: {
364 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500365 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500366 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500367 /** @return {CanvasKit.SkPath} */
368 copy: function() {},
369 countPoints: function() {},
370 equals: function() {},
371 getBounds: function() {},
372 getFillType: function() {},
373 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500374 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500375 isVolatile: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500376 reset: function() {},
377 rewind: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500378 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500379 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500380 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400381
382 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500383 _addArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400384 _addOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400385 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500386 _addRect: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500387 _addPoly: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500388 _addRoundRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300389 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400390 _arcTo: function() {},
391 _close: function() {},
392 _conicTo: function() {},
393 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400394 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400395 _lineTo: function() {},
396 _moveTo: function() {},
397 _op: function() {},
398 _quadTo: function() {},
Kevin Lubick79b71342019-11-01 14:36:52 -0400399 _rArcTo: function() {},
400 _rConicTo: function() {},
401 _rCubicTo: function() {},
402 _rLineTo: function() {},
403 _rMoveTo: function() {},
404 _rQuadTo: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400405 _rect: function() {},
406 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400407 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400408 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400409 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400410 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500411 dump: function() {},
412 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400413 },
414
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400415 SkPathMeasure: {
416 getLength: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500417 getSegment: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400418 getPosTan: function() {},
419 isClosed: function() {},
420 nextContour: function() {},
421 },
422
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400423 SkPicture: {
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500424 serialize: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400425 },
426
427 SkPictureRecorder: {
428 beginRecording: function() {},
429 finishRecordingAsPicture: function() {},
430 },
431
Kevin Lubick006a6f32018-10-19 14:34:34 -0400432 SkRect: {
433 fLeft: {},
434 fTop: {},
435 fRight: {},
436 fBottom: {},
437 },
438
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400439 SkRRect: {
440 rect: {},
Kevin Lubick7d644e12019-09-11 14:22:22 -0400441 rx1: {},
442 ry1: {},
443 rx2: {},
444 ry2: {},
445 rx3: {},
446 ry3: {},
447 rx4: {},
448 ry4: {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400449 },
450
Kevin Lubick62836902019-12-09 09:04:26 -0500451 SkShader: {
452 Blend: function() {},
453 Color: function() {},
454 Empty: function() {},
455 Lerp: function() {},
456
457 _Blend: function() {},
458 _Lerp: function() {},
459 },
460
Kevin Lubick006a6f32018-10-19 14:34:34 -0400461 SkSurface: {
462 // public API (from C++ bindings)
463 /** @return {CanvasKit.SkCanvas} */
464 getCanvas: function() {},
465 /** @return {CanvasKit.SkImage} */
466 makeImageSnapshot: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500467 makeSurface: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400468 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400469
470 // private API
471 _flush: function() {},
472 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400473 delete: function() {},
474 },
475
Kevin Lubickec4903d2019-01-14 08:36:08 -0500476 SkTextBlob: {
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400477 // public API (both C++ and JS bindings)
478 MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500479 MakeFromText: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400480 MakeOnPath: function() {},
481 // private API (from C++ bindings)
482 _MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500483 _MakeFromText: function() {},
484 },
485
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500486 // These are defined in interface.js
487 SkVector: {
488 add: function() {},
489 sub: function() {},
490 dot: function() {},
491 cross: function() {},
492 normalize: function() {},
493 mulScalar: function() {},
494 length: function() {},
495 lengthSquared: function() {},
496 },
497
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400498 SkVertices: {
499 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500500 bounds: function() {},
501 mode: function() {},
502 uniqueID: function() {},
503 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400504
505 // private API
506 /** @return {CanvasKit.SkVertices} */
507 _applyBones: function() {},
508 },
509
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400510 _SkVerticesBuilder: {
511 // public API (from C++ bindings)
512 boneIndices: function() {},
513 boneWeights: function() {},
514 colors: function() {},
515 detach: function() {},
516 indices: function() {},
517 positions: function() {},
518 texCoords: function() {},
519 },
520
Kevin Lubick369f6a52019-10-03 11:22:08 -0400521 TextStyle: function() {},
522
Kevin Lubick006a6f32018-10-19 14:34:34 -0400523 // Constants and Enums
524 gpu: {},
525 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400526
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500527 TRANSPARENT: {},
528 RED: {},
529 BLUE: {},
530 YELLOW: {},
531 CYAN: {},
532 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500533 WHITE: {},
534
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500535 MOVE_VERB: {},
536 LINE_VERB: {},
537 QUAD_VERB: {},
538 CONIC_VERB: {},
539 CUBIC_VERB: {},
540 CLOSE_VERB: {},
541
Kevin Lubick369f6a52019-10-03 11:22:08 -0400542 NoDecoration: {},
543 UnderlineDecoration: {},
544 OverlineDecoration: {},
545 LineThroughDecoration: {},
546
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400547 SaveLayerInitWithPrevious: {},
548 SaveLayerF16ColorType: {},
549
Kevin Lubick369f6a52019-10-03 11:22:08 -0400550 Affinity: {
551 Upstream: {},
552 Downstream: {},
553 },
554
Kevin Lubickea905ec2018-11-30 14:05:58 -0500555 AlphaType: {
556 Opaque: {},
557 Premul: {},
558 Unpremul: {},
559 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500560
561 BlendMode: {
562 Clear: {},
563 Src: {},
564 Dst: {},
565 SrcOver: {},
566 DstOver: {},
567 SrcIn: {},
568 DstIn: {},
569 SrcOut: {},
570 DstOut: {},
571 SrcATop: {},
572 DstATop: {},
573 Xor: {},
574 Plus: {},
575 Modulate: {},
576 Screen: {},
577 Overlay: {},
578 Darken: {},
579 Lighten: {},
580 ColorDodge: {},
581 ColorBurn: {},
582 HardLight: {},
583 SoftLight: {},
584 Difference: {},
585 Exclusion: {},
586 Multiply: {},
587 Hue: {},
588 Saturation: {},
589 Color: {},
590 Luminosity: {},
591 },
592
593 BlurStyle: {
594 Normal: {},
595 Solid: {},
596 Outer: {},
597 Inner: {},
598 },
599
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500600 ClipOp: {
601 Difference: {},
602 Intersect: {},
603 },
604
Kevin Lubickea905ec2018-11-30 14:05:58 -0500605 ColorType: {
606 Alpha_8: {},
607 RGB_565: {},
608 ARGB_4444: {},
609 RGBA_8888: {},
610 RGB_888x: {},
611 BGRA_8888: {},
612 RGBA_1010102: {},
613 RGB_101010x: {},
614 Gray_8: {},
615 RGBA_F16: {},
616 RGBA_F32: {},
617 },
618
Kevin Lubick006a6f32018-10-19 14:34:34 -0400619 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500620 Winding: {},
621 EvenOdd: {},
622 InverseWinding: {},
623 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400624 },
625
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500626 FilterQuality: {
627 None: {},
628 Low: {},
629 Medium: {},
630 High: {},
631 },
632
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400633 FontSlant: {
634 Upright: {},
635 Italic: {},
636 Oblique: {},
637 },
638
639 FontWeight: {
640 Invisible: {},
641 Thin: {},
642 ExtraLight: {},
643 Light: {},
644 Normal: {},
645 Medium: {},
646 SemiBold: {},
647 Bold: {},
648 ExtraBold: {},
649 Black: {},
650 ExtraBlack: {},
651 },
652
653 FontWidth: {
654 UltraCondensed: {},
655 ExtraCondensed: {},
656 Condensed: {},
657 SemiCondensed: {},
658 Normal: {},
659 SemiExpanded: {},
660 Expanded: {},
661 ExtraExpanded: {},
662 UltraExpanded: {},
663 },
664
Alexander Khovansky3e119332018-11-15 02:01:19 +0300665 ImageFormat: {
666 PNG: {},
667 JPEG: {},
668 },
669
Kevin Lubickb9db3902018-11-26 11:47:54 -0500670 PaintStyle: {
671 Fill: {},
672 Stroke: {},
673 StrokeAndFill: {},
674 },
675
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500676 PathOp: {
677 Difference: {},
678 Intersect: {},
679 Union: {},
680 XOR: {},
681 ReverseDifference: {},
682 },
683
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500684 PointMode: {
685 Points: {},
686 Lines: {},
687 Polygon: {},
688 },
689
Kevin Lubick369f6a52019-10-03 11:22:08 -0400690 RectHeightStyle: {
691 Tight: {},
692 Max: {},
Kevin Lubick4a5f4f22019-11-20 08:27:10 -0500693 IncludeLineSpacingMiddle: {},
694 IncludeLineSpacingTop: {},
695 IncludeLineSpacingBottom: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400696 },
697
698 RectWidthStyle: {
699 Tight: {},
700 Max: {},
701 },
702
Kevin Lubickb9db3902018-11-26 11:47:54 -0500703 StrokeCap: {
704 Butt: {},
705 Round: {},
706 Square: {},
707 },
708
709 StrokeJoin: {
710 Miter: {},
711 Round: {},
712 Bevel: {},
713 },
714
Kevin Lubick369f6a52019-10-03 11:22:08 -0400715 TextAlign: {
716 Left: {},
717 Right: {},
718 Center: {},
719 Justify: {},
720 Start: {},
721 End: {},
722 },
723
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400724 TextDirection: {
725 LTR: {},
726 RTL: {},
727 },
728
Kevin Lubickec4903d2019-01-14 08:36:08 -0500729 TextEncoding: {
730 UTF8: {},
731 UTF16: {},
732 UTF32: {},
733 GlyphID: {},
734 },
735
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500736 TileMode: {
737 Clamp: {},
738 Repeat: {},
739 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500740 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500741 },
742
743 VertexMode: {
744 Triangles: {},
745 TrianglesStrip: {},
746 TriangleFan: {},
747 },
748
Kevin Lubick006a6f32018-10-19 14:34:34 -0400749 // Things Enscriptem adds for us
750
Kevin Lubick53965c92018-10-11 08:51:55 -0400751 /**
752 * @type {Float32Array}
753 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400754 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400755 /**
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400756 * @type {Float64Array}
757 */
758 HEAPF64: {},
759 /**
Kevin Lubick53965c92018-10-11 08:51:55 -0400760 * @type {Uint8Array}
761 */
762 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400763 /**
764 * @type {Uint16Array}
765 */
766 HEAPU16: {},
767 /**
Kevin Lubickf5ea37f2019-02-28 10:06:18 -0500768 * @type {Uint32Array}
769 */
770 HEAPU32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400771 /**
772 * @type {Int8Array}
773 */
774 HEAP8: {},
775 /**
776 * @type {Int16Array}
777 */
778 HEAP16: {},
779 /**
780 * @type {Int32Array}
781 */
782 HEAP32: {},
783
Kevin Lubick006a6f32018-10-19 14:34:34 -0400784 _malloc: function() {},
785 _free: function() {},
786 onRuntimeInitialized: function() {},
787};
Kevin Lubick217056c2018-09-20 17:39:31 -0400788
Kevin Lubick006a6f32018-10-19 14:34:34 -0400789// Public API things that are newly declared in the JS should go here.
790// It's not enough to declare them above, because closure can still erase them
791// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400792CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
793
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500794CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400795CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400796CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500797CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500798CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500799CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300800CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400801CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400802CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400803CanvasKit.SkPath.prototype.conicTo = function() {};
804CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400805CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400806CanvasKit.SkPath.prototype.lineTo = function() {};
807CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400808CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400809CanvasKit.SkPath.prototype.op = function() {};
810CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400811CanvasKit.SkPath.prototype.rArcTo = function() {};
812CanvasKit.SkPath.prototype.rConicTo = function() {};
813CanvasKit.SkPath.prototype.rCubicTo = function() {};
814CanvasKit.SkPath.prototype.rLineTo = function() {};
815CanvasKit.SkPath.prototype.rMoveTo = function() {};
816CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400817CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400818CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400819CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400820CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400821CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400822
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500823CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400824
Kevin Lubick5b90b842018-10-17 07:57:18 -0400825CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400826CanvasKit.SkSurface.prototype.flush = function() {};
827CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800828CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400829CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400830
Kevin Lubick12c0e502018-11-28 12:51:56 -0500831/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400832CanvasKit.SkVertices.prototype.applyBones = function() {};
833
Alexander Khovansky3e119332018-11-15 02:01:19 +0300834CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400835CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300836
Kevin Lubickee91c072019-03-29 10:39:52 -0400837CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500838CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500839CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500840/** @return {Uint8Array} */
841CanvasKit.SkCanvas.prototype.readPixels = function() {};
842CanvasKit.SkCanvas.prototype.writePixels = function() {};
843
Kevin Lubickddd0a332018-12-12 10:35:13 -0500844CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
845
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400846CanvasKit.SkFont.prototype.getWidths = function() {};
847
848CanvasKit.RSXFormBuilder.prototype.build = function() {};
849CanvasKit.RSXFormBuilder.prototype.delete = function() {};
850CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400851CanvasKit.RSXFormBuilder.prototype.set = function() {};
852
853CanvasKit.SkColorBuilder.prototype.build = function() {};
854CanvasKit.SkColorBuilder.prototype.delete = function() {};
855CanvasKit.SkColorBuilder.prototype.push = function() {};
856CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400857
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500858CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500859CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500860
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500861CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
862CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
863
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400864// Define StrokeOpts object
865var StrokeOpts = {};
866StrokeOpts.prototype.width;
867StrokeOpts.prototype.miter_limit;
868StrokeOpts.prototype.cap;
869StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500870StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400871
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500872// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500873var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500874HTMLCanvas.prototype.decodeImage = function() {};
875HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500876HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500877HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500878HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500879HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500880
881var CanvasRenderingContext2D = {};
882CanvasRenderingContext2D.prototype.addHitRegion = function() {};
883CanvasRenderingContext2D.prototype.arc = function() {};
884CanvasRenderingContext2D.prototype.arcTo = function() {};
885CanvasRenderingContext2D.prototype.beginPath = function() {};
886CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
887CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500888CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500889CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500890CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500891CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500892CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500893CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500894CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500895CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500896CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500897CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500898CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500899CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500900CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500901CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500902CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500903CanvasRenderingContext2D.prototype.isPointInPath = function() {};
904CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500905CanvasRenderingContext2D.prototype.lineTo = function() {};
906CanvasRenderingContext2D.prototype.measureText = function() {};
907CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500908CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500909CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
910CanvasRenderingContext2D.prototype.rect = function() {};
911CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
912CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500913CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500914CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500915CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500916CanvasRenderingContext2D.prototype.scale = function() {};
917CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500918CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500919CanvasRenderingContext2D.prototype.setTransform = function() {};
920CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500921CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500922CanvasRenderingContext2D.prototype.strokeText = function() {};
923CanvasRenderingContext2D.prototype.transform = function() {};
924CanvasRenderingContext2D.prototype.translate = function() {};
925
Kevin Lubicka40f8322018-12-17 16:01:36 -0500926var Path2D = {};
927Path2D.prototype.addPath = function() {};
928Path2D.prototype.arc = function() {};
929Path2D.prototype.arcTo = function() {};
930Path2D.prototype.bezierCurveTo = function() {};
931Path2D.prototype.closePath = function() {};
932Path2D.prototype.ellipse = function() {};
933Path2D.prototype.lineTo = function() {};
934Path2D.prototype.moveTo = function() {};
935Path2D.prototype.quadraticCurveTo = function() {};
936Path2D.prototype.rect = function() {};
937
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500938var LinearCanvasGradient = {};
939LinearCanvasGradient.prototype.addColorStop = function() {};
940var RadialCanvasGradient = {};
941RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500942var CanvasPattern = {};
943CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500944
Kevin Lubick52b9f372018-12-04 13:57:36 -0500945var ImageData = {
946 /**
947 * @type {Uint8ClampedArray}
948 */
949 data: {},
950 height: {},
951 width: {},
952};
953
Kevin Lubickd29edd72018-12-07 08:29:52 -0500954var DOMMatrix = {
955 a: {},
956 b: {},
957 c: {},
958 d: {},
959 e: {},
960 f: {},
961};
962
Kevin Lubick217056c2018-09-20 17:39:31 -0400963// 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 -0500964function loadWebAssemblyModule() {};