@twin.org/image 0.0.1-next.7 → 0.0.1-next.70

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.
package/docs/changelog.md CHANGED
@@ -1,5 +1,316 @@
1
1
  # @twin.org/image - Changelog
2
2
 
3
- ## 0.0.1-next.7
3
+ ## [0.0.1-next.70](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.69...image-v0.0.1-next.70) (2025-07-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
9
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
10
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
11
+
12
+
13
+ ### Dependencies
14
+
15
+ * The following workspace dependencies were updated
16
+ * dependencies
17
+ * @twin.org/core bumped from 0.0.1-next.69 to 0.0.1-next.70
18
+ * @twin.org/nameof bumped from 0.0.1-next.69 to 0.0.1-next.70
19
+ * devDependencies
20
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.69 to 0.0.1-next.70
21
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.69 to 0.0.1-next.70
22
+
23
+ ## [0.0.1-next.69](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.68...image-v0.0.1-next.69) (2025-07-02)
24
+
25
+
26
+ ### Features
27
+
28
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
29
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
30
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
31
+
32
+
33
+ ### Dependencies
34
+
35
+ * The following workspace dependencies were updated
36
+ * dependencies
37
+ * @twin.org/core bumped from 0.0.1-next.68 to 0.0.1-next.69
38
+ * @twin.org/nameof bumped from 0.0.1-next.68 to 0.0.1-next.69
39
+ * devDependencies
40
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.68 to 0.0.1-next.69
41
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.68 to 0.0.1-next.69
42
+
43
+ ## [0.0.1-next.68](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.67...image-v0.0.1-next.68) (2025-07-02)
44
+
45
+
46
+ ### Features
47
+
48
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
49
+
50
+
51
+ ### Dependencies
52
+
53
+ * The following workspace dependencies were updated
54
+ * dependencies
55
+ * @twin.org/core bumped from 0.0.1-next.67 to 0.0.1-next.68
56
+ * @twin.org/nameof bumped from 0.0.1-next.67 to 0.0.1-next.68
57
+ * devDependencies
58
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.67 to 0.0.1-next.68
59
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.67 to 0.0.1-next.68
60
+
61
+ ## [0.0.1-next.67](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.66...image-v0.0.1-next.67) (2025-06-26)
62
+
63
+
64
+ ### Miscellaneous Chores
65
+
66
+ * **image:** Synchronize repo versions
67
+
68
+
69
+ ### Dependencies
70
+
71
+ * The following workspace dependencies were updated
72
+ * dependencies
73
+ * @twin.org/core bumped from 0.0.1-next.66 to 0.0.1-next.67
74
+
75
+ ## [0.0.1-next.66](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.65...image-v0.0.1-next.66) (2025-06-26)
76
+
77
+
78
+ ### Miscellaneous Chores
79
+
80
+ * **image:** Synchronize repo versions
81
+
82
+
83
+ ### Dependencies
84
+
85
+ * The following workspace dependencies were updated
86
+ * dependencies
87
+ * @twin.org/core bumped from 0.0.1-next.65 to 0.0.1-next.66
88
+
89
+ ## [0.0.1-next.65](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.64...image-v0.0.1-next.65) (2025-06-19)
90
+
91
+
92
+ ### Miscellaneous Chores
93
+
94
+ * **image:** Synchronize repo versions
95
+
96
+
97
+ ### Dependencies
98
+
99
+ * The following workspace dependencies were updated
100
+ * dependencies
101
+ * @twin.org/core bumped from 0.0.1-next.64 to 0.0.1-next.65
102
+
103
+ ## [0.0.1-next.64](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.63...image-v0.0.1-next.64) (2025-06-19)
104
+
105
+
106
+ ### Miscellaneous Chores
107
+
108
+ * **image:** Synchronize repo versions
109
+
110
+
111
+ ### Dependencies
112
+
113
+ * The following workspace dependencies were updated
114
+ * dependencies
115
+ * @twin.org/core bumped from 0.0.1-next.63 to 0.0.1-next.64
116
+
117
+ ## [0.0.1-next.63](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.62...image-v0.0.1-next.63) (2025-06-18)
118
+
119
+
120
+ ### Miscellaneous Chores
121
+
122
+ * **image:** Synchronize repo versions
123
+
124
+
125
+ ### Dependencies
126
+
127
+ * The following workspace dependencies were updated
128
+ * dependencies
129
+ * @twin.org/core bumped from 0.0.1-next.62 to 0.0.1-next.63
130
+
131
+ ## [0.0.1-next.62](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.61...image-v0.0.1-next.62) (2025-06-17)
132
+
133
+
134
+ ### Features
135
+
136
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
137
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
138
+
139
+
140
+ ### Dependencies
141
+
142
+ * The following workspace dependencies were updated
143
+ * dependencies
144
+ * @twin.org/core bumped from 0.0.1-next.61 to 0.0.1-next.62
145
+
146
+ ## [0.0.1-next.61](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.60...image-v0.0.1-next.61) (2025-06-17)
147
+
148
+
149
+ ### Miscellaneous Chores
150
+
151
+ * **image:** Synchronize repo versions
152
+
153
+
154
+ ### Dependencies
155
+
156
+ * The following workspace dependencies were updated
157
+ * dependencies
158
+ * @twin.org/core bumped from 0.0.1-next.60 to 0.0.1-next.61
159
+
160
+ ## [0.0.1-next.60](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.59...image-v0.0.1-next.60) (2025-06-17)
161
+
162
+
163
+ ### Miscellaneous Chores
164
+
165
+ * **image:** Synchronize repo versions
166
+
167
+
168
+ ### Dependencies
169
+
170
+ * The following workspace dependencies were updated
171
+ * dependencies
172
+ * @twin.org/core bumped from 0.0.1-next.59 to 0.0.1-next.60
173
+
174
+ ## [0.0.1-next.59](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.58...image-v0.0.1-next.59) (2025-06-17)
175
+
176
+
177
+ ### Miscellaneous Chores
178
+
179
+ * **image:** Synchronize repo versions
180
+
181
+
182
+ ### Dependencies
183
+
184
+ * The following workspace dependencies were updated
185
+ * dependencies
186
+ * @twin.org/core bumped from 0.0.1-next.58 to 0.0.1-next.59
187
+
188
+ ## [0.0.1-next.58](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.57...image-v0.0.1-next.58) (2025-06-13)
189
+
190
+
191
+ ### Miscellaneous Chores
192
+
193
+ * **image:** Synchronize repo versions
194
+
195
+
196
+ ### Dependencies
197
+
198
+ * The following workspace dependencies were updated
199
+ * dependencies
200
+ * @twin.org/core bumped from 0.0.1-next.57 to 0.0.1-next.58
201
+
202
+ ## [0.0.1-next.57](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.56...image-v0.0.1-next.57) (2025-06-10)
203
+
204
+
205
+ ### Features
206
+
207
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
208
+
209
+
210
+ ### Dependencies
211
+
212
+ * The following workspace dependencies were updated
213
+ * dependencies
214
+ * @twin.org/core bumped from 0.0.1-next.56 to 0.0.1-next.57
215
+
216
+ ## [0.0.1-next.56](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.55...image-v0.0.1-next.56) (2025-05-08)
217
+
218
+
219
+ ### Miscellaneous Chores
220
+
221
+ * **image:** Synchronize repo versions
222
+
223
+
224
+ ### Dependencies
225
+
226
+ * The following workspace dependencies were updated
227
+ * dependencies
228
+ * @twin.org/core bumped from 0.0.1-next.55 to 0.0.1-next.56
229
+
230
+ ## [0.0.1-next.55](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.54...image-v0.0.1-next.55) (2025-05-07)
231
+
232
+
233
+ ### Miscellaneous Chores
234
+
235
+ * **image:** Synchronize repo versions
236
+
237
+
238
+ ### Dependencies
239
+
240
+ * The following workspace dependencies were updated
241
+ * dependencies
242
+ * @twin.org/core bumped from 0.0.1-next.54 to 0.0.1-next.55
243
+
244
+ ## [0.0.1-next.54](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.53...image-v0.0.1-next.54) (2025-05-06)
245
+
246
+
247
+ ### Miscellaneous Chores
248
+
249
+ * **image:** Synchronize repo versions
250
+
251
+
252
+ ### Dependencies
253
+
254
+ * The following workspace dependencies were updated
255
+ * dependencies
256
+ * @twin.org/core bumped from 0.0.1-next.53 to 0.0.1-next.54
257
+
258
+ ## [0.0.1-next.53](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.52...image-v0.0.1-next.53) (2025-05-01)
259
+
260
+
261
+ ### Miscellaneous Chores
262
+
263
+ * **image:** Synchronize repo versions
264
+
265
+
266
+ ### Dependencies
267
+
268
+ * The following workspace dependencies were updated
269
+ * dependencies
270
+ * @twin.org/core bumped from 0.0.1-next.52 to 0.0.1-next.53
271
+
272
+ ## [0.0.1-next.52](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.51...image-v0.0.1-next.52) (2025-04-17)
273
+
274
+
275
+ ### Features
276
+
277
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
278
+
279
+
280
+ ### Dependencies
281
+
282
+ * The following workspace dependencies were updated
283
+ * dependencies
284
+ * @twin.org/core bumped from 0.0.1-next.51 to 0.0.1-next.52
285
+
286
+ ## [0.0.1-next.51](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.50...image-v0.0.1-next.51) (2025-03-27)
287
+
288
+
289
+ ### Miscellaneous Chores
290
+
291
+ * **image:** Synchronize repo versions
292
+
293
+
294
+ ### Dependencies
295
+
296
+ * The following workspace dependencies were updated
297
+ * dependencies
298
+ * @twin.org/core bumped from 0.0.1-next.50 to 0.0.1-next.51
299
+
300
+ ## [0.0.1-next.50](https://github.com/twinfoundation/framework/compare/image-v0.0.1-next.49...image-v0.0.1-next.50) (2025-03-26)
301
+
302
+
303
+ ### Miscellaneous Chores
304
+
305
+ * **image:** Synchronize repo versions
306
+
307
+
308
+ ### Dependencies
309
+
310
+ * The following workspace dependencies were updated
311
+ * dependencies
312
+ * @twin.org/core bumped from 0.0.1-next.49 to 0.0.1-next.50
313
+
314
+ ## 0.0.1-next.49
4
315
 
5
316
  - Initial Release
@@ -4,51 +4,61 @@ Class to represent a color.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new Color()
7
+ ### Constructor
8
8
 
9
- > **new Color**(`alpha`, `red`, `green`, `blue`): [`Color`](Color.md)
9
+ > **new Color**(`alpha`, `red`, `green`, `blue`): `Color`
10
10
 
11
11
  Create a new instance of color.
12
12
 
13
13
  #### Parameters
14
14
 
15
- **alpha**: `number`
15
+ ##### alpha
16
+
17
+ `number`
16
18
 
17
19
  The alpha element of the color.
18
20
 
19
- **red**: `number`
21
+ ##### red
22
+
23
+ `number`
20
24
 
21
25
  The red element of the color.
22
26
 
23
- **green**: `number`
27
+ ##### green
28
+
29
+ `number`
24
30
 
25
31
  The green element of the color.
26
32
 
27
- **blue**: `number`
33
+ ##### blue
34
+
35
+ `number`
28
36
 
29
37
  The blue element of the color.
30
38
 
31
39
  #### Returns
32
40
 
33
- [`Color`](Color.md)
41
+ `Color`
34
42
 
35
43
  ## Methods
36
44
 
37
45
  ### fromHex()
38
46
 
39
- > `static` **fromHex**(`hex`): [`Color`](Color.md)
47
+ > `static` **fromHex**(`hex`): `Color`
40
48
 
41
49
  Construct a color from a hex string.
42
50
 
43
51
  #### Parameters
44
52
 
45
- **hex**: `string`
53
+ ##### hex
54
+
55
+ `string`
46
56
 
47
57
  The hex string to parse.
48
58
 
49
59
  #### Returns
50
60
 
51
- [`Color`](Color.md)
61
+ `Color`
52
62
 
53
63
  The color.
54
64
 
@@ -60,19 +70,21 @@ Error if the format is incorrect.
60
70
 
61
71
  ### coerce()
62
72
 
63
- > `static` **coerce**(`value`): `undefined` \| [`Color`](Color.md)
73
+ > `static` **coerce**(`value`): `undefined` \| `Color`
64
74
 
65
75
  Coerce an unknown type to a color.
66
76
 
67
77
  #### Parameters
68
78
 
69
- **value**: `unknown`
79
+ ##### value
80
+
81
+ `unknown`
70
82
 
71
83
  The value to try and convert.
72
84
 
73
85
  #### Returns
74
86
 
75
- `undefined` \| [`Color`](Color.md)
87
+ `undefined` \| `Color`
76
88
 
77
89
  The color if one can be created.
78
90
 
@@ -5,15 +5,15 @@ Based on JPEG encoder ported to JavaScript and optimized by Andreas Ritter.
5
5
 
6
6
  ## Constructors
7
7
 
8
- ### new JpegEncoder()
8
+ ### Constructor
9
9
 
10
- > **new JpegEncoder**(): [`JpegEncoder`](JpegEncoder.md)
10
+ > **new JpegEncoder**(): `JpegEncoder`
11
11
 
12
12
  Create a new instance of JpegEncoder.
13
13
 
14
14
  #### Returns
15
15
 
16
- [`JpegEncoder`](JpegEncoder.md)
16
+ `JpegEncoder`
17
17
 
18
18
  ## Methods
19
19
 
@@ -25,19 +25,27 @@ Encode the image with the given quality.
25
25
 
26
26
  #### Parameters
27
27
 
28
- **width**: `number`
28
+ ##### width
29
+
30
+ `number`
29
31
 
30
32
  The width of the image to encode.
31
33
 
32
- **height**: `number`
34
+ ##### height
35
+
36
+ `number`
33
37
 
34
38
  The height of the image to encode.
35
39
 
36
- **imageData**: `Uint8Array`
40
+ ##### imageData
41
+
42
+ `Uint8Array`
37
43
 
38
44
  The data for the image.
39
45
 
40
- **quality**: `number`
46
+ ##### quality
47
+
48
+ `number`
41
49
 
42
50
  The quality to encode the image at.
43
51
 
@@ -5,38 +5,44 @@ Based on https://github.com/photopea/UPNG.js.
5
5
 
6
6
  ## Constructors
7
7
 
8
- ### new PngEncoder()
8
+ ### Constructor
9
9
 
10
- > **new PngEncoder**(): [`PngEncoder`](PngEncoder.md)
10
+ > **new PngEncoder**(): `PngEncoder`
11
11
 
12
12
  #### Returns
13
13
 
14
- [`PngEncoder`](PngEncoder.md)
14
+ `PngEncoder`
15
15
 
16
16
  ## Methods
17
17
 
18
18
  ### encode()
19
19
 
20
- > **encode**(`buffers`, `w`, `h`): `Promise`\<`Uint8Array`\>
20
+ > **encode**(`buffers`, `w`, `h`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
21
21
 
22
22
  Encode the image frames to png.
23
23
 
24
24
  #### Parameters
25
25
 
26
- **buffers**: `ArrayBuffer`[]
26
+ ##### buffers
27
+
28
+ `ArrayBuffer`[]
27
29
 
28
30
  The frame buffers to encode.
29
31
 
30
- **w**: `number`
32
+ ##### w
33
+
34
+ `number`
31
35
 
32
36
  The image width.
33
37
 
34
- **h**: `number`
38
+ ##### h
39
+
40
+ `number`
35
41
 
36
42
  The image height.
37
43
 
38
44
  #### Returns
39
45
 
40
- `Promise`\<`Uint8Array`\>
46
+ `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
41
47
 
42
48
  The data for the image.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/image",
3
- "version": "0.0.1-next.7",
3
+ "version": "0.0.1-next.70",
4
4
  "description": "Classes for image manipulation",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,17 +14,17 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "0.0.1-next.7",
18
- "@twin.org/nameof": "next"
17
+ "@twin.org/core": "0.0.1-next.70",
18
+ "@twin.org/nameof": "0.0.1-next.70"
19
19
  },
20
20
  "main": "./dist/cjs/index.cjs",
21
21
  "module": "./dist/esm/index.mjs",
22
22
  "types": "./dist/types/index.d.ts",
23
23
  "exports": {
24
24
  ".": {
25
+ "types": "./dist/types/index.d.ts",
25
26
  "require": "./dist/cjs/index.cjs",
26
- "import": "./dist/esm/index.mjs",
27
- "types": "./dist/types/index.d.ts"
27
+ "import": "./dist/esm/index.mjs"
28
28
  }
29
29
  },
30
30
  "files": [