blob: 6508b56020d7b5c83f0f5fce89f17e7f82aab2a6 [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050039 MakeCanvas: function() {},
40 MakeCanvasSurface: function() {},
41 MakeGrContext: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040042 /** @return {CanvasKit.AnimatedImage} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050043 MakeAnimatedImageFromEncoded: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040044 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050045 MakeImage: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040046 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050047 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060048 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050049 MakeOnScreenGLSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050050 MakeRenderTarget: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040051 MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050052 MakeSWCanvasSurface: function() {},
53 MakeManagedAnimation: function() {},
54 MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040055 MakeVertices: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050056 MakeSurface: function() {},
Kevin Lubicka8f4c912020-11-04 07:23:37 -050057 MakeRasterDirectSurface: 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() {},
Kevin Lubickf7fdf1a2020-12-10 15:21:01 -050064 deleteContext: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050065 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.
Kevin Lubickf7fdf1a2020-12-10 15:21:01 -050075 createContext: function() {},
Kevin Lubicke70af512020-05-14 14:50:54 -040076
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050077 // private API (i.e. things declared in the bindings that we use
78 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040079 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 _MakeImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050081 _MakeManagedAnimation: function() {},
82 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040083 _MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050084 _decodeAnimatedImage: function() {},
85 _decodeImage: function() {},
86 _drawShapedText: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040087
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050088 // The testing object is meant to expose internal functions
89 // for more fine-grained testing, e.g. parseColor
90 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050091
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050092 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -040093
Kevin Lubickf8823b52020-09-03 10:02:10 -040094 Animation: {
95 prototype: {
96 render: function() {},
97 },
98 _render: function() {},
99 },
100
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500101 GrContext: {
102 // public API (from C++ bindings)
103 getResourceCacheLimitBytes: function() {},
104 getResourceCacheUsageBytes: function() {},
105 releaseResourcesAndAbandonContext: function() {},
106 setResourceCacheLimitBytes: function() {},
107 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400108
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400109 ManagedAnimation: {
110 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400111 render: function() {},
112 seek: function() {},
113 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400114 setColor: function() {},
115 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400116 _render: function() {},
117 _seek: function() {},
118 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400119 },
120
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500121 Paragraph: {
122 // public API (from C++ bindings)
123 didExceedMaxLines: function() {},
124 getAlphabeticBaseline: function() {},
125 getGlyphPositionAtCoordinate: function() {},
126 getHeight: function() {},
127 getIdeographicBaseline: function() {},
Kevin Lubicke677f4a2020-11-04 09:46:22 -0500128 getLineMetrics: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500129 getLongestLine: function() {},
130 getMaxIntrinsicWidth: function() {},
131 getMaxWidth: function() {},
132 getMinIntrinsicWidth: function() {},
133 getWordBoundary: function() {},
134 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400135
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500136 // private API
137 /** @return {Float32Array} */
138 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700139 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500140 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400141
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400142 ParagraphBuilder: {
143 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700144 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400145 addText: function() {},
146 build: function() {},
147 pop: function() {},
148
149 prototype: {
150 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400151 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700152 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400153 },
154
155 // private API
156 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700157 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400158 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400159 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700160 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400161 },
162
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400163 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500164 // public API (from C++ bindings)
165 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500166
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500167 // private API
168 _makeShader: function() {},
169 _makeShaderWithChildren: function() {},
170 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500171
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500172 ParagraphStyle: function() {},
173 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400174 ColorBuilder: function() {},
175 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400176
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500177 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400178 prototype: {
179 getBounds: function() {},
180 },
181 // private API (from C++ bindings)
182 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500183 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500184
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400185 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500186 // public API (from C++ bindings)
187 decodeNextFrame: function() {},
188 getFrameCount: function() {},
189 getRepetitionCount: function() {},
190 height: function() {},
191 reset: function() {},
192 width: function() {},
193 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400194
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400195 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500196 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500197 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500198 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400199 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500200 drawImage: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500201 drawImageCubic: function() {},
202 drawImageOptions: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400203 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500204 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 drawPaint: function() {},
206 drawParagraph: function() {},
207 drawPath: function() {},
208 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400209 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500210 drawText: function() {},
211 drawTextBlob: function() {},
212 drawVertices: function() {},
213 flush: function() {},
214 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500215 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400216 markCTM: function() {},
217 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500218 restore: function() {},
219 restoreToCount: function() {},
220 rotate: function() {},
221 save: function() {},
Kevin Lubick9fe83912020-11-03 17:08:34 -0500222 saveLayerPaint: 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 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400232 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000233 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400234 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400235 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000236 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400237 drawImageNine: function() {},
238 drawImageRect: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500239 drawImageRectCubic: function() {},
240 drawImageRectOptions: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400241 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000242 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400243 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000244 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400245 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000246 drawText: function() {},
247 findMarkedCTM: function() {},
248 getLocalToDevice: function() {},
249 getTotalMatrix: function() {},
250 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400251 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000252 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400253 },
254
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500255 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400256 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000257 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400258 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400259 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400260 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500261 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400262 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000263 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400264 _drawImageNine: function() {},
265 _drawImageRect: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500266 _drawImageRectCubic: function() {},
267 _drawImageRectOptions: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400268 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500269 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400270 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000271 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400272 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500273 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000274 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000275 _getLocalToDevice: function() {},
276 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500277 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400278 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500279 _writePixels: function() {},
280 delete: function() {},
281 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400282
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400283 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500284 // public API (from C++ bindings and JS interface)
285 MakeBlend: function() {},
286 MakeCompose: function() {},
287 MakeLerp: function() {},
288 MakeLinearToSRGBGamma: function() {},
289 MakeMatrix: function() {},
290 MakeSRGBToLinearGamma: function() {},
291 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400292 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500293 _makeMatrix: function() {},
294 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400295
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400296 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500297 concat: function() {},
298 identity: function() {},
299 postTranslate: function() {},
300 rotated: function() {},
301 scaled: function() {},
302 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400303
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400304 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400305 Equals: function() {},
306 SRGB: {},
307 DISPLAY_P3: {},
308 ADOBE_RGB: {},
309 // private API (from C++ bindings)
310 _MakeSRGB: function() {},
311 _MakeDisplayP3: function() {},
312 _MakeAdobeRGB: function() {},
313 },
314
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400315 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500316 next: function() {},
317 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500318
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400319 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500320 getPosTan: function() {},
321 getSegment: function() {},
322 isClosed: function() {},
323 length: function() {},
324 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500325
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400326 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500327 // public API (from C++ bindings)
328 getScaleX: function() {},
329 getSize: function() {},
330 getSkewX: function() {},
331 getTypeface: function() {},
332 measureText: function() {},
333 setHinting: function() {},
334 setLinearMetrics: function() {},
335 setScaleX: function() {},
336 setSize: function() {},
337 setSkewX: function() {},
338 setSubpixel: function() {},
339 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400340
341 prototype: {
342 getGlyphBounds: function() {},
343 getGlyphIDs: function() {},
344 getGlyphWidths: function() {},
345 getWidths: function() {},
346 },
347
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500348 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400349 _getGlyphIDs: function() {},
350 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500351 _getWidths: function() {},
352 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500353
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400354 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500355 // public API (from C++ and JS bindings)
356 FromData: function() {},
357 RefDefault: function() {},
358 countFamilies: function() {},
359 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500360
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500361 // private API
362 _makeTypefaceFromData: function() {},
363 _fromData: function() {},
364 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500365
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700366 TypefaceFontProvider: {
367 // public API (from C++ and JS bindings)
368 Make: function() {},
369 registerFont: function() {},
370
371 // private API
372 _registerFont: function() {},
373 },
374
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400375 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500376 // public API (from C++ bindings)
Kevin Lubickae0d3ff2020-11-18 11:23:15 -0500377 getColorSpace: function() {},
378 getImageInfo: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500379 makeCopyWithDefaultMipmaps: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500380 height: function() {},
381 width: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500382
383 prototype: {
384 encodeToData: function() {},
385 makeShaderCubic: function() {},
386 makeShaderOptions: function() {},
387 },
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500388 // private API
389 _encodeToData: function() {},
390 _encodeToDataWithFormat: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500391 _makeShaderCubic: function() {},
392 _makeShaderOptions: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500393 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400394
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400395 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500396 MakeBlur: function() {},
397 MakeColorFilter: function() {},
398 MakeCompose: function() {},
399 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400400
401 // private API
402 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500403 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400404
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500405 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400406 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 identity: function() {},
408 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400409 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500410 multiply: function() {},
411 rotatedUnitSinCos: function() {},
412 rotated: function() {},
413 scaled: function() {},
414 translated: function() {},
415 lookat: function() {},
416 perspective: function() {},
417 rc: function() {},
418 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400419 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500420 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500421
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400422 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500423 identity: function() {},
424 invert: function() {},
425 mapPoints: function() {},
426 multiply: function() {},
427 rotated: function() {},
428 scaled: function() {},
429 skewed: function() {},
430 translated: function() {},
431 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500432
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400433 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500434 MakeBlur: function() {},
435 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400436
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400437 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500438 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400439 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500440 copy: function() {},
441 getBlendMode: function() {},
442 getColor: function() {},
443 getFilterQuality: function() {},
444 getStrokeCap: function() {},
445 getStrokeJoin: function() {},
446 getStrokeMiter: function() {},
447 getStrokeWidth: function() {},
448 setAntiAlias: function() {},
449 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400450 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500451 setFilterQuality: function() {},
452 setImageFilter: function() {},
453 setMaskFilter: function() {},
454 setPathEffect: function() {},
455 setShader: function() {},
456 setStrokeCap: function() {},
457 setStrokeJoin: function() {},
458 setStrokeMiter: function() {},
459 setStrokeWidth: function() {},
460 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500461
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400462 prototype: {
463 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400464 setColorComponents: function() {},
465 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400466 },
467
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500468 // Private API
469 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400470 _getColor: function() {},
471 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500472 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500473
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400474 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400475 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500476 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400477 MakeDiscrete: function() {},
478
479 // Private C++ API
480 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500481 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500482
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400483 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500484 // public API (from C++ bindings)
485 draw: function() {},
486 getEffectUniform: function() {},
487 getEffectUniformCount: function() {},
488 getEffectUniformFloatCount: function() {},
489 getEffectUniformName: function() {},
490 getParticleUniformCount: function() {},
491 getParticleUniformFloatCount: function() {},
492 getParticleUniformName: function() {},
493 getParticleUniform: function() {},
494 setPosition: function() {},
495 setRate: function() {},
496 start: function() {},
497 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500498
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500499 // private API (from C++ bindings)
500 _effectUniformPtr: function() {},
501 _particleUniformPtr: function() {},
502 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500503
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400504 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400505 // public API (from C++ and JS bindings)
506 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400507 MakeFromSVGString: function() {},
508 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400509 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500510 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400511 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500512 copy: function() {},
513 countPoints: function() {},
514 equals: function() {},
515 getBounds: function() {},
516 getFillType: function() {},
517 getPoint: function() {},
518 isEmpty: function() {},
519 isVolatile: function() {},
520 reset: function() {},
521 rewind: function() {},
522 setFillType: function() {},
523 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400524 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500525 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400526
Kevin Lubickf8823b52020-09-03 10:02:10 -0400527 prototype: {
528 addArc: function() {},
529 addOval: function() {},
530 addPath: function() {},
531 addPoly: function() {},
532 addRect: function() {},
533 addRRect: function() {},
534 addVerbsPointsWeights: function() {},
535 arc: function() {},
536 arcToOval: function() {},
537 arcToRotated: function() {},
538 arcToTangent: function() {},
539 close: function() {},
540 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400541 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400542 cubicTo: function() {},
543 dash: function() {},
544 lineTo: function() {},
545 moveTo: function() {},
546 offset: function() {},
547 op: function() {},
548 quadTo: function() {},
549 rArcTo: function() {},
550 rConicTo: function() {},
551 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400552 rLineTo: function() {},
553 rMoveTo: function() {},
554 rQuadTo: function() {},
555 simplify: function() {},
556 stroke: function() {},
557 transform: function() {},
558 trim: function() {},
559 },
560
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500561 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400562 _MakeFromCmds: function() {},
563 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500564 _addArc: function() {},
565 _addOval: function() {},
566 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000567 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400568 _addRect: function() {},
569 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400570 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400571 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000572 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400573 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500574 _close: function() {},
575 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400576 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500577 _cubicTo: function() {},
578 _dash: function() {},
579 _lineTo: function() {},
580 _moveTo: function() {},
581 _op: function() {},
582 _quadTo: function() {},
583 _rArcTo: function() {},
584 _rConicTo: function() {},
585 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400586 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500587 _rLineTo: function() {},
588 _rMoveTo: function() {},
589 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500590 _simplify: function() {},
591 _stroke: function() {},
592 _transform: function() {},
593 _trim: function() {},
594 delete: function() {},
595 dump: function() {},
596 dumpHex: function() {},
597 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400598
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400599 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500600 getLength: function() {},
601 getSegment: function() {},
602 getPosTan: function() {},
603 isClosed: function() {},
604 nextContour: function() {},
605 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400606
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400607 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500608 serialize: function() {},
609 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400610
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400611 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500612 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400613 prototype: {
614 beginRecording: function() {},
615 },
616 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500617 },
Kevin Lubick62836902019-12-09 09:04:26 -0500618
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400619 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400620 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500621 Blend: function() {},
622 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500623 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400624 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400625 MakeBlend: function() {},
626 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400627 MakeFractalNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400628 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400629 MakeLinearGradient: function() {},
630 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700631 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400632 MakeTurbulence: function() {},
633 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400634
635 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400636 _MakeColor: function() {},
637 _MakeLinearGradient: function() {},
638 _MakeRadialGradient: function() {},
639 _MakeSweepGradient: function() {},
640 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500641 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400642
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400643 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400645 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500646 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400647 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400648
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500649 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600650 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400651 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500652 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400653 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400654
Kevin Lubickf8823b52020-09-03 10:02:10 -0400655 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400656 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400657 makeImageSnapshot: function() {},
658 },
659
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500660 // private API
661 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400662 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500663 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500664 delete: function() {},
665 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500666
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400667 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500668 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400669 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500670 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400671 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500672 MakeFromText: function() {},
673 MakeOnPath: function() {},
674 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400675 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500676 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400677 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500678 _MakeFromText: function() {},
679 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500680
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500681 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400682 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 add: function() {},
684 sub: function() {},
685 dot: function() {},
686 cross: function() {},
687 normalize: function() {},
688 mulScalar: function() {},
689 length: function() {},
690 lengthSquared: function() {},
691 dist: function() {},
692 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400693
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400694 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500695 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500696 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400697
698 prototype: {
699 bounds: function() {},
700 },
701 // private API (from C++ bindings)
702
703 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400705
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400706 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500707 colors: function() {},
708 detach: function() {},
709 indices: function() {},
710 positions: function() {},
711 texCoords: function() {},
712 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400713
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500714 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400715
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500716 // Constants and Enums
717 gpu: {},
718 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400719
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500720 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400721 BLACK: {},
722 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500723 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400724 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 BLUE: {},
726 YELLOW: {},
727 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400728 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500729
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 MOVE_VERB: {},
731 LINE_VERB: {},
732 QUAD_VERB: {},
733 CONIC_VERB: {},
734 CUBIC_VERB: {},
735 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500736
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500737 NoDecoration: {},
738 UnderlineDecoration: {},
739 OverlineDecoration: {},
740 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400741
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500742 SaveLayerInitWithPrevious: {},
743 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400744
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500745 Affinity: {
746 Upstream: {},
747 Downstream: {},
748 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400749
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500750 AlphaType: {
751 Opaque: {},
752 Premul: {},
753 Unpremul: {},
754 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500755
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500756 BlendMode: {
757 Clear: {},
758 Src: {},
759 Dst: {},
760 SrcOver: {},
761 DstOver: {},
762 SrcIn: {},
763 DstIn: {},
764 SrcOut: {},
765 DstOut: {},
766 SrcATop: {},
767 DstATop: {},
768 Xor: {},
769 Plus: {},
770 Modulate: {},
771 Screen: {},
772 Overlay: {},
773 Darken: {},
774 Lighten: {},
775 ColorDodge: {},
776 ColorBurn: {},
777 HardLight: {},
778 SoftLight: {},
779 Difference: {},
780 Exclusion: {},
781 Multiply: {},
782 Hue: {},
783 Saturation: {},
784 Color: {},
785 Luminosity: {},
786 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 BlurStyle: {
789 Normal: {},
790 Solid: {},
791 Outer: {},
792 Inner: {},
793 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500794
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500795 ClipOp: {
796 Difference: {},
797 Intersect: {},
798 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500799
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500800 ColorType: {
801 Alpha_8: {},
802 RGB_565: {},
803 ARGB_4444: {},
804 RGBA_8888: {},
805 RGB_888x: {},
806 BGRA_8888: {},
807 RGBA_1010102: {},
808 RGB_101010x: {},
809 Gray_8: {},
810 RGBA_F16: {},
811 RGBA_F32: {},
812 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500813
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500814 FillType: {
815 Winding: {},
816 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500817 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400818
Kevin Lubick2d633492020-12-17 09:58:32 -0500819 FilterMode: {
820 Linear: {},
821 Nearest: {},
822 },
823
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500824 FilterQuality: {
825 None: {},
826 Low: {},
827 Medium: {},
828 High: {},
829 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500830
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500831 FontSlant: {
832 Upright: {},
833 Italic: {},
834 Oblique: {},
835 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400836
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500837 FontHinting: {
838 None: {},
839 Slight: {},
840 Normal: {},
841 Full: {},
842 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500843
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500844 FontWeight: {
845 Invisible: {},
846 Thin: {},
847 ExtraLight: {},
848 Light: {},
849 Normal: {},
850 Medium: {},
851 SemiBold: {},
852 Bold: {},
853 ExtraBold: {},
854 Black: {},
855 ExtraBlack: {},
856 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400857
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500858 FontWidth: {
859 UltraCondensed: {},
860 ExtraCondensed: {},
861 Condensed: {},
862 SemiCondensed: {},
863 Normal: {},
864 SemiExpanded: {},
865 Expanded: {},
866 ExtraExpanded: {},
867 UltraExpanded: {},
868 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400869
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500870 ImageFormat: {
871 PNG: {},
872 JPEG: {},
873 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300874
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500875 PaintStyle: {
876 Fill: {},
877 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500878 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500879
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500880 PathOp: {
881 Difference: {},
882 Intersect: {},
883 Union: {},
884 XOR: {},
885 ReverseDifference: {},
886 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500887
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500888 PointMode: {
889 Points: {},
890 Lines: {},
891 Polygon: {},
892 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500893
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500894 RectHeightStyle: {
895 Tight: {},
896 Max: {},
897 IncludeLineSpacingMiddle: {},
898 IncludeLineSpacingTop: {},
899 IncludeLineSpacingBottom: {},
900 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400901
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500902 RectWidthStyle: {
903 Tight: {},
904 Max: {},
905 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400906
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500907 StrokeCap: {
908 Butt: {},
909 Round: {},
910 Square: {},
911 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500912
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500913 StrokeJoin: {
914 Miter: {},
915 Round: {},
916 Bevel: {},
917 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500918
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500919 TextAlign: {
920 Left: {},
921 Right: {},
922 Center: {},
923 Justify: {},
924 Start: {},
925 End: {},
926 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400927
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500928 TextDirection: {
929 LTR: {},
930 RTL: {},
931 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400932
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700933 DecorationStyle: {
934 Solid: {},
935 Double: {},
936 Dotted: {},
937 Dashed: {},
938 Wavy: {},
939 },
940
941 PlaceholderAlignment: {
942 Baseline: {},
943 AboveBaseline: {},
944 BelowBaseline: {},
945 Top: {},
946 Bottom: {},
947 Middle: {},
948 },
949
950 TextBaseline: {
951 Alphabetic: {},
952 Ideographic: {},
953 },
954
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500955 TileMode: {
956 Clamp: {},
957 Repeat: {},
958 Mirror: {},
959 Decal: {},
960 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500961
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500962 VertexMode: {
963 Triangles: {},
964 TrianglesStrip: {},
965 TriangleFan: {},
966 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500967
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500968 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400969
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500970 /**
971 * @type {Float32Array}
972 */
973 HEAPF32: {},
974 /**
975 * @type {Float64Array}
976 */
977 HEAPF64: {},
978 /**
979 * @type {Uint8Array}
980 */
981 HEAPU8: {},
982 /**
983 * @type {Uint16Array}
984 */
985 HEAPU16: {},
986 /**
987 * @type {Uint32Array}
988 */
989 HEAPU32: {},
990 /**
991 * @type {Int8Array}
992 */
993 HEAP8: {},
994 /**
995 * @type {Int16Array}
996 */
997 HEAP16: {},
998 /**
999 * @type {Int32Array}
1000 */
1001 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -04001002
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001003 _malloc: function() {},
1004 _free: function() {},
1005 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -04001006};
Kevin Lubick217056c2018-09-20 17:39:31 -04001007
Kevin Lubick006a6f32018-10-19 14:34:34 -04001008// Public API things that are newly declared in the JS should go here.
1009// It's not enough to declare them above, because closure can still erase them
1010// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -04001011CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -07001012CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -04001013
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001014CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -04001015
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001016CanvasKit.Surface.prototype.dispose = function() {};
1017CanvasKit.Surface.prototype.flush = function() {};
1018CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1019CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001020
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001021CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001022
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001023CanvasKit.RSXFormBuilder.prototype.build = function() {};
1024CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1025CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001026CanvasKit.RSXFormBuilder.prototype.set = function() {};
1027
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001028CanvasKit.ColorBuilder.prototype.build = function() {};
1029CanvasKit.ColorBuilder.prototype.delete = function() {};
1030CanvasKit.ColorBuilder.prototype.push = function() {};
1031CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001032
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001033CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1034CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001035
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001036CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1037CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001038
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001039// Define StrokeOpts object
1040var StrokeOpts = {};
1041StrokeOpts.prototype.width;
1042StrokeOpts.prototype.miter_limit;
1043StrokeOpts.prototype.cap;
1044StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001045StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001046
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001047// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001048var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001049HTMLCanvas.prototype.decodeImage = function() {};
1050HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001051HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001052HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001053HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001054HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001055
Elliot Evans28796192020-06-15 12:53:27 -06001056var ImageBitmapRenderingContext = {};
1057ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1058
Kevin Lubickb9db3902018-11-26 11:47:54 -05001059var CanvasRenderingContext2D = {};
1060CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1061CanvasRenderingContext2D.prototype.arc = function() {};
1062CanvasRenderingContext2D.prototype.arcTo = function() {};
1063CanvasRenderingContext2D.prototype.beginPath = function() {};
1064CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1065CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001066CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001067CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001068CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001069CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001070CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001071CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001072CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001073CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001074CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001075CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001076CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001077CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001078CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001079CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001080CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001081CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1082CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001083CanvasRenderingContext2D.prototype.lineTo = function() {};
1084CanvasRenderingContext2D.prototype.measureText = function() {};
1085CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001086CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001087CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1088CanvasRenderingContext2D.prototype.rect = function() {};
1089CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1090CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001091CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001092CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001093CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001094CanvasRenderingContext2D.prototype.scale = function() {};
1095CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001096CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001097CanvasRenderingContext2D.prototype.setTransform = function() {};
1098CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001099CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001100CanvasRenderingContext2D.prototype.strokeText = function() {};
1101CanvasRenderingContext2D.prototype.transform = function() {};
1102CanvasRenderingContext2D.prototype.translate = function() {};
1103
Kevin Lubicka40f8322018-12-17 16:01:36 -05001104var Path2D = {};
1105Path2D.prototype.addPath = function() {};
1106Path2D.prototype.arc = function() {};
1107Path2D.prototype.arcTo = function() {};
1108Path2D.prototype.bezierCurveTo = function() {};
1109Path2D.prototype.closePath = function() {};
1110Path2D.prototype.ellipse = function() {};
1111Path2D.prototype.lineTo = function() {};
1112Path2D.prototype.moveTo = function() {};
1113Path2D.prototype.quadraticCurveTo = function() {};
1114Path2D.prototype.rect = function() {};
1115
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001116var LinearCanvasGradient = {};
1117LinearCanvasGradient.prototype.addColorStop = function() {};
1118var RadialCanvasGradient = {};
1119RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001120var CanvasPattern = {};
1121CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001122
Kevin Lubick52b9f372018-12-04 13:57:36 -05001123var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001124 /**
1125 * @type {Uint8ClampedArray}
1126 */
1127 data: {},
1128 height: {},
1129 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001130};
1131
Kevin Lubickd29edd72018-12-07 08:29:52 -05001132var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001133 a: {},
1134 b: {},
1135 c: {},
1136 d: {},
1137 e: {},
1138 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001139};
1140
Kevin Lubick217056c2018-09-20 17:39:31 -04001141// 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 -05001142function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001143
1144// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1145// to override it in the puppeteer tests
1146var LibraryEGL = {
1147 contextAttributes: {
1148 majorVersion: {}
1149 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001150}