blob: fca6a3b41173c198841fac69cb3000321c2278bb [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() {},
87 _getRasterDirectSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040088
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050089 // The testing object is meant to expose internal functions
90 // for more fine-grained testing, e.g. parseColor
91 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050092
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050093 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -040094
Kevin Lubickf8823b52020-09-03 10:02:10 -040095 Animation: {
96 prototype: {
97 render: function() {},
98 },
99 _render: function() {},
100 },
101
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500102 GrContext: {
103 // public API (from C++ bindings)
104 getResourceCacheLimitBytes: function() {},
105 getResourceCacheUsageBytes: function() {},
106 releaseResourcesAndAbandonContext: function() {},
107 setResourceCacheLimitBytes: function() {},
108 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400109
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400110 ManagedAnimation: {
111 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400112 render: function() {},
113 seek: function() {},
114 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400115 setColor: function() {},
116 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400117 _render: function() {},
118 _seek: function() {},
119 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400120 },
121
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500122 Paragraph: {
123 // public API (from C++ bindings)
124 didExceedMaxLines: function() {},
125 getAlphabeticBaseline: function() {},
126 getGlyphPositionAtCoordinate: function() {},
127 getHeight: function() {},
128 getIdeographicBaseline: function() {},
Kevin Lubicke677f4a2020-11-04 09:46:22 -0500129 getLineMetrics: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500130 getLongestLine: function() {},
131 getMaxIntrinsicWidth: function() {},
132 getMaxWidth: function() {},
133 getMinIntrinsicWidth: function() {},
134 getWordBoundary: function() {},
135 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400136
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500137 // private API
138 /** @return {Float32Array} */
139 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700140 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500141 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400142
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400143 ParagraphBuilder: {
144 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700145 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400146 addText: function() {},
147 build: function() {},
148 pop: function() {},
149
150 prototype: {
151 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400152 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700153 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400154 },
155
156 // private API
157 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700158 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400159 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400160 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700161 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400162 },
163
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400164 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500165 // public API (from C++ bindings)
166 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500167
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500168 // private API
169 _makeShader: function() {},
170 _makeShaderWithChildren: function() {},
171 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500172
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500173 ParagraphStyle: function() {},
174 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400175 ColorBuilder: function() {},
176 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400177
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500178 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400179 prototype: {
180 getBounds: function() {},
181 },
182 // private API (from C++ bindings)
183 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500184 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500185
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400186 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500187 // public API (from C++ bindings)
188 decodeNextFrame: function() {},
189 getFrameCount: function() {},
190 getRepetitionCount: function() {},
191 height: function() {},
192 reset: function() {},
193 width: function() {},
194 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400195
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400196 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500197 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500198 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500199 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400200 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500201 drawImage: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400202 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500204 drawPaint: function() {},
205 drawParagraph: function() {},
206 drawPath: function() {},
207 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400208 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500209 drawText: function() {},
210 drawTextBlob: function() {},
211 drawVertices: function() {},
212 flush: function() {},
213 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500214 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400215 markCTM: function() {},
216 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500217 restore: function() {},
218 restoreToCount: function() {},
219 rotate: function() {},
220 save: 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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500649 delete: function() {},
650 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500651
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400652 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400654 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500655 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400656 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500657 MakeFromText: function() {},
658 MakeOnPath: function() {},
659 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400660 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400662 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500663 _MakeFromText: function() {},
664 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500665
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500666 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400667 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500668 add: function() {},
669 sub: function() {},
670 dot: function() {},
671 cross: function() {},
672 normalize: function() {},
673 mulScalar: function() {},
674 length: function() {},
675 lengthSquared: function() {},
676 dist: function() {},
677 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400678
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400679 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500680 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500681 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400682
683 prototype: {
684 bounds: function() {},
685 },
686 // private API (from C++ bindings)
687
688 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500689 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400690
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400691 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 colors: function() {},
693 detach: function() {},
694 indices: function() {},
695 positions: function() {},
696 texCoords: function() {},
697 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400698
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500699 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400700
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500701 // Constants and Enums
702 gpu: {},
703 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400704
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400706 BLACK: {},
707 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500708 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400709 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500710 BLUE: {},
711 YELLOW: {},
712 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400713 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500714
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500715 MOVE_VERB: {},
716 LINE_VERB: {},
717 QUAD_VERB: {},
718 CONIC_VERB: {},
719 CUBIC_VERB: {},
720 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500721
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500722 NoDecoration: {},
723 UnderlineDecoration: {},
724 OverlineDecoration: {},
725 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400726
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500727 SaveLayerInitWithPrevious: {},
728 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400729
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 Affinity: {
731 Upstream: {},
732 Downstream: {},
733 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400734
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500735 AlphaType: {
736 Opaque: {},
737 Premul: {},
738 Unpremul: {},
739 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500740
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500741 BlendMode: {
742 Clear: {},
743 Src: {},
744 Dst: {},
745 SrcOver: {},
746 DstOver: {},
747 SrcIn: {},
748 DstIn: {},
749 SrcOut: {},
750 DstOut: {},
751 SrcATop: {},
752 DstATop: {},
753 Xor: {},
754 Plus: {},
755 Modulate: {},
756 Screen: {},
757 Overlay: {},
758 Darken: {},
759 Lighten: {},
760 ColorDodge: {},
761 ColorBurn: {},
762 HardLight: {},
763 SoftLight: {},
764 Difference: {},
765 Exclusion: {},
766 Multiply: {},
767 Hue: {},
768 Saturation: {},
769 Color: {},
770 Luminosity: {},
771 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500772
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500773 BlurStyle: {
774 Normal: {},
775 Solid: {},
776 Outer: {},
777 Inner: {},
778 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500779
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500780 ClipOp: {
781 Difference: {},
782 Intersect: {},
783 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500784
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500785 ColorType: {
786 Alpha_8: {},
787 RGB_565: {},
788 ARGB_4444: {},
789 RGBA_8888: {},
790 RGB_888x: {},
791 BGRA_8888: {},
792 RGBA_1010102: {},
793 RGB_101010x: {},
794 Gray_8: {},
795 RGBA_F16: {},
796 RGBA_F32: {},
797 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500798
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500799 FillType: {
800 Winding: {},
801 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400803
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500804 FilterQuality: {
805 None: {},
806 Low: {},
807 Medium: {},
808 High: {},
809 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500810
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500811 FontSlant: {
812 Upright: {},
813 Italic: {},
814 Oblique: {},
815 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400816
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500817 FontHinting: {
818 None: {},
819 Slight: {},
820 Normal: {},
821 Full: {},
822 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500823
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500824 FontWeight: {
825 Invisible: {},
826 Thin: {},
827 ExtraLight: {},
828 Light: {},
829 Normal: {},
830 Medium: {},
831 SemiBold: {},
832 Bold: {},
833 ExtraBold: {},
834 Black: {},
835 ExtraBlack: {},
836 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400837
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500838 FontWidth: {
839 UltraCondensed: {},
840 ExtraCondensed: {},
841 Condensed: {},
842 SemiCondensed: {},
843 Normal: {},
844 SemiExpanded: {},
845 Expanded: {},
846 ExtraExpanded: {},
847 UltraExpanded: {},
848 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400849
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500850 ImageFormat: {
851 PNG: {},
852 JPEG: {},
853 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300854
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500855 PaintStyle: {
856 Fill: {},
857 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500858 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500859
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500860 PathOp: {
861 Difference: {},
862 Intersect: {},
863 Union: {},
864 XOR: {},
865 ReverseDifference: {},
866 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500867
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500868 PointMode: {
869 Points: {},
870 Lines: {},
871 Polygon: {},
872 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500873
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500874 RectHeightStyle: {
875 Tight: {},
876 Max: {},
877 IncludeLineSpacingMiddle: {},
878 IncludeLineSpacingTop: {},
879 IncludeLineSpacingBottom: {},
880 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400881
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500882 RectWidthStyle: {
883 Tight: {},
884 Max: {},
885 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400886
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500887 StrokeCap: {
888 Butt: {},
889 Round: {},
890 Square: {},
891 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500892
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500893 StrokeJoin: {
894 Miter: {},
895 Round: {},
896 Bevel: {},
897 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500898
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500899 TextAlign: {
900 Left: {},
901 Right: {},
902 Center: {},
903 Justify: {},
904 Start: {},
905 End: {},
906 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400907
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500908 TextDirection: {
909 LTR: {},
910 RTL: {},
911 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400912
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700913 DecorationStyle: {
914 Solid: {},
915 Double: {},
916 Dotted: {},
917 Dashed: {},
918 Wavy: {},
919 },
920
921 PlaceholderAlignment: {
922 Baseline: {},
923 AboveBaseline: {},
924 BelowBaseline: {},
925 Top: {},
926 Bottom: {},
927 Middle: {},
928 },
929
930 TextBaseline: {
931 Alphabetic: {},
932 Ideographic: {},
933 },
934
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500935 TileMode: {
936 Clamp: {},
937 Repeat: {},
938 Mirror: {},
939 Decal: {},
940 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500941
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500942 VertexMode: {
943 Triangles: {},
944 TrianglesStrip: {},
945 TriangleFan: {},
946 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500947
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500948 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400949
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500950 /**
951 * @type {Float32Array}
952 */
953 HEAPF32: {},
954 /**
955 * @type {Float64Array}
956 */
957 HEAPF64: {},
958 /**
959 * @type {Uint8Array}
960 */
961 HEAPU8: {},
962 /**
963 * @type {Uint16Array}
964 */
965 HEAPU16: {},
966 /**
967 * @type {Uint32Array}
968 */
969 HEAPU32: {},
970 /**
971 * @type {Int8Array}
972 */
973 HEAP8: {},
974 /**
975 * @type {Int16Array}
976 */
977 HEAP16: {},
978 /**
979 * @type {Int32Array}
980 */
981 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400982
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500983 _malloc: function() {},
984 _free: function() {},
985 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400986};
Kevin Lubick217056c2018-09-20 17:39:31 -0400987
Kevin Lubick006a6f32018-10-19 14:34:34 -0400988// Public API things that are newly declared in the JS should go here.
989// It's not enough to declare them above, because closure can still erase them
990// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400991CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700992CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400993
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400994CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400995
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400996CanvasKit.Surface.prototype.dispose = function() {};
997CanvasKit.Surface.prototype.flush = function() {};
998CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
999CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001000
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001001CanvasKit.Image.prototype.encodeToData = function() {};
1002CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +03001003
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001004CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001005
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001006CanvasKit.RSXFormBuilder.prototype.build = function() {};
1007CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1008CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001009CanvasKit.RSXFormBuilder.prototype.set = function() {};
1010
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001011CanvasKit.ColorBuilder.prototype.build = function() {};
1012CanvasKit.ColorBuilder.prototype.delete = function() {};
1013CanvasKit.ColorBuilder.prototype.push = function() {};
1014CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001015
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001016CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1017CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001018
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001019CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1020CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001021
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001022// Define StrokeOpts object
1023var StrokeOpts = {};
1024StrokeOpts.prototype.width;
1025StrokeOpts.prototype.miter_limit;
1026StrokeOpts.prototype.cap;
1027StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001028StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001029
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001030// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001031var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001032HTMLCanvas.prototype.decodeImage = function() {};
1033HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001034HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001035HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001036HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001037HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001038
Elliot Evans28796192020-06-15 12:53:27 -06001039var ImageBitmapRenderingContext = {};
1040ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1041
Kevin Lubickb9db3902018-11-26 11:47:54 -05001042var CanvasRenderingContext2D = {};
1043CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1044CanvasRenderingContext2D.prototype.arc = function() {};
1045CanvasRenderingContext2D.prototype.arcTo = function() {};
1046CanvasRenderingContext2D.prototype.beginPath = function() {};
1047CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1048CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001049CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001050CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001051CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001052CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001053CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001054CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001055CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001056CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001057CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001058CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001059CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001060CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001061CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001062CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001063CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001064CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1065CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001066CanvasRenderingContext2D.prototype.lineTo = function() {};
1067CanvasRenderingContext2D.prototype.measureText = function() {};
1068CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001069CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001070CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1071CanvasRenderingContext2D.prototype.rect = function() {};
1072CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1073CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001074CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001075CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001076CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001077CanvasRenderingContext2D.prototype.scale = function() {};
1078CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001079CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001080CanvasRenderingContext2D.prototype.setTransform = function() {};
1081CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001082CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001083CanvasRenderingContext2D.prototype.strokeText = function() {};
1084CanvasRenderingContext2D.prototype.transform = function() {};
1085CanvasRenderingContext2D.prototype.translate = function() {};
1086
Kevin Lubicka40f8322018-12-17 16:01:36 -05001087var Path2D = {};
1088Path2D.prototype.addPath = function() {};
1089Path2D.prototype.arc = function() {};
1090Path2D.prototype.arcTo = function() {};
1091Path2D.prototype.bezierCurveTo = function() {};
1092Path2D.prototype.closePath = function() {};
1093Path2D.prototype.ellipse = function() {};
1094Path2D.prototype.lineTo = function() {};
1095Path2D.prototype.moveTo = function() {};
1096Path2D.prototype.quadraticCurveTo = function() {};
1097Path2D.prototype.rect = function() {};
1098
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001099var LinearCanvasGradient = {};
1100LinearCanvasGradient.prototype.addColorStop = function() {};
1101var RadialCanvasGradient = {};
1102RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001103var CanvasPattern = {};
1104CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001105
Kevin Lubick52b9f372018-12-04 13:57:36 -05001106var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001107 /**
1108 * @type {Uint8ClampedArray}
1109 */
1110 data: {},
1111 height: {},
1112 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001113};
1114
Kevin Lubickd29edd72018-12-07 08:29:52 -05001115var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001116 a: {},
1117 b: {},
1118 c: {},
1119 d: {},
1120 e: {},
1121 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001122};
1123
Kevin Lubick217056c2018-09-20 17:39:31 -04001124// 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 -05001125function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001126
1127// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1128// to override it in the puppeteer tests
1129var LibraryEGL = {
1130 contextAttributes: {
1131 majorVersion: {}
1132 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001133}