blob: 1d2422dbb42ebe7865cedeb0b358ead9531ca8b8 [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 = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050026 // public API (i.e. things we declare in the pre-js file or in the cpp bindings)
27 Color: function() {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -040028 Color4f: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -040029 ColorAsInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050030 LTRBRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050031 XYWHRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -040032 LTRBiRect: function() {},
33 XYWHiRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050034 RRectXY: function() {},
35 /** @return {ImageData} */
36 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050037
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050038 GetWebGLContext: function() {},
39 MakeBlurMaskFilter: function() {},
40 MakeCanvas: function() {},
41 MakeCanvasSurface: function() {},
42 MakeGrContext: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040043 /** @return {CanvasKit.AnimatedImage} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050044 MakeAnimatedImageFromEncoded: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040045 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050046 MakeImage: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040047 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050048 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060049 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050050 MakeOnScreenGLSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050051 MakeRenderTarget: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040052 MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050053 MakeSWCanvasSurface: function() {},
54 MakeManagedAnimation: function() {},
55 MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040056 MakeVertices: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050057 MakeSurface: function() {},
Kevin Lubicka8f4c912020-11-04 07:23:37 -050058 MakeRasterDirectSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050059 MakeWebGLCanvasSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 Malloc: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -040061 MallocGlyphIDs: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040062 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050063 computeTonalColors: function() {},
64 currentContext: function() {},
65 getColorComponents: function() {},
66 getDecodeCacheLimitBytes: function() {},
67 getDecodeCacheUsageBytes: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040068 getDataBytes: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050069 multiplyByAlpha: function() {},
70 parseColorString: function() {},
71 setCurrentContext: function() {},
72 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040073
Kevin Lubicke70af512020-05-14 14:50:54 -040074 // Defined by emscripten.
75 createContext:function() {},
76
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050077 // private API (i.e. things declared in the bindings that we use
78 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040079 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 _MakeImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050081 _MakeManagedAnimation: function() {},
82 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040083 _MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050084 _decodeAnimatedImage: function() {},
85 _decodeImage: function() {},
86 _drawShapedText: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040087
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050088 // The testing object is meant to expose internal functions
89 // for more fine-grained testing, e.g. parseColor
90 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050091
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050092 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -040093
Kevin Lubickf8823b52020-09-03 10:02:10 -040094 Animation: {
95 prototype: {
96 render: function() {},
97 },
98 _render: function() {},
99 },
100
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500101 GrContext: {
102 // public API (from C++ bindings)
103 getResourceCacheLimitBytes: function() {},
104 getResourceCacheUsageBytes: function() {},
105 releaseResourcesAndAbandonContext: function() {},
106 setResourceCacheLimitBytes: function() {},
107 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400108
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400109 ManagedAnimation: {
110 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400111 render: function() {},
112 seek: function() {},
113 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400114 setColor: function() {},
115 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400116 _render: function() {},
117 _seek: function() {},
118 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400119 },
120
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500121 Paragraph: {
122 // public API (from C++ bindings)
123 didExceedMaxLines: function() {},
124 getAlphabeticBaseline: function() {},
125 getGlyphPositionAtCoordinate: function() {},
126 getHeight: function() {},
127 getIdeographicBaseline: function() {},
Kevin Lubicke677f4a2020-11-04 09:46:22 -0500128 getLineMetrics: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500129 getLongestLine: function() {},
130 getMaxIntrinsicWidth: function() {},
131 getMaxWidth: function() {},
132 getMinIntrinsicWidth: function() {},
133 getWordBoundary: function() {},
134 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400135
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500136 // private API
137 /** @return {Float32Array} */
138 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700139 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500140 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400141
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400142 ParagraphBuilder: {
143 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700144 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400145 addText: function() {},
146 build: function() {},
147 pop: function() {},
148
149 prototype: {
150 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400151 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700152 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400153 },
154
155 // private API
156 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700157 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400158 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400159 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700160 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400161 },
162
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400163 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500164 // public API (from C++ bindings)
165 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500166
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500167 // private API
168 _makeShader: function() {},
169 _makeShaderWithChildren: function() {},
170 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500171
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500172 ParagraphStyle: function() {},
173 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400174 ColorBuilder: function() {},
175 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400176
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500177 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400178 prototype: {
179 getBounds: function() {},
180 },
181 // private API (from C++ bindings)
182 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500183 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500184
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400185 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500186 // public API (from C++ bindings)
187 decodeNextFrame: function() {},
188 getFrameCount: function() {},
189 getRepetitionCount: function() {},
190 height: function() {},
191 reset: function() {},
192 width: function() {},
193 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400194
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400195 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500196 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500197 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500198 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400199 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500200 drawImage: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400201 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500202 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 drawPaint: function() {},
204 drawParagraph: function() {},
205 drawPath: function() {},
206 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400207 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 drawText: function() {},
209 drawTextBlob: function() {},
210 drawVertices: function() {},
211 flush: function() {},
212 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500213 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400214 markCTM: function() {},
215 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500216 restore: function() {},
217 restoreToCount: function() {},
218 rotate: function() {},
219 save: function() {},
Kevin Lubick9fe83912020-11-03 17:08:34 -0500220 saveLayerPaint: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500221 scale: function() {},
222 skew: function() {},
223 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400224
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400225 prototype: {
226 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000227 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400228 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000229 concat44: function() {}, // deprecated
230 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400231 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000232 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400233 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400234 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000235 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400236 drawImageNine: function() {},
237 drawImageRect: function() {},
238 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000239 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400240 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000241 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400242 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000243 drawText: function() {},
244 findMarkedCTM: function() {},
245 getLocalToDevice: function() {},
246 getTotalMatrix: function() {},
247 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400248 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000249 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400250 },
251
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500252 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400253 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000254 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400255 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400256 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400257 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500258 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400259 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000260 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400261 _drawImageNine: function() {},
262 _drawImageRect: function() {},
263 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500264 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400265 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000266 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400267 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500268 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000269 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000270 _getLocalToDevice: function() {},
271 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500272 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400273 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500274 _writePixels: function() {},
275 delete: function() {},
276 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400277
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400278 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500279 // public API (from C++ bindings and JS interface)
280 MakeBlend: function() {},
281 MakeCompose: function() {},
282 MakeLerp: function() {},
283 MakeLinearToSRGBGamma: function() {},
284 MakeMatrix: function() {},
285 MakeSRGBToLinearGamma: function() {},
286 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400287 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500288 _makeMatrix: function() {},
289 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400290
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400291 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500292 concat: function() {},
293 identity: function() {},
294 postTranslate: function() {},
295 rotated: function() {},
296 scaled: function() {},
297 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400298
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400299 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400300 Equals: function() {},
301 SRGB: {},
302 DISPLAY_P3: {},
303 ADOBE_RGB: {},
304 // private API (from C++ bindings)
305 _MakeSRGB: function() {},
306 _MakeDisplayP3: function() {},
307 _MakeAdobeRGB: function() {},
308 },
309
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400310 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500311 next: function() {},
312 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500313
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400314 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500315 getPosTan: function() {},
316 getSegment: function() {},
317 isClosed: function() {},
318 length: function() {},
319 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500320
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400321 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500322 // public API (from C++ bindings)
323 getScaleX: function() {},
324 getSize: function() {},
325 getSkewX: function() {},
326 getTypeface: function() {},
327 measureText: function() {},
328 setHinting: function() {},
329 setLinearMetrics: function() {},
330 setScaleX: function() {},
331 setSize: function() {},
332 setSkewX: function() {},
333 setSubpixel: function() {},
334 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400335
336 prototype: {
337 getGlyphBounds: function() {},
338 getGlyphIDs: function() {},
339 getGlyphWidths: function() {},
340 getWidths: function() {},
341 },
342
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500343 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400344 _getGlyphIDs: function() {},
345 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500346 _getWidths: function() {},
347 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500348
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400349 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500350 // public API (from C++ and JS bindings)
351 FromData: function() {},
352 RefDefault: function() {},
353 countFamilies: function() {},
354 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500355
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500356 // private API
357 _makeTypefaceFromData: function() {},
358 _fromData: function() {},
359 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500360
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700361 TypefaceFontProvider: {
362 // public API (from C++ and JS bindings)
363 Make: function() {},
364 registerFont: function() {},
365
366 // private API
367 _registerFont: function() {},
368 },
369
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400370 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500371 // public API (from C++ bindings)
372 height: function() {},
373 width: function() {},
374 // private API
375 _encodeToData: function() {},
376 _encodeToDataWithFormat: function() {},
377 _makeShader: function() {},
378 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400379
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400380 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500381 MakeBlur: function() {},
382 MakeColorFilter: function() {},
383 MakeCompose: function() {},
384 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400385
386 // private API
387 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500388 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400389
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500390 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400391 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500392 identity: function() {},
393 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400394 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500395 multiply: function() {},
396 rotatedUnitSinCos: function() {},
397 rotated: function() {},
398 scaled: function() {},
399 translated: function() {},
400 lookat: function() {},
401 perspective: function() {},
402 rc: function() {},
403 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400404 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500405 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500406
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400407 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500408 identity: function() {},
409 invert: function() {},
410 mapPoints: function() {},
411 multiply: function() {},
412 rotated: function() {},
413 scaled: function() {},
414 skewed: function() {},
415 translated: function() {},
416 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500417
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400418 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500419 MakeBlur: function() {},
420 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400421
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400422 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500423 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400424 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500425 copy: function() {},
426 getBlendMode: function() {},
427 getColor: function() {},
428 getFilterQuality: function() {},
429 getStrokeCap: function() {},
430 getStrokeJoin: function() {},
431 getStrokeMiter: function() {},
432 getStrokeWidth: function() {},
433 setAntiAlias: function() {},
434 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400435 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500436 setFilterQuality: function() {},
437 setImageFilter: function() {},
438 setMaskFilter: function() {},
439 setPathEffect: function() {},
440 setShader: function() {},
441 setStrokeCap: function() {},
442 setStrokeJoin: function() {},
443 setStrokeMiter: function() {},
444 setStrokeWidth: function() {},
445 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500446
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400447 prototype: {
448 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400449 setColorComponents: function() {},
450 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400451 },
452
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500453 // Private API
454 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400455 _getColor: function() {},
456 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500457 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500458
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400459 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400460 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500461 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400462 MakeDiscrete: function() {},
463
464 // Private C++ API
465 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500466 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500467
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400468 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500469 // public API (from C++ bindings)
470 draw: function() {},
471 getEffectUniform: function() {},
472 getEffectUniformCount: function() {},
473 getEffectUniformFloatCount: function() {},
474 getEffectUniformName: function() {},
475 getParticleUniformCount: function() {},
476 getParticleUniformFloatCount: function() {},
477 getParticleUniformName: function() {},
478 getParticleUniform: function() {},
479 setPosition: function() {},
480 setRate: function() {},
481 start: function() {},
482 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500483
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500484 // private API (from C++ bindings)
485 _effectUniformPtr: function() {},
486 _particleUniformPtr: function() {},
487 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500488
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400489 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400490 // public API (from C++ and JS bindings)
491 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400492 MakeFromSVGString: function() {},
493 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400494 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500495 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400496 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500497 copy: function() {},
498 countPoints: function() {},
499 equals: function() {},
500 getBounds: function() {},
501 getFillType: function() {},
502 getPoint: function() {},
503 isEmpty: function() {},
504 isVolatile: function() {},
505 reset: function() {},
506 rewind: function() {},
507 setFillType: function() {},
508 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400509 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500510 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400511
Kevin Lubickf8823b52020-09-03 10:02:10 -0400512 prototype: {
513 addArc: function() {},
514 addOval: function() {},
515 addPath: function() {},
516 addPoly: function() {},
517 addRect: function() {},
518 addRRect: function() {},
519 addVerbsPointsWeights: function() {},
520 arc: function() {},
521 arcToOval: function() {},
522 arcToRotated: function() {},
523 arcToTangent: function() {},
524 close: function() {},
525 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400526 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400527 cubicTo: function() {},
528 dash: function() {},
529 lineTo: function() {},
530 moveTo: function() {},
531 offset: function() {},
532 op: function() {},
533 quadTo: function() {},
534 rArcTo: function() {},
535 rConicTo: function() {},
536 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400537 rLineTo: function() {},
538 rMoveTo: function() {},
539 rQuadTo: function() {},
540 simplify: function() {},
541 stroke: function() {},
542 transform: function() {},
543 trim: function() {},
544 },
545
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500546 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400547 _MakeFromCmds: function() {},
548 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500549 _addArc: function() {},
550 _addOval: function() {},
551 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000552 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400553 _addRect: function() {},
554 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400555 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400556 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000557 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400558 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500559 _close: function() {},
560 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400561 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500562 _cubicTo: function() {},
563 _dash: function() {},
564 _lineTo: function() {},
565 _moveTo: function() {},
566 _op: function() {},
567 _quadTo: function() {},
568 _rArcTo: function() {},
569 _rConicTo: function() {},
570 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400571 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500572 _rLineTo: function() {},
573 _rMoveTo: function() {},
574 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500575 _simplify: function() {},
576 _stroke: function() {},
577 _transform: function() {},
578 _trim: function() {},
579 delete: function() {},
580 dump: function() {},
581 dumpHex: function() {},
582 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400583
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400584 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500585 getLength: function() {},
586 getSegment: function() {},
587 getPosTan: function() {},
588 isClosed: function() {},
589 nextContour: function() {},
590 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400591
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400592 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500593 serialize: function() {},
594 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400595
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400596 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500597 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400598 prototype: {
599 beginRecording: function() {},
600 },
601 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500602 },
Kevin Lubick62836902019-12-09 09:04:26 -0500603
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400604 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400605 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500606 Blend: function() {},
607 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500608 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400609 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400610 MakeBlend: function() {},
611 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400612 MakeFractalNoise: function() {},
613 MakeImprovedNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400614 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400615 MakeLinearGradient: function() {},
616 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700617 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400618 MakeTurbulence: function() {},
619 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400620
621 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400622 _MakeColor: function() {},
623 _MakeLinearGradient: function() {},
624 _MakeRadialGradient: function() {},
625 _MakeSweepGradient: function() {},
626 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500627 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400628
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400629 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400631 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500632 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400633 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400634
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500635 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600636 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400637 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500638 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400639 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400640
Kevin Lubickf8823b52020-09-03 10:02:10 -0400641 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400642 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400643 makeImageSnapshot: function() {},
644 },
645
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500646 // private API
647 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400648 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500649 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500650 delete: function() {},
651 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500652
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400653 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500654 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400655 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500656 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400657 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500658 MakeFromText: function() {},
659 MakeOnPath: function() {},
660 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400661 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500662 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400663 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500664 _MakeFromText: function() {},
665 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500666
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500667 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400668 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500669 add: function() {},
670 sub: function() {},
671 dot: function() {},
672 cross: function() {},
673 normalize: function() {},
674 mulScalar: function() {},
675 length: function() {},
676 lengthSquared: function() {},
677 dist: function() {},
678 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400679
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400680 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500681 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500682 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400683
684 prototype: {
685 bounds: function() {},
686 },
687 // private API (from C++ bindings)
688
689 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500690 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400691
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400692 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500693 colors: function() {},
694 detach: function() {},
695 indices: function() {},
696 positions: function() {},
697 texCoords: function() {},
698 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400699
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400701
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500702 // Constants and Enums
703 gpu: {},
704 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400705
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500706 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400707 BLACK: {},
708 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500709 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400710 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 BLUE: {},
712 YELLOW: {},
713 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400714 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500715
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500716 MOVE_VERB: {},
717 LINE_VERB: {},
718 QUAD_VERB: {},
719 CONIC_VERB: {},
720 CUBIC_VERB: {},
721 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500722
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500723 NoDecoration: {},
724 UnderlineDecoration: {},
725 OverlineDecoration: {},
726 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400727
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500728 SaveLayerInitWithPrevious: {},
729 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400730
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500731 Affinity: {
732 Upstream: {},
733 Downstream: {},
734 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400735
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500736 AlphaType: {
737 Opaque: {},
738 Premul: {},
739 Unpremul: {},
740 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500741
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500742 BlendMode: {
743 Clear: {},
744 Src: {},
745 Dst: {},
746 SrcOver: {},
747 DstOver: {},
748 SrcIn: {},
749 DstIn: {},
750 SrcOut: {},
751 DstOut: {},
752 SrcATop: {},
753 DstATop: {},
754 Xor: {},
755 Plus: {},
756 Modulate: {},
757 Screen: {},
758 Overlay: {},
759 Darken: {},
760 Lighten: {},
761 ColorDodge: {},
762 ColorBurn: {},
763 HardLight: {},
764 SoftLight: {},
765 Difference: {},
766 Exclusion: {},
767 Multiply: {},
768 Hue: {},
769 Saturation: {},
770 Color: {},
771 Luminosity: {},
772 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500773
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500774 BlurStyle: {
775 Normal: {},
776 Solid: {},
777 Outer: {},
778 Inner: {},
779 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500780
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500781 ClipOp: {
782 Difference: {},
783 Intersect: {},
784 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500785
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500786 ColorType: {
787 Alpha_8: {},
788 RGB_565: {},
789 ARGB_4444: {},
790 RGBA_8888: {},
791 RGB_888x: {},
792 BGRA_8888: {},
793 RGBA_1010102: {},
794 RGB_101010x: {},
795 Gray_8: {},
796 RGBA_F16: {},
797 RGBA_F32: {},
798 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500799
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500800 FillType: {
801 Winding: {},
802 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500803 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400804
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500805 FilterQuality: {
806 None: {},
807 Low: {},
808 Medium: {},
809 High: {},
810 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500811
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500812 FontSlant: {
813 Upright: {},
814 Italic: {},
815 Oblique: {},
816 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400817
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500818 FontHinting: {
819 None: {},
820 Slight: {},
821 Normal: {},
822 Full: {},
823 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500824
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500825 FontWeight: {
826 Invisible: {},
827 Thin: {},
828 ExtraLight: {},
829 Light: {},
830 Normal: {},
831 Medium: {},
832 SemiBold: {},
833 Bold: {},
834 ExtraBold: {},
835 Black: {},
836 ExtraBlack: {},
837 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400838
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500839 FontWidth: {
840 UltraCondensed: {},
841 ExtraCondensed: {},
842 Condensed: {},
843 SemiCondensed: {},
844 Normal: {},
845 SemiExpanded: {},
846 Expanded: {},
847 ExtraExpanded: {},
848 UltraExpanded: {},
849 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400850
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500851 ImageFormat: {
852 PNG: {},
853 JPEG: {},
854 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300855
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500856 PaintStyle: {
857 Fill: {},
858 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500859 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500860
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500861 PathOp: {
862 Difference: {},
863 Intersect: {},
864 Union: {},
865 XOR: {},
866 ReverseDifference: {},
867 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500868
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500869 PointMode: {
870 Points: {},
871 Lines: {},
872 Polygon: {},
873 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500874
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500875 RectHeightStyle: {
876 Tight: {},
877 Max: {},
878 IncludeLineSpacingMiddle: {},
879 IncludeLineSpacingTop: {},
880 IncludeLineSpacingBottom: {},
881 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400882
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500883 RectWidthStyle: {
884 Tight: {},
885 Max: {},
886 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400887
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500888 StrokeCap: {
889 Butt: {},
890 Round: {},
891 Square: {},
892 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500893
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500894 StrokeJoin: {
895 Miter: {},
896 Round: {},
897 Bevel: {},
898 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500899
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500900 TextAlign: {
901 Left: {},
902 Right: {},
903 Center: {},
904 Justify: {},
905 Start: {},
906 End: {},
907 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400908
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500909 TextDirection: {
910 LTR: {},
911 RTL: {},
912 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400913
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700914 DecorationStyle: {
915 Solid: {},
916 Double: {},
917 Dotted: {},
918 Dashed: {},
919 Wavy: {},
920 },
921
922 PlaceholderAlignment: {
923 Baseline: {},
924 AboveBaseline: {},
925 BelowBaseline: {},
926 Top: {},
927 Bottom: {},
928 Middle: {},
929 },
930
931 TextBaseline: {
932 Alphabetic: {},
933 Ideographic: {},
934 },
935
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500936 TileMode: {
937 Clamp: {},
938 Repeat: {},
939 Mirror: {},
940 Decal: {},
941 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500942
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500943 VertexMode: {
944 Triangles: {},
945 TrianglesStrip: {},
946 TriangleFan: {},
947 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500948
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500949 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400950
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500951 /**
952 * @type {Float32Array}
953 */
954 HEAPF32: {},
955 /**
956 * @type {Float64Array}
957 */
958 HEAPF64: {},
959 /**
960 * @type {Uint8Array}
961 */
962 HEAPU8: {},
963 /**
964 * @type {Uint16Array}
965 */
966 HEAPU16: {},
967 /**
968 * @type {Uint32Array}
969 */
970 HEAPU32: {},
971 /**
972 * @type {Int8Array}
973 */
974 HEAP8: {},
975 /**
976 * @type {Int16Array}
977 */
978 HEAP16: {},
979 /**
980 * @type {Int32Array}
981 */
982 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400983
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500984 _malloc: function() {},
985 _free: function() {},
986 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400987};
Kevin Lubick217056c2018-09-20 17:39:31 -0400988
Kevin Lubick006a6f32018-10-19 14:34:34 -0400989// Public API things that are newly declared in the JS should go here.
990// It's not enough to declare them above, because closure can still erase them
991// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400992CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700993CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400994
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400995CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400996
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400997CanvasKit.Surface.prototype.dispose = function() {};
998CanvasKit.Surface.prototype.flush = function() {};
999CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1000CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001001
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001002CanvasKit.Image.prototype.encodeToData = function() {};
1003CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +03001004
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001005CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001006
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001007CanvasKit.RSXFormBuilder.prototype.build = function() {};
1008CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1009CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001010CanvasKit.RSXFormBuilder.prototype.set = function() {};
1011
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001012CanvasKit.ColorBuilder.prototype.build = function() {};
1013CanvasKit.ColorBuilder.prototype.delete = function() {};
1014CanvasKit.ColorBuilder.prototype.push = function() {};
1015CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001016
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001017CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1018CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001019
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001020CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1021CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001022
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001023// Define StrokeOpts object
1024var StrokeOpts = {};
1025StrokeOpts.prototype.width;
1026StrokeOpts.prototype.miter_limit;
1027StrokeOpts.prototype.cap;
1028StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001029StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001030
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001031// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001032var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001033HTMLCanvas.prototype.decodeImage = function() {};
1034HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001035HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001036HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001037HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001038HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001039
Elliot Evans28796192020-06-15 12:53:27 -06001040var ImageBitmapRenderingContext = {};
1041ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1042
Kevin Lubickb9db3902018-11-26 11:47:54 -05001043var CanvasRenderingContext2D = {};
1044CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1045CanvasRenderingContext2D.prototype.arc = function() {};
1046CanvasRenderingContext2D.prototype.arcTo = function() {};
1047CanvasRenderingContext2D.prototype.beginPath = function() {};
1048CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1049CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001050CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001051CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001052CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001053CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001054CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001055CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001056CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001057CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001058CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001059CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001060CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001061CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001062CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001063CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001064CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001065CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1066CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001067CanvasRenderingContext2D.prototype.lineTo = function() {};
1068CanvasRenderingContext2D.prototype.measureText = function() {};
1069CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001070CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001071CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1072CanvasRenderingContext2D.prototype.rect = function() {};
1073CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1074CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001075CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001076CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001077CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001078CanvasRenderingContext2D.prototype.scale = function() {};
1079CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001080CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001081CanvasRenderingContext2D.prototype.setTransform = function() {};
1082CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001083CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001084CanvasRenderingContext2D.prototype.strokeText = function() {};
1085CanvasRenderingContext2D.prototype.transform = function() {};
1086CanvasRenderingContext2D.prototype.translate = function() {};
1087
Kevin Lubicka40f8322018-12-17 16:01:36 -05001088var Path2D = {};
1089Path2D.prototype.addPath = function() {};
1090Path2D.prototype.arc = function() {};
1091Path2D.prototype.arcTo = function() {};
1092Path2D.prototype.bezierCurveTo = function() {};
1093Path2D.prototype.closePath = function() {};
1094Path2D.prototype.ellipse = function() {};
1095Path2D.prototype.lineTo = function() {};
1096Path2D.prototype.moveTo = function() {};
1097Path2D.prototype.quadraticCurveTo = function() {};
1098Path2D.prototype.rect = function() {};
1099
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001100var LinearCanvasGradient = {};
1101LinearCanvasGradient.prototype.addColorStop = function() {};
1102var RadialCanvasGradient = {};
1103RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001104var CanvasPattern = {};
1105CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001106
Kevin Lubick52b9f372018-12-04 13:57:36 -05001107var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001108 /**
1109 * @type {Uint8ClampedArray}
1110 */
1111 data: {},
1112 height: {},
1113 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001114};
1115
Kevin Lubickd29edd72018-12-07 08:29:52 -05001116var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001117 a: {},
1118 b: {},
1119 c: {},
1120 d: {},
1121 e: {},
1122 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001123};
1124
Kevin Lubick217056c2018-09-20 17:39:31 -04001125// 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 -05001126function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001127
1128// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1129// to override it in the puppeteer tests
1130var LibraryEGL = {
1131 contextAttributes: {
1132 majorVersion: {}
1133 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001134}