blob: c6dc9c2474c01215301206e587a78560fd1f8fdd [file] [log] [blame]
Kevin Lubick217056c2018-09-20 17:39:31 -04001/*
2 * This externs file prevents the Closure JS compiler from minifying away
3 * names of objects created by Emscripten.
4 * Basically, by defining empty objects and functions here, Closure will
5 * know not to rename them. This is needed because of our pre-js files,
6 * that is, the JS we hand-write to bundle into the output. That JS will be
7 * hit by the closure compiler and thus needs to know about what functions
8 * have special names and should not be minified.
9 *
10 * Emscripten does not support automatically generating an externs file, so we
11 * do it by hand. The general process is to write some JS code, and then put any
12 * calls to CanvasKit or related things in here. Running ./compile.sh and then
13 * looking at the minified results or running the Release trybot should
14 * verify nothing was missed. Optionally, looking directly at the minified
15 * pathkit.js can be useful when developing locally.
16 *
17 * Docs:
18 * https://github.com/cljsjs/packages/wiki/Creating-Externs
19 * https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System
20 *
21 * Example externs:
22 * https://github.com/google/closure-compiler/tree/master/externs
23 */
24
25var CanvasKit = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050026 // public API (i.e. things we declare in the pre-js file or in the cpp bindings)
27 Color: function() {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -040028 Color4f: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -040029 ColorAsInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050030 LTRBRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050031 XYWHRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -040032 LTRBiRect: function() {},
33 XYWHiRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050034 RRectXY: function() {},
35 /** @return {ImageData} */
36 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050037
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050038 GetWebGLContext: function() {},
39 MakeBlurMaskFilter: function() {},
40 MakeCanvas: function() {},
41 MakeCanvasSurface: function() {},
42 MakeGrContext: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040043 /** @return {CanvasKit.AnimatedImage} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050044 MakeAnimatedImageFromEncoded: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040045 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050046 MakeImage: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040047 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050048 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060049 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050050 MakeOnScreenGLSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050051 MakeRenderTarget: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040052 MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050053 MakeSWCanvasSurface: function() {},
54 MakeManagedAnimation: function() {},
55 MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040056 MakeVertices: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050057 MakeSurface: function() {},
Kevin Lubicka8f4c912020-11-04 07:23:37 -050058 MakeRasterDirectSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050059 MakeWebGLCanvasSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 Malloc: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -040061 MallocGlyphIDs: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040062 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050063 computeTonalColors: function() {},
64 currentContext: function() {},
Kevin Lubickf7fdf1a2020-12-10 15:21:01 -050065 deleteContext: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050066 getColorComponents: function() {},
67 getDecodeCacheLimitBytes: function() {},
68 getDecodeCacheUsageBytes: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040069 getDataBytes: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050070 multiplyByAlpha: function() {},
71 parseColorString: function() {},
72 setCurrentContext: function() {},
73 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040074
Kevin Lubicke70af512020-05-14 14:50:54 -040075 // Defined by emscripten.
Kevin Lubickf7fdf1a2020-12-10 15:21:01 -050076 createContext: function() {},
Kevin Lubicke70af512020-05-14 14:50:54 -040077
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050078 // private API (i.e. things declared in the bindings that we use
79 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040080 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050081 _MakeImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050082 _MakeManagedAnimation: function() {},
83 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040084 _MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050085 _decodeAnimatedImage: function() {},
86 _decodeImage: function() {},
87 _drawShapedText: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040088
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050089 // The testing object is meant to expose internal functions
90 // for more fine-grained testing, e.g. parseColor
91 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050092
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050093 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -040094
Kevin Lubickf8823b52020-09-03 10:02:10 -040095 Animation: {
96 prototype: {
97 render: function() {},
98 },
99 _render: function() {},
100 },
101
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500102 GrContext: {
103 // public API (from C++ bindings)
104 getResourceCacheLimitBytes: function() {},
105 getResourceCacheUsageBytes: function() {},
106 releaseResourcesAndAbandonContext: function() {},
107 setResourceCacheLimitBytes: function() {},
108 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400109
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400110 ManagedAnimation: {
111 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400112 render: function() {},
113 seek: function() {},
114 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400115 setColor: function() {},
116 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400117 _render: function() {},
118 _seek: function() {},
119 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400120 },
121
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500122 Paragraph: {
123 // public API (from C++ bindings)
124 didExceedMaxLines: function() {},
125 getAlphabeticBaseline: function() {},
126 getGlyphPositionAtCoordinate: function() {},
127 getHeight: function() {},
128 getIdeographicBaseline: function() {},
Kevin Lubicke677f4a2020-11-04 09:46:22 -0500129 getLineMetrics: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500130 getLongestLine: function() {},
131 getMaxIntrinsicWidth: function() {},
132 getMaxWidth: function() {},
133 getMinIntrinsicWidth: function() {},
134 getWordBoundary: function() {},
135 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400136
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500137 // private API
138 /** @return {Float32Array} */
139 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700140 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500141 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400142
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400143 ParagraphBuilder: {
144 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700145 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400146 addText: function() {},
147 build: function() {},
148 pop: function() {},
149
150 prototype: {
151 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400152 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700153 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400154 },
155
156 // private API
157 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700158 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400159 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400160 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700161 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400162 },
163
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400164 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500165 // public API (from C++ bindings)
166 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500167
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500168 // private API
169 _makeShader: function() {},
170 _makeShaderWithChildren: function() {},
171 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500172
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500173 ParagraphStyle: function() {},
174 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400175 ColorBuilder: function() {},
176 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400177
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500178 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400179 prototype: {
180 getBounds: function() {},
181 },
182 // private API (from C++ bindings)
183 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500184 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500185
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400186 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500187 // public API (from C++ bindings)
188 decodeNextFrame: function() {},
189 getFrameCount: function() {},
190 getRepetitionCount: function() {},
191 height: function() {},
192 reset: function() {},
193 width: function() {},
194 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400195
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400196 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500197 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500198 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500199 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400200 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500201 drawImage: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400202 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500204 drawPaint: function() {},
205 drawParagraph: function() {},
206 drawPath: function() {},
207 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400208 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500209 drawText: function() {},
210 drawTextBlob: function() {},
211 drawVertices: function() {},
212 flush: function() {},
213 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500214 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400215 markCTM: function() {},
216 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500217 restore: function() {},
218 restoreToCount: function() {},
219 rotate: function() {},
220 save: function() {},
Kevin Lubick9fe83912020-11-03 17:08:34 -0500221 saveLayerPaint: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500222 scale: function() {},
223 skew: function() {},
224 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400225
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400226 prototype: {
227 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000228 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400229 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000230 concat44: function() {}, // deprecated
231 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() {},
239 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000240 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400241 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000242 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400243 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000244 drawText: function() {},
245 findMarkedCTM: function() {},
246 getLocalToDevice: function() {},
247 getTotalMatrix: function() {},
248 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400249 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000250 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400251 },
252
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500253 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400254 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000255 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400256 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400257 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400258 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500259 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400260 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000261 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400262 _drawImageNine: function() {},
263 _drawImageRect: function() {},
264 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500265 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400266 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000267 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400268 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500269 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000270 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000271 _getLocalToDevice: function() {},
272 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500273 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400274 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500275 _writePixels: function() {},
276 delete: function() {},
277 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400278
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400279 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500280 // public API (from C++ bindings and JS interface)
281 MakeBlend: function() {},
282 MakeCompose: function() {},
283 MakeLerp: function() {},
284 MakeLinearToSRGBGamma: function() {},
285 MakeMatrix: function() {},
286 MakeSRGBToLinearGamma: function() {},
287 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400288 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500289 _makeMatrix: function() {},
290 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400291
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400292 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500293 concat: function() {},
294 identity: function() {},
295 postTranslate: function() {},
296 rotated: function() {},
297 scaled: function() {},
298 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400299
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400300 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400301 Equals: function() {},
302 SRGB: {},
303 DISPLAY_P3: {},
304 ADOBE_RGB: {},
305 // private API (from C++ bindings)
306 _MakeSRGB: function() {},
307 _MakeDisplayP3: function() {},
308 _MakeAdobeRGB: function() {},
309 },
310
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400311 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500312 next: function() {},
313 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500314
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400315 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500316 getPosTan: function() {},
317 getSegment: function() {},
318 isClosed: function() {},
319 length: function() {},
320 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500321
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400322 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500323 // public API (from C++ bindings)
324 getScaleX: function() {},
325 getSize: function() {},
326 getSkewX: function() {},
327 getTypeface: function() {},
328 measureText: function() {},
329 setHinting: function() {},
330 setLinearMetrics: function() {},
331 setScaleX: function() {},
332 setSize: function() {},
333 setSkewX: function() {},
334 setSubpixel: function() {},
335 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400336
337 prototype: {
338 getGlyphBounds: function() {},
339 getGlyphIDs: function() {},
340 getGlyphWidths: function() {},
341 getWidths: function() {},
342 },
343
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500344 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400345 _getGlyphIDs: function() {},
346 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500347 _getWidths: function() {},
348 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500349
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400350 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500351 // public API (from C++ and JS bindings)
352 FromData: function() {},
353 RefDefault: function() {},
354 countFamilies: function() {},
355 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500356
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500357 // private API
358 _makeTypefaceFromData: function() {},
359 _fromData: function() {},
360 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500361
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700362 TypefaceFontProvider: {
363 // public API (from C++ and JS bindings)
364 Make: function() {},
365 registerFont: function() {},
366
367 // private API
368 _registerFont: function() {},
369 },
370
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400371 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500372 // public API (from C++ bindings)
Kevin Lubickae0d3ff2020-11-18 11:23:15 -0500373 getColorSpace: function() {},
374 getImageInfo: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500375 makeCopyWithDefaultMipmaps: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500376 height: function() {},
377 width: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500378
379 prototype: {
380 encodeToData: function() {},
381 makeShaderCubic: function() {},
382 makeShaderOptions: function() {},
383 },
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500384 // private API
385 _encodeToData: function() {},
386 _encodeToDataWithFormat: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500387 _makeShaderCubic: function() {},
388 _makeShaderOptions: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500389 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400390
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400391 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500392 MakeBlur: function() {},
393 MakeColorFilter: function() {},
394 MakeCompose: function() {},
395 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400396
397 // private API
398 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500399 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400400
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500401 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400402 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500403 identity: function() {},
404 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400405 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500406 multiply: function() {},
407 rotatedUnitSinCos: function() {},
408 rotated: function() {},
409 scaled: function() {},
410 translated: function() {},
411 lookat: function() {},
412 perspective: function() {},
413 rc: function() {},
414 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400415 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500416 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500417
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400418 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500419 identity: function() {},
420 invert: function() {},
421 mapPoints: function() {},
422 multiply: function() {},
423 rotated: function() {},
424 scaled: function() {},
425 skewed: function() {},
426 translated: function() {},
427 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500428
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400429 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500430 MakeBlur: function() {},
431 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400432
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400433 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500434 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400435 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500436 copy: function() {},
437 getBlendMode: function() {},
438 getColor: function() {},
439 getFilterQuality: function() {},
440 getStrokeCap: function() {},
441 getStrokeJoin: function() {},
442 getStrokeMiter: function() {},
443 getStrokeWidth: function() {},
444 setAntiAlias: function() {},
445 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400446 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500447 setFilterQuality: function() {},
448 setImageFilter: function() {},
449 setMaskFilter: function() {},
450 setPathEffect: function() {},
451 setShader: function() {},
452 setStrokeCap: function() {},
453 setStrokeJoin: function() {},
454 setStrokeMiter: function() {},
455 setStrokeWidth: function() {},
456 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500457
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400458 prototype: {
459 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400460 setColorComponents: function() {},
461 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400462 },
463
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500464 // Private API
465 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400466 _getColor: function() {},
467 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500468 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500469
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400470 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400471 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500472 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400473 MakeDiscrete: function() {},
474
475 // Private C++ API
476 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500477 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500478
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400479 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500480 // public API (from C++ bindings)
481 draw: function() {},
482 getEffectUniform: function() {},
483 getEffectUniformCount: function() {},
484 getEffectUniformFloatCount: function() {},
485 getEffectUniformName: function() {},
486 getParticleUniformCount: function() {},
487 getParticleUniformFloatCount: function() {},
488 getParticleUniformName: function() {},
489 getParticleUniform: function() {},
490 setPosition: function() {},
491 setRate: function() {},
492 start: function() {},
493 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500494
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500495 // private API (from C++ bindings)
496 _effectUniformPtr: function() {},
497 _particleUniformPtr: function() {},
498 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500499
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400500 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400501 // public API (from C++ and JS bindings)
502 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400503 MakeFromSVGString: function() {},
504 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400505 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500506 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400507 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500508 copy: function() {},
509 countPoints: function() {},
510 equals: function() {},
511 getBounds: function() {},
512 getFillType: function() {},
513 getPoint: function() {},
514 isEmpty: function() {},
515 isVolatile: function() {},
516 reset: function() {},
517 rewind: function() {},
518 setFillType: function() {},
519 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400520 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500521 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400522
Kevin Lubickf8823b52020-09-03 10:02:10 -0400523 prototype: {
524 addArc: function() {},
525 addOval: function() {},
526 addPath: function() {},
527 addPoly: function() {},
528 addRect: function() {},
529 addRRect: function() {},
530 addVerbsPointsWeights: function() {},
531 arc: function() {},
532 arcToOval: function() {},
533 arcToRotated: function() {},
534 arcToTangent: function() {},
535 close: function() {},
536 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400537 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400538 cubicTo: function() {},
539 dash: function() {},
540 lineTo: function() {},
541 moveTo: function() {},
542 offset: function() {},
543 op: function() {},
544 quadTo: function() {},
545 rArcTo: function() {},
546 rConicTo: function() {},
547 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400548 rLineTo: function() {},
549 rMoveTo: function() {},
550 rQuadTo: function() {},
551 simplify: function() {},
552 stroke: function() {},
553 transform: function() {},
554 trim: function() {},
555 },
556
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500557 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400558 _MakeFromCmds: function() {},
559 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500560 _addArc: function() {},
561 _addOval: function() {},
562 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000563 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400564 _addRect: function() {},
565 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400566 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400567 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000568 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400569 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500570 _close: function() {},
571 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400572 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500573 _cubicTo: function() {},
574 _dash: function() {},
575 _lineTo: function() {},
576 _moveTo: function() {},
577 _op: function() {},
578 _quadTo: function() {},
579 _rArcTo: function() {},
580 _rConicTo: function() {},
581 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400582 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500583 _rLineTo: function() {},
584 _rMoveTo: function() {},
585 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500586 _simplify: function() {},
587 _stroke: function() {},
588 _transform: function() {},
589 _trim: function() {},
590 delete: function() {},
591 dump: function() {},
592 dumpHex: function() {},
593 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400594
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400595 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500596 getLength: function() {},
597 getSegment: function() {},
598 getPosTan: function() {},
599 isClosed: function() {},
600 nextContour: function() {},
601 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400602
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400603 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 serialize: function() {},
605 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400606
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400607 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500608 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400609 prototype: {
610 beginRecording: function() {},
611 },
612 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500613 },
Kevin Lubick62836902019-12-09 09:04:26 -0500614
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400615 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400616 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500617 Blend: function() {},
618 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500619 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400620 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400621 MakeBlend: function() {},
622 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400623 MakeFractalNoise: function() {},
624 MakeImprovedNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400625 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400626 MakeLinearGradient: function() {},
627 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700628 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400629 MakeTurbulence: function() {},
630 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400631
632 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400633 _MakeColor: function() {},
634 _MakeLinearGradient: function() {},
635 _MakeRadialGradient: function() {},
636 _MakeSweepGradient: function() {},
637 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500638 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400639
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400640 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500641 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400642 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500643 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400644 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400645
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500646 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600647 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400648 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500649 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400650 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400651
Kevin Lubickf8823b52020-09-03 10:02:10 -0400652 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400653 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400654 makeImageSnapshot: function() {},
655 },
656
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500657 // private API
658 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400659 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500660 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 delete: function() {},
662 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500663
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400664 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500665 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400666 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500667 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400668 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500669 MakeFromText: function() {},
670 MakeOnPath: function() {},
671 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400672 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500673 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400674 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500675 _MakeFromText: function() {},
676 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500677
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500678 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400679 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500680 add: function() {},
681 sub: function() {},
682 dot: function() {},
683 cross: function() {},
684 normalize: function() {},
685 mulScalar: function() {},
686 length: function() {},
687 lengthSquared: function() {},
688 dist: function() {},
689 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400690
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400691 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500693 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400694
695 prototype: {
696 bounds: function() {},
697 },
698 // private API (from C++ bindings)
699
700 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500701 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400702
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400703 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 colors: function() {},
705 detach: function() {},
706 indices: function() {},
707 positions: function() {},
708 texCoords: function() {},
709 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400710
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400712
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 // Constants and Enums
714 gpu: {},
715 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400716
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500717 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400718 BLACK: {},
719 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500720 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400721 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500722 BLUE: {},
723 YELLOW: {},
724 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400725 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500726
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500727 MOVE_VERB: {},
728 LINE_VERB: {},
729 QUAD_VERB: {},
730 CONIC_VERB: {},
731 CUBIC_VERB: {},
732 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500733
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500734 NoDecoration: {},
735 UnderlineDecoration: {},
736 OverlineDecoration: {},
737 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400738
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500739 SaveLayerInitWithPrevious: {},
740 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400741
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500742 Affinity: {
743 Upstream: {},
744 Downstream: {},
745 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400746
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500747 AlphaType: {
748 Opaque: {},
749 Premul: {},
750 Unpremul: {},
751 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500752
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500753 BlendMode: {
754 Clear: {},
755 Src: {},
756 Dst: {},
757 SrcOver: {},
758 DstOver: {},
759 SrcIn: {},
760 DstIn: {},
761 SrcOut: {},
762 DstOut: {},
763 SrcATop: {},
764 DstATop: {},
765 Xor: {},
766 Plus: {},
767 Modulate: {},
768 Screen: {},
769 Overlay: {},
770 Darken: {},
771 Lighten: {},
772 ColorDodge: {},
773 ColorBurn: {},
774 HardLight: {},
775 SoftLight: {},
776 Difference: {},
777 Exclusion: {},
778 Multiply: {},
779 Hue: {},
780 Saturation: {},
781 Color: {},
782 Luminosity: {},
783 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500784
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500785 BlurStyle: {
786 Normal: {},
787 Solid: {},
788 Outer: {},
789 Inner: {},
790 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500791
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500792 ClipOp: {
793 Difference: {},
794 Intersect: {},
795 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500796
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500797 ColorType: {
798 Alpha_8: {},
799 RGB_565: {},
800 ARGB_4444: {},
801 RGBA_8888: {},
802 RGB_888x: {},
803 BGRA_8888: {},
804 RGBA_1010102: {},
805 RGB_101010x: {},
806 Gray_8: {},
807 RGBA_F16: {},
808 RGBA_F32: {},
809 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500810
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500811 FillType: {
812 Winding: {},
813 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500814 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400815
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500816 FilterQuality: {
817 None: {},
818 Low: {},
819 Medium: {},
820 High: {},
821 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500822
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500823 FontSlant: {
824 Upright: {},
825 Italic: {},
826 Oblique: {},
827 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400828
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500829 FontHinting: {
830 None: {},
831 Slight: {},
832 Normal: {},
833 Full: {},
834 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500835
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500836 FontWeight: {
837 Invisible: {},
838 Thin: {},
839 ExtraLight: {},
840 Light: {},
841 Normal: {},
842 Medium: {},
843 SemiBold: {},
844 Bold: {},
845 ExtraBold: {},
846 Black: {},
847 ExtraBlack: {},
848 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400849
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500850 FontWidth: {
851 UltraCondensed: {},
852 ExtraCondensed: {},
853 Condensed: {},
854 SemiCondensed: {},
855 Normal: {},
856 SemiExpanded: {},
857 Expanded: {},
858 ExtraExpanded: {},
859 UltraExpanded: {},
860 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400861
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500862 ImageFormat: {
863 PNG: {},
864 JPEG: {},
865 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300866
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500867 PaintStyle: {
868 Fill: {},
869 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500870 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500871
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500872 PathOp: {
873 Difference: {},
874 Intersect: {},
875 Union: {},
876 XOR: {},
877 ReverseDifference: {},
878 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500879
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500880 PointMode: {
881 Points: {},
882 Lines: {},
883 Polygon: {},
884 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500885
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500886 RectHeightStyle: {
887 Tight: {},
888 Max: {},
889 IncludeLineSpacingMiddle: {},
890 IncludeLineSpacingTop: {},
891 IncludeLineSpacingBottom: {},
892 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400893
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500894 RectWidthStyle: {
895 Tight: {},
896 Max: {},
897 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400898
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500899 StrokeCap: {
900 Butt: {},
901 Round: {},
902 Square: {},
903 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500904
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500905 StrokeJoin: {
906 Miter: {},
907 Round: {},
908 Bevel: {},
909 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500910
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500911 TextAlign: {
912 Left: {},
913 Right: {},
914 Center: {},
915 Justify: {},
916 Start: {},
917 End: {},
918 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400919
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500920 TextDirection: {
921 LTR: {},
922 RTL: {},
923 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400924
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700925 DecorationStyle: {
926 Solid: {},
927 Double: {},
928 Dotted: {},
929 Dashed: {},
930 Wavy: {},
931 },
932
933 PlaceholderAlignment: {
934 Baseline: {},
935 AboveBaseline: {},
936 BelowBaseline: {},
937 Top: {},
938 Bottom: {},
939 Middle: {},
940 },
941
942 TextBaseline: {
943 Alphabetic: {},
944 Ideographic: {},
945 },
946
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500947 TileMode: {
948 Clamp: {},
949 Repeat: {},
950 Mirror: {},
951 Decal: {},
952 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500953
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500954 VertexMode: {
955 Triangles: {},
956 TrianglesStrip: {},
957 TriangleFan: {},
958 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500959
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500960 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400961
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500962 /**
963 * @type {Float32Array}
964 */
965 HEAPF32: {},
966 /**
967 * @type {Float64Array}
968 */
969 HEAPF64: {},
970 /**
971 * @type {Uint8Array}
972 */
973 HEAPU8: {},
974 /**
975 * @type {Uint16Array}
976 */
977 HEAPU16: {},
978 /**
979 * @type {Uint32Array}
980 */
981 HEAPU32: {},
982 /**
983 * @type {Int8Array}
984 */
985 HEAP8: {},
986 /**
987 * @type {Int16Array}
988 */
989 HEAP16: {},
990 /**
991 * @type {Int32Array}
992 */
993 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400994
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500995 _malloc: function() {},
996 _free: function() {},
997 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400998};
Kevin Lubick217056c2018-09-20 17:39:31 -0400999
Kevin Lubick006a6f32018-10-19 14:34:34 -04001000// Public API things that are newly declared in the JS should go here.
1001// It's not enough to declare them above, because closure can still erase them
1002// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -04001003CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -07001004CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -04001005
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001006CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -04001007
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001008CanvasKit.Surface.prototype.dispose = function() {};
1009CanvasKit.Surface.prototype.flush = function() {};
1010CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1011CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001012
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001013CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001014
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001015CanvasKit.RSXFormBuilder.prototype.build = function() {};
1016CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1017CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001018CanvasKit.RSXFormBuilder.prototype.set = function() {};
1019
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001020CanvasKit.ColorBuilder.prototype.build = function() {};
1021CanvasKit.ColorBuilder.prototype.delete = function() {};
1022CanvasKit.ColorBuilder.prototype.push = function() {};
1023CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001024
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001025CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1026CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001027
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001028CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1029CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001030
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001031// Define StrokeOpts object
1032var StrokeOpts = {};
1033StrokeOpts.prototype.width;
1034StrokeOpts.prototype.miter_limit;
1035StrokeOpts.prototype.cap;
1036StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001037StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001038
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001039// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001040var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001041HTMLCanvas.prototype.decodeImage = function() {};
1042HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001043HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001044HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001045HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001046HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001047
Elliot Evans28796192020-06-15 12:53:27 -06001048var ImageBitmapRenderingContext = {};
1049ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1050
Kevin Lubickb9db3902018-11-26 11:47:54 -05001051var CanvasRenderingContext2D = {};
1052CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1053CanvasRenderingContext2D.prototype.arc = function() {};
1054CanvasRenderingContext2D.prototype.arcTo = function() {};
1055CanvasRenderingContext2D.prototype.beginPath = function() {};
1056CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1057CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001058CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001059CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001060CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001061CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001062CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001063CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001064CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001065CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001066CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001067CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001068CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001069CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001070CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001071CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001072CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001073CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1074CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001075CanvasRenderingContext2D.prototype.lineTo = function() {};
1076CanvasRenderingContext2D.prototype.measureText = function() {};
1077CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001078CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001079CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1080CanvasRenderingContext2D.prototype.rect = function() {};
1081CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1082CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001083CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001084CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001085CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001086CanvasRenderingContext2D.prototype.scale = function() {};
1087CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001088CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001089CanvasRenderingContext2D.prototype.setTransform = function() {};
1090CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001091CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001092CanvasRenderingContext2D.prototype.strokeText = function() {};
1093CanvasRenderingContext2D.prototype.transform = function() {};
1094CanvasRenderingContext2D.prototype.translate = function() {};
1095
Kevin Lubicka40f8322018-12-17 16:01:36 -05001096var Path2D = {};
1097Path2D.prototype.addPath = function() {};
1098Path2D.prototype.arc = function() {};
1099Path2D.prototype.arcTo = function() {};
1100Path2D.prototype.bezierCurveTo = function() {};
1101Path2D.prototype.closePath = function() {};
1102Path2D.prototype.ellipse = function() {};
1103Path2D.prototype.lineTo = function() {};
1104Path2D.prototype.moveTo = function() {};
1105Path2D.prototype.quadraticCurveTo = function() {};
1106Path2D.prototype.rect = function() {};
1107
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001108var LinearCanvasGradient = {};
1109LinearCanvasGradient.prototype.addColorStop = function() {};
1110var RadialCanvasGradient = {};
1111RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001112var CanvasPattern = {};
1113CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001114
Kevin Lubick52b9f372018-12-04 13:57:36 -05001115var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001116 /**
1117 * @type {Uint8ClampedArray}
1118 */
1119 data: {},
1120 height: {},
1121 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001122};
1123
Kevin Lubickd29edd72018-12-07 08:29:52 -05001124var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001125 a: {},
1126 b: {},
1127 c: {},
1128 d: {},
1129 e: {},
1130 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001131};
1132
Kevin Lubick217056c2018-09-20 17:39:31 -04001133// 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 -05001134function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001135
1136// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1137// to override it in the puppeteer tests
1138var LibraryEGL = {
1139 contextAttributes: {
1140 majorVersion: {}
1141 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001142}