p5 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/{src → dist}/accessibility/color_namer.js +48 -3
  2. package/{src → dist}/accessibility/describe.js +12 -2
  3. package/{src → dist}/accessibility/gridOutput.js +2 -2
  4. package/dist/accessibility/index.js +60 -0
  5. package/{src → dist}/accessibility/outputs.js +23 -2
  6. package/{src → dist}/accessibility/textOutput.js +2 -2
  7. package/dist/app.js +120 -0
  8. package/{src → dist}/color/color_conversion.js +48 -10
  9. package/{src → dist}/color/color_spaces/hsb.js +3 -1
  10. package/dist/color/creating_reading.js +3 -0
  11. package/dist/color/index.js +13 -0
  12. package/dist/color/p5.Color.culori.js +1 -0
  13. package/dist/color/p5.Color.js +3 -0
  14. package/{src → dist}/color/setting.js +9 -6
  15. package/{src/core/constants.js → dist/constants-tYr0tCl8.js} +284 -132
  16. package/{src → dist}/core/States.js +3 -1
  17. package/dist/core/constants.js +1 -0
  18. package/{src → dist}/core/environment.js +12 -10
  19. package/{src → dist}/core/friendly_errors/browser_errors.js +1 -1
  20. package/{src → dist}/core/friendly_errors/fes_core.js +14 -44
  21. package/{src → dist}/core/friendly_errors/file_errors.js +6 -3
  22. package/dist/core/friendly_errors/index.js +23 -0
  23. package/dist/core/friendly_errors/param_validator.js +5421 -0
  24. package/{src → dist}/core/friendly_errors/sketch_reader.js +50 -4
  25. package/{src → dist}/core/friendly_errors/sketch_verifier.js +6 -6
  26. package/{src → dist}/core/friendly_errors/stacktrace.js +3 -5
  27. package/{src → dist}/core/friendly_errors/validate_params.js +50 -41
  28. package/{src → dist}/core/helpers.js +9 -6
  29. package/dist/core/init.js +105 -0
  30. package/dist/core/internationalization.js +302 -0
  31. package/dist/core/legacy.js +73 -0
  32. package/dist/core/main.js +44 -0
  33. package/dist/core/noop.js +3 -0
  34. package/dist/core/p5.Graphics.js +40 -0
  35. package/dist/core/p5.Renderer.js +11 -0
  36. package/dist/core/p5.Renderer2D.js +44 -0
  37. package/dist/core/reference.js +1 -0
  38. package/dist/core/rendering.js +40 -0
  39. package/{src → dist}/core/structure.js +3 -3
  40. package/{src → dist}/core/transform.js +2 -2
  41. package/{src/color/creating_reading.js → dist/creating_reading-Cr8L2Jnm.js} +841 -13
  42. package/{src → dist}/data/index.js +3 -1
  43. package/{src → dist}/data/local_storage.js +2 -8
  44. package/{src → dist}/dom/dom.js +19 -13
  45. package/dist/dom/index.js +18 -0
  46. package/{src → dist}/dom/p5.Element.js +14 -12
  47. package/{src → dist}/dom/p5.File.js +4 -4
  48. package/{src → dist}/dom/p5.MediaElement.js +10 -4
  49. package/{src → dist}/events/acceleration.js +26 -26
  50. package/{src → dist}/events/index.js +3 -1
  51. package/{src → dist}/events/keyboard.js +14 -12
  52. package/{src → dist}/events/pointer.js +16 -17
  53. package/dist/image/const.js +9 -0
  54. package/{src → dist}/image/filterRenderer2D.js +57 -37
  55. package/{src → dist}/image/filters.js +1 -3
  56. package/dist/image/image.js +40 -0
  57. package/dist/image/index.js +51 -0
  58. package/dist/image/loading_displaying.js +40 -0
  59. package/dist/image/p5.Image.js +11 -0
  60. package/{src → dist}/image/pixels.js +5 -3
  61. package/{src → dist}/io/csv.js +72 -70
  62. package/dist/io/files.js +40 -0
  63. package/dist/io/index.js +51 -0
  64. package/{src → dist}/io/p5.Table.js +6 -6
  65. package/{src → dist}/io/p5.TableRow.js +5 -6
  66. package/{src → dist}/io/p5.XML.js +2 -5
  67. package/{src → dist}/io/utilities.js +1 -1
  68. package/{src/core/p5.Renderer2D.js → dist/main-CAxvgiOV.js} +738 -57
  69. package/{src → dist}/math/Matrices/Matrix.js +10 -8
  70. package/{src → dist}/math/Matrices/MatrixInterface.js +5 -3
  71. package/{src → dist}/math/Matrices/MatrixNumjs.js +12 -26
  72. package/{src → dist}/math/calculation.js +2 -2
  73. package/{src → dist}/math/index.js +6 -3
  74. package/{src → dist}/math/math.js +3 -3
  75. package/{src → dist}/math/noise.js +2 -2
  76. package/{src → dist}/math/p5.Matrix.js +7 -4
  77. package/{src → dist}/math/p5.Vector.js +6 -6
  78. package/{src → dist}/math/random.js +2 -2
  79. package/{src → dist}/math/trigonometry.js +16 -15
  80. package/{src/image/p5.Image.js → dist/p5.Renderer-Swjl9HQO.js} +393 -22
  81. package/dist/rendering-B5TRR7aY.js +24960 -0
  82. package/{src → dist}/shape/2d_primitives.js +18 -17
  83. package/{src → dist}/shape/attributes.js +18 -17
  84. package/{src → dist}/shape/curves.js +2 -2
  85. package/{src → dist}/shape/custom_shapes.js +44 -64
  86. package/{src → dist}/shape/index.js +10 -2
  87. package/{src → dist}/shape/vertex.js +2 -3
  88. package/dist/type/index.js +25 -0
  89. package/{src → dist}/type/lib/Typr.js +76 -94
  90. package/{src → dist}/type/p5.Font.js +37 -63
  91. package/{src → dist}/type/textCore.js +35 -58
  92. package/{src → dist}/type/unicodeRanges.js +3 -1
  93. package/{src → dist}/utilities/conversion.js +2 -2
  94. package/{src → dist}/utilities/index.js +3 -1
  95. package/{src → dist}/utilities/time_date.js +6 -7
  96. package/{src → dist}/utilities/utility_functions.js +2 -2
  97. package/dist/webgl/3d_primitives.js +40 -0
  98. package/{src → dist}/webgl/GeometryBufferCache.js +3 -1
  99. package/{src → dist}/webgl/GeometryBuilder.js +12 -8
  100. package/{src → dist}/webgl/ShaderGenerator.js +79 -82
  101. package/{src → dist}/webgl/ShapeBuilder.js +26 -23
  102. package/dist/webgl/index.js +76 -0
  103. package/{src → dist}/webgl/interaction.js +7 -6
  104. package/dist/webgl/light.js +40 -0
  105. package/{src → dist}/webgl/loading.js +45 -12
  106. package/dist/webgl/material.js +40 -0
  107. package/dist/webgl/p5.Camera.js +40 -0
  108. package/{src → dist}/webgl/p5.DataArray.js +3 -5
  109. package/dist/webgl/p5.Framebuffer.js +40 -0
  110. package/{src → dist}/webgl/p5.Geometry.js +12 -15
  111. package/{src → dist}/webgl/p5.Quat.js +5 -4
  112. package/{src → dist}/webgl/p5.RenderBuffer.js +2 -3
  113. package/dist/webgl/p5.RendererGL.js +40 -0
  114. package/dist/webgl/p5.Shader.js +40 -0
  115. package/dist/webgl/p5.Texture.js +40 -0
  116. package/{src → dist}/webgl/text.js +78 -38
  117. package/lib/p5.esm.js +296 -194
  118. package/lib/p5.js +296 -194
  119. package/lib/p5.min.js +1 -1
  120. package/package.json +17 -17
  121. package/translations/dev.js +6 -6
  122. package/translations/index.js +1 -1
  123. package/types/accessibility/color_namer.d.ts +8 -0
  124. package/types/accessibility/describe.d.ts +184 -0
  125. package/types/accessibility/gridOutput.d.ts +8 -0
  126. package/types/accessibility/outputs.d.ts +235 -0
  127. package/types/accessibility/textOutput.d.ts +8 -0
  128. package/types/color/color_conversion.d.ts +47 -0
  129. package/types/color/creating_reading.d.ts +1348 -0
  130. package/types/color/p5.Color.d.ts +1070 -0
  131. package/types/color/setting.d.ts +2085 -0
  132. package/types/core/constants.d.ts +341 -0
  133. package/types/core/environment.d.ts +668 -0
  134. package/types/core/friendly_errors/fes_core.d.ts +8 -0
  135. package/types/core/friendly_errors/file_errors.d.ts +8 -0
  136. package/types/core/friendly_errors/param_validator.d.ts +30 -0
  137. package/types/core/friendly_errors/sketch_reader.d.ts +8 -0
  138. package/types/core/friendly_errors/stacktrace.d.ts +11 -0
  139. package/types/core/friendly_errors/validate_params.d.ts +8 -0
  140. package/types/core/helpers.d.ts +8 -0
  141. package/types/core/legacy.d.ts +8 -0
  142. package/types/core/main.d.ts +5996 -0
  143. package/types/core/p5.Graphics.d.ts +484 -0
  144. package/types/core/p5.Renderer.d.ts +14 -0
  145. package/types/core/reference.d.ts +8 -0
  146. package/types/core/rendering.d.ts +481 -0
  147. package/types/core/structure.d.ts +492 -0
  148. package/types/core/transform.d.ts +1638 -0
  149. package/types/data/local_storage.d.ts +323 -0
  150. package/types/dom/dom.d.ts +1295 -0
  151. package/types/dom/p5.Element.d.ts +2011 -0
  152. package/types/dom/p5.File.d.ts +13 -0
  153. package/types/dom/p5.MediaElement.d.ts +1249 -0
  154. package/types/events/acceleration.d.ts +193 -0
  155. package/types/events/keyboard.d.ts +499 -0
  156. package/types/events/pointer.d.ts +782 -0
  157. package/types/global.d.ts +5542 -0
  158. package/types/image/filterRenderer2D.d.ts +54 -0
  159. package/types/image/image.d.ts +326 -0
  160. package/types/image/loading_displaying.d.ts +580 -0
  161. package/types/image/p5.Image.d.ts +5882 -0
  162. package/types/image/pixels.d.ts +832 -0
  163. package/types/io/files.d.ts +1447 -0
  164. package/types/io/p5.Table.d.ts +1247 -0
  165. package/types/io/p5.TableRow.d.ts +343 -0
  166. package/types/io/p5.XML.d.ts +1188 -0
  167. package/types/math/Matrices/Matrix.d.ts +1029 -0
  168. package/types/math/Matrices/MatrixNumjs.d.ts +8 -0
  169. package/types/math/calculation.d.ts +923 -0
  170. package/types/math/math.d.ts +90 -0
  171. package/types/math/noise.d.ts +311 -0
  172. package/types/math/p5.Matrix.d.ts +8 -0
  173. package/types/math/p5.Vector.d.ts +3416 -0
  174. package/types/math/random.d.ts +267 -0
  175. package/types/math/trigonometry.d.ts +663 -0
  176. package/types/p5.d.ts +6663 -0
  177. package/types/shape/2d_primitives.d.ts +1033 -0
  178. package/types/shape/attributes.d.ts +466 -0
  179. package/types/shape/curves.d.ts +740 -0
  180. package/types/shape/custom_shapes.d.ts +888 -0
  181. package/types/shape/vertex.d.ts +1141 -0
  182. package/types/type/p5.Font.d.ts +575 -0
  183. package/types/type/textCore.d.ts +1198 -0
  184. package/types/utilities/conversion.d.ts +894 -0
  185. package/types/utilities/time_date.d.ts +295 -0
  186. package/types/utilities/utility_functions.d.ts +587 -0
  187. package/types/webgl/3d_primitives.d.ts +1432 -0
  188. package/types/webgl/ShaderGenerator.d.ts +8 -0
  189. package/types/webgl/interaction.d.ts +371 -0
  190. package/types/webgl/light.d.ts +1184 -0
  191. package/types/webgl/loading.d.ts +481 -0
  192. package/types/webgl/material.d.ts +2656 -0
  193. package/types/webgl/p5.Camera.d.ts +3023 -0
  194. package/types/webgl/p5.DataArray.d.ts +61 -0
  195. package/types/webgl/p5.Framebuffer.d.ts +760 -0
  196. package/types/webgl/p5.Geometry.d.ts +1191 -0
  197. package/types/webgl/p5.Quat.d.ts +45 -0
  198. package/types/webgl/p5.RendererGL.d.ts +234 -0
  199. package/types/webgl/p5.Shader.d.ts +660 -0
  200. package/types/webgl/p5.Texture.d.ts +61 -0
  201. package/types/webgl/text.d.ts +74 -0
  202. package/src/README.md +0 -27
  203. package/src/accessibility/index.js +0 -13
  204. package/src/app.js +0 -61
  205. package/src/color/index.js +0 -9
  206. package/src/color/p5.Color.culori.js +0 -66
  207. package/src/color/p5.Color.js +0 -851
  208. package/src/core/README.md +0 -91
  209. package/src/core/friendly_errors/index.js +0 -13
  210. package/src/core/friendly_errors/param_validator.js +0 -561
  211. package/src/core/init.js +0 -58
  212. package/src/core/internationalization.js +0 -195
  213. package/src/core/legacy.js +0 -29
  214. package/src/core/main.js +0 -689
  215. package/src/core/noop.js +0 -1
  216. package/src/core/p5.Graphics.js +0 -696
  217. package/src/core/p5.Renderer.js +0 -408
  218. package/src/core/reference.js +0 -2060
  219. package/src/core/rendering.js +0 -697
  220. package/src/dom/index.js +0 -11
  221. package/src/image/const.js +0 -6
  222. package/src/image/image.js +0 -731
  223. package/src/image/index.js +0 -15
  224. package/src/image/loading_displaying.js +0 -1431
  225. package/src/io/files.js +0 -2210
  226. package/src/io/index.js +0 -11
  227. package/src/math/README.md +0 -40
  228. package/src/type/index.js +0 -9
  229. package/src/webgl/3d_primitives.js +0 -2741
  230. package/src/webgl/index.js +0 -37
  231. package/src/webgl/light.js +0 -1851
  232. package/src/webgl/material.js +0 -3854
  233. package/src/webgl/p5.Camera.js +0 -4010
  234. package/src/webgl/p5.Framebuffer.js +0 -1865
  235. package/src/webgl/p5.RendererGL.js +0 -2867
  236. package/src/webgl/p5.Shader.js +0 -1505
  237. package/src/webgl/p5.Texture.js +0 -541
  238. package/src/webgl/shaders/basic.frag +0 -6
  239. package/src/webgl/shaders/filters/base.frag +0 -22
  240. package/src/webgl/shaders/filters/base.vert +0 -19
  241. package/src/webgl/shaders/filters/blur.frag +0 -60
  242. package/src/webgl/shaders/filters/default.vert +0 -18
  243. package/src/webgl/shaders/filters/dilate.frag +0 -39
  244. package/src/webgl/shaders/filters/erode.frag +0 -39
  245. package/src/webgl/shaders/filters/gray.frag +0 -16
  246. package/src/webgl/shaders/filters/invert.frag +0 -15
  247. package/src/webgl/shaders/filters/opaque.frag +0 -12
  248. package/src/webgl/shaders/filters/posterize.frag +0 -29
  249. package/src/webgl/shaders/filters/threshold.frag +0 -23
  250. package/src/webgl/shaders/font.frag +0 -216
  251. package/src/webgl/shaders/font.vert +0 -44
  252. package/src/webgl/shaders/imageLight.vert +0 -33
  253. package/src/webgl/shaders/imageLightDiffused.frag +0 -82
  254. package/src/webgl/shaders/imageLightSpecular.frag +0 -134
  255. package/src/webgl/shaders/light.vert +0 -37
  256. package/src/webgl/shaders/light_texture.frag +0 -26
  257. package/src/webgl/shaders/lighting.glsl +0 -227
  258. package/src/webgl/shaders/line.frag +0 -74
  259. package/src/webgl/shaders/line.vert +0 -294
  260. package/src/webgl/shaders/normal.frag +0 -6
  261. package/src/webgl/shaders/normal.vert +0 -72
  262. package/src/webgl/shaders/phong.frag +0 -84
  263. package/src/webgl/shaders/phong.vert +0 -87
  264. package/src/webgl/shaders/point.frag +0 -29
  265. package/src/webgl/shaders/point.vert +0 -19
  266. package/src/webgl/shaders/sphereMapping.frag +0 -26
  267. package/src/webgl/shaders/webgl2Compatibility.glsl +0 -34
@@ -0,0 +1,8 @@
1
+ // This file is auto-generated from JSDoc documentation
2
+
3
+ import p5 from 'p5';
4
+
5
+ declare module 'p5' {
6
+ }
7
+
8
+ export default function ShaderGenerator(p5: any, fn: any): void;
@@ -0,0 +1,371 @@
1
+ // This file is auto-generated from JSDoc documentation
2
+
3
+ import p5 from 'p5';
4
+
5
+ declare module 'p5' {
6
+ /**
7
+ * Allows the user to orbit around a 3D sketch using a mouse, trackpad, or
8
+ * touchscreen.3D sketches are viewed through an imaginary camera. Calling
9
+ * `orbitControl()` within the draw() function allows
10
+ * the user to change the camera’s position:`function draw() {
11
+ * background(200);
12
+ *
13
+ * // Enable orbiting with the mouse.
14
+ * orbitControl();
15
+ *
16
+ * // Rest of sketch.
17
+ * }`Left-clicking and dragging or swipe motion will rotate the camera position
18
+ * about the center of the sketch. Right-clicking and dragging or multi-swipe
19
+ * will pan the camera position without rotation. Using the mouse wheel
20
+ * (scrolling) or pinch in/out will move the camera further or closer from the
21
+ * center of the sketch.The first three parameters, `sensitivityX`, `sensitivityY`, and
22
+ * `sensitivityZ`, are optional. They’re numbers that set the sketch’s
23
+ * sensitivity to movement along each axis. For example, calling
24
+ * `orbitControl(1, 2, -1)` keeps movement along the x-axis at its default
25
+ * value, makes the sketch twice as sensitive to movement along the y-axis,
26
+ * and reverses motion along the z-axis. By default, all sensitivity values
27
+ * are 1.The fourth parameter, `options`, is also optional. It’s an object that
28
+ * changes the behavior of orbiting. For example, calling
29
+ * `orbitControl(1, 1, 1, options)` keeps the default sensitivity values while
30
+ * changing the behaviors set with `options`. The object can have the
31
+ * following properties:`let options = {
32
+ * // Setting this to false makes mobile interactions smoother by
33
+ * // preventing accidental interactions with the page while orbiting.
34
+ * // By default, it's true.
35
+ * disableTouchActions: true,
36
+ *
37
+ * // Setting this to true makes the camera always rotate in the
38
+ * // direction the mouse/touch is moving.
39
+ * // By default, it's false.
40
+ * freeRotation: false
41
+ * };
42
+ *
43
+ * orbitControl(1, 1, 1, options);`
44
+ *
45
+ * @for p5
46
+ * @param sensitivity to movement along the x-axis. Defaults to 1.
47
+ * @param sensitivity to movement along the y-axis. Defaults to 1.
48
+ * @param sensitivity to movement along the z-axis. Defaults to 1.
49
+ * @param object with two optional properties, `disableTouchActions`
50
+ * and `freeRotation`. Both are `Boolean`s. `disableTouchActions`
51
+ * defaults to `true` and `freeRotation` defaults to `false`.
52
+ * @example <div>
53
+ * <code>
54
+ * // Click and drag the mouse to view the scene from different angles.
55
+ *
56
+ * function setup() {
57
+ * createCanvas(100, 100, WEBGL);
58
+ *
59
+ * describe('A multicolor box on a gray background. The camera angle changes when the user interacts using a mouse, trackpad, or touchscreen.');
60
+ * }
61
+ *
62
+ * function draw() {
63
+ * background(200);
64
+ *
65
+ * // Enable orbiting with the mouse.
66
+ * orbitControl();
67
+ *
68
+ * // Style the box.
69
+ * normalMaterial();
70
+ *
71
+ * // Draw the box.
72
+ * box(30, 50);
73
+ * }
74
+ * </code>
75
+ * </div>
76
+ *
77
+ * <div>
78
+ * <code>
79
+ * // Click and drag the mouse to view the scene from different angles.
80
+ *
81
+ * function setup() {
82
+ * createCanvas(100, 100, WEBGL);
83
+ *
84
+ * describe('A multicolor box on a gray background. The camera angle changes when the user interacts using a mouse, trackpad, or touchscreen.');
85
+ * }
86
+ *
87
+ * function draw() {
88
+ * background(200);
89
+ *
90
+ * // Enable orbiting with the mouse.
91
+ * // Make the interactions 3X sensitive.
92
+ * orbitControl(3, 3, 3);
93
+ *
94
+ * // Style the box.
95
+ * normalMaterial();
96
+ *
97
+ * // Draw the box.
98
+ * box(30, 50);
99
+ * }
100
+ * </code>
101
+ * </div>
102
+ *
103
+ * <div>
104
+ * <code>
105
+ * // Click and drag the mouse to view the scene from different angles.
106
+ *
107
+ * function setup() {
108
+ * createCanvas(100, 100, WEBGL);
109
+ *
110
+ * describe('A multicolor box on a gray background. The camera angle changes when the user interacts using a mouse, trackpad, or touchscreen.');
111
+ * }
112
+ *
113
+ * function draw() {
114
+ * background(200);
115
+ *
116
+ * // Create an options object.
117
+ * let options = {
118
+ * disableTouchActions: false,
119
+ * freeRotation: true
120
+ * };
121
+ *
122
+ * // Enable orbiting with the mouse.
123
+ * // Prevent accidental touch actions on touchscreen devices
124
+ * // and enable free rotation.
125
+ * orbitControl(1, 1, 1, options);
126
+ *
127
+ * // Style the box.
128
+ * normalMaterial();
129
+ *
130
+ * // Draw the box.
131
+ * box(30, 50);
132
+ * }
133
+ * </code>
134
+ * </div>
135
+ */
136
+ function orbitControl(sensitivityX?: number, sensitivityY?: number, sensitivityZ?: number, options?: object): void;
137
+
138
+ /**
139
+ * Adds a grid and an axes icon to clarify orientation in 3D sketches.`debugMode()` adds a grid that shows where the “ground” is in a sketch. By
140
+ * default, the grid will run through the origin `(0, 0, 0)` of the sketch
141
+ * along the XZ plane. `debugMode()` also adds an axes icon that points along
142
+ * the positive x-, y-, and z-axes. Calling `debugMode()` displays the grid
143
+ * and axes icon with their default size and position.There are four ways to call `debugMode()` with optional parameters to
144
+ * customize the debugging environment.The first way to call `debugMode()` has one parameter, `mode`. If the
145
+ * system constant `GRID` is passed, as in `debugMode(GRID)`, then the grid
146
+ * will be displayed and the axes icon will be hidden. If the constant `AXES`
147
+ * is passed, as in `debugMode(AXES)`, then the axes icon will be displayed
148
+ * and the grid will be hidden.The second way to call `debugMode()` has six parameters. The first
149
+ * parameter, `mode`, selects either `GRID` or `AXES` to be displayed. The
150
+ * next five parameters, `gridSize`, `gridDivisions`, `xOff`, `yOff`, and
151
+ * `zOff` are optional. They’re numbers that set the appearance of the grid
152
+ * (`gridSize` and `gridDivisions`) and the placement of the axes icon
153
+ * (`xOff`, `yOff`, and `zOff`). For example, calling
154
+ * `debugMode(20, 5, 10, 10, 10)` sets the `gridSize` to 20 pixels, the number
155
+ * of `gridDivisions` to 5, and offsets the axes icon by 10 pixels along the
156
+ * x-, y-, and z-axes.The third way to call `debugMode()` has five parameters. The first
157
+ * parameter, `mode`, selects either `GRID` or `AXES` to be displayed. The
158
+ * next four parameters, `axesSize`, `xOff`, `yOff`, and `zOff` are optional.
159
+ * They’re numbers that set the appearance of the size of the axes icon
160
+ * (`axesSize`) and its placement (`xOff`, `yOff`, and `zOff`).The fourth way to call `debugMode()` has nine optional parameters. The
161
+ * first five parameters, `gridSize`, `gridDivisions`, `gridXOff`, `gridYOff`,
162
+ * and `gridZOff` are numbers that set the appearance of the grid. For
163
+ * example, calling `debugMode(100, 5, 0, 0, 0)` sets the `gridSize` to 100,
164
+ * the number of `gridDivisions` to 5, and sets all the offsets to 0 so that
165
+ * the grid is centered at the origin. The next four parameters, `axesSize`,
166
+ * `xOff`, `yOff`, and `zOff` are numbers that set the appearance of the size
167
+ * of the axes icon (`axesSize`) and its placement (`axesXOff`, `axesYOff`,
168
+ * and `axesZOff`). For example, calling
169
+ * `debugMode(100, 5, 0, 0, 0, 50, 10, 10, 10)` sets the `gridSize` to 100,
170
+ * the number of `gridDivisions` to 5, and sets all the offsets to 0 so that
171
+ * the grid is centered at the origin. It then sets the `axesSize` to 50 and
172
+ * offsets the icon 10 pixels along each axis.
173
+ *
174
+ * @example <div>
175
+ * <code>
176
+ * // Click and drag the mouse to view the scene from different angles.
177
+ *
178
+ * function setup() {
179
+ * createCanvas(100, 100, WEBGL);
180
+ *
181
+ * // Enable debug mode.
182
+ * debugMode();
183
+ *
184
+ * describe('A multicolor box on a gray background. A grid and axes icon are displayed near the box.');
185
+ * }
186
+ *
187
+ * function draw() {
188
+ * background(200);
189
+ *
190
+ * // Enable orbiting with the mouse.
191
+ * orbitControl();
192
+ *
193
+ * // Style the box.
194
+ * normalMaterial();
195
+ *
196
+ * // Draw the box.
197
+ * box(20, 40);
198
+ * }
199
+ * </code>
200
+ * </div>
201
+ *
202
+ * <div>
203
+ * <code>
204
+ * // Click and drag the mouse to view the scene from different angles.
205
+ *
206
+ * function setup() {
207
+ * createCanvas(100, 100, WEBGL);
208
+ *
209
+ * // Enable debug mode.
210
+ * // Only display the axes icon.
211
+ * debugMode(AXES);
212
+ *
213
+ * describe('A multicolor box on a gray background. A grid and axes icon are displayed near the box.');
214
+ * }
215
+ *
216
+ * function draw() {
217
+ * background(200);
218
+ *
219
+ * // Enable orbiting with the mouse.
220
+ * orbitControl();
221
+ *
222
+ * // Style the box.
223
+ * normalMaterial();
224
+ *
225
+ * // Draw the box.
226
+ * box(20, 40);
227
+ * }
228
+ * </code>
229
+ * </div>
230
+ *
231
+ * <div>
232
+ * <code>
233
+ * // Click and drag the mouse to view the scene from different angles.
234
+ *
235
+ * function setup() {
236
+ * createCanvas(100, 100, WEBGL);
237
+ *
238
+ * // Enable debug mode.
239
+ * // Only display the grid and customize it:
240
+ * // - size: 50
241
+ * // - divisions: 10
242
+ * // - offsets: 0, 20, 0
243
+ * debugMode(GRID, 50, 10, 0, 20, 0);
244
+ *
245
+ * describe('A multicolor box on a gray background. A grid is displayed below the box.');
246
+ * }
247
+ *
248
+ * function draw() {
249
+ * background(200);
250
+ *
251
+ * // Enable orbiting with the mouse.
252
+ * orbitControl();
253
+ *
254
+ * // Style the box.
255
+ * normalMaterial();
256
+ *
257
+ * // Draw the box.
258
+ * box(20, 40);
259
+ * }
260
+ * </code>
261
+ * </div>
262
+ *
263
+ * <div>
264
+ * <code>
265
+ * // Click and drag the mouse to view the scene from different angles.
266
+ *
267
+ * function setup() {
268
+ * createCanvas(100, 100, WEBGL);
269
+ *
270
+ * // Enable debug mode.
271
+ * // Display the grid and axes icon and customize them:
272
+ * // Grid
273
+ * // ----
274
+ * // - size: 50
275
+ * // - divisions: 10
276
+ * // - offsets: 0, 20, 0
277
+ * // Axes
278
+ * // ----
279
+ * // - size: 50
280
+ * // - offsets: 0, 0, 0
281
+ * debugMode(50, 10, 0, 20, 0, 50, 0, 0, 0);
282
+ *
283
+ * describe('A multicolor box on a gray background. A grid is displayed below the box. An axes icon is displayed at the center of the box.');
284
+ * }
285
+ *
286
+ * function draw() {
287
+ * background(200);
288
+ *
289
+ * // Enable orbiting with the mouse.
290
+ * orbitControl();
291
+ *
292
+ * // Style the box.
293
+ * normalMaterial();
294
+ *
295
+ * // Draw the box.
296
+ * box(20, 40);
297
+ * }
298
+ * </code>
299
+ * </div>
300
+ */
301
+ function debugMode(): void;
302
+
303
+ /**
304
+ * @param either GRID or AXES
305
+ */
306
+ function debugMode(mode: GRID | AXES): void;
307
+
308
+ /**
309
+ * @param side length of the grid.
310
+ * @param number of divisions in the grid.
311
+ * @param offset from origin along the x-axis.
312
+ * @param offset from origin along the y-axis.
313
+ * @param offset from origin along the z-axis.
314
+ */
315
+ function debugMode(mode: GRID | AXES, gridSize?: number, gridDivisions?: number, xOff?: number, yOff?: number, zOff?: number): void;
316
+
317
+ /**
318
+ * @param length of axes icon markers.
319
+ */
320
+ function debugMode(mode: GRID | AXES, axesSize?: number, xOff?: number, yOff?: number, zOff?: number): void;
321
+
322
+ /**
323
+ * @param grid offset from the origin along the x-axis.
324
+ * @param grid offset from the origin along the y-axis.
325
+ * @param grid offset from the origin along the z-axis.
326
+ * @param axes icon offset from the origin along the x-axis.
327
+ * @param axes icon offset from the origin along the y-axis.
328
+ * @param axes icon offset from the origin along the z-axis.
329
+ */
330
+ function debugMode(gridSize?: number, gridDivisions?: number, gridXOff?: number, gridYOff?: number, gridZOff?: number, axesSize?: number, axesXOff?: number, axesYOff?: number, axesZOff?: number): void;
331
+
332
+ /**
333
+ * Turns off debugMode() in a 3D sketch.
334
+ *
335
+ * @example <div>
336
+ * <code>
337
+ * // Click and drag the mouse to view the scene from different angles.
338
+ *
339
+ * function setup() {
340
+ * createCanvas(100, 100, WEBGL);
341
+ *
342
+ * // Enable debug mode.
343
+ * debugMode();
344
+ *
345
+ * describe('A multicolor box on a gray background. A grid and axes icon are displayed near the box. They disappear when the user double-clicks.');
346
+ * }
347
+ *
348
+ * function draw() {
349
+ * background(200);
350
+ *
351
+ * // Enable orbiting with the mouse.
352
+ * orbitControl();
353
+ *
354
+ * // Style the box.
355
+ * normalMaterial();
356
+ *
357
+ * // Draw the box. box(20, 40);
358
+ * }
359
+ *
360
+ * // Disable debug mode when the user double-clicks.
361
+ * function doubleClicked() {
362
+ * noDebugMode();
363
+ * }
364
+ * </code>
365
+ * </div>
366
+ */
367
+ function noDebugMode(): void;
368
+
369
+ }
370
+
371
+ export default function interaction(p5: any, fn: any): void;