blob: d6f794f264755e078fb3bd4a4746c1ba4d287e3e [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500375 height: function() {},
376 width: function() {},
377 // private API
378 _encodeToData: function() {},
379 _encodeToDataWithFormat: function() {},
380 _makeShader: function() {},
381 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400382
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400383 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500384 MakeBlur: function() {},
385 MakeColorFilter: function() {},
386 MakeCompose: function() {},
387 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400388
389 // private API
390 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500391 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400392
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500393 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400394 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500395 identity: function() {},
396 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400397 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500398 multiply: function() {},
399 rotatedUnitSinCos: function() {},
400 rotated: function() {},
401 scaled: function() {},
402 translated: function() {},
403 lookat: function() {},
404 perspective: function() {},
405 rc: function() {},
406 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400407 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500408 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500409
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400410 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500411 identity: function() {},
412 invert: function() {},
413 mapPoints: function() {},
414 multiply: function() {},
415 rotated: function() {},
416 scaled: function() {},
417 skewed: function() {},
418 translated: function() {},
419 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500420
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400421 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500422 MakeBlur: function() {},
423 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400424
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400425 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500426 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400427 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500428 copy: function() {},
429 getBlendMode: function() {},
430 getColor: function() {},
431 getFilterQuality: function() {},
432 getStrokeCap: function() {},
433 getStrokeJoin: function() {},
434 getStrokeMiter: function() {},
435 getStrokeWidth: function() {},
436 setAntiAlias: function() {},
437 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400438 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500439 setFilterQuality: function() {},
440 setImageFilter: function() {},
441 setMaskFilter: function() {},
442 setPathEffect: function() {},
443 setShader: function() {},
444 setStrokeCap: function() {},
445 setStrokeJoin: function() {},
446 setStrokeMiter: function() {},
447 setStrokeWidth: function() {},
448 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500449
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400450 prototype: {
451 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400452 setColorComponents: function() {},
453 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400454 },
455
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500456 // Private API
457 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400458 _getColor: function() {},
459 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500460 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500461
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400462 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400463 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500464 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400465 MakeDiscrete: function() {},
466
467 // Private C++ API
468 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500469 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500470
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400471 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500472 // public API (from C++ bindings)
473 draw: function() {},
474 getEffectUniform: function() {},
475 getEffectUniformCount: function() {},
476 getEffectUniformFloatCount: function() {},
477 getEffectUniformName: function() {},
478 getParticleUniformCount: function() {},
479 getParticleUniformFloatCount: function() {},
480 getParticleUniformName: function() {},
481 getParticleUniform: function() {},
482 setPosition: function() {},
483 setRate: function() {},
484 start: function() {},
485 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500486
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500487 // private API (from C++ bindings)
488 _effectUniformPtr: function() {},
489 _particleUniformPtr: function() {},
490 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500491
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400492 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400493 // public API (from C++ and JS bindings)
494 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400495 MakeFromSVGString: function() {},
496 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400497 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500498 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400499 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500500 copy: function() {},
501 countPoints: function() {},
502 equals: function() {},
503 getBounds: function() {},
504 getFillType: function() {},
505 getPoint: function() {},
506 isEmpty: function() {},
507 isVolatile: function() {},
508 reset: function() {},
509 rewind: function() {},
510 setFillType: function() {},
511 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400512 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500513 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400514
Kevin Lubickf8823b52020-09-03 10:02:10 -0400515 prototype: {
516 addArc: function() {},
517 addOval: function() {},
518 addPath: function() {},
519 addPoly: function() {},
520 addRect: function() {},
521 addRRect: function() {},
522 addVerbsPointsWeights: function() {},
523 arc: function() {},
524 arcToOval: function() {},
525 arcToRotated: function() {},
526 arcToTangent: function() {},
527 close: function() {},
528 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400529 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400530 cubicTo: function() {},
531 dash: function() {},
532 lineTo: function() {},
533 moveTo: function() {},
534 offset: function() {},
535 op: function() {},
536 quadTo: function() {},
537 rArcTo: function() {},
538 rConicTo: function() {},
539 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400540 rLineTo: function() {},
541 rMoveTo: function() {},
542 rQuadTo: function() {},
543 simplify: function() {},
544 stroke: function() {},
545 transform: function() {},
546 trim: function() {},
547 },
548
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500549 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400550 _MakeFromCmds: function() {},
551 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500552 _addArc: function() {},
553 _addOval: function() {},
554 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000555 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400556 _addRect: function() {},
557 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400558 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400559 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000560 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400561 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500562 _close: function() {},
563 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400564 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500565 _cubicTo: function() {},
566 _dash: function() {},
567 _lineTo: function() {},
568 _moveTo: function() {},
569 _op: function() {},
570 _quadTo: function() {},
571 _rArcTo: function() {},
572 _rConicTo: function() {},
573 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400574 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500575 _rLineTo: function() {},
576 _rMoveTo: function() {},
577 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500578 _simplify: function() {},
579 _stroke: function() {},
580 _transform: function() {},
581 _trim: function() {},
582 delete: function() {},
583 dump: function() {},
584 dumpHex: function() {},
585 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400586
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400587 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500588 getLength: function() {},
589 getSegment: function() {},
590 getPosTan: function() {},
591 isClosed: function() {},
592 nextContour: function() {},
593 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400594
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400595 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500596 serialize: function() {},
597 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400598
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400599 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500600 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400601 prototype: {
602 beginRecording: function() {},
603 },
604 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500605 },
Kevin Lubick62836902019-12-09 09:04:26 -0500606
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400607 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400608 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500609 Blend: function() {},
610 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500611 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400612 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400613 MakeBlend: function() {},
614 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400615 MakeFractalNoise: function() {},
616 MakeImprovedNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400617 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400618 MakeLinearGradient: function() {},
619 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700620 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400621 MakeTurbulence: function() {},
622 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400623
624 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400625 _MakeColor: function() {},
626 _MakeLinearGradient: function() {},
627 _MakeRadialGradient: function() {},
628 _MakeSweepGradient: function() {},
629 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400631
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400632 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400634 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500635 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400636 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400637
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500638 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600639 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400640 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500641 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400642 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400643
Kevin Lubickf8823b52020-09-03 10:02:10 -0400644 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400645 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400646 makeImageSnapshot: function() {},
647 },
648
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500649 // private API
650 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400651 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500652 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 delete: function() {},
654 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500655
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400656 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500657 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400658 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500659 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400660 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 MakeFromText: function() {},
662 MakeOnPath: function() {},
663 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400664 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500665 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400666 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500667 _MakeFromText: function() {},
668 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500669
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500670 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400671 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500672 add: function() {},
673 sub: function() {},
674 dot: function() {},
675 cross: function() {},
676 normalize: function() {},
677 mulScalar: function() {},
678 length: function() {},
679 lengthSquared: function() {},
680 dist: function() {},
681 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400682
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400683 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500684 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500685 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400686
687 prototype: {
688 bounds: function() {},
689 },
690 // private API (from C++ bindings)
691
692 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500693 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400694
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400695 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500696 colors: function() {},
697 detach: function() {},
698 indices: function() {},
699 positions: function() {},
700 texCoords: function() {},
701 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400702
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500703 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400704
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 // Constants and Enums
706 gpu: {},
707 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400708
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500709 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400710 BLACK: {},
711 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500712 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400713 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500714 BLUE: {},
715 YELLOW: {},
716 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400717 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500718
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500719 MOVE_VERB: {},
720 LINE_VERB: {},
721 QUAD_VERB: {},
722 CONIC_VERB: {},
723 CUBIC_VERB: {},
724 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500725
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500726 NoDecoration: {},
727 UnderlineDecoration: {},
728 OverlineDecoration: {},
729 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400730
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500731 SaveLayerInitWithPrevious: {},
732 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400733
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500734 Affinity: {
735 Upstream: {},
736 Downstream: {},
737 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400738
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500739 AlphaType: {
740 Opaque: {},
741 Premul: {},
742 Unpremul: {},
743 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500744
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500745 BlendMode: {
746 Clear: {},
747 Src: {},
748 Dst: {},
749 SrcOver: {},
750 DstOver: {},
751 SrcIn: {},
752 DstIn: {},
753 SrcOut: {},
754 DstOut: {},
755 SrcATop: {},
756 DstATop: {},
757 Xor: {},
758 Plus: {},
759 Modulate: {},
760 Screen: {},
761 Overlay: {},
762 Darken: {},
763 Lighten: {},
764 ColorDodge: {},
765 ColorBurn: {},
766 HardLight: {},
767 SoftLight: {},
768 Difference: {},
769 Exclusion: {},
770 Multiply: {},
771 Hue: {},
772 Saturation: {},
773 Color: {},
774 Luminosity: {},
775 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500776
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500777 BlurStyle: {
778 Normal: {},
779 Solid: {},
780 Outer: {},
781 Inner: {},
782 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500783
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500784 ClipOp: {
785 Difference: {},
786 Intersect: {},
787 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500788
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500789 ColorType: {
790 Alpha_8: {},
791 RGB_565: {},
792 ARGB_4444: {},
793 RGBA_8888: {},
794 RGB_888x: {},
795 BGRA_8888: {},
796 RGBA_1010102: {},
797 RGB_101010x: {},
798 Gray_8: {},
799 RGBA_F16: {},
800 RGBA_F32: {},
801 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500802
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500803 FillType: {
804 Winding: {},
805 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500806 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400807
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500808 FilterQuality: {
809 None: {},
810 Low: {},
811 Medium: {},
812 High: {},
813 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500814
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500815 FontSlant: {
816 Upright: {},
817 Italic: {},
818 Oblique: {},
819 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400820
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500821 FontHinting: {
822 None: {},
823 Slight: {},
824 Normal: {},
825 Full: {},
826 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500827
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500828 FontWeight: {
829 Invisible: {},
830 Thin: {},
831 ExtraLight: {},
832 Light: {},
833 Normal: {},
834 Medium: {},
835 SemiBold: {},
836 Bold: {},
837 ExtraBold: {},
838 Black: {},
839 ExtraBlack: {},
840 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400841
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500842 FontWidth: {
843 UltraCondensed: {},
844 ExtraCondensed: {},
845 Condensed: {},
846 SemiCondensed: {},
847 Normal: {},
848 SemiExpanded: {},
849 Expanded: {},
850 ExtraExpanded: {},
851 UltraExpanded: {},
852 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400853
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500854 ImageFormat: {
855 PNG: {},
856 JPEG: {},
857 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300858
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500859 PaintStyle: {
860 Fill: {},
861 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500862 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500863
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500864 PathOp: {
865 Difference: {},
866 Intersect: {},
867 Union: {},
868 XOR: {},
869 ReverseDifference: {},
870 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500871
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500872 PointMode: {
873 Points: {},
874 Lines: {},
875 Polygon: {},
876 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500877
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500878 RectHeightStyle: {
879 Tight: {},
880 Max: {},
881 IncludeLineSpacingMiddle: {},
882 IncludeLineSpacingTop: {},
883 IncludeLineSpacingBottom: {},
884 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400885
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500886 RectWidthStyle: {
887 Tight: {},
888 Max: {},
889 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400890
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500891 StrokeCap: {
892 Butt: {},
893 Round: {},
894 Square: {},
895 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500896
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500897 StrokeJoin: {
898 Miter: {},
899 Round: {},
900 Bevel: {},
901 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500902
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500903 TextAlign: {
904 Left: {},
905 Right: {},
906 Center: {},
907 Justify: {},
908 Start: {},
909 End: {},
910 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400911
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500912 TextDirection: {
913 LTR: {},
914 RTL: {},
915 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400916
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700917 DecorationStyle: {
918 Solid: {},
919 Double: {},
920 Dotted: {},
921 Dashed: {},
922 Wavy: {},
923 },
924
925 PlaceholderAlignment: {
926 Baseline: {},
927 AboveBaseline: {},
928 BelowBaseline: {},
929 Top: {},
930 Bottom: {},
931 Middle: {},
932 },
933
934 TextBaseline: {
935 Alphabetic: {},
936 Ideographic: {},
937 },
938
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500939 TileMode: {
940 Clamp: {},
941 Repeat: {},
942 Mirror: {},
943 Decal: {},
944 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500945
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500946 VertexMode: {
947 Triangles: {},
948 TrianglesStrip: {},
949 TriangleFan: {},
950 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500951
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500952 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400953
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500954 /**
955 * @type {Float32Array}
956 */
957 HEAPF32: {},
958 /**
959 * @type {Float64Array}
960 */
961 HEAPF64: {},
962 /**
963 * @type {Uint8Array}
964 */
965 HEAPU8: {},
966 /**
967 * @type {Uint16Array}
968 */
969 HEAPU16: {},
970 /**
971 * @type {Uint32Array}
972 */
973 HEAPU32: {},
974 /**
975 * @type {Int8Array}
976 */
977 HEAP8: {},
978 /**
979 * @type {Int16Array}
980 */
981 HEAP16: {},
982 /**
983 * @type {Int32Array}
984 */
985 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400986
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500987 _malloc: function() {},
988 _free: function() {},
989 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400990};
Kevin Lubick217056c2018-09-20 17:39:31 -0400991
Kevin Lubick006a6f32018-10-19 14:34:34 -0400992// Public API things that are newly declared in the JS should go here.
993// It's not enough to declare them above, because closure can still erase them
994// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400995CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700996CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400997
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400998CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400999
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001000CanvasKit.Surface.prototype.dispose = function() {};
1001CanvasKit.Surface.prototype.flush = function() {};
1002CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1003CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001004
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001005CanvasKit.Image.prototype.encodeToData = function() {};
1006CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +03001007
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001008CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001009
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001010CanvasKit.RSXFormBuilder.prototype.build = function() {};
1011CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1012CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001013CanvasKit.RSXFormBuilder.prototype.set = function() {};
1014
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001015CanvasKit.ColorBuilder.prototype.build = function() {};
1016CanvasKit.ColorBuilder.prototype.delete = function() {};
1017CanvasKit.ColorBuilder.prototype.push = function() {};
1018CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001019
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001020CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1021CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001022
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001023CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1024CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001025
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001026// Define StrokeOpts object
1027var StrokeOpts = {};
1028StrokeOpts.prototype.width;
1029StrokeOpts.prototype.miter_limit;
1030StrokeOpts.prototype.cap;
1031StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001032StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001033
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001034// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001035var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001036HTMLCanvas.prototype.decodeImage = function() {};
1037HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001038HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001039HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001040HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001041HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001042
Elliot Evans28796192020-06-15 12:53:27 -06001043var ImageBitmapRenderingContext = {};
1044ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1045
Kevin Lubickb9db3902018-11-26 11:47:54 -05001046var CanvasRenderingContext2D = {};
1047CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1048CanvasRenderingContext2D.prototype.arc = function() {};
1049CanvasRenderingContext2D.prototype.arcTo = function() {};
1050CanvasRenderingContext2D.prototype.beginPath = function() {};
1051CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1052CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001053CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001054CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001055CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001056CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001057CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001058CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001059CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001060CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001061CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001062CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001063CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001064CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001065CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001066CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001067CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001068CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1069CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001070CanvasRenderingContext2D.prototype.lineTo = function() {};
1071CanvasRenderingContext2D.prototype.measureText = function() {};
1072CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001073CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001074CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1075CanvasRenderingContext2D.prototype.rect = function() {};
1076CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1077CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001078CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001079CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001080CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001081CanvasRenderingContext2D.prototype.scale = function() {};
1082CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001083CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001084CanvasRenderingContext2D.prototype.setTransform = function() {};
1085CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001086CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001087CanvasRenderingContext2D.prototype.strokeText = function() {};
1088CanvasRenderingContext2D.prototype.transform = function() {};
1089CanvasRenderingContext2D.prototype.translate = function() {};
1090
Kevin Lubicka40f8322018-12-17 16:01:36 -05001091var Path2D = {};
1092Path2D.prototype.addPath = function() {};
1093Path2D.prototype.arc = function() {};
1094Path2D.prototype.arcTo = function() {};
1095Path2D.prototype.bezierCurveTo = function() {};
1096Path2D.prototype.closePath = function() {};
1097Path2D.prototype.ellipse = function() {};
1098Path2D.prototype.lineTo = function() {};
1099Path2D.prototype.moveTo = function() {};
1100Path2D.prototype.quadraticCurveTo = function() {};
1101Path2D.prototype.rect = function() {};
1102
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001103var LinearCanvasGradient = {};
1104LinearCanvasGradient.prototype.addColorStop = function() {};
1105var RadialCanvasGradient = {};
1106RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001107var CanvasPattern = {};
1108CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001109
Kevin Lubick52b9f372018-12-04 13:57:36 -05001110var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001111 /**
1112 * @type {Uint8ClampedArray}
1113 */
1114 data: {},
1115 height: {},
1116 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001117};
1118
Kevin Lubickd29edd72018-12-07 08:29:52 -05001119var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001120 a: {},
1121 b: {},
1122 c: {},
1123 d: {},
1124 e: {},
1125 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001126};
1127
Kevin Lubick217056c2018-09-20 17:39:31 -04001128// 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 -05001129function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001130
1131// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1132// to override it in the puppeteer tests
1133var LibraryEGL = {
1134 contextAttributes: {
1135 majorVersion: {}
1136 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001137}