blob: 10e3e4adb56a47b2220342c5b896ab7bc54b1717 [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 Lubick15d7a382020-11-11 16:48:30 -0500273 _readPixelsForCanvas2D: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400274 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500275 _writePixels: function() {},
276 delete: function() {},
277 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400278
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400279 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500280 // public API (from C++ bindings and JS interface)
281 MakeBlend: function() {},
282 MakeCompose: function() {},
283 MakeLerp: function() {},
284 MakeLinearToSRGBGamma: function() {},
285 MakeMatrix: function() {},
286 MakeSRGBToLinearGamma: function() {},
287 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400288 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500289 _makeMatrix: function() {},
290 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400291
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400292 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500293 concat: function() {},
294 identity: function() {},
295 postTranslate: function() {},
296 rotated: function() {},
297 scaled: function() {},
298 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400299
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400300 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400301 Equals: function() {},
302 SRGB: {},
303 DISPLAY_P3: {},
304 ADOBE_RGB: {},
305 // private API (from C++ bindings)
306 _MakeSRGB: function() {},
307 _MakeDisplayP3: function() {},
308 _MakeAdobeRGB: function() {},
309 },
310
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400311 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500312 next: function() {},
313 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500314
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400315 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500316 getPosTan: function() {},
317 getSegment: function() {},
318 isClosed: function() {},
319 length: function() {},
320 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500321
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400322 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500323 // public API (from C++ bindings)
324 getScaleX: function() {},
325 getSize: function() {},
326 getSkewX: function() {},
327 getTypeface: function() {},
328 measureText: function() {},
329 setHinting: function() {},
330 setLinearMetrics: function() {},
331 setScaleX: function() {},
332 setSize: function() {},
333 setSkewX: function() {},
334 setSubpixel: function() {},
335 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400336
337 prototype: {
338 getGlyphBounds: function() {},
339 getGlyphIDs: function() {},
340 getGlyphWidths: function() {},
341 getWidths: function() {},
342 },
343
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500344 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400345 _getGlyphIDs: function() {},
346 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500347 _getWidths: function() {},
348 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500349
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400350 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500351 // public API (from C++ and JS bindings)
352 FromData: function() {},
353 RefDefault: function() {},
354 countFamilies: function() {},
355 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500356
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500357 // private API
358 _makeTypefaceFromData: function() {},
359 _fromData: function() {},
360 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500361
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700362 TypefaceFontProvider: {
363 // public API (from C++ and JS bindings)
364 Make: function() {},
365 registerFont: function() {},
366
367 // private API
368 _registerFont: function() {},
369 },
370
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400371 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500372 // public API (from C++ bindings)
373 height: function() {},
374 width: function() {},
375 // private API
376 _encodeToData: function() {},
377 _encodeToDataWithFormat: function() {},
378 _makeShader: function() {},
379 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400380
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400381 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500382 MakeBlur: function() {},
383 MakeColorFilter: function() {},
384 MakeCompose: function() {},
385 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400386
387 // private API
388 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500389 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400390
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500391 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400392 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500393 identity: function() {},
394 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400395 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500396 multiply: function() {},
397 rotatedUnitSinCos: function() {},
398 rotated: function() {},
399 scaled: function() {},
400 translated: function() {},
401 lookat: function() {},
402 perspective: function() {},
403 rc: function() {},
404 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400405 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500406 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500407
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400408 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500409 identity: function() {},
410 invert: function() {},
411 mapPoints: function() {},
412 multiply: function() {},
413 rotated: function() {},
414 scaled: function() {},
415 skewed: function() {},
416 translated: function() {},
417 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500418
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400419 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500420 MakeBlur: function() {},
421 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400422
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400423 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500424 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400425 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500426 copy: function() {},
427 getBlendMode: function() {},
428 getColor: function() {},
429 getFilterQuality: function() {},
430 getStrokeCap: function() {},
431 getStrokeJoin: function() {},
432 getStrokeMiter: function() {},
433 getStrokeWidth: function() {},
434 setAntiAlias: function() {},
435 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400436 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500437 setFilterQuality: function() {},
438 setImageFilter: function() {},
439 setMaskFilter: function() {},
440 setPathEffect: function() {},
441 setShader: function() {},
442 setStrokeCap: function() {},
443 setStrokeJoin: function() {},
444 setStrokeMiter: function() {},
445 setStrokeWidth: function() {},
446 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500447
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400448 prototype: {
449 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400450 setColorComponents: function() {},
451 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400452 },
453
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500454 // Private API
455 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400456 _getColor: function() {},
457 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500458 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500459
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400460 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400461 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500462 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400463 MakeDiscrete: function() {},
464
465 // Private C++ API
466 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500467 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500468
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400469 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500470 // public API (from C++ bindings)
471 draw: function() {},
472 getEffectUniform: function() {},
473 getEffectUniformCount: function() {},
474 getEffectUniformFloatCount: function() {},
475 getEffectUniformName: function() {},
476 getParticleUniformCount: function() {},
477 getParticleUniformFloatCount: function() {},
478 getParticleUniformName: function() {},
479 getParticleUniform: function() {},
480 setPosition: function() {},
481 setRate: function() {},
482 start: function() {},
483 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500484
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500485 // private API (from C++ bindings)
486 _effectUniformPtr: function() {},
487 _particleUniformPtr: function() {},
488 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500489
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400490 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400491 // public API (from C++ and JS bindings)
492 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400493 MakeFromSVGString: function() {},
494 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400495 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500496 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400497 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500498 copy: function() {},
499 countPoints: function() {},
500 equals: function() {},
501 getBounds: function() {},
502 getFillType: function() {},
503 getPoint: function() {},
504 isEmpty: function() {},
505 isVolatile: function() {},
506 reset: function() {},
507 rewind: function() {},
508 setFillType: function() {},
509 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400510 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500511 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400512
Kevin Lubickf8823b52020-09-03 10:02:10 -0400513 prototype: {
514 addArc: function() {},
515 addOval: function() {},
516 addPath: function() {},
517 addPoly: function() {},
518 addRect: function() {},
519 addRRect: function() {},
520 addVerbsPointsWeights: function() {},
521 arc: function() {},
522 arcToOval: function() {},
523 arcToRotated: function() {},
524 arcToTangent: function() {},
525 close: function() {},
526 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400527 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400528 cubicTo: function() {},
529 dash: function() {},
530 lineTo: function() {},
531 moveTo: function() {},
532 offset: function() {},
533 op: function() {},
534 quadTo: function() {},
535 rArcTo: function() {},
536 rConicTo: function() {},
537 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400538 rLineTo: function() {},
539 rMoveTo: function() {},
540 rQuadTo: function() {},
541 simplify: function() {},
542 stroke: function() {},
543 transform: function() {},
544 trim: function() {},
545 },
546
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500547 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400548 _MakeFromCmds: function() {},
549 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500550 _addArc: function() {},
551 _addOval: function() {},
552 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000553 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400554 _addRect: function() {},
555 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400556 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400557 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000558 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400559 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500560 _close: function() {},
561 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400562 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500563 _cubicTo: function() {},
564 _dash: function() {},
565 _lineTo: function() {},
566 _moveTo: function() {},
567 _op: function() {},
568 _quadTo: function() {},
569 _rArcTo: function() {},
570 _rConicTo: function() {},
571 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400572 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500573 _rLineTo: function() {},
574 _rMoveTo: function() {},
575 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500576 _simplify: function() {},
577 _stroke: function() {},
578 _transform: function() {},
579 _trim: function() {},
580 delete: function() {},
581 dump: function() {},
582 dumpHex: function() {},
583 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400584
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400585 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500586 getLength: function() {},
587 getSegment: function() {},
588 getPosTan: function() {},
589 isClosed: function() {},
590 nextContour: function() {},
591 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400592
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400593 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500594 serialize: function() {},
595 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400596
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400597 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500598 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400599 prototype: {
600 beginRecording: function() {},
601 },
602 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500603 },
Kevin Lubick62836902019-12-09 09:04:26 -0500604
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400605 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400606 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500607 Blend: function() {},
608 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500609 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400610 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400611 MakeBlend: function() {},
612 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400613 MakeFractalNoise: function() {},
614 MakeImprovedNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400615 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400616 MakeLinearGradient: function() {},
617 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700618 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400619 MakeTurbulence: function() {},
620 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400621
622 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400623 _MakeColor: function() {},
624 _MakeLinearGradient: function() {},
625 _MakeRadialGradient: function() {},
626 _MakeSweepGradient: function() {},
627 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500628 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400629
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400630 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500631 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400632 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400634 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400635
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500636 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600637 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400638 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500639 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400640 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400641
Kevin Lubickf8823b52020-09-03 10:02:10 -0400642 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400643 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400644 makeImageSnapshot: function() {},
645 },
646
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500647 // private API
648 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400649 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500650 _makeRaster: function() {},
651 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500652 delete: function() {},
653 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500654
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400655 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500656 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400657 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500658 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400659 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500660 MakeFromText: function() {},
661 MakeOnPath: function() {},
662 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400663 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500664 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400665 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500666 _MakeFromText: function() {},
667 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500668
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500669 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400670 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500671 add: function() {},
672 sub: function() {},
673 dot: function() {},
674 cross: function() {},
675 normalize: function() {},
676 mulScalar: function() {},
677 length: function() {},
678 lengthSquared: function() {},
679 dist: function() {},
680 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400681
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400682 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500684 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400685
686 prototype: {
687 bounds: function() {},
688 },
689 // private API (from C++ bindings)
690
691 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400693
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400694 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500695 colors: function() {},
696 detach: function() {},
697 indices: function() {},
698 positions: function() {},
699 texCoords: function() {},
700 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400701
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500702 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400703
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 // Constants and Enums
705 gpu: {},
706 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400707
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500708 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400709 BLACK: {},
710 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400712 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 BLUE: {},
714 YELLOW: {},
715 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400716 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500717
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500718 MOVE_VERB: {},
719 LINE_VERB: {},
720 QUAD_VERB: {},
721 CONIC_VERB: {},
722 CUBIC_VERB: {},
723 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 NoDecoration: {},
726 UnderlineDecoration: {},
727 OverlineDecoration: {},
728 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400729
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 SaveLayerInitWithPrevious: {},
731 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400732
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500733 Affinity: {
734 Upstream: {},
735 Downstream: {},
736 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400737
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500738 AlphaType: {
739 Opaque: {},
740 Premul: {},
741 Unpremul: {},
742 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500743
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500744 BlendMode: {
745 Clear: {},
746 Src: {},
747 Dst: {},
748 SrcOver: {},
749 DstOver: {},
750 SrcIn: {},
751 DstIn: {},
752 SrcOut: {},
753 DstOut: {},
754 SrcATop: {},
755 DstATop: {},
756 Xor: {},
757 Plus: {},
758 Modulate: {},
759 Screen: {},
760 Overlay: {},
761 Darken: {},
762 Lighten: {},
763 ColorDodge: {},
764 ColorBurn: {},
765 HardLight: {},
766 SoftLight: {},
767 Difference: {},
768 Exclusion: {},
769 Multiply: {},
770 Hue: {},
771 Saturation: {},
772 Color: {},
773 Luminosity: {},
774 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500775
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500776 BlurStyle: {
777 Normal: {},
778 Solid: {},
779 Outer: {},
780 Inner: {},
781 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500782
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500783 ClipOp: {
784 Difference: {},
785 Intersect: {},
786 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 ColorType: {
789 Alpha_8: {},
790 RGB_565: {},
791 ARGB_4444: {},
792 RGBA_8888: {},
793 RGB_888x: {},
794 BGRA_8888: {},
795 RGBA_1010102: {},
796 RGB_101010x: {},
797 Gray_8: {},
798 RGBA_F16: {},
799 RGBA_F32: {},
800 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 FillType: {
803 Winding: {},
804 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500805 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400806
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500807 FilterQuality: {
808 None: {},
809 Low: {},
810 Medium: {},
811 High: {},
812 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500813
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500814 FontSlant: {
815 Upright: {},
816 Italic: {},
817 Oblique: {},
818 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400819
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500820 FontHinting: {
821 None: {},
822 Slight: {},
823 Normal: {},
824 Full: {},
825 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500826
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500827 FontWeight: {
828 Invisible: {},
829 Thin: {},
830 ExtraLight: {},
831 Light: {},
832 Normal: {},
833 Medium: {},
834 SemiBold: {},
835 Bold: {},
836 ExtraBold: {},
837 Black: {},
838 ExtraBlack: {},
839 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400840
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500841 FontWidth: {
842 UltraCondensed: {},
843 ExtraCondensed: {},
844 Condensed: {},
845 SemiCondensed: {},
846 Normal: {},
847 SemiExpanded: {},
848 Expanded: {},
849 ExtraExpanded: {},
850 UltraExpanded: {},
851 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400852
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500853 ImageFormat: {
854 PNG: {},
855 JPEG: {},
856 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300857
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500858 PaintStyle: {
859 Fill: {},
860 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500861 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500862
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500863 PathOp: {
864 Difference: {},
865 Intersect: {},
866 Union: {},
867 XOR: {},
868 ReverseDifference: {},
869 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500870
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500871 PointMode: {
872 Points: {},
873 Lines: {},
874 Polygon: {},
875 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500876
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500877 RectHeightStyle: {
878 Tight: {},
879 Max: {},
880 IncludeLineSpacingMiddle: {},
881 IncludeLineSpacingTop: {},
882 IncludeLineSpacingBottom: {},
883 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400884
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500885 RectWidthStyle: {
886 Tight: {},
887 Max: {},
888 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400889
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500890 StrokeCap: {
891 Butt: {},
892 Round: {},
893 Square: {},
894 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500895
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500896 StrokeJoin: {
897 Miter: {},
898 Round: {},
899 Bevel: {},
900 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500901
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500902 TextAlign: {
903 Left: {},
904 Right: {},
905 Center: {},
906 Justify: {},
907 Start: {},
908 End: {},
909 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400910
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500911 TextDirection: {
912 LTR: {},
913 RTL: {},
914 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400915
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700916 DecorationStyle: {
917 Solid: {},
918 Double: {},
919 Dotted: {},
920 Dashed: {},
921 Wavy: {},
922 },
923
924 PlaceholderAlignment: {
925 Baseline: {},
926 AboveBaseline: {},
927 BelowBaseline: {},
928 Top: {},
929 Bottom: {},
930 Middle: {},
931 },
932
933 TextBaseline: {
934 Alphabetic: {},
935 Ideographic: {},
936 },
937
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500938 TileMode: {
939 Clamp: {},
940 Repeat: {},
941 Mirror: {},
942 Decal: {},
943 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500944
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500945 VertexMode: {
946 Triangles: {},
947 TrianglesStrip: {},
948 TriangleFan: {},
949 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500950
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500951 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400952
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500953 /**
954 * @type {Float32Array}
955 */
956 HEAPF32: {},
957 /**
958 * @type {Float64Array}
959 */
960 HEAPF64: {},
961 /**
962 * @type {Uint8Array}
963 */
964 HEAPU8: {},
965 /**
966 * @type {Uint16Array}
967 */
968 HEAPU16: {},
969 /**
970 * @type {Uint32Array}
971 */
972 HEAPU32: {},
973 /**
974 * @type {Int8Array}
975 */
976 HEAP8: {},
977 /**
978 * @type {Int16Array}
979 */
980 HEAP16: {},
981 /**
982 * @type {Int32Array}
983 */
984 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400985
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500986 _malloc: function() {},
987 _free: function() {},
988 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400989};
Kevin Lubick217056c2018-09-20 17:39:31 -0400990
Kevin Lubick006a6f32018-10-19 14:34:34 -0400991// Public API things that are newly declared in the JS should go here.
992// It's not enough to declare them above, because closure can still erase them
993// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400994CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700995CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400996
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400997CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400998
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400999CanvasKit.Surface.prototype.dispose = function() {};
1000CanvasKit.Surface.prototype.flush = function() {};
1001CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1002CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001003
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001004CanvasKit.Image.prototype.encodeToData = function() {};
1005CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +03001006
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001007CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001008
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001009CanvasKit.RSXFormBuilder.prototype.build = function() {};
1010CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1011CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001012CanvasKit.RSXFormBuilder.prototype.set = function() {};
1013
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001014CanvasKit.ColorBuilder.prototype.build = function() {};
1015CanvasKit.ColorBuilder.prototype.delete = function() {};
1016CanvasKit.ColorBuilder.prototype.push = function() {};
1017CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001018
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001019CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1020CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001021
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001022CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1023CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001024
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001025// Define StrokeOpts object
1026var StrokeOpts = {};
1027StrokeOpts.prototype.width;
1028StrokeOpts.prototype.miter_limit;
1029StrokeOpts.prototype.cap;
1030StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001031StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001032
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001033// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001034var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001035HTMLCanvas.prototype.decodeImage = function() {};
1036HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001037HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001038HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001039HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001040HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001041
Elliot Evans28796192020-06-15 12:53:27 -06001042var ImageBitmapRenderingContext = {};
1043ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1044
Kevin Lubickb9db3902018-11-26 11:47:54 -05001045var CanvasRenderingContext2D = {};
1046CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1047CanvasRenderingContext2D.prototype.arc = function() {};
1048CanvasRenderingContext2D.prototype.arcTo = function() {};
1049CanvasRenderingContext2D.prototype.beginPath = function() {};
1050CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1051CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001052CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001053CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001054CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001055CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001056CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001057CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001058CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001059CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001060CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001061CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001062CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001063CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001064CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001065CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001066CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001067CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1068CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001069CanvasRenderingContext2D.prototype.lineTo = function() {};
1070CanvasRenderingContext2D.prototype.measureText = function() {};
1071CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001072CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001073CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1074CanvasRenderingContext2D.prototype.rect = function() {};
1075CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1076CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001077CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001078CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001079CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001080CanvasRenderingContext2D.prototype.scale = function() {};
1081CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001082CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001083CanvasRenderingContext2D.prototype.setTransform = function() {};
1084CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001085CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001086CanvasRenderingContext2D.prototype.strokeText = function() {};
1087CanvasRenderingContext2D.prototype.transform = function() {};
1088CanvasRenderingContext2D.prototype.translate = function() {};
1089
Kevin Lubicka40f8322018-12-17 16:01:36 -05001090var Path2D = {};
1091Path2D.prototype.addPath = function() {};
1092Path2D.prototype.arc = function() {};
1093Path2D.prototype.arcTo = function() {};
1094Path2D.prototype.bezierCurveTo = function() {};
1095Path2D.prototype.closePath = function() {};
1096Path2D.prototype.ellipse = function() {};
1097Path2D.prototype.lineTo = function() {};
1098Path2D.prototype.moveTo = function() {};
1099Path2D.prototype.quadraticCurveTo = function() {};
1100Path2D.prototype.rect = function() {};
1101
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001102var LinearCanvasGradient = {};
1103LinearCanvasGradient.prototype.addColorStop = function() {};
1104var RadialCanvasGradient = {};
1105RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001106var CanvasPattern = {};
1107CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001108
Kevin Lubick52b9f372018-12-04 13:57:36 -05001109var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001110 /**
1111 * @type {Uint8ClampedArray}
1112 */
1113 data: {},
1114 height: {},
1115 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001116};
1117
Kevin Lubickd29edd72018-12-07 08:29:52 -05001118var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001119 a: {},
1120 b: {},
1121 c: {},
1122 d: {},
1123 e: {},
1124 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001125};
1126
Kevin Lubick217056c2018-09-20 17:39:31 -04001127// 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 -05001128function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001129
1130// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1131// to override it in the puppeteer tests
1132var LibraryEGL = {
1133 contextAttributes: {
1134 majorVersion: {}
1135 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001136}