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,323 @@
1
+ // This file is auto-generated from JSDoc documentation
2
+
3
+ import p5 from 'p5';
4
+
5
+ declare module 'p5' {
6
+ /**
7
+ * Stores a value in the web browser's local storage.Web browsers can save small amounts of data using the built-in
8
+ * localStorage object.
9
+ * Data stored in `localStorage` can be retrieved at any point, even after
10
+ * refreshing a page or restarting the browser. Data are stored as key-value
11
+ * pairs.`storeItem()` makes it easy to store values in `localStorage` and
12
+ * getItem() makes it easy to retrieve them.The first parameter, `key`, is the name of the value to be stored as a
13
+ * string.The second parameter, `value`, is the value to be stored. Values can have
14
+ * any type.Note: Sensitive data such as passwords or personal information shouldn't be
15
+ * stored in `localStorage`.
16
+ *
17
+ * @for p5
18
+ * @param name of the value.
19
+ * @param value to be stored.
20
+ * @example <div>
21
+ * <code>
22
+ * function setup() {
23
+ * createCanvas(100, 100);
24
+ *
25
+ * // Store the player's name.
26
+ * storeItem('name', 'Feist');
27
+ *
28
+ * // Store the player's score.
29
+ * storeItem('score', 1234);
30
+ *
31
+ * describe('The text "Feist: 1234" written in black on a gray background.');
32
+ * }
33
+ *
34
+ * function draw() {
35
+ * background(200);
36
+ *
37
+ * // Style the text.
38
+ * textAlign(CENTER, CENTER);
39
+ * textSize(14);
40
+ *
41
+ * // Retrieve the name.
42
+ * let name = getItem('name');
43
+ *
44
+ * // Retrieve the score.
45
+ * let score = getItem('score');
46
+ *
47
+ * // Display the score.
48
+ * text(`${name}: ${score}`, 50, 50);
49
+ * }
50
+ * </code>
51
+ * </div>
52
+ *
53
+ * <div>
54
+ * <code>
55
+ * function setup() {
56
+ * createCanvas(100, 100);
57
+ *
58
+ * // Create an object.
59
+ * let p = { x: 50, y: 50 };
60
+ *
61
+ * // Store the object.
62
+ * storeItem('position', p);
63
+ *
64
+ * describe('A white circle on a gray background.');
65
+ * }
66
+ *
67
+ * function draw() {
68
+ * background(200);
69
+ *
70
+ * // Retrieve the object.
71
+ * let p = getItem('position');
72
+ *
73
+ * // Draw the circle.
74
+ * circle(p.x, p.y, 30);
75
+ * }
76
+ * </code>
77
+ * </div>
78
+ *
79
+ * function setup() {
80
+ * createCanvas(100, 100);
81
+ *
82
+ * // Create a p5.Color object.
83
+ * let c = color('deeppink');
84
+ *
85
+ * // Store the object.
86
+ * storeItem('color', c);
87
+ *
88
+ * describe('A pink circle on a gray background.');
89
+ * }
90
+ *
91
+ * function draw() {
92
+ * background(200);
93
+ *
94
+ * // Retrieve the object.
95
+ * let c = getItem('color');
96
+ *
97
+ * // Style the circle.
98
+ * fill(c);
99
+ *
100
+ * // Draw the circle.
101
+ * circle(50, 50, 30);
102
+ * }
103
+ * </code>
104
+ * </div>
105
+ */
106
+ function storeItem(key: string, value: string | number | boolean | object | Array): void;
107
+
108
+ /**
109
+ * Returns a value in the web browser's local storage.Web browsers can save small amounts of data using the built-in
110
+ * localStorage object.
111
+ * Data stored in `localStorage` can be retrieved at any point, even after
112
+ * refreshing a page or restarting the browser. Data are stored as key-value
113
+ * pairs.storeItem() makes it easy to store values in
114
+ * `localStorage` and `getItem()` makes it easy to retrieve them.The first parameter, `key`, is the name of the value to be stored as a
115
+ * string.The second parameter, `value`, is the value to be retrieved a string. For
116
+ * example, calling `getItem('size')` retrieves the value with the key `size`.Note: Sensitive data such as passwords or personal information shouldn't be
117
+ * stored in `localStorage`.
118
+ *
119
+ * @for p5
120
+ * @param name of the value.
121
+ * @return stored item.
122
+ * @example <div>
123
+ * <code>
124
+ * function setup() {
125
+ * createCanvas(100, 100);
126
+ *
127
+ * // Store the player's name.
128
+ * storeItem('name', 'Feist');
129
+ *
130
+ * // Store the player's score.
131
+ * storeItem('score', 1234);
132
+ *
133
+ * describe('The text "Feist: 1234" written in black on a gray background.');
134
+ * }
135
+ *
136
+ * function draw() {
137
+ * background(200);
138
+ *
139
+ * // Style the text.
140
+ * textAlign(CENTER, CENTER);
141
+ * textSize(14);
142
+ *
143
+ * // Retrieve the name.
144
+ * let name = getItem('name');
145
+ *
146
+ * // Retrieve the score.
147
+ * let score = getItem('score');
148
+ *
149
+ * // Display the score.
150
+ * text(`${name}: ${score}`, 50, 50);
151
+ * }
152
+ * </code>
153
+ * </div>
154
+ *
155
+ * <div>
156
+ * <code>
157
+ * function setup() {
158
+ * createCanvas(100, 100);
159
+ *
160
+ * // Create an object.
161
+ * let p = { x: 50, y: 50 };
162
+ *
163
+ * // Store the object.
164
+ * storeItem('position', p);
165
+ *
166
+ * describe('A white circle on a gray background.');
167
+ * }
168
+ *
169
+ * function draw() {
170
+ * background(200);
171
+ *
172
+ * // Retrieve the object.
173
+ * let p = getItem('position');
174
+ *
175
+ * // Draw the circle.
176
+ * circle(p.x, p.y, 30);
177
+ * }
178
+ * </code>
179
+ * </div>
180
+ *
181
+ * <div>
182
+ * <code>
183
+ * function setup() {
184
+ * createCanvas(100, 100);
185
+ *
186
+ * // Create a p5.Color object.
187
+ * let c = color('deeppink');
188
+ *
189
+ * // Store the object.
190
+ * storeItem('color', c);
191
+ *
192
+ * describe('A pink circle on a gray background.');
193
+ * }
194
+ *
195
+ * function draw() {
196
+ * background(200);
197
+ *
198
+ * // Retrieve the object.
199
+ * let c = getItem('color');
200
+ *
201
+ * // Style the circle.
202
+ * fill(c);
203
+ *
204
+ * // Draw the circle.
205
+ * circle(50, 50, 30);
206
+ * }
207
+ * </code>
208
+ * </div>
209
+ */
210
+ function getItem(key: string): string | number | boolean | object | Array;
211
+
212
+ /**
213
+ * Removes all items in the web browser's local storage.Web browsers can save small amounts of data using the built-in
214
+ * localStorage object.
215
+ * Data stored in `localStorage` can be retrieved at any point, even after
216
+ * refreshing a page or restarting the browser. Data are stored as key-value
217
+ * pairs. Calling `clearStorage()` removes all data from `localStorage`.Note: Sensitive data such as passwords or personal information shouldn't be
218
+ * stored in `localStorage`.
219
+ *
220
+ * @for p5
221
+ * @example <div>
222
+ * <code>
223
+ * // Double-click to clear localStorage.
224
+ *
225
+ * function setup() {
226
+ * createCanvas(100, 100);
227
+ *
228
+ * // Store the player's name.
229
+ * storeItem('name', 'Feist');
230
+ *
231
+ * // Store the player's score.
232
+ * storeItem('score', 1234);
233
+ *
234
+ * describe(
235
+ * 'The text "Feist: 1234" written in black on a gray background. The text "null: null" appears when the user double-clicks.'
236
+ * );
237
+ * }
238
+ *
239
+ * function draw() {
240
+ * background(200);
241
+ *
242
+ * // Style the text.
243
+ * textAlign(CENTER, CENTER);
244
+ * textSize(14);
245
+ *
246
+ * // Retrieve the name.
247
+ * let name = getItem('name');
248
+ *
249
+ * // Retrieve the score.
250
+ * let score = getItem('score');
251
+ *
252
+ * // Display the score.
253
+ * text(`${name}: ${score}`, 50, 50);
254
+ * }
255
+ *
256
+ * // Clear localStorage when the user double-clicks.
257
+ * function doubleClicked() {
258
+ * clearStorage();
259
+ * }
260
+ * </code>
261
+ * </div>
262
+ */
263
+ function clearStorage(): void;
264
+
265
+ /**
266
+ * Removes an item from the web browser's local storage.Web browsers can save small amounts of data using the built-in
267
+ * localStorage object.
268
+ * Data stored in `localStorage` can be retrieved at any point, even after
269
+ * refreshing a page or restarting the browser. Data are stored as key-value
270
+ * pairs.storeItem() makes it easy to store values in
271
+ * `localStorage` and `removeItem()` makes it easy to delete them.The parameter, `key`, is the name of the value to remove as a string. For
272
+ * example, calling `removeItem('size')` removes the item with the key `size`.Note: Sensitive data such as passwords or personal information shouldn't be
273
+ * stored in `localStorage`.
274
+ *
275
+ * @param name of the value to remove.
276
+ * @for p5
277
+ * @example <div>
278
+ * <code>
279
+ * // Double-click to remove an item from localStorage.
280
+ *
281
+ * function setup() {
282
+ * createCanvas(100, 100);
283
+ *
284
+ * // Store the player's name.
285
+ * storeItem('name', 'Feist');
286
+ *
287
+ * // Store the player's score.
288
+ * storeItem('score', 1234);
289
+ *
290
+ * describe(
291
+ * 'The text "Feist: 1234" written in black on a gray background. The text "Feist: null" appears when the user double-clicks.'
292
+ * );
293
+ * }
294
+ *
295
+ * function draw() {
296
+ * background(200);
297
+ *
298
+ * // Style the text.
299
+ * textAlign(CENTER, CENTER);
300
+ * textSize(14);
301
+ *
302
+ * // Retrieve the name.
303
+ * let name = getItem('name');
304
+ *
305
+ * // Retrieve the score.
306
+ * let score = getItem('score');
307
+ *
308
+ * // Display the score.
309
+ * text(`${name}: ${score}`, 50, 50);
310
+ * }
311
+ *
312
+ * // Remove the word from localStorage when the user double-clicks.
313
+ * function doubleClicked() {
314
+ * removeItem('score');
315
+ * }
316
+ * </code>
317
+ * </div>
318
+ */
319
+ function removeItem(key: string): void;
320
+
321
+ }
322
+
323
+ export default function local_storage(p5: any, fn: any): void;