blob: 158de8b4a110b13426aa34edc8cdcec65c90cca2 [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() {},
Kevin Lubick92797982020-02-24 10:00:20 -0500108 releaseResourcesAndAbandonContext: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400109 setResourceCacheLimitBytes: function() {},
110 },
111
Kevin Lubick369f6a52019-10-03 11:22:08 -0400112 Paragraph: {
113 // public API (from C++ bindings)
Kevin Lubick04912672019-11-15 14:48:55 -0500114 didExceedMaxLines: function() {},
115 getAlphabeticBaseline: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400116 getGlyphPositionAtCoordinate: function() {},
Kevin Lubick04912672019-11-15 14:48:55 -0500117 getHeight: function() {},
118 getIdeographicBaseline: function() {},
119 getLongestLine: function() {},
120 getMaxIntrinsicWidth: function() {},
121 getMaxWidth: function() {},
122 getMinIntrinsicWidth: function() {},
123 getWordBoundary: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400124 layout: function() {},
125
126 // private API
127 /** @return {Float32Array} */
128 _getRectsForRange: function() {},
129 },
130
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500131 SkRuntimeEffect: {
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500132 // public API (from C++ bindings)
Brian Osman93de1622019-12-26 08:43:05 -0500133 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500134
135 // private API
Brian Osman93de1622019-12-26 08:43:05 -0500136 _makeShader: function() {},
Kevin Lubickecd87622020-02-22 07:37:33 -0500137 _makeShaderWithChildren: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500138 },
139
Kevin Lubick369f6a52019-10-03 11:22:08 -0400140 ParagraphStyle: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400141 RSXFormBuilder: function() {},
Kevin Lubickee91c072019-03-29 10:39:52 -0400142 SkColorBuilder: function() {},
143 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400144
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500145 ShapedText: {
146 // public API (from C++ bindings)
147 getBounds: function() {},
148 },
149
Kevin Lubick6b921b72019-09-18 16:18:17 -0400150 SkAnimatedImage: {
151 // public API (from C++ bindings)
Kevin Lubick6b921b72019-09-18 16:18:17 -0400152 decodeNextFrame: function() {},
Kevin Lubick47bd9f12019-11-08 06:55:15 -0800153 getFrameCount: function() {},
154 getRepetitionCount: function() {},
155 height: function() {},
156 reset: function() {},
157 width: function() {},
Kevin Lubick6b921b72019-09-18 16:18:17 -0400158 },
159
Kevin Lubick006a6f32018-10-19 14:34:34 -0400160 SkCanvas: {
161 // public API (from C++ bindings)
162 clear: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500163 clipPath: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400164 clipRRect: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -0500165 clipRect: function() {},
166 concat: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400167 drawAnimatedImage: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500168 drawArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400169 drawCircle: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400170 drawColor: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400171 drawDRRect: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500172 drawImage: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500173 drawImageNine: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500174 drawImageRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500175 drawLine: function() {},
176 drawOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400177 drawPaint: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400178 drawParagraph: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400179 drawPath: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400180 drawPicture: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400181 drawRRect: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500182 drawRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500183 drawRoundRect: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500184 drawShadow: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500185 drawText: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500186 drawTextBlob: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500187 drawVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400188 flush: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400189 getSaveCount: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -0500190 getTotalMatrix: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500191 makeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500192 restore: function() {},
Kevin Lubickb3574c92019-03-06 08:25:36 -0500193 restoreToCount: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400194 rotate: function() {},
195 save: function() {},
Kevin Lubickb3574c92019-03-06 08:25:36 -0500196 saveLayer: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400197 scale: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400198 skew: function() {},
199 translate: function() {},
200
201 // private API
Kevin Lubickee91c072019-03-29 10:39:52 -0400202 _drawAtlas: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500203 _drawPoints: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500204 _drawSimpleText: function() {},
Kevin Lubick52b9f372018-12-04 13:57:36 -0500205 _readPixels: function() {},
206 _writePixels: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400207 delete: function() {},
208 },
209
Kevin Lubickd3729342019-09-12 11:11:25 -0400210 SkColorFilter: {
211 // public API (from C++ bindings and JS interface)
212 MakeBlend: function() {},
213 MakeCompose: function() {},
214 MakeLerp: function() {},
215 MakeLinearToSRGBGamma: function() {},
216 MakeMatrix: function() {},
217 MakeSRGBToLinearGamma: function() {},
218 // private API (from C++ bindings)
219 _makeMatrix: function() {},
220 },
221
222 SkColorMatrix: {
223 concat: function() {},
224 identity: function() {},
225 postTranslate: function() {},
226 rotated: function() {},
227 scaled: function() {},
228 },
229
Kevin Lubicke59c1672019-11-20 14:17:53 -0500230 SkContourMeasureIter: {
231 next: function() {},
232 },
233
234 SkContourMeasure: {
235 getPosTan: function() {},
236 getSegment: function() {},
237 isClosed: function() {},
238 length: function() {},
239 },
240
Kevin Lubick35ac0382019-01-02 15:13:57 -0500241 SkFont: {
242 // public API (from C++ bindings)
243 getScaleX: function() {},
244 getSize: function() {},
245 getSkewX: function() {},
246 getTypeface: function() {},
247 measureText: function() {},
248 setScaleX: function() {},
249 setSize: function() {},
250 setSkewX: function() {},
251 setTypeface: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400252 // private API (from C++ bindings)
253 _getWidths: function() {},
Kevin Lubick35ac0382019-01-02 15:13:57 -0500254 },
255
Kevin Lubickddd0a332018-12-12 10:35:13 -0500256 SkFontMgr: {
Kevin Lubick61887c72019-09-26 13:20:50 -0400257 // public API (from C++ and JS bindings)
258 FromData: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500259 RefDefault: function() {},
260 countFamilies: function() {},
Kevin Lubick486aecf2020-01-15 13:49:53 -0500261 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500262
263 // private API
264 _makeTypefaceFromData: function() {},
Kevin Lubick61887c72019-09-26 13:20:50 -0400265 _fromData: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500266 },
267
Kevin Lubick006a6f32018-10-19 14:34:34 -0400268 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500269 // public API (from C++ bindings)
270 height: function() {},
271 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300272 // private API
273 _encodeToData: function() {},
274 _encodeToDataWithFormat: function() {},
Kevin Lubicka064c282019-04-04 09:28:53 -0400275 _makeShader: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400276 },
277
Kevin Lubick15b40232019-10-29 09:55:39 -0400278 SkImageFilter: {
279 MakeBlur: function() {},
280 MakeColorFilter: function() {},
281 MakeCompose: function() {},
Kevin Lubickd2677192019-11-15 14:13:20 -0500282 MakeMatrixTransform: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400283 },
284
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500285 // These are defined in interface.js
286 SkM44: {
287 identity: function() {},
288 invert: function() {},
289 multiply: function() {},
290 rotatedUnitSinCos: function() {},
291 rotated: function() {},
292 scaled: function() {},
293 translated: function() {},
294 lookat: function() {},
295 perspective: function() {},
296 rc: function() {},
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500297 transpose: function() {},
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500298 },
299
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500300 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500301 identity: function() {},
Kevin Lubickf3555182019-03-14 10:55:10 -0400302 invert: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500303 mapPoints: function() {},
304 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500305 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500306 scaled: function() {},
307 skewed: function() {},
308 translated: function() {},
309 },
310
Kevin Lubick15b40232019-10-29 09:55:39 -0400311 SkMaskFilter: {
312 MakeBlur: function() {},
313 },
314
Kevin Lubickb9db3902018-11-26 11:47:54 -0500315 SkPaint: {
316 // public API (from C++ bindings)
317 /** @return {CanvasKit.SkPaint} */
318 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500319 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500320 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500321 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500322 getStrokeCap: function() {},
323 getStrokeJoin: function() {},
324 getStrokeMiter: function() {},
325 getStrokeWidth: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500326 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500327 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500328 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500329 setFilterQuality: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400330 setImageFilter: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500331 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500332 setPathEffect: function() {},
333 setShader: function() {},
334 setStrokeCap: function() {},
335 setStrokeJoin: function() {},
336 setStrokeMiter: function() {},
337 setStrokeWidth: function() {},
338 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500339
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500340 // Private API
Kevin Lubickb9db3902018-11-26 11:47:54 -0500341 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500342 },
343
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500344 SkParticleEffect: {
345 // public API (from C++ bindings)
346 draw: function() {},
347 getEffectUniform: function() {},
348 getEffectUniformCount: function() {},
349 getEffectUniformFloatCount: function() {},
350 getEffectUniformName: function() {},
351 getParticleUniformCount: function() {},
352 getParticleUniformFloatCount: function() {},
353 getParticleUniformName: function() {},
354 getParticleUniform: function() {},
355 setPosition: function() {},
356 setRate: function() {},
357 start: function() {},
358 update: function() {},
359
360 // private API (from C++ bindings)
361 _effectUniformPtr: function() {},
362 _particleUniformPtr: function() {},
363 },
364
Kevin Lubick006a6f32018-10-19 14:34:34 -0400365 SkPath: {
366 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500367 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500368 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500369 /** @return {CanvasKit.SkPath} */
370 copy: function() {},
371 countPoints: function() {},
372 equals: function() {},
373 getBounds: function() {},
374 getFillType: function() {},
375 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500376 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500377 isVolatile: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500378 reset: function() {},
379 rewind: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500380 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500381 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500382 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400383
384 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500385 _addArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400386 _addOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400387 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500388 _addRect: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500389 _addPoly: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500390 _addRoundRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300391 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400392 _arcTo: function() {},
393 _close: function() {},
394 _conicTo: function() {},
395 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400396 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400397 _lineTo: function() {},
398 _moveTo: function() {},
399 _op: function() {},
400 _quadTo: function() {},
Kevin Lubick79b71342019-11-01 14:36:52 -0400401 _rArcTo: function() {},
402 _rConicTo: function() {},
403 _rCubicTo: function() {},
404 _rLineTo: function() {},
405 _rMoveTo: function() {},
406 _rQuadTo: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400407 _rect: function() {},
408 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400409 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400410 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400411 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400412 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500413 dump: function() {},
414 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400415 },
416
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400417 SkPathMeasure: {
418 getLength: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500419 getSegment: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400420 getPosTan: function() {},
421 isClosed: function() {},
422 nextContour: function() {},
423 },
424
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400425 SkPicture: {
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500426 serialize: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400427 },
428
429 SkPictureRecorder: {
430 beginRecording: function() {},
431 finishRecordingAsPicture: function() {},
432 },
433
Kevin Lubick006a6f32018-10-19 14:34:34 -0400434 SkRect: {
435 fLeft: {},
436 fTop: {},
437 fRight: {},
438 fBottom: {},
439 },
440
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400441 SkRRect: {
442 rect: {},
Kevin Lubick7d644e12019-09-11 14:22:22 -0400443 rx1: {},
444 ry1: {},
445 rx2: {},
446 ry2: {},
447 rx3: {},
448 ry3: {},
449 rx4: {},
450 ry4: {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400451 },
452
Kevin Lubick62836902019-12-09 09:04:26 -0500453 SkShader: {
454 Blend: function() {},
455 Color: function() {},
456 Empty: function() {},
457 Lerp: function() {},
458
459 _Blend: function() {},
460 _Lerp: function() {},
461 },
462
Kevin Lubick006a6f32018-10-19 14:34:34 -0400463 SkSurface: {
464 // public API (from C++ bindings)
465 /** @return {CanvasKit.SkCanvas} */
466 getCanvas: function() {},
467 /** @return {CanvasKit.SkImage} */
468 makeImageSnapshot: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500469 makeSurface: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400470 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400471
472 // private API
473 _flush: function() {},
474 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400475 delete: function() {},
476 },
477
Kevin Lubickec4903d2019-01-14 08:36:08 -0500478 SkTextBlob: {
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400479 // public API (both C++ and JS bindings)
480 MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500481 MakeFromText: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400482 MakeOnPath: function() {},
483 // private API (from C++ bindings)
484 _MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500485 _MakeFromText: function() {},
486 },
487
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500488 // These are defined in interface.js
489 SkVector: {
490 add: function() {},
491 sub: function() {},
492 dot: function() {},
493 cross: function() {},
494 normalize: function() {},
495 mulScalar: function() {},
496 length: function() {},
497 lengthSquared: function() {},
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500498 dist: function() {},
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500499 },
500
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400501 SkVertices: {
502 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500503 bounds: function() {},
504 mode: function() {},
505 uniqueID: function() {},
506 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400507
508 // private API
509 /** @return {CanvasKit.SkVertices} */
510 _applyBones: function() {},
511 },
512
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400513 _SkVerticesBuilder: {
514 // public API (from C++ bindings)
515 boneIndices: function() {},
516 boneWeights: function() {},
517 colors: function() {},
518 detach: function() {},
519 indices: function() {},
520 positions: function() {},
521 texCoords: function() {},
522 },
523
Kevin Lubick369f6a52019-10-03 11:22:08 -0400524 TextStyle: function() {},
525
Kevin Lubick006a6f32018-10-19 14:34:34 -0400526 // Constants and Enums
527 gpu: {},
528 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400529
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500530 TRANSPARENT: {},
531 RED: {},
532 BLUE: {},
533 YELLOW: {},
534 CYAN: {},
535 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500536 WHITE: {},
537
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500538 MOVE_VERB: {},
539 LINE_VERB: {},
540 QUAD_VERB: {},
541 CONIC_VERB: {},
542 CUBIC_VERB: {},
543 CLOSE_VERB: {},
544
Kevin Lubick369f6a52019-10-03 11:22:08 -0400545 NoDecoration: {},
546 UnderlineDecoration: {},
547 OverlineDecoration: {},
548 LineThroughDecoration: {},
549
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400550 SaveLayerInitWithPrevious: {},
551 SaveLayerF16ColorType: {},
552
Kevin Lubick369f6a52019-10-03 11:22:08 -0400553 Affinity: {
554 Upstream: {},
555 Downstream: {},
556 },
557
Kevin Lubickea905ec2018-11-30 14:05:58 -0500558 AlphaType: {
559 Opaque: {},
560 Premul: {},
561 Unpremul: {},
562 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500563
564 BlendMode: {
565 Clear: {},
566 Src: {},
567 Dst: {},
568 SrcOver: {},
569 DstOver: {},
570 SrcIn: {},
571 DstIn: {},
572 SrcOut: {},
573 DstOut: {},
574 SrcATop: {},
575 DstATop: {},
576 Xor: {},
577 Plus: {},
578 Modulate: {},
579 Screen: {},
580 Overlay: {},
581 Darken: {},
582 Lighten: {},
583 ColorDodge: {},
584 ColorBurn: {},
585 HardLight: {},
586 SoftLight: {},
587 Difference: {},
588 Exclusion: {},
589 Multiply: {},
590 Hue: {},
591 Saturation: {},
592 Color: {},
593 Luminosity: {},
594 },
595
596 BlurStyle: {
597 Normal: {},
598 Solid: {},
599 Outer: {},
600 Inner: {},
601 },
602
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500603 ClipOp: {
604 Difference: {},
605 Intersect: {},
606 },
607
Kevin Lubickea905ec2018-11-30 14:05:58 -0500608 ColorType: {
609 Alpha_8: {},
610 RGB_565: {},
611 ARGB_4444: {},
612 RGBA_8888: {},
613 RGB_888x: {},
614 BGRA_8888: {},
615 RGBA_1010102: {},
616 RGB_101010x: {},
617 Gray_8: {},
618 RGBA_F16: {},
619 RGBA_F32: {},
620 },
621
Kevin Lubick006a6f32018-10-19 14:34:34 -0400622 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500623 Winding: {},
624 EvenOdd: {},
625 InverseWinding: {},
626 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400627 },
628
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500629 FilterQuality: {
630 None: {},
631 Low: {},
632 Medium: {},
633 High: {},
634 },
635
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400636 FontSlant: {
637 Upright: {},
638 Italic: {},
639 Oblique: {},
640 },
641
642 FontWeight: {
643 Invisible: {},
644 Thin: {},
645 ExtraLight: {},
646 Light: {},
647 Normal: {},
648 Medium: {},
649 SemiBold: {},
650 Bold: {},
651 ExtraBold: {},
652 Black: {},
653 ExtraBlack: {},
654 },
655
656 FontWidth: {
657 UltraCondensed: {},
658 ExtraCondensed: {},
659 Condensed: {},
660 SemiCondensed: {},
661 Normal: {},
662 SemiExpanded: {},
663 Expanded: {},
664 ExtraExpanded: {},
665 UltraExpanded: {},
666 },
667
Alexander Khovansky3e119332018-11-15 02:01:19 +0300668 ImageFormat: {
669 PNG: {},
670 JPEG: {},
671 },
672
Kevin Lubickb9db3902018-11-26 11:47:54 -0500673 PaintStyle: {
674 Fill: {},
675 Stroke: {},
676 StrokeAndFill: {},
677 },
678
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500679 PathOp: {
680 Difference: {},
681 Intersect: {},
682 Union: {},
683 XOR: {},
684 ReverseDifference: {},
685 },
686
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500687 PointMode: {
688 Points: {},
689 Lines: {},
690 Polygon: {},
691 },
692
Kevin Lubick369f6a52019-10-03 11:22:08 -0400693 RectHeightStyle: {
694 Tight: {},
695 Max: {},
Kevin Lubick4a5f4f22019-11-20 08:27:10 -0500696 IncludeLineSpacingMiddle: {},
697 IncludeLineSpacingTop: {},
698 IncludeLineSpacingBottom: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400699 },
700
701 RectWidthStyle: {
702 Tight: {},
703 Max: {},
704 },
705
Kevin Lubickb9db3902018-11-26 11:47:54 -0500706 StrokeCap: {
707 Butt: {},
708 Round: {},
709 Square: {},
710 },
711
712 StrokeJoin: {
713 Miter: {},
714 Round: {},
715 Bevel: {},
716 },
717
Kevin Lubick369f6a52019-10-03 11:22:08 -0400718 TextAlign: {
719 Left: {},
720 Right: {},
721 Center: {},
722 Justify: {},
723 Start: {},
724 End: {},
725 },
726
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400727 TextDirection: {
728 LTR: {},
729 RTL: {},
730 },
731
Kevin Lubickec4903d2019-01-14 08:36:08 -0500732 TextEncoding: {
733 UTF8: {},
734 UTF16: {},
735 UTF32: {},
736 GlyphID: {},
737 },
738
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500739 TileMode: {
740 Clamp: {},
741 Repeat: {},
742 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500743 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500744 },
745
746 VertexMode: {
747 Triangles: {},
748 TrianglesStrip: {},
749 TriangleFan: {},
750 },
751
Kevin Lubick006a6f32018-10-19 14:34:34 -0400752 // Things Enscriptem adds for us
753
Kevin Lubick53965c92018-10-11 08:51:55 -0400754 /**
755 * @type {Float32Array}
756 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400757 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400758 /**
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400759 * @type {Float64Array}
760 */
761 HEAPF64: {},
762 /**
Kevin Lubick53965c92018-10-11 08:51:55 -0400763 * @type {Uint8Array}
764 */
765 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400766 /**
767 * @type {Uint16Array}
768 */
769 HEAPU16: {},
770 /**
Kevin Lubickf5ea37f2019-02-28 10:06:18 -0500771 * @type {Uint32Array}
772 */
773 HEAPU32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400774 /**
775 * @type {Int8Array}
776 */
777 HEAP8: {},
778 /**
779 * @type {Int16Array}
780 */
781 HEAP16: {},
782 /**
783 * @type {Int32Array}
784 */
785 HEAP32: {},
786
Kevin Lubick006a6f32018-10-19 14:34:34 -0400787 _malloc: function() {},
788 _free: function() {},
789 onRuntimeInitialized: function() {},
790};
Kevin Lubick217056c2018-09-20 17:39:31 -0400791
Kevin Lubick006a6f32018-10-19 14:34:34 -0400792// Public API things that are newly declared in the JS should go here.
793// It's not enough to declare them above, because closure can still erase them
794// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400795CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
796
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500797CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400798CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400799CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500800CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500801CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500802CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300803CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400804CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400805CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400806CanvasKit.SkPath.prototype.conicTo = function() {};
807CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400808CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400809CanvasKit.SkPath.prototype.lineTo = function() {};
810CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400811CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400812CanvasKit.SkPath.prototype.op = function() {};
813CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400814CanvasKit.SkPath.prototype.rArcTo = function() {};
815CanvasKit.SkPath.prototype.rConicTo = function() {};
816CanvasKit.SkPath.prototype.rCubicTo = function() {};
817CanvasKit.SkPath.prototype.rLineTo = function() {};
818CanvasKit.SkPath.prototype.rMoveTo = function() {};
819CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400820CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400821CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400822CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400823CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400824CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400825
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500826CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400827
Kevin Lubick5b90b842018-10-17 07:57:18 -0400828CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400829CanvasKit.SkSurface.prototype.flush = function() {};
830CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800831CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400832CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400833
Kevin Lubick12c0e502018-11-28 12:51:56 -0500834/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400835CanvasKit.SkVertices.prototype.applyBones = function() {};
836
Alexander Khovansky3e119332018-11-15 02:01:19 +0300837CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400838CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300839
Kevin Lubickee91c072019-03-29 10:39:52 -0400840CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500841CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500842CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500843/** @return {Uint8Array} */
844CanvasKit.SkCanvas.prototype.readPixels = function() {};
845CanvasKit.SkCanvas.prototype.writePixels = function() {};
846
Kevin Lubickddd0a332018-12-12 10:35:13 -0500847CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
848
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400849CanvasKit.SkFont.prototype.getWidths = function() {};
850
851CanvasKit.RSXFormBuilder.prototype.build = function() {};
852CanvasKit.RSXFormBuilder.prototype.delete = function() {};
853CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400854CanvasKit.RSXFormBuilder.prototype.set = function() {};
855
856CanvasKit.SkColorBuilder.prototype.build = function() {};
857CanvasKit.SkColorBuilder.prototype.delete = function() {};
858CanvasKit.SkColorBuilder.prototype.push = function() {};
859CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400860
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500861CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500862CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500863
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500864CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
865CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
866
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400867// Define StrokeOpts object
868var StrokeOpts = {};
869StrokeOpts.prototype.width;
870StrokeOpts.prototype.miter_limit;
871StrokeOpts.prototype.cap;
872StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500873StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400874
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500875// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500876var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500877HTMLCanvas.prototype.decodeImage = function() {};
878HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500879HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500880HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500881HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500882HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500883
884var CanvasRenderingContext2D = {};
885CanvasRenderingContext2D.prototype.addHitRegion = function() {};
886CanvasRenderingContext2D.prototype.arc = function() {};
887CanvasRenderingContext2D.prototype.arcTo = function() {};
888CanvasRenderingContext2D.prototype.beginPath = function() {};
889CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
890CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500891CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500892CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500893CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500894CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500895CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500896CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500897CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500898CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500899CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500900CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500901CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500902CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500903CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500904CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500905CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500906CanvasRenderingContext2D.prototype.isPointInPath = function() {};
907CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500908CanvasRenderingContext2D.prototype.lineTo = function() {};
909CanvasRenderingContext2D.prototype.measureText = function() {};
910CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500911CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500912CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
913CanvasRenderingContext2D.prototype.rect = function() {};
914CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
915CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500916CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500917CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500918CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500919CanvasRenderingContext2D.prototype.scale = function() {};
920CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500921CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500922CanvasRenderingContext2D.prototype.setTransform = function() {};
923CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500924CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500925CanvasRenderingContext2D.prototype.strokeText = function() {};
926CanvasRenderingContext2D.prototype.transform = function() {};
927CanvasRenderingContext2D.prototype.translate = function() {};
928
Kevin Lubicka40f8322018-12-17 16:01:36 -0500929var Path2D = {};
930Path2D.prototype.addPath = function() {};
931Path2D.prototype.arc = function() {};
932Path2D.prototype.arcTo = function() {};
933Path2D.prototype.bezierCurveTo = function() {};
934Path2D.prototype.closePath = function() {};
935Path2D.prototype.ellipse = function() {};
936Path2D.prototype.lineTo = function() {};
937Path2D.prototype.moveTo = function() {};
938Path2D.prototype.quadraticCurveTo = function() {};
939Path2D.prototype.rect = function() {};
940
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500941var LinearCanvasGradient = {};
942LinearCanvasGradient.prototype.addColorStop = function() {};
943var RadialCanvasGradient = {};
944RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500945var CanvasPattern = {};
946CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500947
Kevin Lubick52b9f372018-12-04 13:57:36 -0500948var ImageData = {
949 /**
950 * @type {Uint8ClampedArray}
951 */
952 data: {},
953 height: {},
954 width: {},
955};
956
Kevin Lubickd29edd72018-12-07 08:29:52 -0500957var DOMMatrix = {
958 a: {},
959 b: {},
960 c: {},
961 d: {},
962 e: {},
963 f: {},
964};
965
Kevin Lubick217056c2018-09-20 17:39:31 -0400966// 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 -0500967function loadWebAssemblyModule() {};