blob: 96b5e7cf163c81ff0d6333ac0d25454ff521308a [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050058 MakeWebGLCanvasSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050059 Malloc: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -040060 MallocGlyphIDs: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040061 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050062 computeTonalColors: function() {},
63 currentContext: function() {},
64 getColorComponents: function() {},
65 getDecodeCacheLimitBytes: function() {},
66 getDecodeCacheUsageBytes: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040067 getDataBytes: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050068 multiplyByAlpha: function() {},
69 parseColorString: function() {},
70 setCurrentContext: function() {},
71 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040072
Kevin Lubicke70af512020-05-14 14:50:54 -040073 // Defined by emscripten.
74 createContext:function() {},
75
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050076 // private API (i.e. things declared in the bindings that we use
77 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040078 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050079 _MakeImage: function() {},
80 _MakeLinearGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050081 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070082 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050083 _MakeManagedAnimation: function() {},
84 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040085 _MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050086 _MakeTwoPointConicalGradientShader: function() {},
87 _decodeAnimatedImage: function() {},
88 _decodeImage: function() {},
89 _drawShapedText: function() {},
90 _getRasterDirectSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040091
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050092 // The testing object is meant to expose internal functions
93 // for more fine-grained testing, e.g. parseColor
94 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050095
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050096 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -040097
Kevin Lubickf8823b52020-09-03 10:02:10 -040098 Animation: {
99 prototype: {
100 render: function() {},
101 },
102 _render: function() {},
103 },
104
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500105 GrContext: {
106 // public API (from C++ bindings)
107 getResourceCacheLimitBytes: function() {},
108 getResourceCacheUsageBytes: function() {},
109 releaseResourcesAndAbandonContext: function() {},
110 setResourceCacheLimitBytes: function() {},
111 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400112
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400113 ManagedAnimation: {
114 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400115 render: function() {},
116 seek: function() {},
117 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400118 setColor: function() {},
119 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400120 _render: function() {},
121 _seek: function() {},
122 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400123 },
124
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500125 Paragraph: {
126 // public API (from C++ bindings)
127 didExceedMaxLines: function() {},
128 getAlphabeticBaseline: function() {},
129 getGlyphPositionAtCoordinate: function() {},
130 getHeight: function() {},
131 getIdeographicBaseline: function() {},
132 getLongestLine: function() {},
133 getMaxIntrinsicWidth: function() {},
134 getMaxWidth: function() {},
135 getMinIntrinsicWidth: function() {},
136 getWordBoundary: function() {},
137 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400138
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500139 // private API
140 /** @return {Float32Array} */
141 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700142 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500143 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400144
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400145 ParagraphBuilder: {
146 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700147 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400148 addText: function() {},
149 build: function() {},
150 pop: function() {},
151
152 prototype: {
153 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400154 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700155 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400156 },
157
158 // private API
159 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700160 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400161 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400162 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700163 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400164 },
165
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400166 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500167 // public API (from C++ bindings)
168 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500169
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500170 // private API
171 _makeShader: function() {},
172 _makeShaderWithChildren: function() {},
173 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500174
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500175 ParagraphStyle: function() {},
176 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400177 ColorBuilder: function() {},
178 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400179
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500180 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400181 prototype: {
182 getBounds: function() {},
183 },
184 // private API (from C++ bindings)
185 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500186 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500187
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400188 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500189 // public API (from C++ bindings)
190 decodeNextFrame: function() {},
191 getFrameCount: function() {},
192 getRepetitionCount: function() {},
193 height: function() {},
194 reset: function() {},
195 width: function() {},
196 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400197
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400198 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500199 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500200 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500201 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400202 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 drawImage: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400204 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500206 drawPaint: function() {},
207 drawParagraph: function() {},
208 drawPath: function() {},
209 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400210 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500211 drawText: function() {},
212 drawTextBlob: function() {},
213 drawVertices: function() {},
214 flush: function() {},
215 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500216 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400217 markCTM: function() {},
218 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500219 restore: function() {},
220 restoreToCount: function() {},
221 rotate: function() {},
222 save: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500223 scale: function() {},
224 skew: function() {},
225 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400226
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400227 prototype: {
228 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000229 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400230 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000231 concat44: function() {}, // deprecated
232 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400233 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000234 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400235 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400236 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000237 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400238 drawImageNine: function() {},
239 drawImageRect: function() {},
240 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000241 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400242 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000243 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400244 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000245 drawText: function() {},
246 findMarkedCTM: function() {},
247 getLocalToDevice: function() {},
248 getTotalMatrix: function() {},
249 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400250 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000251 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400252 },
253
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500254 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400255 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000256 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400257 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400258 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400259 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500260 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400261 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000262 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400263 _drawImageNine: function() {},
264 _drawImageRect: function() {},
265 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500266 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400267 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000268 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400269 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500270 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000271 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000272 _getLocalToDevice: function() {},
273 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500274 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400275 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500276 _writePixels: function() {},
277 delete: function() {},
278 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400279
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400280 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500281 // public API (from C++ bindings and JS interface)
282 MakeBlend: function() {},
283 MakeCompose: function() {},
284 MakeLerp: function() {},
285 MakeLinearToSRGBGamma: function() {},
286 MakeMatrix: function() {},
287 MakeSRGBToLinearGamma: function() {},
288 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400289 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500290 _makeMatrix: function() {},
291 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400292
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400293 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500294 concat: function() {},
295 identity: function() {},
296 postTranslate: function() {},
297 rotated: function() {},
298 scaled: function() {},
299 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400300
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400301 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400302 Equals: function() {},
303 SRGB: {},
304 DISPLAY_P3: {},
305 ADOBE_RGB: {},
306 // private API (from C++ bindings)
307 _MakeSRGB: function() {},
308 _MakeDisplayP3: function() {},
309 _MakeAdobeRGB: function() {},
310 },
311
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400312 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500313 next: function() {},
314 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500315
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400316 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500317 getPosTan: function() {},
318 getSegment: function() {},
319 isClosed: function() {},
320 length: function() {},
321 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500322
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400323 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500324 // public API (from C++ bindings)
325 getScaleX: function() {},
326 getSize: function() {},
327 getSkewX: function() {},
328 getTypeface: function() {},
329 measureText: function() {},
330 setHinting: function() {},
331 setLinearMetrics: function() {},
332 setScaleX: function() {},
333 setSize: function() {},
334 setSkewX: function() {},
335 setSubpixel: function() {},
336 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400337
338 prototype: {
339 getGlyphBounds: function() {},
340 getGlyphIDs: function() {},
341 getGlyphWidths: function() {},
342 getWidths: function() {},
343 },
344
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500345 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400346 _getGlyphIDs: function() {},
347 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500348 _getWidths: function() {},
349 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500350
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400351 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500352 // public API (from C++ and JS bindings)
353 FromData: function() {},
354 RefDefault: function() {},
355 countFamilies: function() {},
356 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500357
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500358 // private API
359 _makeTypefaceFromData: function() {},
360 _fromData: function() {},
361 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500362
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700363 TypefaceFontProvider: {
364 // public API (from C++ and JS bindings)
365 Make: function() {},
366 registerFont: function() {},
367
368 // private API
369 _registerFont: function() {},
370 },
371
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400372 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500373 // public API (from C++ bindings)
374 height: function() {},
375 width: function() {},
376 // private API
377 _encodeToData: function() {},
378 _encodeToDataWithFormat: function() {},
379 _makeShader: function() {},
380 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400381
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400382 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500383 MakeBlur: function() {},
384 MakeColorFilter: function() {},
385 MakeCompose: function() {},
386 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400387
388 // private API
389 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500390 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400391
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500392 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400393 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500394 identity: function() {},
395 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400396 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500397 multiply: function() {},
398 rotatedUnitSinCos: function() {},
399 rotated: function() {},
400 scaled: function() {},
401 translated: function() {},
402 lookat: function() {},
403 perspective: function() {},
404 rc: function() {},
405 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400406 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500408
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400409 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500410 identity: function() {},
411 invert: function() {},
412 mapPoints: function() {},
413 multiply: function() {},
414 rotated: function() {},
415 scaled: function() {},
416 skewed: function() {},
417 translated: function() {},
418 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500419
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400420 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500421 MakeBlur: function() {},
422 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400423
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400424 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500425 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400426 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500427 copy: function() {},
428 getBlendMode: function() {},
429 getColor: function() {},
430 getFilterQuality: function() {},
431 getStrokeCap: function() {},
432 getStrokeJoin: function() {},
433 getStrokeMiter: function() {},
434 getStrokeWidth: function() {},
435 setAntiAlias: function() {},
436 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400437 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500438 setFilterQuality: function() {},
439 setImageFilter: function() {},
440 setMaskFilter: function() {},
441 setPathEffect: function() {},
442 setShader: function() {},
443 setStrokeCap: function() {},
444 setStrokeJoin: function() {},
445 setStrokeMiter: function() {},
446 setStrokeWidth: function() {},
447 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500448
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400449 prototype: {
450 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400451 setColorComponents: function() {},
452 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400453 },
454
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500455 // Private API
456 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400457 _getColor: function() {},
458 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500459 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500460
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400461 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400462 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500463 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400464 MakeDiscrete: function() {},
465
466 // Private C++ API
467 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500468 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500469
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400470 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500471 // public API (from C++ bindings)
472 draw: function() {},
473 getEffectUniform: function() {},
474 getEffectUniformCount: function() {},
475 getEffectUniformFloatCount: function() {},
476 getEffectUniformName: function() {},
477 getParticleUniformCount: function() {},
478 getParticleUniformFloatCount: function() {},
479 getParticleUniformName: function() {},
480 getParticleUniform: function() {},
481 setPosition: function() {},
482 setRate: function() {},
483 start: function() {},
484 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500485
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500486 // private API (from C++ bindings)
487 _effectUniformPtr: function() {},
488 _particleUniformPtr: function() {},
489 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500490
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400491 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400492 // public API (from C++ and JS bindings)
493 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400494 MakeFromSVGString: function() {},
495 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400496 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500497 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400498 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500499 copy: function() {},
500 countPoints: function() {},
501 equals: function() {},
502 getBounds: function() {},
503 getFillType: function() {},
504 getPoint: function() {},
505 isEmpty: function() {},
506 isVolatile: function() {},
507 reset: function() {},
508 rewind: function() {},
509 setFillType: function() {},
510 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400511 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500512 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400513
Kevin Lubickf8823b52020-09-03 10:02:10 -0400514 prototype: {
515 addArc: function() {},
516 addOval: function() {},
517 addPath: function() {},
518 addPoly: function() {},
519 addRect: function() {},
520 addRRect: function() {},
521 addVerbsPointsWeights: function() {},
522 arc: function() {},
523 arcToOval: function() {},
524 arcToRotated: function() {},
525 arcToTangent: function() {},
526 close: function() {},
527 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400528 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400529 cubicTo: function() {},
530 dash: function() {},
531 lineTo: function() {},
532 moveTo: function() {},
533 offset: function() {},
534 op: function() {},
535 quadTo: function() {},
536 rArcTo: function() {},
537 rConicTo: function() {},
538 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400539 rLineTo: function() {},
540 rMoveTo: function() {},
541 rQuadTo: function() {},
542 simplify: function() {},
543 stroke: function() {},
544 transform: function() {},
545 trim: function() {},
546 },
547
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400549 _MakeFromCmds: function() {},
550 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500551 _addArc: function() {},
552 _addOval: function() {},
553 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000554 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400555 _addRect: function() {},
556 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400557 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400558 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000559 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400560 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500561 _close: function() {},
562 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400563 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500564 _cubicTo: function() {},
565 _dash: function() {},
566 _lineTo: function() {},
567 _moveTo: function() {},
568 _op: function() {},
569 _quadTo: function() {},
570 _rArcTo: function() {},
571 _rConicTo: function() {},
572 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400573 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500574 _rLineTo: function() {},
575 _rMoveTo: function() {},
576 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500577 _simplify: function() {},
578 _stroke: function() {},
579 _transform: function() {},
580 _trim: function() {},
581 delete: function() {},
582 dump: function() {},
583 dumpHex: function() {},
584 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400585
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400586 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500587 getLength: function() {},
588 getSegment: function() {},
589 getPosTan: function() {},
590 isClosed: function() {},
591 nextContour: function() {},
592 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400593
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400594 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500595 serialize: function() {},
596 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400597
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400598 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500599 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400600 prototype: {
601 beginRecording: function() {},
602 },
603 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 },
Kevin Lubick62836902019-12-09 09:04:26 -0500605
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400606 Shader: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500607 Blend: function() {},
608 Color: function() {},
609 Empty: function() {},
610 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400611 MakeLinearGradient: function() {},
612 MakeRadialGradient: function() {},
613 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700614 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400615
616 // private API (from C++ bindings)
617 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500618 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400619
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400620 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500621 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400622 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500623 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400624 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400625
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500626 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600627 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400628 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500629 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400630 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400631
Kevin Lubickf8823b52020-09-03 10:02:10 -0400632 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400633 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400634 makeImageSnapshot: function() {},
635 },
636
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500637 // private API
638 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400639 _makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500640 delete: function() {},
641 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500642
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400643 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400645 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500646 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400647 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500648 MakeFromText: function() {},
649 MakeOnPath: function() {},
650 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400651 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500652 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400653 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500654 _MakeFromText: function() {},
655 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500656
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500657 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400658 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500659 add: function() {},
660 sub: function() {},
661 dot: function() {},
662 cross: function() {},
663 normalize: function() {},
664 mulScalar: function() {},
665 length: function() {},
666 lengthSquared: function() {},
667 dist: function() {},
668 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400669
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400670 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500671 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500672 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400673
674 prototype: {
675 bounds: function() {},
676 },
677 // private API (from C++ bindings)
678
679 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500680 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400681
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400682 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 colors: function() {},
684 detach: function() {},
685 indices: function() {},
686 positions: function() {},
687 texCoords: function() {},
688 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400689
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500690 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400691
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 // Constants and Enums
693 gpu: {},
694 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400695
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500696 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400697 BLACK: {},
698 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500699 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400700 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500701 BLUE: {},
702 YELLOW: {},
703 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400704 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500705
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500706 MOVE_VERB: {},
707 LINE_VERB: {},
708 QUAD_VERB: {},
709 CONIC_VERB: {},
710 CUBIC_VERB: {},
711 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500712
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 NoDecoration: {},
714 UnderlineDecoration: {},
715 OverlineDecoration: {},
716 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400717
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500718 SaveLayerInitWithPrevious: {},
719 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400720
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500721 Affinity: {
722 Upstream: {},
723 Downstream: {},
724 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400725
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500726 AlphaType: {
727 Opaque: {},
728 Premul: {},
729 Unpremul: {},
730 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500731
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500732 BlendMode: {
733 Clear: {},
734 Src: {},
735 Dst: {},
736 SrcOver: {},
737 DstOver: {},
738 SrcIn: {},
739 DstIn: {},
740 SrcOut: {},
741 DstOut: {},
742 SrcATop: {},
743 DstATop: {},
744 Xor: {},
745 Plus: {},
746 Modulate: {},
747 Screen: {},
748 Overlay: {},
749 Darken: {},
750 Lighten: {},
751 ColorDodge: {},
752 ColorBurn: {},
753 HardLight: {},
754 SoftLight: {},
755 Difference: {},
756 Exclusion: {},
757 Multiply: {},
758 Hue: {},
759 Saturation: {},
760 Color: {},
761 Luminosity: {},
762 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500763
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500764 BlurStyle: {
765 Normal: {},
766 Solid: {},
767 Outer: {},
768 Inner: {},
769 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500770
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500771 ClipOp: {
772 Difference: {},
773 Intersect: {},
774 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500775
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500776 ColorType: {
777 Alpha_8: {},
778 RGB_565: {},
779 ARGB_4444: {},
780 RGBA_8888: {},
781 RGB_888x: {},
782 BGRA_8888: {},
783 RGBA_1010102: {},
784 RGB_101010x: {},
785 Gray_8: {},
786 RGBA_F16: {},
787 RGBA_F32: {},
788 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500789
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500790 FillType: {
791 Winding: {},
792 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500793 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400794
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500795 FilterQuality: {
796 None: {},
797 Low: {},
798 Medium: {},
799 High: {},
800 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 FontSlant: {
803 Upright: {},
804 Italic: {},
805 Oblique: {},
806 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400807
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500808 FontHinting: {
809 None: {},
810 Slight: {},
811 Normal: {},
812 Full: {},
813 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500814
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500815 FontWeight: {
816 Invisible: {},
817 Thin: {},
818 ExtraLight: {},
819 Light: {},
820 Normal: {},
821 Medium: {},
822 SemiBold: {},
823 Bold: {},
824 ExtraBold: {},
825 Black: {},
826 ExtraBlack: {},
827 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400828
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500829 FontWidth: {
830 UltraCondensed: {},
831 ExtraCondensed: {},
832 Condensed: {},
833 SemiCondensed: {},
834 Normal: {},
835 SemiExpanded: {},
836 Expanded: {},
837 ExtraExpanded: {},
838 UltraExpanded: {},
839 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400840
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500841 ImageFormat: {
842 PNG: {},
843 JPEG: {},
844 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300845
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500846 PaintStyle: {
847 Fill: {},
848 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500849 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500850
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500851 PathOp: {
852 Difference: {},
853 Intersect: {},
854 Union: {},
855 XOR: {},
856 ReverseDifference: {},
857 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500858
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500859 PointMode: {
860 Points: {},
861 Lines: {},
862 Polygon: {},
863 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500864
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500865 RectHeightStyle: {
866 Tight: {},
867 Max: {},
868 IncludeLineSpacingMiddle: {},
869 IncludeLineSpacingTop: {},
870 IncludeLineSpacingBottom: {},
871 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400872
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500873 RectWidthStyle: {
874 Tight: {},
875 Max: {},
876 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400877
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500878 StrokeCap: {
879 Butt: {},
880 Round: {},
881 Square: {},
882 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500883
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500884 StrokeJoin: {
885 Miter: {},
886 Round: {},
887 Bevel: {},
888 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500889
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500890 TextAlign: {
891 Left: {},
892 Right: {},
893 Center: {},
894 Justify: {},
895 Start: {},
896 End: {},
897 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400898
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500899 TextDirection: {
900 LTR: {},
901 RTL: {},
902 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400903
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700904 DecorationStyle: {
905 Solid: {},
906 Double: {},
907 Dotted: {},
908 Dashed: {},
909 Wavy: {},
910 },
911
912 PlaceholderAlignment: {
913 Baseline: {},
914 AboveBaseline: {},
915 BelowBaseline: {},
916 Top: {},
917 Bottom: {},
918 Middle: {},
919 },
920
921 TextBaseline: {
922 Alphabetic: {},
923 Ideographic: {},
924 },
925
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500926 TileMode: {
927 Clamp: {},
928 Repeat: {},
929 Mirror: {},
930 Decal: {},
931 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500932
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500933 VertexMode: {
934 Triangles: {},
935 TrianglesStrip: {},
936 TriangleFan: {},
937 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500938
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500939 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400940
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500941 /**
942 * @type {Float32Array}
943 */
944 HEAPF32: {},
945 /**
946 * @type {Float64Array}
947 */
948 HEAPF64: {},
949 /**
950 * @type {Uint8Array}
951 */
952 HEAPU8: {},
953 /**
954 * @type {Uint16Array}
955 */
956 HEAPU16: {},
957 /**
958 * @type {Uint32Array}
959 */
960 HEAPU32: {},
961 /**
962 * @type {Int8Array}
963 */
964 HEAP8: {},
965 /**
966 * @type {Int16Array}
967 */
968 HEAP16: {},
969 /**
970 * @type {Int32Array}
971 */
972 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400973
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500974 _malloc: function() {},
975 _free: function() {},
976 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400977};
Kevin Lubick217056c2018-09-20 17:39:31 -0400978
Kevin Lubick006a6f32018-10-19 14:34:34 -0400979// Public API things that are newly declared in the JS should go here.
980// It's not enough to declare them above, because closure can still erase them
981// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400982CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700983CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400984
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400985CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400986
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400987CanvasKit.Surface.prototype.dispose = function() {};
988CanvasKit.Surface.prototype.flush = function() {};
989CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
990CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400991
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400992CanvasKit.Image.prototype.encodeToData = function() {};
993CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300994
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400995CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -0500996
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400997CanvasKit.RSXFormBuilder.prototype.build = function() {};
998CanvasKit.RSXFormBuilder.prototype.delete = function() {};
999CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001000CanvasKit.RSXFormBuilder.prototype.set = function() {};
1001
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001002CanvasKit.ColorBuilder.prototype.build = function() {};
1003CanvasKit.ColorBuilder.prototype.delete = function() {};
1004CanvasKit.ColorBuilder.prototype.push = function() {};
1005CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001006
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001007CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1008CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001009
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001010CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1011CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001012
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001013// Define StrokeOpts object
1014var StrokeOpts = {};
1015StrokeOpts.prototype.width;
1016StrokeOpts.prototype.miter_limit;
1017StrokeOpts.prototype.cap;
1018StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001019StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001020
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001021// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001022var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001023HTMLCanvas.prototype.decodeImage = function() {};
1024HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001025HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001026HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001027HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001028HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001029
Elliot Evans28796192020-06-15 12:53:27 -06001030var ImageBitmapRenderingContext = {};
1031ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1032
Kevin Lubickb9db3902018-11-26 11:47:54 -05001033var CanvasRenderingContext2D = {};
1034CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1035CanvasRenderingContext2D.prototype.arc = function() {};
1036CanvasRenderingContext2D.prototype.arcTo = function() {};
1037CanvasRenderingContext2D.prototype.beginPath = function() {};
1038CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1039CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001040CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001041CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001042CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001043CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001044CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001045CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001046CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001047CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001048CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001049CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001050CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001051CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001052CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001053CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001054CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001055CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1056CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001057CanvasRenderingContext2D.prototype.lineTo = function() {};
1058CanvasRenderingContext2D.prototype.measureText = function() {};
1059CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001060CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001061CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1062CanvasRenderingContext2D.prototype.rect = function() {};
1063CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1064CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001065CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001066CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001067CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001068CanvasRenderingContext2D.prototype.scale = function() {};
1069CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001070CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001071CanvasRenderingContext2D.prototype.setTransform = function() {};
1072CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001073CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001074CanvasRenderingContext2D.prototype.strokeText = function() {};
1075CanvasRenderingContext2D.prototype.transform = function() {};
1076CanvasRenderingContext2D.prototype.translate = function() {};
1077
Kevin Lubicka40f8322018-12-17 16:01:36 -05001078var Path2D = {};
1079Path2D.prototype.addPath = function() {};
1080Path2D.prototype.arc = function() {};
1081Path2D.prototype.arcTo = function() {};
1082Path2D.prototype.bezierCurveTo = function() {};
1083Path2D.prototype.closePath = function() {};
1084Path2D.prototype.ellipse = function() {};
1085Path2D.prototype.lineTo = function() {};
1086Path2D.prototype.moveTo = function() {};
1087Path2D.prototype.quadraticCurveTo = function() {};
1088Path2D.prototype.rect = function() {};
1089
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001090var LinearCanvasGradient = {};
1091LinearCanvasGradient.prototype.addColorStop = function() {};
1092var RadialCanvasGradient = {};
1093RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001094var CanvasPattern = {};
1095CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001096
Kevin Lubick52b9f372018-12-04 13:57:36 -05001097var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001098 /**
1099 * @type {Uint8ClampedArray}
1100 */
1101 data: {},
1102 height: {},
1103 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001104};
1105
Kevin Lubickd29edd72018-12-07 08:29:52 -05001106var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001107 a: {},
1108 b: {},
1109 c: {},
1110 d: {},
1111 e: {},
1112 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001113};
1114
Kevin Lubick217056c2018-09-20 17:39:31 -04001115// 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 -05001116function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001117
1118// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1119// to override it in the puppeteer tests
1120var LibraryEGL = {
1121 contextAttributes: {
1122 majorVersion: {}
1123 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001124}