blob: 9ceadaa3cc76c7b9927b955bd9b87ccb017783ce [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() {},
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500296 transpose: function() {},
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500297 },
298
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500299 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500300 identity: function() {},
Kevin Lubickf3555182019-03-14 10:55:10 -0400301 invert: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500302 mapPoints: function() {},
303 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500304 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500305 scaled: function() {},
306 skewed: function() {},
307 translated: function() {},
308 },
309
Kevin Lubick15b40232019-10-29 09:55:39 -0400310 SkMaskFilter: {
311 MakeBlur: function() {},
312 },
313
Kevin Lubickb9db3902018-11-26 11:47:54 -0500314 SkPaint: {
315 // public API (from C++ bindings)
316 /** @return {CanvasKit.SkPaint} */
317 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500318 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500319 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500320 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500321 getStrokeCap: function() {},
322 getStrokeJoin: function() {},
323 getStrokeMiter: function() {},
324 getStrokeWidth: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500325 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500326 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500327 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500328 setFilterQuality: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400329 setImageFilter: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500330 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500331 setPathEffect: function() {},
332 setShader: function() {},
333 setStrokeCap: function() {},
334 setStrokeJoin: function() {},
335 setStrokeMiter: function() {},
336 setStrokeWidth: function() {},
337 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500338
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500339 // Private API
Kevin Lubickb9db3902018-11-26 11:47:54 -0500340 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500341 },
342
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500343 SkParticleEffect: {
344 // public API (from C++ bindings)
345 draw: function() {},
346 getEffectUniform: function() {},
347 getEffectUniformCount: function() {},
348 getEffectUniformFloatCount: function() {},
349 getEffectUniformName: function() {},
350 getParticleUniformCount: function() {},
351 getParticleUniformFloatCount: function() {},
352 getParticleUniformName: function() {},
353 getParticleUniform: function() {},
354 setPosition: function() {},
355 setRate: function() {},
356 start: function() {},
357 update: function() {},
358
359 // private API (from C++ bindings)
360 _effectUniformPtr: function() {},
361 _particleUniformPtr: function() {},
362 },
363
Kevin Lubick006a6f32018-10-19 14:34:34 -0400364 SkPath: {
365 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500366 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500367 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500368 /** @return {CanvasKit.SkPath} */
369 copy: function() {},
370 countPoints: function() {},
371 equals: function() {},
372 getBounds: function() {},
373 getFillType: function() {},
374 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500375 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500376 isVolatile: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500377 reset: function() {},
378 rewind: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500379 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500380 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500381 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400382
383 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500384 _addArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400385 _addOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400386 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500387 _addRect: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500388 _addPoly: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500389 _addRoundRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300390 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400391 _arcTo: function() {},
392 _close: function() {},
393 _conicTo: function() {},
394 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400395 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400396 _lineTo: function() {},
397 _moveTo: function() {},
398 _op: function() {},
399 _quadTo: function() {},
Kevin Lubick79b71342019-11-01 14:36:52 -0400400 _rArcTo: function() {},
401 _rConicTo: function() {},
402 _rCubicTo: function() {},
403 _rLineTo: function() {},
404 _rMoveTo: function() {},
405 _rQuadTo: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400406 _rect: function() {},
407 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400408 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400409 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400410 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400411 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500412 dump: function() {},
413 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400414 },
415
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400416 SkPathMeasure: {
417 getLength: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500418 getSegment: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400419 getPosTan: function() {},
420 isClosed: function() {},
421 nextContour: function() {},
422 },
423
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400424 SkPicture: {
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500425 serialize: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400426 },
427
428 SkPictureRecorder: {
429 beginRecording: function() {},
430 finishRecordingAsPicture: function() {},
431 },
432
Kevin Lubick006a6f32018-10-19 14:34:34 -0400433 SkRect: {
434 fLeft: {},
435 fTop: {},
436 fRight: {},
437 fBottom: {},
438 },
439
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400440 SkRRect: {
441 rect: {},
Kevin Lubick7d644e12019-09-11 14:22:22 -0400442 rx1: {},
443 ry1: {},
444 rx2: {},
445 ry2: {},
446 rx3: {},
447 ry3: {},
448 rx4: {},
449 ry4: {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400450 },
451
Kevin Lubick62836902019-12-09 09:04:26 -0500452 SkShader: {
453 Blend: function() {},
454 Color: function() {},
455 Empty: function() {},
456 Lerp: function() {},
457
458 _Blend: function() {},
459 _Lerp: function() {},
460 },
461
Kevin Lubick006a6f32018-10-19 14:34:34 -0400462 SkSurface: {
463 // public API (from C++ bindings)
464 /** @return {CanvasKit.SkCanvas} */
465 getCanvas: function() {},
466 /** @return {CanvasKit.SkImage} */
467 makeImageSnapshot: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500468 makeSurface: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400469 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400470
471 // private API
472 _flush: function() {},
473 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400474 delete: function() {},
475 },
476
Kevin Lubickec4903d2019-01-14 08:36:08 -0500477 SkTextBlob: {
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400478 // public API (both C++ and JS bindings)
479 MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500480 MakeFromText: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400481 MakeOnPath: function() {},
482 // private API (from C++ bindings)
483 _MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500484 _MakeFromText: function() {},
485 },
486
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500487 // These are defined in interface.js
488 SkVector: {
489 add: function() {},
490 sub: function() {},
491 dot: function() {},
492 cross: function() {},
493 normalize: function() {},
494 mulScalar: function() {},
495 length: function() {},
496 lengthSquared: function() {},
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500497 dist: function() {},
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500498 },
499
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400500 SkVertices: {
501 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500502 bounds: function() {},
503 mode: function() {},
504 uniqueID: function() {},
505 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400506
507 // private API
508 /** @return {CanvasKit.SkVertices} */
509 _applyBones: function() {},
510 },
511
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400512 _SkVerticesBuilder: {
513 // public API (from C++ bindings)
514 boneIndices: function() {},
515 boneWeights: function() {},
516 colors: function() {},
517 detach: function() {},
518 indices: function() {},
519 positions: function() {},
520 texCoords: function() {},
521 },
522
Kevin Lubick369f6a52019-10-03 11:22:08 -0400523 TextStyle: function() {},
524
Kevin Lubick006a6f32018-10-19 14:34:34 -0400525 // Constants and Enums
526 gpu: {},
527 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400528
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500529 TRANSPARENT: {},
530 RED: {},
531 BLUE: {},
532 YELLOW: {},
533 CYAN: {},
534 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500535 WHITE: {},
536
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500537 MOVE_VERB: {},
538 LINE_VERB: {},
539 QUAD_VERB: {},
540 CONIC_VERB: {},
541 CUBIC_VERB: {},
542 CLOSE_VERB: {},
543
Kevin Lubick369f6a52019-10-03 11:22:08 -0400544 NoDecoration: {},
545 UnderlineDecoration: {},
546 OverlineDecoration: {},
547 LineThroughDecoration: {},
548
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400549 SaveLayerInitWithPrevious: {},
550 SaveLayerF16ColorType: {},
551
Kevin Lubick369f6a52019-10-03 11:22:08 -0400552 Affinity: {
553 Upstream: {},
554 Downstream: {},
555 },
556
Kevin Lubickea905ec2018-11-30 14:05:58 -0500557 AlphaType: {
558 Opaque: {},
559 Premul: {},
560 Unpremul: {},
561 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500562
563 BlendMode: {
564 Clear: {},
565 Src: {},
566 Dst: {},
567 SrcOver: {},
568 DstOver: {},
569 SrcIn: {},
570 DstIn: {},
571 SrcOut: {},
572 DstOut: {},
573 SrcATop: {},
574 DstATop: {},
575 Xor: {},
576 Plus: {},
577 Modulate: {},
578 Screen: {},
579 Overlay: {},
580 Darken: {},
581 Lighten: {},
582 ColorDodge: {},
583 ColorBurn: {},
584 HardLight: {},
585 SoftLight: {},
586 Difference: {},
587 Exclusion: {},
588 Multiply: {},
589 Hue: {},
590 Saturation: {},
591 Color: {},
592 Luminosity: {},
593 },
594
595 BlurStyle: {
596 Normal: {},
597 Solid: {},
598 Outer: {},
599 Inner: {},
600 },
601
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500602 ClipOp: {
603 Difference: {},
604 Intersect: {},
605 },
606
Kevin Lubickea905ec2018-11-30 14:05:58 -0500607 ColorType: {
608 Alpha_8: {},
609 RGB_565: {},
610 ARGB_4444: {},
611 RGBA_8888: {},
612 RGB_888x: {},
613 BGRA_8888: {},
614 RGBA_1010102: {},
615 RGB_101010x: {},
616 Gray_8: {},
617 RGBA_F16: {},
618 RGBA_F32: {},
619 },
620
Kevin Lubick006a6f32018-10-19 14:34:34 -0400621 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500622 Winding: {},
623 EvenOdd: {},
624 InverseWinding: {},
625 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400626 },
627
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500628 FilterQuality: {
629 None: {},
630 Low: {},
631 Medium: {},
632 High: {},
633 },
634
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400635 FontSlant: {
636 Upright: {},
637 Italic: {},
638 Oblique: {},
639 },
640
641 FontWeight: {
642 Invisible: {},
643 Thin: {},
644 ExtraLight: {},
645 Light: {},
646 Normal: {},
647 Medium: {},
648 SemiBold: {},
649 Bold: {},
650 ExtraBold: {},
651 Black: {},
652 ExtraBlack: {},
653 },
654
655 FontWidth: {
656 UltraCondensed: {},
657 ExtraCondensed: {},
658 Condensed: {},
659 SemiCondensed: {},
660 Normal: {},
661 SemiExpanded: {},
662 Expanded: {},
663 ExtraExpanded: {},
664 UltraExpanded: {},
665 },
666
Alexander Khovansky3e119332018-11-15 02:01:19 +0300667 ImageFormat: {
668 PNG: {},
669 JPEG: {},
670 },
671
Kevin Lubickb9db3902018-11-26 11:47:54 -0500672 PaintStyle: {
673 Fill: {},
674 Stroke: {},
675 StrokeAndFill: {},
676 },
677
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500678 PathOp: {
679 Difference: {},
680 Intersect: {},
681 Union: {},
682 XOR: {},
683 ReverseDifference: {},
684 },
685
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500686 PointMode: {
687 Points: {},
688 Lines: {},
689 Polygon: {},
690 },
691
Kevin Lubick369f6a52019-10-03 11:22:08 -0400692 RectHeightStyle: {
693 Tight: {},
694 Max: {},
Kevin Lubick4a5f4f22019-11-20 08:27:10 -0500695 IncludeLineSpacingMiddle: {},
696 IncludeLineSpacingTop: {},
697 IncludeLineSpacingBottom: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400698 },
699
700 RectWidthStyle: {
701 Tight: {},
702 Max: {},
703 },
704
Kevin Lubickb9db3902018-11-26 11:47:54 -0500705 StrokeCap: {
706 Butt: {},
707 Round: {},
708 Square: {},
709 },
710
711 StrokeJoin: {
712 Miter: {},
713 Round: {},
714 Bevel: {},
715 },
716
Kevin Lubick369f6a52019-10-03 11:22:08 -0400717 TextAlign: {
718 Left: {},
719 Right: {},
720 Center: {},
721 Justify: {},
722 Start: {},
723 End: {},
724 },
725
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400726 TextDirection: {
727 LTR: {},
728 RTL: {},
729 },
730
Kevin Lubickec4903d2019-01-14 08:36:08 -0500731 TextEncoding: {
732 UTF8: {},
733 UTF16: {},
734 UTF32: {},
735 GlyphID: {},
736 },
737
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500738 TileMode: {
739 Clamp: {},
740 Repeat: {},
741 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500742 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500743 },
744
745 VertexMode: {
746 Triangles: {},
747 TrianglesStrip: {},
748 TriangleFan: {},
749 },
750
Kevin Lubick006a6f32018-10-19 14:34:34 -0400751 // Things Enscriptem adds for us
752
Kevin Lubick53965c92018-10-11 08:51:55 -0400753 /**
754 * @type {Float32Array}
755 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400756 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400757 /**
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400758 * @type {Float64Array}
759 */
760 HEAPF64: {},
761 /**
Kevin Lubick53965c92018-10-11 08:51:55 -0400762 * @type {Uint8Array}
763 */
764 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400765 /**
766 * @type {Uint16Array}
767 */
768 HEAPU16: {},
769 /**
Kevin Lubickf5ea37f2019-02-28 10:06:18 -0500770 * @type {Uint32Array}
771 */
772 HEAPU32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400773 /**
774 * @type {Int8Array}
775 */
776 HEAP8: {},
777 /**
778 * @type {Int16Array}
779 */
780 HEAP16: {},
781 /**
782 * @type {Int32Array}
783 */
784 HEAP32: {},
785
Kevin Lubick006a6f32018-10-19 14:34:34 -0400786 _malloc: function() {},
787 _free: function() {},
788 onRuntimeInitialized: function() {},
789};
Kevin Lubick217056c2018-09-20 17:39:31 -0400790
Kevin Lubick006a6f32018-10-19 14:34:34 -0400791// Public API things that are newly declared in the JS should go here.
792// It's not enough to declare them above, because closure can still erase them
793// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400794CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
795
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500796CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400797CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400798CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500799CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500800CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500801CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300802CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400803CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400804CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400805CanvasKit.SkPath.prototype.conicTo = function() {};
806CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400807CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400808CanvasKit.SkPath.prototype.lineTo = function() {};
809CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400810CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400811CanvasKit.SkPath.prototype.op = function() {};
812CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400813CanvasKit.SkPath.prototype.rArcTo = function() {};
814CanvasKit.SkPath.prototype.rConicTo = function() {};
815CanvasKit.SkPath.prototype.rCubicTo = function() {};
816CanvasKit.SkPath.prototype.rLineTo = function() {};
817CanvasKit.SkPath.prototype.rMoveTo = function() {};
818CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400819CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400820CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400821CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400822CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400823CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400824
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500825CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400826
Kevin Lubick5b90b842018-10-17 07:57:18 -0400827CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400828CanvasKit.SkSurface.prototype.flush = function() {};
829CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800830CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400831CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400832
Kevin Lubick12c0e502018-11-28 12:51:56 -0500833/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400834CanvasKit.SkVertices.prototype.applyBones = function() {};
835
Alexander Khovansky3e119332018-11-15 02:01:19 +0300836CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400837CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300838
Kevin Lubickee91c072019-03-29 10:39:52 -0400839CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500840CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500841CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500842/** @return {Uint8Array} */
843CanvasKit.SkCanvas.prototype.readPixels = function() {};
844CanvasKit.SkCanvas.prototype.writePixels = function() {};
845
Kevin Lubickddd0a332018-12-12 10:35:13 -0500846CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
847
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400848CanvasKit.SkFont.prototype.getWidths = function() {};
849
850CanvasKit.RSXFormBuilder.prototype.build = function() {};
851CanvasKit.RSXFormBuilder.prototype.delete = function() {};
852CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400853CanvasKit.RSXFormBuilder.prototype.set = function() {};
854
855CanvasKit.SkColorBuilder.prototype.build = function() {};
856CanvasKit.SkColorBuilder.prototype.delete = function() {};
857CanvasKit.SkColorBuilder.prototype.push = function() {};
858CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400859
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500860CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500861CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500862
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500863CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
864CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
865
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400866// Define StrokeOpts object
867var StrokeOpts = {};
868StrokeOpts.prototype.width;
869StrokeOpts.prototype.miter_limit;
870StrokeOpts.prototype.cap;
871StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500872StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400873
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500874// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500875var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500876HTMLCanvas.prototype.decodeImage = function() {};
877HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500878HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500879HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500880HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500881HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500882
883var CanvasRenderingContext2D = {};
884CanvasRenderingContext2D.prototype.addHitRegion = function() {};
885CanvasRenderingContext2D.prototype.arc = function() {};
886CanvasRenderingContext2D.prototype.arcTo = function() {};
887CanvasRenderingContext2D.prototype.beginPath = function() {};
888CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
889CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500890CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500891CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500892CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500893CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500894CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500895CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500896CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500897CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500898CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500899CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500900CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500901CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500902CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500903CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500904CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500905CanvasRenderingContext2D.prototype.isPointInPath = function() {};
906CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500907CanvasRenderingContext2D.prototype.lineTo = function() {};
908CanvasRenderingContext2D.prototype.measureText = function() {};
909CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500910CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500911CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
912CanvasRenderingContext2D.prototype.rect = function() {};
913CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
914CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500915CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500916CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500917CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500918CanvasRenderingContext2D.prototype.scale = function() {};
919CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500920CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500921CanvasRenderingContext2D.prototype.setTransform = function() {};
922CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500923CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500924CanvasRenderingContext2D.prototype.strokeText = function() {};
925CanvasRenderingContext2D.prototype.transform = function() {};
926CanvasRenderingContext2D.prototype.translate = function() {};
927
Kevin Lubicka40f8322018-12-17 16:01:36 -0500928var Path2D = {};
929Path2D.prototype.addPath = function() {};
930Path2D.prototype.arc = function() {};
931Path2D.prototype.arcTo = function() {};
932Path2D.prototype.bezierCurveTo = function() {};
933Path2D.prototype.closePath = function() {};
934Path2D.prototype.ellipse = function() {};
935Path2D.prototype.lineTo = function() {};
936Path2D.prototype.moveTo = function() {};
937Path2D.prototype.quadraticCurveTo = function() {};
938Path2D.prototype.rect = function() {};
939
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500940var LinearCanvasGradient = {};
941LinearCanvasGradient.prototype.addColorStop = function() {};
942var RadialCanvasGradient = {};
943RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500944var CanvasPattern = {};
945CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500946
Kevin Lubick52b9f372018-12-04 13:57:36 -0500947var ImageData = {
948 /**
949 * @type {Uint8ClampedArray}
950 */
951 data: {},
952 height: {},
953 width: {},
954};
955
Kevin Lubickd29edd72018-12-07 08:29:52 -0500956var DOMMatrix = {
957 a: {},
958 b: {},
959 c: {},
960 d: {},
961 e: {},
962 f: {},
963};
964
Kevin Lubick217056c2018-09-20 17:39:31 -0400965// 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 -0500966function loadWebAssemblyModule() {};