blob: 5c9bdd2e6826d8aa0a858ef8a6ec70c721c7012b [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 Lubick4b5b6452019-12-06 13:55:58 -0500136 },
137
Kevin Lubick369f6a52019-10-03 11:22:08 -0400138 ParagraphStyle: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400139 RSXFormBuilder: function() {},
Kevin Lubickee91c072019-03-29 10:39:52 -0400140 SkColorBuilder: function() {},
141 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400142
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500143 ShapedText: {
144 // public API (from C++ bindings)
145 getBounds: function() {},
146 },
147
Kevin Lubick6b921b72019-09-18 16:18:17 -0400148 SkAnimatedImage: {
149 // public API (from C++ bindings)
Kevin Lubick6b921b72019-09-18 16:18:17 -0400150 decodeNextFrame: function() {},
Kevin Lubick47bd9f12019-11-08 06:55:15 -0800151 getFrameCount: function() {},
152 getRepetitionCount: function() {},
153 height: function() {},
154 reset: function() {},
155 width: function() {},
Kevin Lubick6b921b72019-09-18 16:18:17 -0400156 },
157
Kevin Lubick006a6f32018-10-19 14:34:34 -0400158 SkCanvas: {
159 // public API (from C++ bindings)
160 clear: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500161 clipPath: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400162 clipRRect: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -0500163 clipRect: function() {},
164 concat: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400165 drawAnimatedImage: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500166 drawArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400167 drawCircle: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400168 drawColor: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400169 drawDRRect: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500170 drawImage: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500171 drawImageNine: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500172 drawImageRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500173 drawLine: function() {},
174 drawOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400175 drawPaint: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400176 drawParagraph: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400177 drawPath: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400178 drawPicture: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400179 drawRRect: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500180 drawRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500181 drawRoundRect: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500182 drawShadow: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500183 drawText: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500184 drawTextBlob: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500185 drawVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400186 flush: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400187 getSaveCount: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -0500188 getTotalMatrix: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500189 makeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500190 restore: function() {},
Kevin Lubickb3574c92019-03-06 08:25:36 -0500191 restoreToCount: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400192 rotate: function() {},
193 save: function() {},
Kevin Lubickb3574c92019-03-06 08:25:36 -0500194 saveLayer: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400195 scale: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400196 skew: function() {},
197 translate: function() {},
198
199 // private API
Kevin Lubickee91c072019-03-29 10:39:52 -0400200 _drawAtlas: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500201 _drawPoints: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500202 _drawSimpleText: function() {},
Kevin Lubick52b9f372018-12-04 13:57:36 -0500203 _readPixels: function() {},
204 _writePixels: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400205 delete: function() {},
206 },
207
Kevin Lubickd3729342019-09-12 11:11:25 -0400208 SkColorFilter: {
209 // public API (from C++ bindings and JS interface)
210 MakeBlend: function() {},
211 MakeCompose: function() {},
212 MakeLerp: function() {},
213 MakeLinearToSRGBGamma: function() {},
214 MakeMatrix: function() {},
215 MakeSRGBToLinearGamma: function() {},
216 // private API (from C++ bindings)
217 _makeMatrix: function() {},
218 },
219
220 SkColorMatrix: {
221 concat: function() {},
222 identity: function() {},
223 postTranslate: function() {},
224 rotated: function() {},
225 scaled: function() {},
226 },
227
Kevin Lubicke59c1672019-11-20 14:17:53 -0500228 SkContourMeasureIter: {
229 next: function() {},
230 },
231
232 SkContourMeasure: {
233 getPosTan: function() {},
234 getSegment: function() {},
235 isClosed: function() {},
236 length: function() {},
237 },
238
Kevin Lubick35ac0382019-01-02 15:13:57 -0500239 SkFont: {
240 // public API (from C++ bindings)
241 getScaleX: function() {},
242 getSize: function() {},
243 getSkewX: function() {},
244 getTypeface: function() {},
245 measureText: function() {},
246 setScaleX: function() {},
247 setSize: function() {},
248 setSkewX: function() {},
249 setTypeface: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400250 // private API (from C++ bindings)
251 _getWidths: function() {},
Kevin Lubick35ac0382019-01-02 15:13:57 -0500252 },
253
Kevin Lubickddd0a332018-12-12 10:35:13 -0500254 SkFontMgr: {
Kevin Lubick61887c72019-09-26 13:20:50 -0400255 // public API (from C++ and JS bindings)
256 FromData: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500257 RefDefault: function() {},
258 countFamilies: function() {},
Kevin Lubick486aecf2020-01-15 13:49:53 -0500259 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500260
261 // private API
262 _makeTypefaceFromData: function() {},
Kevin Lubick61887c72019-09-26 13:20:50 -0400263 _fromData: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500264 },
265
Kevin Lubick006a6f32018-10-19 14:34:34 -0400266 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500267 // public API (from C++ bindings)
268 height: function() {},
269 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300270 // private API
271 _encodeToData: function() {},
272 _encodeToDataWithFormat: function() {},
Kevin Lubicka064c282019-04-04 09:28:53 -0400273 _makeShader: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400274 },
275
Kevin Lubick15b40232019-10-29 09:55:39 -0400276 SkImageFilter: {
277 MakeBlur: function() {},
278 MakeColorFilter: function() {},
279 MakeCompose: function() {},
Kevin Lubickd2677192019-11-15 14:13:20 -0500280 MakeMatrixTransform: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400281 },
282
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500283 // These are defined in interface.js
284 SkM44: {
285 identity: function() {},
286 invert: function() {},
287 multiply: function() {},
288 rotatedUnitSinCos: function() {},
289 rotated: function() {},
290 scaled: function() {},
291 translated: function() {},
292 lookat: function() {},
293 perspective: function() {},
294 rc: function() {},
295 },
296
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500297 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500298 identity: function() {},
Kevin Lubickf3555182019-03-14 10:55:10 -0400299 invert: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500300 mapPoints: function() {},
301 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500302 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500303 scaled: function() {},
304 skewed: function() {},
305 translated: function() {},
306 },
307
Kevin Lubick15b40232019-10-29 09:55:39 -0400308 SkMaskFilter: {
309 MakeBlur: function() {},
310 },
311
Kevin Lubickb9db3902018-11-26 11:47:54 -0500312 SkPaint: {
313 // public API (from C++ bindings)
314 /** @return {CanvasKit.SkPaint} */
315 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500316 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500317 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500318 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500319 getStrokeCap: function() {},
320 getStrokeJoin: function() {},
321 getStrokeMiter: function() {},
322 getStrokeWidth: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500323 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500324 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500325 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500326 setFilterQuality: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400327 setImageFilter: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500328 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500329 setPathEffect: function() {},
330 setShader: function() {},
331 setStrokeCap: function() {},
332 setStrokeJoin: function() {},
333 setStrokeMiter: function() {},
334 setStrokeWidth: function() {},
335 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500336
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500337 // private API
Kevin Lubickb9db3902018-11-26 11:47:54 -0500338 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500339 },
340
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500341 SkParticleEffect: {
342 // public API (from C++ bindings)
343 draw: function() {},
344 getEffectUniform: function() {},
345 getEffectUniformCount: function() {},
346 getEffectUniformFloatCount: function() {},
347 getEffectUniformName: function() {},
348 getParticleUniformCount: function() {},
349 getParticleUniformFloatCount: function() {},
350 getParticleUniformName: function() {},
351 getParticleUniform: function() {},
352 setPosition: function() {},
353 setRate: function() {},
354 start: function() {},
355 update: function() {},
356
357 // private API (from C++ bindings)
358 _effectUniformPtr: function() {},
359 _particleUniformPtr: function() {},
360 },
361
Kevin Lubick006a6f32018-10-19 14:34:34 -0400362 SkPath: {
363 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500364 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500365 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500366 /** @return {CanvasKit.SkPath} */
367 copy: function() {},
368 countPoints: function() {},
369 equals: function() {},
370 getBounds: function() {},
371 getFillType: function() {},
372 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500373 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500374 isVolatile: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500375 reset: function() {},
376 rewind: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500377 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500378 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500379 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400380
381 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500382 _addArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400383 _addOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400384 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500385 _addRect: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500386 _addPoly: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500387 _addRoundRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300388 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400389 _arcTo: function() {},
390 _close: function() {},
391 _conicTo: function() {},
392 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400393 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400394 _lineTo: function() {},
395 _moveTo: function() {},
396 _op: function() {},
397 _quadTo: function() {},
Kevin Lubick79b71342019-11-01 14:36:52 -0400398 _rArcTo: function() {},
399 _rConicTo: function() {},
400 _rCubicTo: function() {},
401 _rLineTo: function() {},
402 _rMoveTo: function() {},
403 _rQuadTo: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400404 _rect: function() {},
405 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400406 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400407 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400408 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400409 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500410 dump: function() {},
411 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400412 },
413
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400414 SkPathMeasure: {
415 getLength: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500416 getSegment: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400417 getPosTan: function() {},
418 isClosed: function() {},
419 nextContour: function() {},
420 },
421
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400422 SkPicture: {
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500423 serialize: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400424 },
425
426 SkPictureRecorder: {
427 beginRecording: function() {},
428 finishRecordingAsPicture: function() {},
429 },
430
Kevin Lubick006a6f32018-10-19 14:34:34 -0400431 SkRect: {
432 fLeft: {},
433 fTop: {},
434 fRight: {},
435 fBottom: {},
436 },
437
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400438 SkRRect: {
439 rect: {},
Kevin Lubick7d644e12019-09-11 14:22:22 -0400440 rx1: {},
441 ry1: {},
442 rx2: {},
443 ry2: {},
444 rx3: {},
445 ry3: {},
446 rx4: {},
447 ry4: {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400448 },
449
Kevin Lubick62836902019-12-09 09:04:26 -0500450 SkShader: {
451 Blend: function() {},
452 Color: function() {},
453 Empty: function() {},
454 Lerp: function() {},
455
456 _Blend: function() {},
457 _Lerp: function() {},
458 },
459
Kevin Lubick006a6f32018-10-19 14:34:34 -0400460 SkSurface: {
461 // public API (from C++ bindings)
462 /** @return {CanvasKit.SkCanvas} */
463 getCanvas: function() {},
464 /** @return {CanvasKit.SkImage} */
465 makeImageSnapshot: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500466 makeSurface: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400467 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400468
469 // private API
470 _flush: function() {},
471 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400472 delete: function() {},
473 },
474
Kevin Lubickec4903d2019-01-14 08:36:08 -0500475 SkTextBlob: {
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400476 // public API (both C++ and JS bindings)
477 MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500478 MakeFromText: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400479 MakeOnPath: function() {},
480 // private API (from C++ bindings)
481 _MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500482 _MakeFromText: function() {},
483 },
484
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500485 // These are defined in interface.js
486 SkVector: {
487 add: function() {},
488 sub: function() {},
489 dot: function() {},
490 cross: function() {},
491 normalize: function() {},
492 mulScalar: function() {},
493 length: function() {},
494 lengthSquared: function() {},
495 },
496
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400497 SkVertices: {
498 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500499 bounds: function() {},
500 mode: function() {},
501 uniqueID: function() {},
502 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400503
504 // private API
505 /** @return {CanvasKit.SkVertices} */
506 _applyBones: function() {},
507 },
508
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400509 _SkVerticesBuilder: {
510 // public API (from C++ bindings)
511 boneIndices: function() {},
512 boneWeights: function() {},
513 colors: function() {},
514 detach: function() {},
515 indices: function() {},
516 positions: function() {},
517 texCoords: function() {},
518 },
519
Kevin Lubick369f6a52019-10-03 11:22:08 -0400520 TextStyle: function() {},
521
Kevin Lubick006a6f32018-10-19 14:34:34 -0400522 // Constants and Enums
523 gpu: {},
524 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400525
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500526 TRANSPARENT: {},
527 RED: {},
528 BLUE: {},
529 YELLOW: {},
530 CYAN: {},
531 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500532 WHITE: {},
533
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500534 MOVE_VERB: {},
535 LINE_VERB: {},
536 QUAD_VERB: {},
537 CONIC_VERB: {},
538 CUBIC_VERB: {},
539 CLOSE_VERB: {},
540
Kevin Lubick369f6a52019-10-03 11:22:08 -0400541 NoDecoration: {},
542 UnderlineDecoration: {},
543 OverlineDecoration: {},
544 LineThroughDecoration: {},
545
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400546 SaveLayerInitWithPrevious: {},
547 SaveLayerF16ColorType: {},
548
Kevin Lubick369f6a52019-10-03 11:22:08 -0400549 Affinity: {
550 Upstream: {},
551 Downstream: {},
552 },
553
Kevin Lubickea905ec2018-11-30 14:05:58 -0500554 AlphaType: {
555 Opaque: {},
556 Premul: {},
557 Unpremul: {},
558 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500559
560 BlendMode: {
561 Clear: {},
562 Src: {},
563 Dst: {},
564 SrcOver: {},
565 DstOver: {},
566 SrcIn: {},
567 DstIn: {},
568 SrcOut: {},
569 DstOut: {},
570 SrcATop: {},
571 DstATop: {},
572 Xor: {},
573 Plus: {},
574 Modulate: {},
575 Screen: {},
576 Overlay: {},
577 Darken: {},
578 Lighten: {},
579 ColorDodge: {},
580 ColorBurn: {},
581 HardLight: {},
582 SoftLight: {},
583 Difference: {},
584 Exclusion: {},
585 Multiply: {},
586 Hue: {},
587 Saturation: {},
588 Color: {},
589 Luminosity: {},
590 },
591
592 BlurStyle: {
593 Normal: {},
594 Solid: {},
595 Outer: {},
596 Inner: {},
597 },
598
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500599 ClipOp: {
600 Difference: {},
601 Intersect: {},
602 },
603
Kevin Lubickea905ec2018-11-30 14:05:58 -0500604 ColorType: {
605 Alpha_8: {},
606 RGB_565: {},
607 ARGB_4444: {},
608 RGBA_8888: {},
609 RGB_888x: {},
610 BGRA_8888: {},
611 RGBA_1010102: {},
612 RGB_101010x: {},
613 Gray_8: {},
614 RGBA_F16: {},
615 RGBA_F32: {},
616 },
617
Kevin Lubick006a6f32018-10-19 14:34:34 -0400618 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500619 Winding: {},
620 EvenOdd: {},
621 InverseWinding: {},
622 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400623 },
624
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500625 FilterQuality: {
626 None: {},
627 Low: {},
628 Medium: {},
629 High: {},
630 },
631
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400632 FontSlant: {
633 Upright: {},
634 Italic: {},
635 Oblique: {},
636 },
637
638 FontWeight: {
639 Invisible: {},
640 Thin: {},
641 ExtraLight: {},
642 Light: {},
643 Normal: {},
644 Medium: {},
645 SemiBold: {},
646 Bold: {},
647 ExtraBold: {},
648 Black: {},
649 ExtraBlack: {},
650 },
651
652 FontWidth: {
653 UltraCondensed: {},
654 ExtraCondensed: {},
655 Condensed: {},
656 SemiCondensed: {},
657 Normal: {},
658 SemiExpanded: {},
659 Expanded: {},
660 ExtraExpanded: {},
661 UltraExpanded: {},
662 },
663
Alexander Khovansky3e119332018-11-15 02:01:19 +0300664 ImageFormat: {
665 PNG: {},
666 JPEG: {},
667 },
668
Kevin Lubickb9db3902018-11-26 11:47:54 -0500669 PaintStyle: {
670 Fill: {},
671 Stroke: {},
672 StrokeAndFill: {},
673 },
674
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500675 PathOp: {
676 Difference: {},
677 Intersect: {},
678 Union: {},
679 XOR: {},
680 ReverseDifference: {},
681 },
682
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500683 PointMode: {
684 Points: {},
685 Lines: {},
686 Polygon: {},
687 },
688
Kevin Lubick369f6a52019-10-03 11:22:08 -0400689 RectHeightStyle: {
690 Tight: {},
691 Max: {},
Kevin Lubick4a5f4f22019-11-20 08:27:10 -0500692 IncludeLineSpacingMiddle: {},
693 IncludeLineSpacingTop: {},
694 IncludeLineSpacingBottom: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400695 },
696
697 RectWidthStyle: {
698 Tight: {},
699 Max: {},
700 },
701
Kevin Lubickb9db3902018-11-26 11:47:54 -0500702 StrokeCap: {
703 Butt: {},
704 Round: {},
705 Square: {},
706 },
707
708 StrokeJoin: {
709 Miter: {},
710 Round: {},
711 Bevel: {},
712 },
713
Kevin Lubick369f6a52019-10-03 11:22:08 -0400714 TextAlign: {
715 Left: {},
716 Right: {},
717 Center: {},
718 Justify: {},
719 Start: {},
720 End: {},
721 },
722
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400723 TextDirection: {
724 LTR: {},
725 RTL: {},
726 },
727
Kevin Lubickec4903d2019-01-14 08:36:08 -0500728 TextEncoding: {
729 UTF8: {},
730 UTF16: {},
731 UTF32: {},
732 GlyphID: {},
733 },
734
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500735 TileMode: {
736 Clamp: {},
737 Repeat: {},
738 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500739 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500740 },
741
742 VertexMode: {
743 Triangles: {},
744 TrianglesStrip: {},
745 TriangleFan: {},
746 },
747
Kevin Lubick006a6f32018-10-19 14:34:34 -0400748 // Things Enscriptem adds for us
749
Kevin Lubick53965c92018-10-11 08:51:55 -0400750 /**
751 * @type {Float32Array}
752 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400753 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400754 /**
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400755 * @type {Float64Array}
756 */
757 HEAPF64: {},
758 /**
Kevin Lubick53965c92018-10-11 08:51:55 -0400759 * @type {Uint8Array}
760 */
761 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400762 /**
763 * @type {Uint16Array}
764 */
765 HEAPU16: {},
766 /**
Kevin Lubickf5ea37f2019-02-28 10:06:18 -0500767 * @type {Uint32Array}
768 */
769 HEAPU32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400770 /**
771 * @type {Int8Array}
772 */
773 HEAP8: {},
774 /**
775 * @type {Int16Array}
776 */
777 HEAP16: {},
778 /**
779 * @type {Int32Array}
780 */
781 HEAP32: {},
782
Kevin Lubick006a6f32018-10-19 14:34:34 -0400783 _malloc: function() {},
784 _free: function() {},
785 onRuntimeInitialized: function() {},
786};
Kevin Lubick217056c2018-09-20 17:39:31 -0400787
Kevin Lubick006a6f32018-10-19 14:34:34 -0400788// Public API things that are newly declared in the JS should go here.
789// It's not enough to declare them above, because closure can still erase them
790// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400791CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
792
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500793CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400794CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400795CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500796CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500797CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500798CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300799CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400800CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400801CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400802CanvasKit.SkPath.prototype.conicTo = function() {};
803CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400804CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400805CanvasKit.SkPath.prototype.lineTo = function() {};
806CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400807CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400808CanvasKit.SkPath.prototype.op = function() {};
809CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400810CanvasKit.SkPath.prototype.rArcTo = function() {};
811CanvasKit.SkPath.prototype.rConicTo = function() {};
812CanvasKit.SkPath.prototype.rCubicTo = function() {};
813CanvasKit.SkPath.prototype.rLineTo = function() {};
814CanvasKit.SkPath.prototype.rMoveTo = function() {};
815CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400816CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400817CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400818CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400819CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400820CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400821
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500822CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400823
Kevin Lubick5b90b842018-10-17 07:57:18 -0400824CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400825CanvasKit.SkSurface.prototype.flush = function() {};
826CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800827CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400828CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400829
Kevin Lubick12c0e502018-11-28 12:51:56 -0500830/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400831CanvasKit.SkVertices.prototype.applyBones = function() {};
832
Alexander Khovansky3e119332018-11-15 02:01:19 +0300833CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400834CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300835
Kevin Lubickee91c072019-03-29 10:39:52 -0400836CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500837CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500838CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500839/** @return {Uint8Array} */
840CanvasKit.SkCanvas.prototype.readPixels = function() {};
841CanvasKit.SkCanvas.prototype.writePixels = function() {};
842
Kevin Lubickddd0a332018-12-12 10:35:13 -0500843CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
844
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400845CanvasKit.SkFont.prototype.getWidths = function() {};
846
847CanvasKit.RSXFormBuilder.prototype.build = function() {};
848CanvasKit.RSXFormBuilder.prototype.delete = function() {};
849CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400850CanvasKit.RSXFormBuilder.prototype.set = function() {};
851
852CanvasKit.SkColorBuilder.prototype.build = function() {};
853CanvasKit.SkColorBuilder.prototype.delete = function() {};
854CanvasKit.SkColorBuilder.prototype.push = function() {};
855CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400856
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500857CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500858
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500859CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
860CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
861
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400862// Define StrokeOpts object
863var StrokeOpts = {};
864StrokeOpts.prototype.width;
865StrokeOpts.prototype.miter_limit;
866StrokeOpts.prototype.cap;
867StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500868StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400869
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500870// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500871var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500872HTMLCanvas.prototype.decodeImage = function() {};
873HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500874HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500875HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500876HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500877HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500878
879var CanvasRenderingContext2D = {};
880CanvasRenderingContext2D.prototype.addHitRegion = function() {};
881CanvasRenderingContext2D.prototype.arc = function() {};
882CanvasRenderingContext2D.prototype.arcTo = function() {};
883CanvasRenderingContext2D.prototype.beginPath = function() {};
884CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
885CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500886CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500887CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500888CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500889CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500890CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500891CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500892CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500893CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500894CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500895CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500896CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500897CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500898CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500899CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500900CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500901CanvasRenderingContext2D.prototype.isPointInPath = function() {};
902CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500903CanvasRenderingContext2D.prototype.lineTo = function() {};
904CanvasRenderingContext2D.prototype.measureText = function() {};
905CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500906CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500907CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
908CanvasRenderingContext2D.prototype.rect = function() {};
909CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
910CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500911CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500912CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500913CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500914CanvasRenderingContext2D.prototype.scale = function() {};
915CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500916CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500917CanvasRenderingContext2D.prototype.setTransform = function() {};
918CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500919CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500920CanvasRenderingContext2D.prototype.strokeText = function() {};
921CanvasRenderingContext2D.prototype.transform = function() {};
922CanvasRenderingContext2D.prototype.translate = function() {};
923
Kevin Lubicka40f8322018-12-17 16:01:36 -0500924var Path2D = {};
925Path2D.prototype.addPath = function() {};
926Path2D.prototype.arc = function() {};
927Path2D.prototype.arcTo = function() {};
928Path2D.prototype.bezierCurveTo = function() {};
929Path2D.prototype.closePath = function() {};
930Path2D.prototype.ellipse = function() {};
931Path2D.prototype.lineTo = function() {};
932Path2D.prototype.moveTo = function() {};
933Path2D.prototype.quadraticCurveTo = function() {};
934Path2D.prototype.rect = function() {};
935
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500936var LinearCanvasGradient = {};
937LinearCanvasGradient.prototype.addColorStop = function() {};
938var RadialCanvasGradient = {};
939RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500940var CanvasPattern = {};
941CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500942
Kevin Lubick52b9f372018-12-04 13:57:36 -0500943var ImageData = {
944 /**
945 * @type {Uint8ClampedArray}
946 */
947 data: {},
948 height: {},
949 width: {},
950};
951
Kevin Lubickd29edd72018-12-07 08:29:52 -0500952var DOMMatrix = {
953 a: {},
954 b: {},
955 c: {},
956 d: {},
957 e: {},
958 f: {},
959};
960
Kevin Lubick217056c2018-09-20 17:39:31 -0400961// 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 -0500962function loadWebAssemblyModule() {};