blob: 93203d7d12f4ec6056c4d8a97678bb4d5a89967f [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
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500283 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500284 identity: function() {},
Kevin Lubickf3555182019-03-14 10:55:10 -0400285 invert: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500286 mapPoints: function() {},
287 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500288 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500289 scaled: function() {},
290 skewed: function() {},
291 translated: function() {},
292 },
293
Kevin Lubick15b40232019-10-29 09:55:39 -0400294 SkMaskFilter: {
295 MakeBlur: function() {},
296 },
297
Kevin Lubickb9db3902018-11-26 11:47:54 -0500298 SkPaint: {
299 // public API (from C++ bindings)
300 /** @return {CanvasKit.SkPaint} */
301 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500302 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500303 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500304 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500305 getStrokeCap: function() {},
306 getStrokeJoin: function() {},
307 getStrokeMiter: function() {},
308 getStrokeWidth: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500309 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500310 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500311 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500312 setFilterQuality: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400313 setImageFilter: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500314 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500315 setPathEffect: function() {},
316 setShader: function() {},
317 setStrokeCap: function() {},
318 setStrokeJoin: function() {},
319 setStrokeMiter: function() {},
320 setStrokeWidth: function() {},
321 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500322
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500323 // private API
Kevin Lubickb9db3902018-11-26 11:47:54 -0500324 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500325 },
326
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500327 SkParticleEffect: {
328 // public API (from C++ bindings)
329 draw: function() {},
330 getEffectUniform: function() {},
331 getEffectUniformCount: function() {},
332 getEffectUniformFloatCount: function() {},
333 getEffectUniformName: function() {},
334 getParticleUniformCount: function() {},
335 getParticleUniformFloatCount: function() {},
336 getParticleUniformName: function() {},
337 getParticleUniform: function() {},
338 setPosition: function() {},
339 setRate: function() {},
340 start: function() {},
341 update: function() {},
342
343 // private API (from C++ bindings)
344 _effectUniformPtr: function() {},
345 _particleUniformPtr: function() {},
346 },
347
Kevin Lubick006a6f32018-10-19 14:34:34 -0400348 SkPath: {
349 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500350 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500351 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500352 /** @return {CanvasKit.SkPath} */
353 copy: function() {},
354 countPoints: function() {},
355 equals: function() {},
356 getBounds: function() {},
357 getFillType: function() {},
358 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500359 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500360 isVolatile: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500361 reset: function() {},
362 rewind: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500363 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500364 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500365 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400366
367 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500368 _addArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400369 _addOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400370 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500371 _addRect: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500372 _addPoly: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500373 _addRoundRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300374 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400375 _arcTo: function() {},
376 _close: function() {},
377 _conicTo: function() {},
378 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400379 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400380 _lineTo: function() {},
381 _moveTo: function() {},
382 _op: function() {},
383 _quadTo: function() {},
Kevin Lubick79b71342019-11-01 14:36:52 -0400384 _rArcTo: function() {},
385 _rConicTo: function() {},
386 _rCubicTo: function() {},
387 _rLineTo: function() {},
388 _rMoveTo: function() {},
389 _rQuadTo: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400390 _rect: function() {},
391 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400392 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400393 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400394 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400395 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500396 dump: function() {},
397 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400398 },
399
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400400 SkPathMeasure: {
401 getLength: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500402 getSegment: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400403 getPosTan: function() {},
404 isClosed: function() {},
405 nextContour: function() {},
406 },
407
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400408 SkPicture: {
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500409 serialize: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400410 },
411
412 SkPictureRecorder: {
413 beginRecording: function() {},
414 finishRecordingAsPicture: function() {},
415 },
416
Kevin Lubick006a6f32018-10-19 14:34:34 -0400417 SkRect: {
418 fLeft: {},
419 fTop: {},
420 fRight: {},
421 fBottom: {},
422 },
423
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400424 SkRRect: {
425 rect: {},
Kevin Lubick7d644e12019-09-11 14:22:22 -0400426 rx1: {},
427 ry1: {},
428 rx2: {},
429 ry2: {},
430 rx3: {},
431 ry3: {},
432 rx4: {},
433 ry4: {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400434 },
435
Kevin Lubick62836902019-12-09 09:04:26 -0500436 SkShader: {
437 Blend: function() {},
438 Color: function() {},
439 Empty: function() {},
440 Lerp: function() {},
441
442 _Blend: function() {},
443 _Lerp: function() {},
444 },
445
Kevin Lubick006a6f32018-10-19 14:34:34 -0400446 SkSurface: {
447 // public API (from C++ bindings)
448 /** @return {CanvasKit.SkCanvas} */
449 getCanvas: function() {},
450 /** @return {CanvasKit.SkImage} */
451 makeImageSnapshot: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500452 makeSurface: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400453 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400454
455 // private API
456 _flush: function() {},
457 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400458 delete: function() {},
459 },
460
Kevin Lubickec4903d2019-01-14 08:36:08 -0500461 SkTextBlob: {
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400462 // public API (both C++ and JS bindings)
463 MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500464 MakeFromText: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400465 MakeOnPath: function() {},
466 // private API (from C++ bindings)
467 _MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500468 _MakeFromText: function() {},
469 },
470
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400471 SkVertices: {
472 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500473 bounds: function() {},
474 mode: function() {},
475 uniqueID: function() {},
476 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400477
478 // private API
479 /** @return {CanvasKit.SkVertices} */
480 _applyBones: function() {},
481 },
482
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400483 _SkVerticesBuilder: {
484 // public API (from C++ bindings)
485 boneIndices: function() {},
486 boneWeights: function() {},
487 colors: function() {},
488 detach: function() {},
489 indices: function() {},
490 positions: function() {},
491 texCoords: function() {},
492 },
493
Kevin Lubick369f6a52019-10-03 11:22:08 -0400494 TextStyle: function() {},
495
Kevin Lubick006a6f32018-10-19 14:34:34 -0400496 // Constants and Enums
497 gpu: {},
498 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400499
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500500 TRANSPARENT: {},
501 RED: {},
502 BLUE: {},
503 YELLOW: {},
504 CYAN: {},
505 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500506 WHITE: {},
507
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500508 MOVE_VERB: {},
509 LINE_VERB: {},
510 QUAD_VERB: {},
511 CONIC_VERB: {},
512 CUBIC_VERB: {},
513 CLOSE_VERB: {},
514
Kevin Lubick369f6a52019-10-03 11:22:08 -0400515 NoDecoration: {},
516 UnderlineDecoration: {},
517 OverlineDecoration: {},
518 LineThroughDecoration: {},
519
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400520 SaveLayerInitWithPrevious: {},
521 SaveLayerF16ColorType: {},
522
Kevin Lubick369f6a52019-10-03 11:22:08 -0400523 Affinity: {
524 Upstream: {},
525 Downstream: {},
526 },
527
Kevin Lubickea905ec2018-11-30 14:05:58 -0500528 AlphaType: {
529 Opaque: {},
530 Premul: {},
531 Unpremul: {},
532 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500533
534 BlendMode: {
535 Clear: {},
536 Src: {},
537 Dst: {},
538 SrcOver: {},
539 DstOver: {},
540 SrcIn: {},
541 DstIn: {},
542 SrcOut: {},
543 DstOut: {},
544 SrcATop: {},
545 DstATop: {},
546 Xor: {},
547 Plus: {},
548 Modulate: {},
549 Screen: {},
550 Overlay: {},
551 Darken: {},
552 Lighten: {},
553 ColorDodge: {},
554 ColorBurn: {},
555 HardLight: {},
556 SoftLight: {},
557 Difference: {},
558 Exclusion: {},
559 Multiply: {},
560 Hue: {},
561 Saturation: {},
562 Color: {},
563 Luminosity: {},
564 },
565
566 BlurStyle: {
567 Normal: {},
568 Solid: {},
569 Outer: {},
570 Inner: {},
571 },
572
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500573 ClipOp: {
574 Difference: {},
575 Intersect: {},
576 },
577
Kevin Lubickea905ec2018-11-30 14:05:58 -0500578 ColorType: {
579 Alpha_8: {},
580 RGB_565: {},
581 ARGB_4444: {},
582 RGBA_8888: {},
583 RGB_888x: {},
584 BGRA_8888: {},
585 RGBA_1010102: {},
586 RGB_101010x: {},
587 Gray_8: {},
588 RGBA_F16: {},
589 RGBA_F32: {},
590 },
591
Kevin Lubick006a6f32018-10-19 14:34:34 -0400592 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500593 Winding: {},
594 EvenOdd: {},
595 InverseWinding: {},
596 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400597 },
598
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500599 FilterQuality: {
600 None: {},
601 Low: {},
602 Medium: {},
603 High: {},
604 },
605
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400606 FontSlant: {
607 Upright: {},
608 Italic: {},
609 Oblique: {},
610 },
611
612 FontWeight: {
613 Invisible: {},
614 Thin: {},
615 ExtraLight: {},
616 Light: {},
617 Normal: {},
618 Medium: {},
619 SemiBold: {},
620 Bold: {},
621 ExtraBold: {},
622 Black: {},
623 ExtraBlack: {},
624 },
625
626 FontWidth: {
627 UltraCondensed: {},
628 ExtraCondensed: {},
629 Condensed: {},
630 SemiCondensed: {},
631 Normal: {},
632 SemiExpanded: {},
633 Expanded: {},
634 ExtraExpanded: {},
635 UltraExpanded: {},
636 },
637
Alexander Khovansky3e119332018-11-15 02:01:19 +0300638 ImageFormat: {
639 PNG: {},
640 JPEG: {},
641 },
642
Kevin Lubickb9db3902018-11-26 11:47:54 -0500643 PaintStyle: {
644 Fill: {},
645 Stroke: {},
646 StrokeAndFill: {},
647 },
648
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500649 PathOp: {
650 Difference: {},
651 Intersect: {},
652 Union: {},
653 XOR: {},
654 ReverseDifference: {},
655 },
656
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500657 PointMode: {
658 Points: {},
659 Lines: {},
660 Polygon: {},
661 },
662
Kevin Lubick369f6a52019-10-03 11:22:08 -0400663 RectHeightStyle: {
664 Tight: {},
665 Max: {},
Kevin Lubick4a5f4f22019-11-20 08:27:10 -0500666 IncludeLineSpacingMiddle: {},
667 IncludeLineSpacingTop: {},
668 IncludeLineSpacingBottom: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400669 },
670
671 RectWidthStyle: {
672 Tight: {},
673 Max: {},
674 },
675
Kevin Lubickb9db3902018-11-26 11:47:54 -0500676 StrokeCap: {
677 Butt: {},
678 Round: {},
679 Square: {},
680 },
681
682 StrokeJoin: {
683 Miter: {},
684 Round: {},
685 Bevel: {},
686 },
687
Kevin Lubick369f6a52019-10-03 11:22:08 -0400688 TextAlign: {
689 Left: {},
690 Right: {},
691 Center: {},
692 Justify: {},
693 Start: {},
694 End: {},
695 },
696
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400697 TextDirection: {
698 LTR: {},
699 RTL: {},
700 },
701
Kevin Lubickec4903d2019-01-14 08:36:08 -0500702 TextEncoding: {
703 UTF8: {},
704 UTF16: {},
705 UTF32: {},
706 GlyphID: {},
707 },
708
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500709 TileMode: {
710 Clamp: {},
711 Repeat: {},
712 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500713 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500714 },
715
716 VertexMode: {
717 Triangles: {},
718 TrianglesStrip: {},
719 TriangleFan: {},
720 },
721
Kevin Lubick006a6f32018-10-19 14:34:34 -0400722 // Things Enscriptem adds for us
723
Kevin Lubick53965c92018-10-11 08:51:55 -0400724 /**
725 * @type {Float32Array}
726 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400727 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400728 /**
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400729 * @type {Float64Array}
730 */
731 HEAPF64: {},
732 /**
Kevin Lubick53965c92018-10-11 08:51:55 -0400733 * @type {Uint8Array}
734 */
735 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400736 /**
737 * @type {Uint16Array}
738 */
739 HEAPU16: {},
740 /**
Kevin Lubickf5ea37f2019-02-28 10:06:18 -0500741 * @type {Uint32Array}
742 */
743 HEAPU32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400744 /**
745 * @type {Int8Array}
746 */
747 HEAP8: {},
748 /**
749 * @type {Int16Array}
750 */
751 HEAP16: {},
752 /**
753 * @type {Int32Array}
754 */
755 HEAP32: {},
756
Kevin Lubick006a6f32018-10-19 14:34:34 -0400757 _malloc: function() {},
758 _free: function() {},
759 onRuntimeInitialized: function() {},
760};
Kevin Lubick217056c2018-09-20 17:39:31 -0400761
Kevin Lubick006a6f32018-10-19 14:34:34 -0400762// Public API things that are newly declared in the JS should go here.
763// It's not enough to declare them above, because closure can still erase them
764// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400765CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
766
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500767CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400768CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400769CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500770CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500771CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500772CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300773CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400774CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400775CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400776CanvasKit.SkPath.prototype.conicTo = function() {};
777CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400778CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400779CanvasKit.SkPath.prototype.lineTo = function() {};
780CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400781CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400782CanvasKit.SkPath.prototype.op = function() {};
783CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400784CanvasKit.SkPath.prototype.rArcTo = function() {};
785CanvasKit.SkPath.prototype.rConicTo = function() {};
786CanvasKit.SkPath.prototype.rCubicTo = function() {};
787CanvasKit.SkPath.prototype.rLineTo = function() {};
788CanvasKit.SkPath.prototype.rMoveTo = function() {};
789CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400790CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400791CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400792CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400793CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400794CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400795
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500796CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400797
Kevin Lubick5b90b842018-10-17 07:57:18 -0400798CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400799CanvasKit.SkSurface.prototype.flush = function() {};
800CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800801CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400802CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400803
Kevin Lubick12c0e502018-11-28 12:51:56 -0500804/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400805CanvasKit.SkVertices.prototype.applyBones = function() {};
806
Alexander Khovansky3e119332018-11-15 02:01:19 +0300807CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400808CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300809
Kevin Lubickee91c072019-03-29 10:39:52 -0400810CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500811CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500812CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500813/** @return {Uint8Array} */
814CanvasKit.SkCanvas.prototype.readPixels = function() {};
815CanvasKit.SkCanvas.prototype.writePixels = function() {};
816
Kevin Lubickddd0a332018-12-12 10:35:13 -0500817CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
818
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400819CanvasKit.SkFont.prototype.getWidths = function() {};
820
821CanvasKit.RSXFormBuilder.prototype.build = function() {};
822CanvasKit.RSXFormBuilder.prototype.delete = function() {};
823CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400824CanvasKit.RSXFormBuilder.prototype.set = function() {};
825
826CanvasKit.SkColorBuilder.prototype.build = function() {};
827CanvasKit.SkColorBuilder.prototype.delete = function() {};
828CanvasKit.SkColorBuilder.prototype.push = function() {};
829CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400830
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500831CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500832
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500833CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
834CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
835
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400836// Define StrokeOpts object
837var StrokeOpts = {};
838StrokeOpts.prototype.width;
839StrokeOpts.prototype.miter_limit;
840StrokeOpts.prototype.cap;
841StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500842StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400843
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500844// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500845var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500846HTMLCanvas.prototype.decodeImage = function() {};
847HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500848HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500849HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500850HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500851HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500852
853var CanvasRenderingContext2D = {};
854CanvasRenderingContext2D.prototype.addHitRegion = function() {};
855CanvasRenderingContext2D.prototype.arc = function() {};
856CanvasRenderingContext2D.prototype.arcTo = function() {};
857CanvasRenderingContext2D.prototype.beginPath = function() {};
858CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
859CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500860CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500861CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500862CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500863CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500864CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500865CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500866CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500867CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500868CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500869CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500870CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500871CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500872CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500873CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500874CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500875CanvasRenderingContext2D.prototype.isPointInPath = function() {};
876CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500877CanvasRenderingContext2D.prototype.lineTo = function() {};
878CanvasRenderingContext2D.prototype.measureText = function() {};
879CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500880CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500881CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
882CanvasRenderingContext2D.prototype.rect = function() {};
883CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
884CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500885CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500886CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500887CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500888CanvasRenderingContext2D.prototype.scale = function() {};
889CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500890CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500891CanvasRenderingContext2D.prototype.setTransform = function() {};
892CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500893CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500894CanvasRenderingContext2D.prototype.strokeText = function() {};
895CanvasRenderingContext2D.prototype.transform = function() {};
896CanvasRenderingContext2D.prototype.translate = function() {};
897
Kevin Lubicka40f8322018-12-17 16:01:36 -0500898var Path2D = {};
899Path2D.prototype.addPath = function() {};
900Path2D.prototype.arc = function() {};
901Path2D.prototype.arcTo = function() {};
902Path2D.prototype.bezierCurveTo = function() {};
903Path2D.prototype.closePath = function() {};
904Path2D.prototype.ellipse = function() {};
905Path2D.prototype.lineTo = function() {};
906Path2D.prototype.moveTo = function() {};
907Path2D.prototype.quadraticCurveTo = function() {};
908Path2D.prototype.rect = function() {};
909
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500910var LinearCanvasGradient = {};
911LinearCanvasGradient.prototype.addColorStop = function() {};
912var RadialCanvasGradient = {};
913RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500914var CanvasPattern = {};
915CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500916
Kevin Lubick52b9f372018-12-04 13:57:36 -0500917var ImageData = {
918 /**
919 * @type {Uint8ClampedArray}
920 */
921 data: {},
922 height: {},
923 width: {},
924};
925
Kevin Lubickd29edd72018-12-07 08:29:52 -0500926var DOMMatrix = {
927 a: {},
928 b: {},
929 c: {},
930 d: {},
931 e: {},
932 f: {},
933};
934
Kevin Lubick217056c2018-09-20 17:39:31 -0400935// 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 -0500936function loadWebAssemblyModule() {};