p5 2.0.1 → 2.0.3

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 (160) hide show
  1. package/dist/accessibility/color_namer.js +5 -5
  2. package/dist/accessibility/describe.js +10 -0
  3. package/dist/accessibility/index.js +5 -5
  4. package/dist/accessibility/outputs.js +21 -0
  5. package/dist/app.js +5 -5
  6. package/dist/color/color_conversion.js +5 -5
  7. package/dist/color/creating_reading.js +1 -1
  8. package/dist/color/index.js +2 -2
  9. package/dist/color/p5.Color.js +1 -1
  10. package/dist/color/setting.js +2 -2
  11. package/dist/{constants-C-g_eAdC.js → constants-BRcElHU3.js} +19 -3
  12. package/dist/core/constants.js +1 -1
  13. package/dist/core/environment.js +6 -5
  14. package/dist/core/friendly_errors/fes_core.js +1 -1
  15. package/dist/core/friendly_errors/index.js +1 -1
  16. package/dist/core/friendly_errors/param_validator.js +46 -93
  17. package/dist/core/friendly_errors/sketch_reader.js +5 -5
  18. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  19. package/dist/core/friendly_errors/validate_params.js +5 -5
  20. package/dist/core/helpers.js +1 -1
  21. package/dist/core/init.js +5 -5
  22. package/dist/core/legacy.js +5 -5
  23. package/dist/core/main.js +5 -5
  24. package/dist/core/p5.Graphics.js +4 -4
  25. package/dist/core/p5.Renderer.js +3 -3
  26. package/dist/core/p5.Renderer2D.js +5 -5
  27. package/dist/core/rendering.js +4 -4
  28. package/dist/{creating_reading-D4AAKRbx.js → creating_reading-Cr8L2Jnm.js} +2 -2
  29. package/dist/dom/dom.js +10 -10
  30. package/dist/dom/index.js +2 -2
  31. package/dist/dom/p5.Element.js +2 -2
  32. package/dist/dom/p5.MediaElement.js +2 -2
  33. package/dist/events/acceleration.js +24 -24
  34. package/dist/events/keyboard.js +11 -6
  35. package/dist/image/const.js +1 -1
  36. package/dist/image/filterRenderer2D.js +4 -4
  37. package/dist/image/image.js +4 -4
  38. package/dist/image/index.js +4 -4
  39. package/dist/image/loading_displaying.js +4 -4
  40. package/dist/image/p5.Image.js +3 -3
  41. package/dist/image/pixels.js +1 -0
  42. package/dist/io/files.js +4 -4
  43. package/dist/io/index.js +4 -4
  44. package/dist/io/p5.TableRow.js +2 -2
  45. package/dist/{main-s72KWcUy.js → main-BKN5yFoS.js} +12 -9
  46. package/dist/math/Matrices/Matrix.js +1 -1
  47. package/dist/math/Matrices/MatrixNumjs.js +1 -1
  48. package/dist/math/index.js +1 -1
  49. package/dist/math/math.js +1 -1
  50. package/dist/math/p5.Matrix.js +1 -1
  51. package/dist/math/p5.Vector.js +1 -1
  52. package/dist/math/trigonometry.js +1 -1
  53. package/dist/{p5.Renderer-CwAYZOC2.js → p5.Renderer-R23xoC7s.js} +5 -5
  54. package/dist/{rendering--aAe5aq3.js → rendering-CvUVN-Vb.js} +101 -66
  55. package/dist/shape/2d_primitives.js +1 -1
  56. package/dist/shape/attributes.js +1 -1
  57. package/dist/shape/custom_shapes.js +2 -2
  58. package/dist/shape/index.js +2 -2
  59. package/dist/type/index.js +3 -3
  60. package/dist/type/p5.Font.js +3 -5
  61. package/dist/type/textCore.js +4 -4
  62. package/dist/webgl/3d_primitives.js +4 -4
  63. package/dist/webgl/GeometryBuilder.js +1 -1
  64. package/dist/webgl/ShapeBuilder.js +1 -1
  65. package/dist/webgl/index.js +4 -4
  66. package/dist/webgl/interaction.js +1 -1
  67. package/dist/webgl/light.js +4 -4
  68. package/dist/webgl/loading.js +5 -4
  69. package/dist/webgl/material.js +4 -4
  70. package/dist/webgl/p5.Camera.js +4 -4
  71. package/dist/webgl/p5.Framebuffer.js +4 -4
  72. package/dist/webgl/p5.Geometry.js +1 -1
  73. package/dist/webgl/p5.Quat.js +1 -1
  74. package/dist/webgl/p5.RendererGL.js +4 -4
  75. package/dist/webgl/p5.Shader.js +4 -4
  76. package/dist/webgl/p5.Texture.js +4 -4
  77. package/dist/webgl/text.js +32 -34
  78. package/lib/p5.esm.js +289 -247
  79. package/lib/p5.js +289 -247
  80. package/lib/p5.min.js +1 -1
  81. package/package.json +1 -2
  82. package/types/accessibility/color_namer.d.ts +8 -0
  83. package/types/accessibility/describe.d.ts +184 -0
  84. package/types/accessibility/gridOutput.d.ts +8 -0
  85. package/types/accessibility/outputs.d.ts +235 -0
  86. package/types/accessibility/textOutput.d.ts +8 -0
  87. package/types/color/color_conversion.d.ts +47 -0
  88. package/types/color/creating_reading.d.ts +1348 -0
  89. package/types/color/p5.Color.d.ts +1070 -0
  90. package/types/color/setting.d.ts +2085 -0
  91. package/types/core/constants.d.ts +341 -0
  92. package/types/core/environment.d.ts +668 -0
  93. package/types/core/friendly_errors/fes_core.d.ts +8 -0
  94. package/types/core/friendly_errors/file_errors.d.ts +8 -0
  95. package/types/core/friendly_errors/param_validator.d.ts +30 -0
  96. package/types/core/friendly_errors/sketch_reader.d.ts +8 -0
  97. package/types/core/friendly_errors/stacktrace.d.ts +11 -0
  98. package/types/core/friendly_errors/validate_params.d.ts +8 -0
  99. package/types/core/helpers.d.ts +8 -0
  100. package/types/core/legacy.d.ts +8 -0
  101. package/types/core/main.d.ts +5999 -0
  102. package/types/core/p5.Graphics.d.ts +484 -0
  103. package/types/core/p5.Renderer.d.ts +14 -0
  104. package/types/core/reference.d.ts +8 -0
  105. package/types/core/rendering.d.ts +481 -0
  106. package/types/core/structure.d.ts +492 -0
  107. package/types/core/transform.d.ts +1638 -0
  108. package/types/data/local_storage.d.ts +323 -0
  109. package/types/dom/dom.d.ts +1295 -0
  110. package/types/dom/p5.Element.d.ts +2011 -0
  111. package/types/dom/p5.File.d.ts +13 -0
  112. package/types/dom/p5.MediaElement.d.ts +1249 -0
  113. package/types/events/acceleration.d.ts +193 -0
  114. package/types/events/keyboard.d.ts +501 -0
  115. package/types/events/pointer.d.ts +782 -0
  116. package/types/global.d.ts +5544 -0
  117. package/types/image/filterRenderer2D.d.ts +54 -0
  118. package/types/image/image.d.ts +326 -0
  119. package/types/image/loading_displaying.d.ts +580 -0
  120. package/types/image/p5.Image.d.ts +5882 -0
  121. package/types/image/pixels.d.ts +832 -0
  122. package/types/io/files.d.ts +1447 -0
  123. package/types/io/p5.Table.d.ts +1247 -0
  124. package/types/io/p5.TableRow.d.ts +343 -0
  125. package/types/io/p5.XML.d.ts +1188 -0
  126. package/types/math/Matrices/Matrix.d.ts +1029 -0
  127. package/types/math/Matrices/MatrixNumjs.d.ts +8 -0
  128. package/types/math/calculation.d.ts +923 -0
  129. package/types/math/math.d.ts +90 -0
  130. package/types/math/noise.d.ts +311 -0
  131. package/types/math/p5.Matrix.d.ts +8 -0
  132. package/types/math/p5.Vector.d.ts +3416 -0
  133. package/types/math/random.d.ts +267 -0
  134. package/types/math/trigonometry.d.ts +663 -0
  135. package/types/p5.d.ts +6666 -0
  136. package/types/shape/2d_primitives.d.ts +1033 -0
  137. package/types/shape/attributes.d.ts +466 -0
  138. package/types/shape/curves.d.ts +740 -0
  139. package/types/shape/custom_shapes.d.ts +888 -0
  140. package/types/shape/vertex.d.ts +1141 -0
  141. package/types/type/p5.Font.d.ts +575 -0
  142. package/types/type/textCore.d.ts +1198 -0
  143. package/types/utilities/conversion.d.ts +894 -0
  144. package/types/utilities/time_date.d.ts +295 -0
  145. package/types/utilities/utility_functions.d.ts +587 -0
  146. package/types/webgl/3d_primitives.d.ts +1432 -0
  147. package/types/webgl/ShaderGenerator.d.ts +8 -0
  148. package/types/webgl/interaction.d.ts +371 -0
  149. package/types/webgl/light.d.ts +1184 -0
  150. package/types/webgl/loading.d.ts +482 -0
  151. package/types/webgl/material.d.ts +2656 -0
  152. package/types/webgl/p5.Camera.d.ts +3023 -0
  153. package/types/webgl/p5.DataArray.d.ts +61 -0
  154. package/types/webgl/p5.Framebuffer.d.ts +760 -0
  155. package/types/webgl/p5.Geometry.d.ts +1191 -0
  156. package/types/webgl/p5.Quat.d.ts +45 -0
  157. package/types/webgl/p5.RendererGL.d.ts +234 -0
  158. package/types/webgl/p5.Shader.d.ts +660 -0
  159. package/types/webgl/p5.Texture.d.ts +61 -0
  160. package/types/webgl/text.d.ts +74 -0
@@ -0,0 +1,295 @@
1
+ // This file is auto-generated from JSDoc documentation
2
+
3
+ import p5 from 'p5';
4
+
5
+ declare module 'p5' {
6
+ /**
7
+ * Returns the current day as a number from 1–31.
8
+ *
9
+ * @return current day between 1 and 31.
10
+ * @example <div>
11
+ * <code>
12
+ * function setup() {
13
+ * createCanvas(100, 100);
14
+ *
15
+ * background(200);
16
+ *
17
+ * // Get the current day.
18
+ * let d = day();
19
+ *
20
+ * // Style the text.
21
+ * textAlign(LEFT, CENTER);
22
+ * textSize(12);
23
+ * textFont('Courier New');
24
+ *
25
+ * // Display the day.
26
+ * text(`Current day: ${d}`, 20, 50, 60);
27
+ *
28
+ * describe(`The text 'Current day: ${d}' written in black on a gray background.`);
29
+ * }
30
+ * </code>
31
+ * </div>
32
+ */
33
+ function day(): number;
34
+
35
+ /**
36
+ * Returns the current hour as a number from 0–23.
37
+ *
38
+ * @return current hour between 0 and 23.
39
+ * @example <div>
40
+ * <code>
41
+ * function setup() {
42
+ * createCanvas(100, 100);
43
+ *
44
+ * background(200);
45
+ *
46
+ * // Get the current hour.
47
+ * let h = hour();
48
+ *
49
+ * // Style the text.
50
+ * textAlign(LEFT, CENTER);
51
+ * textSize(12);
52
+ * textFont('Courier New');
53
+ *
54
+ * // Display the hour.
55
+ * text(`Current hour: ${h}`, 20, 50, 60);
56
+ *
57
+ * describe(`The text 'Current hour: ${h}' written in black on a gray background.`);
58
+ * }
59
+ * </code>
60
+ * </div>
61
+ */
62
+ function hour(): number;
63
+
64
+ /**
65
+ * Returns the current minute as a number from 0–59.
66
+ *
67
+ * @return current minute between 0 and 59.
68
+ * @example <div>
69
+ * <code>
70
+ * function setup() {
71
+ * createCanvas(100, 100);
72
+ *
73
+ * background(200);
74
+ *
75
+ * // Get the current minute.
76
+ * let m = minute();
77
+ *
78
+ * // Style the text.
79
+ * textAlign(LEFT, CENTER);
80
+ * textSize(12);
81
+ * textFont('Courier New');
82
+ *
83
+ * // Display the minute.
84
+ * text(`Current minute: ${m}`, 10, 50, 80);
85
+ *
86
+ * describe(`The text 'Current minute: ${m}' written in black on a gray background.`);
87
+ * }
88
+ * </code>
89
+ * </div>
90
+ */
91
+ function minute(): number;
92
+
93
+ /**
94
+ * Returns the number of milliseconds since a sketch started running.`millis()` keeps track of how long a sketch has been running in
95
+ * milliseconds (thousandths of a second). This information is often
96
+ * helpful for timing events and animations.If a sketch has a
97
+ * setup() function, then `millis()` begins tracking
98
+ * time before the code in setup() runs. If a
99
+ * sketch includes asynchronous loading using `async`/`await`, then
100
+ * `millis()` begins tracking time as soon as the asynchronous code
101
+ * starts running.
102
+ *
103
+ * @return number of milliseconds since starting the sketch.
104
+ * @example <div>
105
+ * <code>
106
+ * function setup() {
107
+ * createCanvas(100, 100);
108
+ *
109
+ * background(200);
110
+ *
111
+ * // Get the number of milliseconds the sketch has run.
112
+ * let ms = millis();
113
+ *
114
+ * // Style the text.
115
+ * textAlign(LEFT, CENTER);
116
+ * textSize(10);
117
+ * textFont('Courier New');
118
+ *
119
+ * // Display how long it took setup() to be called.
120
+ * text(`Startup time: ${round(ms, 2)} ms`, 5, 50, 90);
121
+ *
122
+ * describe(
123
+ * `The text 'Startup time: ${round(ms, 2)} ms' written in black on a gray background.`
124
+ * );
125
+ * }
126
+ * </code>
127
+ * </div>
128
+ *
129
+ * <div>
130
+ * <code>
131
+ * function setup() {
132
+ * createCanvas(100, 100);
133
+ *
134
+ * describe('The text "Running time: S sec" written in black on a gray background. The number S increases as the sketch runs.');
135
+ * }
136
+ *
137
+ * function draw() {
138
+ * background(200);
139
+ *
140
+ * // Get the number of seconds the sketch has run.
141
+ * let s = millis() / 1000;
142
+ *
143
+ * // Style the text.
144
+ * textAlign(LEFT, CENTER);
145
+ * textSize(10);
146
+ * textFont('Courier New');
147
+ *
148
+ * // Display how long the sketch has run.
149
+ * text(`Running time: ${nf(s, 1, 1)} sec`, 5, 50, 90);
150
+ * }
151
+ * </code>
152
+ * </div>
153
+ *
154
+ * <div>
155
+ * <code>
156
+ * function setup() {
157
+ * createCanvas(100, 100);
158
+ *
159
+ * describe('A white circle oscillates left and right on a gray background.');
160
+ * }
161
+ *
162
+ * function draw() {
163
+ * background(200);
164
+ *
165
+ * // Get the number of seconds the sketch has run.
166
+ * let s = millis() / 1000;
167
+ *
168
+ * // Calculate an x-coordinate.
169
+ * let x = 30 * sin(s) + 50;
170
+ *
171
+ * // Draw the circle.
172
+ * circle(x, 50, 30);
173
+ * }
174
+ * </code>
175
+ * </div>
176
+ *
177
+ * <div>
178
+ * <code>
179
+ * async function setup() {
180
+ * // Load the GeoJSON.
181
+ * await loadJSON('https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson');
182
+ * createCanvas(100, 100);
183
+ *
184
+ * background(200);
185
+ *
186
+ * // Get the number of milliseconds the sketch has run.
187
+ * let ms = millis();
188
+ *
189
+ * // Style the text.
190
+ * textAlign(LEFT, CENTER);
191
+ * textFont('Courier New');
192
+ * textSize(11);
193
+ *
194
+ * // Display how long it took to load the data.
195
+ * text(`It took ${round(ms, 2)} ms to load the data`, 5, 50, 100);
196
+ *
197
+ * describe(
198
+ * `The text "It took ${round(ms, 2)} ms to load the data" written in black on a gray background.`
199
+ * );
200
+ * }
201
+ * </code>
202
+ * </div>
203
+ */
204
+ function millis(): number;
205
+
206
+ /**
207
+ * Returns the current month as a number from 1–12.
208
+ *
209
+ * @return current month between 1 and 12.
210
+ * @example <div>
211
+ * <code>
212
+ * function setup() {
213
+ * createCanvas(100, 100);
214
+ *
215
+ * background(200);
216
+ *
217
+ * // Get the current month.
218
+ * let m = month();
219
+ *
220
+ * // Style the text.
221
+ * textAlign(LEFT, CENTER);
222
+ * textSize(12);
223
+ * textFont('Courier New');
224
+ *
225
+ * // Display the month.
226
+ * text(`Current month: ${m}`, 10, 50, 80);
227
+ *
228
+ * describe(`The text 'Current month: ${m}' written in black on a gray background.`);
229
+ * }
230
+ * </code>
231
+ * </div>
232
+ */
233
+ function month(): number;
234
+
235
+ /**
236
+ * Returns the current second as a number from 0–59.
237
+ *
238
+ * @return current second between 0 and 59.
239
+ * @example <div>
240
+ * <code>
241
+ * function setup() {
242
+ * createCanvas(100, 100);
243
+ *
244
+ * background(200);
245
+ *
246
+ * // Get the current second.
247
+ * let s = second();
248
+ *
249
+ * // Style the text.
250
+ * textAlign(LEFT, CENTER);
251
+ * textSize(12);
252
+ * textFont('Courier New');
253
+ *
254
+ * // Display the second.
255
+ * text(`Current second: ${s}`, 10, 50, 80);
256
+ *
257
+ * describe(`The text 'Current second: ${s}' written in black on a gray background.`);
258
+ * }
259
+ * </code>
260
+ * </div>
261
+ */
262
+ function second(): number;
263
+
264
+ /**
265
+ * Returns the current year as a number such as 1999.
266
+ *
267
+ * @return current year.
268
+ * @example <div>
269
+ * <code>
270
+ * function setup() {
271
+ * createCanvas(100, 100);
272
+ *
273
+ * background(200);
274
+ *
275
+ * // Get the current year.
276
+ * let y = year();
277
+ *
278
+ * // Style the text.
279
+ * textAlign(LEFT, CENTER);
280
+ * textSize(12);
281
+ * textFont('Courier New');
282
+ *
283
+ * // Display the year.
284
+ * text(`Current year: ${y}`, 10, 50, 80);
285
+ *
286
+ * describe(`The text 'Current year: ${y}' written in black on a gray background.`);
287
+ * }
288
+ * </code>
289
+ * </div>
290
+ */
291
+ function year(): number;
292
+
293
+ }
294
+
295
+ export default function time_date(p5: any, fn: any): void;