-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathp5.global-mode.d.ts
1700 lines (1367 loc) · 45.4 KB
/
p5.global-mode.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file was auto-generated. Please do not edit it.
///<reference path="p5.d.ts" />
// Properties from p5
// src/3d/3d_primitives.js
/**
* Draw a plane with given a width and height
*/
declare function plane(width: number, height: number): p5;
/**
* Draw a sphere with given raduis
*/
declare function sphere(radius: number, detail?: number): void;
/**
* Draw an ellipsoid with given radius
*/
declare function ellipsoid(radiusx: number, radiusy: number, radiusz: number, detail?: number): p5;
/**
* Draw a cylinder with given radius and height
*/
declare function cylinder(radius: number, height: number, detail?: number): p5;
/**
* Draw a cone with given radius and height
*/
declare function cone(radius: number, height: number, detail?: number): void;
/**
* Draw a torus with given radius and tube radius
*/
declare function torus(radius: number, tubeRadius: number, detail?: number): void;
/**
* Draw a box with given width, height and depth
*/
declare function box(width: number, height: number, depth: number): p5;
// src/3d/camera.js
/**
* Sets camera position
*/
declare function camera(x: number, y: number, z: number): p5;
/**
* Sets perspective camera
*/
declare function perspective(fovy: number, aspect: number, near: number, far: number): p5;
/**
* Setup ortho camera
*/
declare function ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): p5;
// src/3d/light.js
/**
* Creates an ambient light with a color
*/
declare function ambientLight(v1: number|any[]|string|p5.Color, v2?: number, v3?: number, a?: number): p5;
// TODO: Fix directionalLight() errors in src/3d/light.js:
//
// required param "x" follows an optional param
//
// declare function directionalLight(v1: number|any[]|string|p5.Color, v2?: number, v3?: number, a?: number, x: number|p5.Vector, y?: number, z?: number): p5;
// TODO: Fix pointLight() errors in src/3d/light.js:
//
// required param "x" follows an optional param
//
// declare function pointLight(v1: number|any[]|string|p5.Color, v2?: number, v3?: number, a?: number, x: number|p5.Vector, y?: number, z?: number): p5;
// src/3d/material.js
/**
* Normal material for geometry
*/
declare function normalMaterial(): p5;
/**
* Texture for geometry
*/
declare function texture(): p5;
/**
* Basic material for geometry with a given color
*/
declare function basicMaterial(v1: number|any[]|string|p5.Color, v2?: number, v3?: number, a?: number): p5;
/**
* Ambient material for geometry with a given color
*/
declare function ambientMaterial(v1: number|any[]|string|p5.Color, v2?: number, v3?: number, a?: number): p5;
/**
* Specular material for geometry with a given color
*/
declare function specularMaterial(v1: number|any[]|string|p5.Color, v2?: number, v3?: number, a?: number): p5;
// src/color/creating_reading.js
/**
* Extracts the alpha value from a color or pixel array.
*/
declare function alpha(obj: any): void;
/**
* Extracts the blue value from a color or pixel array.
*/
declare function blue(obj: any): void;
/**
* Extracts the HSB brightness value from a color or pixel array.
*/
declare function brightness(color: any): void;
/**
* Creates colors for storing in variables of the color datatype.
*/
declare function color(v1: number|string, v2?: number, v3?: number, alpha?: number): any[];
/**
* Extracts the green value from a color or pixel array.
*/
declare function green(color: any): void;
/**
* Extracts the hue value from a color or pixel array.
*/
declare function hue(color: any): void;
// TODO: Fix lerpColor() errors in src/color/creating_reading.js:
//
// param "c1" has invalid type: Array/Number
// param "c2" has invalid type: Array/Number
// return has invalid type: Array/Number
//
// declare function lerpColor(c1: Array/Number, c2: Array/Number, amt: number): Array/Number;
/**
* Extracts the HSL lightness value from a color or pixel array.
*/
declare function lightness(color: any): void;
/**
* Extracts the red value from a color or pixel array.
*/
declare function red(obj: any): void;
/**
* Extracts the saturation value from a color or pixel array.
*/
declare function saturation(color: any): void;
// src/color/setting.js
/**
* The background() function sets the color used for the background of the
* p5.js canvas.
*/
declare function background(v1: number|string|p5.Color|p5.Image, v2?: number, v3?: number, a?: number): void;
/**
* Clears the pixels within a buffer.
*/
declare function clear(): void;
// TODO: Fix colorMode() errors in src/color/setting.js:
//
// param "mode" has invalid type: Number|Constant
// param "max1" has invalid type: Number|Constant
// param "max2" has invalid type: Number|Constant
// param "max3" has invalid type: Number|Constant
// param "maxA" has invalid type: Number|Constant
//
// declare function colorMode(mode: number|Constant, max1?: number|Constant, max2?: number|Constant, max3?: number|Constant, maxA?: number|Constant): void;
/**
* Sets the color used to fill shapes.
*/
declare function fill(v1: number|any[]|string|p5.Color, v2?: number, v3?: number, a?: number): void;
/**
* Disables filling geometry.
*/
declare function noFill(): void;
/**
* Disables drawing the stroke (outline).
*/
declare function noStroke(): void;
/**
* Sets the color used to draw lines and borders around shapes.
*/
declare function stroke(v1: number|any[]|string|p5.Color, v2?: number, v3?: number, a?: number): void;
// src/core/2d_primitives.js
/**
* Draw an arc to the screen.
*/
declare function arc(a: number, b: number, c: number, d: number, start: number, stop: number, mode?: string): any;
/**
* Draws an ellipse (oval) to the screen.
*/
declare function ellipse(a: number, b: number, c: number, d: number): p5;
/**
* Draws a line (a direct path between two points) to the screen.
*/
declare function line(x1: number, y1: number, x2: number, y2: number): p5;
/**
* Draws a point, a coordinate in space at the dimension of one pixel.
*/
declare function point(x: number, y: number): p5;
/**
* Draw a quad.
*/
declare function quad(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): p5;
/**
* Draws a rectangle to the screen.
*/
declare function rect(x: number, y: number, w: number, h: number, tl?: number, tr?: number, br?: number, bl?: number): p5;
/**
* A triangle is a plane created by connecting three points.
*/
declare function triangle(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): p5;
// src/core/attributes.js
// TODO: Fix ellipseMode() errors in src/core/attributes.js:
//
// param "mode" has invalid type: Number/Constant
//
// declare function ellipseMode(mode: Number/Constant): p5;
/**
* Draws all geometry with jagged (aliased) edges.
*/
declare function noSmooth(): p5;
// TODO: Fix rectMode() errors in src/core/attributes.js:
//
// param "mode" has invalid type: Number/Constant
//
// declare function rectMode(mode: Number/Constant): p5;
/**
* Draws all geometry with smooth (anti-aliased) edges.
*/
declare function smooth(): p5;
// TODO: Fix strokeCap() errors in src/core/attributes.js:
//
// param "cap" has invalid type: Number/Constant
//
// declare function strokeCap(cap: Number/Constant): p5;
// TODO: Fix strokeJoin() errors in src/core/attributes.js:
//
// param "join" has invalid type: Number/Constant
//
// declare function strokeJoin(join: Number/Constant): p5;
/**
* Sets the width of the stroke used for lines, points, and the border
* around shapes.
*/
declare function strokeWeight(weight: number): p5;
// src/core/constants.js
/**
* HALF_PI is a mathematical constant with the value
* 1.57079632679489661923.
*/
declare var HALF_PI: any;
/**
* PI is a mathematical constant with the value
* 3.14159265358979323846.
*/
declare var PI: any;
/**
* QUARTER_PI is a mathematical constant with the value 0.7853982.
*/
declare var QUARTER_PI: any;
/**
* TAU is an alias for TWO_PI, a mathematical constant with the
* value 6.28318530717958647693.
*/
declare var TAU: any;
/**
* TWO_PI is a mathematical constant with the value
* 6.28318530717958647693.
*/
declare var TWO_PI: any;
// src/core/core.js
/**
* Called directly before setup(), the preload() function is used to handle
* asynchronous loading of external files.
*/
declare function preload(): void;
/**
* The setup() function is called once when the program starts.
*/
declare function setup(): void;
/**
* Called directly after setup(), the draw() function continuously executes
* the lines of code contained inside its block until the program is stopped
* or noLoop() is called.
*/
declare function draw(): void;
/**
* Removes the entire p5 sketch.
*/
declare function remove(): void;
// src/core/curves.js
/**
* Draws a cubic Bezier curve on the screen.
*/
declare function bezier(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): any;
/**
* Evaluates the Bezier at position t for points a, b, c, d.
*/
declare function bezierPoint(a: number, b: number, c: number, d: number, t: number): number;
/**
* Evaluates the tangent to the Bezier at position t for points a, b, c, d.
*/
declare function bezierTangent(a: number, b: number, c: number, d: number, t: number): number;
/**
* Draws a curved line on the screen between two points, given as the
* middle four parameters.
*/
declare function curve(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): any;
/**
* Modifies the quality of forms created with curve() and curveVertex().
*/
declare function curveTightness(amount: number): any;
/**
* Evaluates the curve at position t for points a, b, c, d.
*/
declare function curvePoint(a: number, b: number, c: number, d: number, t: number): number;
/**
* Evaluates the tangent to the curve at position t for points a, b, c, d.
*/
declare function curveTangent(a: number, b: number, c: number, d: number, t: number): number;
// src/core/environment.js
/**
* The print() function writes to the console area of your browser.
*/
declare function print(contents: any): void;
/**
* The system variable frameCount contains the number of frames that have
* been displayed since the program started.
*/
declare var frameCount: any;
/**
* Confirms if the window a p5.js program is in is "focused," meaning that
* the sketch will accept mouse or keyboard input.
*/
declare var focused: any;
// TODO: Fix cursor() errors in src/core/environment.js:
//
// param "type" has invalid type: Number/Constant
//
// declare function cursor(type: Number/Constant, x?: number, y?: number): void;
/**
* Specifies the number of frames to be displayed every second.
*/
declare function frameRate(fps?: number): number;
/**
* Hides the cursor from view.
*/
declare function noCursor(): void;
/**
* System variable that stores the width of the entire screen display.
*/
declare var displayWidth: any;
/**
* System variable that stores the height of the entire screen display.
*/
declare var displayHeight: any;
/**
* System variable that stores the width of the inner window, it maps to
* window.innerWidth.
*/
declare var windowWidth: any;
/**
* System variable that stores the height of the inner window, it maps to
* window.innerHeight.
*/
declare var windowHeight: any;
/**
* The windowResized() function is called once every time the browser window
* is resized.
*/
declare function windowResized(): void;
/**
* System variable that stores the width of the drawing canvas.
*/
declare var width: any;
/**
* System variable that stores the height of the drawing canvas.
*/
declare var height: any;
/**
* If argument is given, sets the sketch to fullscreen or not based on the
* value of the argument.
*/
declare function fullscreen(val?: boolean): boolean;
/**
* Sets the pixel scaling for high pixel density displays.
*/
declare function pixelDensity(val?: number): number;
/**
* Returns the pixel density of the current display the sketch is running on.
*/
declare function displayDensity(): number;
/**
* Gets the current URL.
*/
declare function getURL(): string;
/**
* Gets the current URL path as an array.
*/
declare function getURLPath(): any[];
/**
* Gets the current URL params as an Object.
*/
declare function getURLParams(): any;
// src/core/rendering.js
/**
* Creates a canvas element in the document, and sets the dimensions of it
* in pixels.
*/
declare function createCanvas(w: number, h: number, renderer?: string): any;
/**
* Resizes the canvas to given width and height.
*/
declare function resizeCanvas(): void;
/**
* Removes the default canvas for a p5 sketch that doesn't
* require a canvas
*/
declare function noCanvas(): void;
/**
* Creates and returns a new p5.Renderer object.
*/
declare function createGraphics(w: number, h: number, renderer: string): any;
// TODO: Fix blendMode() errors in src/core/rendering.js:
//
// param "mode" has invalid type: String/Constant
//
// declare function blendMode(mode: String/Constant): void;
// src/core/structure.js
/**
* Stops p5.js from continuously executing the code within draw().
*/
declare function noLoop(): void;
/**
* By default, p5.js loops through draw() continuously, executing the code
* within it.
*/
declare function loop(): void;
/**
* The push() function saves the current drawing style settings and
* transformations, while pop() restores these settings.
*/
declare function push(): void;
/**
* The push() function saves the current drawing style settings and
* transformations, while pop() restores these settings.
*/
declare function pop(): void;
/**
* Executes the code within draw() one time.
*/
declare function redraw(): void;
// src/core/transform.js
/**
* Multiplies the current matrix by the one specified through the parameters.
*/
declare function applyMatrix(n00: number, n01: number, n02: number, n10: number, n11: number, n12: number): p5;
/**
* Replaces the current matrix with the identity matrix.
*/
declare function resetMatrix(): p5;
/**
* Rotates a shape the amount specified by the angle parameter.
*/
declare function rotate(angle: number): p5;
// TODO: Fix scale() errors in src/core/transform.js:
//
// param "s" has invalid type: Number | p5.Vector | Array
//
// declare function scale(s: Number | p5.Vector | Array, y?: number, z?: number): p5;
/**
* Shears a shape around the x-axis the amount specified by the angle
* parameter.
*/
declare function shearX(angle: number): p5;
/**
* Shears a shape around the y-axis the amount specified by the angle
* parameter.
*/
declare function shearY(angle: number): p5;
/**
* Specifies an amount to displace objects within the display window.
*/
declare function translate(x: number, y: number): p5;
// src/core/vertex.js
/**
* Use the beginContour() and endContour() functions to create negative
* shapes within shapes such as the center of the letter 'O'.
*/
declare function beginContour(): any;
// TODO: Fix beginShape() errors in src/core/vertex.js:
//
// param "kind" has invalid type: Number/Constant
//
// declare function beginShape(kind: Number/Constant): any;
/**
* Specifies vertex coordinates for Bezier curves.
*/
declare function bezierVertex(x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): any;
/**
* Specifies vertex coordinates for curves.
*/
declare function curveVertex(x: number, y: number): any;
/**
* Use the beginContour() and endContour() functions to create negative
* shapes within shapes such as the center of the letter 'O'.
*/
declare function endContour(): any;
// TODO: Fix endShape() errors in src/core/vertex.js:
//
// param "mode" has invalid type: Number/Constant
//
// declare function endShape(mode: Number/Constant): any;
/**
* Specifies vertex coordinates for quadratic Bezier curves.
*/
declare function quadraticVertex(cx: number, cy: number, x3: number, y3: number): any;
/**
* All shapes are constructed by connecting a series of vertices.
*/
declare function vertex(x: number, y: number): any;
// src/events/acceleration.js
/**
* The system variable deviceOrientation always contains the orientation of
* the device.
*/
declare var deviceOrientation: any;
/**
* The system variable accelerationX always contains the acceleration of the
* device along the x axis.
*/
declare var accelerationX: any;
/**
* The system variable accelerationY always contains the acceleration of the
* device along the y axis.
*/
declare var accelerationY: any;
/**
* The system variable accelerationZ always contains the acceleration of the
* device along the z axis.
*/
declare var accelerationZ: any;
/**
* The system variable pAccelerationX always contains the acceleration of the
* device along the x axis in the frame previous to the current frame.
*/
declare var pAccelerationX: any;
/**
* The system variable pAccelerationY always contains the acceleration of the
* device along the y axis in the frame previous to the current frame.
*/
declare var pAccelerationY: any;
/**
* The system variable pAccelerationZ always contains the acceleration of the
* device along the z axis in the frame previous to the current frame.
*/
declare var pAccelerationZ: any;
/**
* The system variable rotationX always contains the rotation of the
* device along the x axis.
*/
declare var rotationX: any;
/**
* The system variable rotationY always contains the rotation of the
* device along the y axis.
*/
declare var rotationY: any;
/**
* The system variable rotationZ always contains the rotation of the
* device along the z axis.
*/
declare var rotationZ: any;
/**
* The system variable pRotationX always contains the rotation of the
* device along the x axis in the frame previous to the current frame.
*/
declare var pRotationX: any;
/**
* The system variable pRotationY always contains the rotation of the
* device along the y axis in the frame previous to the current frame.
*/
declare var pRotationY: any;
/**
* The system variable pRotationZ always contains the rotation of the
* device along the z axis in the frame previous to the current frame.
*/
declare var pRotationZ: any;
/**
* The setMoveThreshold() function is used to set the movement threshold for
* the deviceMoved() function.
*/
declare function setMoveThreshold(value: number): void;
/**
* The setShakeThreshold() function is used to set the movement threshold for
* the deviceShaken() function.
*/
declare function setShakeThreshold(value: number): void;
/**
* The deviceMoved() function is called when the device is moved by more than
* the threshold value along X, Y or Z axis.
*/
declare function deviceMoved(): void;
/**
* The deviceTurned() function is called when the device rotates by
* more than 90 degrees continuously.
*/
declare function deviceTurned(): void;
/**
* The deviceShaken() function is called when the device total acceleration
* changes of accelerationX and accelerationY values is more than
* the threshold value.
*/
declare function deviceShaken(): void;
// src/events/keyboard.js
/**
* The boolean system variable keyIsPressed is true if any key is pressed
* and false if no keys are pressed.
*/
declare var keyIsPressed: any;
/**
* The system variable key always contains the value of the most recent
* key on the keyboard that was typed.
*/
declare var key: any;
/**
* The variable keyCode is used to detect special keys such as BACKSPACE,
* DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, OPTION, ALT, UP_ARROW,
* DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW.
*/
declare var keyCode: any;
/**
* The keyPressed() function is called once every time a key is pressed.
*/
declare function keyPressed(): void;
/**
* The keyReleased() function is called once every time a key is released.
*/
declare function keyReleased(): void;
/**
* The keyTyped() function is called once every time a key is pressed, but
* action keys such as Ctrl, Shift, and Alt are ignored.
*/
declare function keyTyped(): void;
/**
* The keyIsDown() function checks if the key is currently down, i.e.
*/
declare function keyIsDown(code: number): boolean;
// src/events/mouse.js
/**
* The system variable mouseX always contains the current horizontal
* position of the mouse, relative to (0, 0) of the canvas.
*/
declare var mouseX: any;
/**
* The system variable mouseY always contains the current vertical position
* of the mouse, relative to (0, 0) of the canvas.
*/
declare var mouseY: any;
/**
* The system variable pmouseX always contains the horizontal position of
* the mouse in the frame previous to the current frame, relative to (0, 0)
* of the canvas.
*/
declare var pmouseX: any;
/**
* The system variable pmouseY always contains the vertical position of the
* mouse in the frame previous to the current frame, relative to (0, 0) of
* the canvas.
*/
declare var pmouseY: any;
/**
* The system variable winMouseX always contains the current horizontal
* position of the mouse, relative to (0, 0) of the window.
*/
declare var winMouseX: any;
/**
* The system variable winMouseY always contains the current vertical
* position of the mouse, relative to (0, 0) of the window.
*/
declare var winMouseY: any;
/**
* The system variable pwinMouseX always contains the horizontal position
* of the mouse in the frame previous to the current frame, relative to
* (0, 0) of the window.
*/
declare var pwinMouseX: any;
/**
* The system variable pwinMouseY always contains the vertical position of
* the mouse in the frame previous to the current frame, relative to (0, 0)
* of the window.
*/
declare var pwinMouseY: any;
/**
* Processing automatically tracks if the mouse button is pressed and which
* button is pressed.
*/
declare var mouseButton: any;
/**
* The boolean system variable mouseIsPressed is true if the mouse is pressed
* and false if not.
*/
declare var mouseIsPressed: any;
/**
* The mouseMoved() function is called every time the mouse moves and a mouse
* button is not pressed.<br><br>
* Browsers may have different default
* behaviors attached to various mouse events.
*/
declare function mouseMoved(): void;
/**
* The mouseDragged() function is called once every time the mouse moves and
* a mouse button is pressed.
*/
declare function mouseDragged(): void;
/**
* The mousePressed() function is called once after every time a mouse button
* is pressed.
*/
declare function mousePressed(): void;
/**
* The mouseReleased() function is called every time a mouse button is
* released.
*/
declare function mouseReleased(): void;
/**
* The mouseClicked() function is called once after a mouse button has been
* pressed and then released.<br><br>
* Browsers may have different default
* behaviors attached to various mouse events.
*/
declare function mouseClicked(): void;
/**
* The function mouseWheel() is executed every time a vertical mouse wheel
* event is detected either triggered by an actual mouse wheel or by a
* touchpad.<br><br>
* The event.delta property returns the amount the mouse wheel
* have scrolled.
*/
declare function mouseWheel(): void;
// src/events/touch.js
/**
* The system variable touchX always contains the horizontal position of
* one finger, relative to (0, 0) of the canvas.
*/
declare var touchX: any;
/**
* The system variable touchY always contains the vertical position of
* one finger, relative to (0, 0) of the canvas.
*/
declare var touchY: any;
/**
* The system variable ptouchX always contains the horizontal position of
* one finger, relative to (0, 0) of the canvas, in the frame previous to the
* current frame.
*/
declare var ptouchX: any;
/**
* The system variable ptouchY always contains the vertical position of
* one finger, relative to (0, 0) of the canvas, in the frame previous to the
* current frame.
*/
declare var ptouchY: any;
// TODO: Property "touches[]", defined in src/events/touch.js, is not a valid JS symbol name
/**
* The boolean system variable touchIsDown is true if the screen is
* touched and false if not.
*/
declare var touchIsDown: any;
/**
* The touchStarted() function is called once after every time a touch is
* registered.
*/
declare function touchStarted(): void;
/**
* The touchMoved() function is called every time a touch move is registered.
*/
declare function touchMoved(): void;
/**
* The touchEnded() function is called every time a touch ends.
*/
declare function touchEnded(): void;
// src/image/image.js
/**
* Creates a new p5.Image (the datatype for storing images).
*/
declare function createImage(width: number, height: number): p5.Image;
// TODO: Fix saveCanvas() errors in src/image/image.js:
//
// param "canvas" has invalid type: [selectedCanvas]
// param "filename" has invalid type: [String]
// param "extension" has invalid type: [String]
//
// declare function saveCanvas(canvas: [selectedCanvas], filename: [String], extension: [String]): void;
/**
* Capture a sequence of frames that can be used to create a movie.
*/
declare function saveFrames(filename: string, extension: string, duration: number, framerate: number, callback?: () => any): void;
// src/image/loading_displaying.js
// TODO: Fix loadImage() errors in src/image/loading_displaying.js:
//
// param "successCallback" has invalid type: Function(p5.Image)
// param "failureCallback" has invalid type: Function(Event)
//
// declare function loadImage(path: string, successCallback?: Function(p5.Image), failureCallback?: Function(Event)): p5.Image;
/**
* Draw an image to the main canvas of the p5js sketch
*/
declare function image(img: p5.Image, sx?: number, sy?: number, sWidth?: number, sHeight?: number, dx?: number, dy?: number, dWidth?: number, dHeight?: number): void;
/**
* Sets the fill value for displaying images.
*/
declare function tint(v1: number|any[], v2?: number|any[], v3?: number|any[], a?: number|any[]): void;
/**
* Removes the current fill value for displaying images and reverts to
* displaying images with their original hues.
*/
declare function noTint(): void;
/**
* Set image mode.
*/
declare function imageMode(m: string): void;
// src/image/pixels.js
// TODO: Property "pixels[]", defined in src/image/pixels.js, is not a valid JS symbol name
// TODO: Fix blend() errors in src/image/pixels.js:
//
// param "srcImage" has invalid type: p5.Image|undefined
//