@takumi-rs/core 1.0.8 → 1.0.10
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/README.md +1 -1
- package/dist/export.cjs +46 -28
- package/dist/export.d.cts +4 -0
- package/dist/export.d.mts +4 -0
- package/dist/export.mjs +46 -28
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Takumi is a **image rendering engine** written in Rust and this package provides Node.js bindings using [napi-rs](https://napi.rs/).
|
|
4
4
|
|
|
5
|
-
Please refer to the [
|
|
5
|
+
Please refer to the [Integration](https://takumi.kane.tw/docs/integration) page in our official documentation for more details.
|
|
6
6
|
|
|
7
7
|
If you are looking for WebAssembly bindings, take a look at the [@takumi-rs/wasm](https://npmjs.com/package/@takumi-rs/wasm) package.
|
package/dist/export.cjs
CHANGED
|
@@ -60,7 +60,7 @@ function requireNative() {
|
|
|
60
60
|
try {
|
|
61
61
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/core.android-arm64.node");
|
|
62
62
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/package.json").version;
|
|
63
|
-
if (bindingPackageVersion !== "1.0.
|
|
63
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
64
64
|
return binding;
|
|
65
65
|
} catch (e) {
|
|
66
66
|
loadErrors.push(e);
|
|
@@ -74,7 +74,7 @@ function requireNative() {
|
|
|
74
74
|
try {
|
|
75
75
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/core.android-arm-eabi.node");
|
|
76
76
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/package.json").version;
|
|
77
|
-
if (bindingPackageVersion !== "1.0.
|
|
77
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
78
78
|
return binding;
|
|
79
79
|
} catch (e) {
|
|
80
80
|
loadErrors.push(e);
|
|
@@ -91,7 +91,7 @@ function requireNative() {
|
|
|
91
91
|
try {
|
|
92
92
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/core.win32-x64-gnu.node");
|
|
93
93
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/package.json").version;
|
|
94
|
-
if (bindingPackageVersion !== "1.0.
|
|
94
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
95
95
|
return binding;
|
|
96
96
|
} catch (e) {
|
|
97
97
|
loadErrors.push(e);
|
|
@@ -105,7 +105,7 @@ function requireNative() {
|
|
|
105
105
|
try {
|
|
106
106
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/core.win32-x64-msvc.node");
|
|
107
107
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/package.json").version;
|
|
108
|
-
if (bindingPackageVersion !== "1.0.
|
|
108
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
109
109
|
return binding;
|
|
110
110
|
} catch (e) {
|
|
111
111
|
loadErrors.push(e);
|
|
@@ -120,7 +120,7 @@ function requireNative() {
|
|
|
120
120
|
try {
|
|
121
121
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/core.win32-ia32-msvc.node");
|
|
122
122
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/package.json").version;
|
|
123
|
-
if (bindingPackageVersion !== "1.0.
|
|
123
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
124
124
|
return binding;
|
|
125
125
|
} catch (e) {
|
|
126
126
|
loadErrors.push(e);
|
|
@@ -134,7 +134,7 @@ function requireNative() {
|
|
|
134
134
|
try {
|
|
135
135
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/core.win32-arm64-msvc.node");
|
|
136
136
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/package.json").version;
|
|
137
|
-
if (bindingPackageVersion !== "1.0.
|
|
137
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
138
138
|
return binding;
|
|
139
139
|
} catch (e) {
|
|
140
140
|
loadErrors.push(e);
|
|
@@ -149,7 +149,7 @@ function requireNative() {
|
|
|
149
149
|
try {
|
|
150
150
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/core.darwin-universal.node");
|
|
151
151
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/package.json").version;
|
|
152
|
-
if (bindingPackageVersion !== "1.0.
|
|
152
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
153
153
|
return binding;
|
|
154
154
|
} catch (e) {
|
|
155
155
|
loadErrors.push(e);
|
|
@@ -163,7 +163,7 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/core.darwin-x64.node");
|
|
165
165
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/package.json").version;
|
|
166
|
-
if (bindingPackageVersion !== "1.0.
|
|
166
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
167
167
|
return binding;
|
|
168
168
|
} catch (e) {
|
|
169
169
|
loadErrors.push(e);
|
|
@@ -177,7 +177,7 @@ function requireNative() {
|
|
|
177
177
|
try {
|
|
178
178
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/core.darwin-arm64.node");
|
|
179
179
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/package.json").version;
|
|
180
|
-
if (bindingPackageVersion !== "1.0.
|
|
180
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
181
181
|
return binding;
|
|
182
182
|
} catch (e) {
|
|
183
183
|
loadErrors.push(e);
|
|
@@ -192,7 +192,7 @@ function requireNative() {
|
|
|
192
192
|
try {
|
|
193
193
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/core.freebsd-x64.node");
|
|
194
194
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/package.json").version;
|
|
195
|
-
if (bindingPackageVersion !== "1.0.
|
|
195
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
196
196
|
return binding;
|
|
197
197
|
} catch (e) {
|
|
198
198
|
loadErrors.push(e);
|
|
@@ -206,7 +206,7 @@ function requireNative() {
|
|
|
206
206
|
try {
|
|
207
207
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/core.freebsd-arm64.node");
|
|
208
208
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/package.json").version;
|
|
209
|
-
if (bindingPackageVersion !== "1.0.
|
|
209
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
210
210
|
return binding;
|
|
211
211
|
} catch (e) {
|
|
212
212
|
loadErrors.push(e);
|
|
@@ -221,7 +221,7 @@ function requireNative() {
|
|
|
221
221
|
try {
|
|
222
222
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/core.linux-x64-musl.node");
|
|
223
223
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/package.json").version;
|
|
224
|
-
if (bindingPackageVersion !== "1.0.
|
|
224
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
225
225
|
return binding;
|
|
226
226
|
} catch (e) {
|
|
227
227
|
loadErrors.push(e);
|
|
@@ -235,7 +235,7 @@ function requireNative() {
|
|
|
235
235
|
try {
|
|
236
236
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/core.linux-x64-gnu.node");
|
|
237
237
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/package.json").version;
|
|
238
|
-
if (bindingPackageVersion !== "1.0.
|
|
238
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
239
239
|
return binding;
|
|
240
240
|
} catch (e) {
|
|
241
241
|
loadErrors.push(e);
|
|
@@ -250,7 +250,7 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/core.linux-arm64-musl.node");
|
|
252
252
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/package.json").version;
|
|
253
|
-
if (bindingPackageVersion !== "1.0.
|
|
253
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
254
254
|
return binding;
|
|
255
255
|
} catch (e) {
|
|
256
256
|
loadErrors.push(e);
|
|
@@ -264,7 +264,7 @@ function requireNative() {
|
|
|
264
264
|
try {
|
|
265
265
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/core.linux-arm64-gnu.node");
|
|
266
266
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/package.json").version;
|
|
267
|
-
if (bindingPackageVersion !== "1.0.
|
|
267
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
268
268
|
return binding;
|
|
269
269
|
} catch (e) {
|
|
270
270
|
loadErrors.push(e);
|
|
@@ -279,7 +279,7 @@ function requireNative() {
|
|
|
279
279
|
try {
|
|
280
280
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/core.linux-arm-musleabihf.node");
|
|
281
281
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/package.json").version;
|
|
282
|
-
if (bindingPackageVersion !== "1.0.
|
|
282
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
283
283
|
return binding;
|
|
284
284
|
} catch (e) {
|
|
285
285
|
loadErrors.push(e);
|
|
@@ -293,7 +293,7 @@ function requireNative() {
|
|
|
293
293
|
try {
|
|
294
294
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/core.linux-arm-gnueabihf.node");
|
|
295
295
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/package.json").version;
|
|
296
|
-
if (bindingPackageVersion !== "1.0.
|
|
296
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
297
297
|
return binding;
|
|
298
298
|
} catch (e) {
|
|
299
299
|
loadErrors.push(e);
|
|
@@ -308,7 +308,7 @@ function requireNative() {
|
|
|
308
308
|
try {
|
|
309
309
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/core.linux-loong64-musl.node");
|
|
310
310
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/package.json").version;
|
|
311
|
-
if (bindingPackageVersion !== "1.0.
|
|
311
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
312
312
|
return binding;
|
|
313
313
|
} catch (e) {
|
|
314
314
|
loadErrors.push(e);
|
|
@@ -322,7 +322,7 @@ function requireNative() {
|
|
|
322
322
|
try {
|
|
323
323
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/core.linux-loong64-gnu.node");
|
|
324
324
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/package.json").version;
|
|
325
|
-
if (bindingPackageVersion !== "1.0.
|
|
325
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
326
326
|
return binding;
|
|
327
327
|
} catch (e) {
|
|
328
328
|
loadErrors.push(e);
|
|
@@ -337,7 +337,7 @@ function requireNative() {
|
|
|
337
337
|
try {
|
|
338
338
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/core.linux-riscv64-musl.node");
|
|
339
339
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/package.json").version;
|
|
340
|
-
if (bindingPackageVersion !== "1.0.
|
|
340
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
341
341
|
return binding;
|
|
342
342
|
} catch (e) {
|
|
343
343
|
loadErrors.push(e);
|
|
@@ -351,7 +351,7 @@ function requireNative() {
|
|
|
351
351
|
try {
|
|
352
352
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/core.linux-riscv64-gnu.node");
|
|
353
353
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/package.json").version;
|
|
354
|
-
if (bindingPackageVersion !== "1.0.
|
|
354
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
355
355
|
return binding;
|
|
356
356
|
} catch (e) {
|
|
357
357
|
loadErrors.push(e);
|
|
@@ -366,7 +366,7 @@ function requireNative() {
|
|
|
366
366
|
try {
|
|
367
367
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/core.linux-ppc64-gnu.node");
|
|
368
368
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/package.json").version;
|
|
369
|
-
if (bindingPackageVersion !== "1.0.
|
|
369
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
370
370
|
return binding;
|
|
371
371
|
} catch (e) {
|
|
372
372
|
loadErrors.push(e);
|
|
@@ -380,7 +380,7 @@ function requireNative() {
|
|
|
380
380
|
try {
|
|
381
381
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/core.linux-s390x-gnu.node");
|
|
382
382
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/package.json").version;
|
|
383
|
-
if (bindingPackageVersion !== "1.0.
|
|
383
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
384
384
|
return binding;
|
|
385
385
|
} catch (e) {
|
|
386
386
|
loadErrors.push(e);
|
|
@@ -395,7 +395,7 @@ function requireNative() {
|
|
|
395
395
|
try {
|
|
396
396
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/core.openharmony-arm64.node");
|
|
397
397
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/package.json").version;
|
|
398
|
-
if (bindingPackageVersion !== "1.0.
|
|
398
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
399
399
|
return binding;
|
|
400
400
|
} catch (e) {
|
|
401
401
|
loadErrors.push(e);
|
|
@@ -409,7 +409,7 @@ function requireNative() {
|
|
|
409
409
|
try {
|
|
410
410
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/core.openharmony-x64.node");
|
|
411
411
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/package.json").version;
|
|
412
|
-
if (bindingPackageVersion !== "1.0.
|
|
412
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
413
413
|
return binding;
|
|
414
414
|
} catch (e) {
|
|
415
415
|
loadErrors.push(e);
|
|
@@ -423,7 +423,7 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/core.openharmony-arm.node");
|
|
425
425
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/package.json").version;
|
|
426
|
-
if (bindingPackageVersion !== "1.0.
|
|
426
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
427
427
|
return binding;
|
|
428
428
|
} catch (e) {
|
|
429
429
|
loadErrors.push(e);
|
|
@@ -470,9 +470,19 @@ const { Renderer: Renderer$1, AnimationOutputFormat, DitheringAlgorithm, OutputF
|
|
|
470
470
|
var Renderer = class extends Renderer$1 {
|
|
471
471
|
fontsMark = /* @__PURE__ */ new Set();
|
|
472
472
|
fontBuffersMark = /* @__PURE__ */ new WeakSet();
|
|
473
|
+
persistentImageSrcMark = /* @__PURE__ */ new Set();
|
|
474
|
+
pendingPersistentImages = /* @__PURE__ */ new Map();
|
|
473
475
|
async putPersistentImage(source, signal) {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
+
if (!this.isNewPersistentImage(source.src)) return this.pendingPersistentImages.get(source.src);
|
|
477
|
+
const pending = resolveImageLoader(source).then(async (resolved) => {
|
|
478
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted) return;
|
|
479
|
+
await super.putPersistentImage(resolved, signal);
|
|
480
|
+
this.persistentImageSrcMark.add(source.src);
|
|
481
|
+
}).finally(() => {
|
|
482
|
+
this.pendingPersistentImages.delete(source.src);
|
|
483
|
+
});
|
|
484
|
+
this.pendingPersistentImages.set(source.src, pending);
|
|
485
|
+
return pending;
|
|
476
486
|
}
|
|
477
487
|
async loadFonts(fonts, signal) {
|
|
478
488
|
const batchFontsMark = /* @__PURE__ */ new Set();
|
|
@@ -506,6 +516,11 @@ var Renderer = class extends Renderer$1 {
|
|
|
506
516
|
super.loadFontSync(resolved);
|
|
507
517
|
this.checkAndMarkFont(font);
|
|
508
518
|
}
|
|
519
|
+
clearImageStore() {
|
|
520
|
+
super.clearImageStore();
|
|
521
|
+
this.persistentImageSrcMark.clear();
|
|
522
|
+
this.pendingPersistentImages.clear();
|
|
523
|
+
}
|
|
509
524
|
checkAndMarkFont(font) {
|
|
510
525
|
const key = createFontKey(font);
|
|
511
526
|
if (isBuffer(key)) {
|
|
@@ -521,6 +536,9 @@ var Renderer = class extends Renderer$1 {
|
|
|
521
536
|
const key = createFontKey(font);
|
|
522
537
|
return isBuffer(key) ? !this.fontBuffersMark.has(key) : !this.fontsMark.has(key);
|
|
523
538
|
}
|
|
539
|
+
isNewPersistentImage(src) {
|
|
540
|
+
return !this.persistentImageSrcMark.has(src) && !this.pendingPersistentImages.has(src);
|
|
541
|
+
}
|
|
524
542
|
};
|
|
525
543
|
function createFontKey(font) {
|
|
526
544
|
var _font$name, _font$style, _font$weight;
|
package/dist/export.d.cts
CHANGED
|
@@ -213,12 +213,16 @@ type FontLoaderSync = Font | (Omit<FontDetails, "data"> & {
|
|
|
213
213
|
declare class Renderer extends Renderer$1 {
|
|
214
214
|
private fontsMark;
|
|
215
215
|
private fontBuffersMark;
|
|
216
|
+
private persistentImageSrcMark;
|
|
217
|
+
private pendingPersistentImages;
|
|
216
218
|
putPersistentImage(source: ImageSourceLoader, signal?: AbortSignal): Promise<void>;
|
|
217
219
|
loadFonts(fonts: FontLoader[], signal?: AbortSignal): Promise<number>;
|
|
218
220
|
loadFont(data: FontLoader, signal?: AbortSignal): Promise<number>;
|
|
219
221
|
loadFontSync(font: FontLoaderSync): void;
|
|
222
|
+
clearImageStore(): void;
|
|
220
223
|
private checkAndMarkFont;
|
|
221
224
|
private isNewFont;
|
|
225
|
+
private isNewPersistentImage;
|
|
222
226
|
}
|
|
223
227
|
//#endregion
|
|
224
228
|
export { AnimationFrameSource, AnimationOutputFormat, AnimationSceneSource, ByteBuf, ConstructRendererOptions, type ContainerNode, DitheringAlgorithm, EncodeFramesOptions, Font, FontDetails, FontLoader, FontLoaderSync, type ImageNode, ImageSource, ImageSourceLoader, ImageSourceLoaderSync, Keyframes, KeyframesMap, KeyframesRuleList, MeasuredNode, MeasuredTextRun, type Node, type NodeMetadata, OutputFormat, RenderAnimationOptions, RenderOptions, Renderer, type TextNode, extractResourceUrls };
|
package/dist/export.d.mts
CHANGED
|
@@ -24,12 +24,16 @@ type FontLoaderSync = Font | (Omit<FontDetails, "data"> & {
|
|
|
24
24
|
declare class Renderer extends Renderer$1 {
|
|
25
25
|
private fontsMark;
|
|
26
26
|
private fontBuffersMark;
|
|
27
|
+
private persistentImageSrcMark;
|
|
28
|
+
private pendingPersistentImages;
|
|
27
29
|
putPersistentImage(source: ImageSourceLoader, signal?: AbortSignal): Promise<void>;
|
|
28
30
|
loadFonts(fonts: FontLoader[], signal?: AbortSignal): Promise<number>;
|
|
29
31
|
loadFont(data: FontLoader, signal?: AbortSignal): Promise<number>;
|
|
30
32
|
loadFontSync(font: FontLoaderSync): void;
|
|
33
|
+
clearImageStore(): void;
|
|
31
34
|
private checkAndMarkFont;
|
|
32
35
|
private isNewFont;
|
|
36
|
+
private isNewPersistentImage;
|
|
33
37
|
}
|
|
34
38
|
//#endregion
|
|
35
39
|
export { AnimationOutputFormat, DitheringAlgorithm, FontLoader, FontLoaderSync, ImageSourceLoader, ImageSourceLoaderSync, OutputFormat, Renderer, extractResourceUrls };
|
package/dist/export.mjs
CHANGED
|
@@ -59,7 +59,7 @@ function requireNative() {
|
|
|
59
59
|
try {
|
|
60
60
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/core.android-arm64.node");
|
|
61
61
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/package.json").version;
|
|
62
|
-
if (bindingPackageVersion !== "1.0.
|
|
62
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
63
63
|
return binding;
|
|
64
64
|
} catch (e) {
|
|
65
65
|
loadErrors.push(e);
|
|
@@ -73,7 +73,7 @@ function requireNative() {
|
|
|
73
73
|
try {
|
|
74
74
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/core.android-arm-eabi.node");
|
|
75
75
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/package.json").version;
|
|
76
|
-
if (bindingPackageVersion !== "1.0.
|
|
76
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
77
77
|
return binding;
|
|
78
78
|
} catch (e) {
|
|
79
79
|
loadErrors.push(e);
|
|
@@ -90,7 +90,7 @@ function requireNative() {
|
|
|
90
90
|
try {
|
|
91
91
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/core.win32-x64-gnu.node");
|
|
92
92
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/package.json").version;
|
|
93
|
-
if (bindingPackageVersion !== "1.0.
|
|
93
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
94
94
|
return binding;
|
|
95
95
|
} catch (e) {
|
|
96
96
|
loadErrors.push(e);
|
|
@@ -104,7 +104,7 @@ function requireNative() {
|
|
|
104
104
|
try {
|
|
105
105
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/core.win32-x64-msvc.node");
|
|
106
106
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/package.json").version;
|
|
107
|
-
if (bindingPackageVersion !== "1.0.
|
|
107
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
108
108
|
return binding;
|
|
109
109
|
} catch (e) {
|
|
110
110
|
loadErrors.push(e);
|
|
@@ -119,7 +119,7 @@ function requireNative() {
|
|
|
119
119
|
try {
|
|
120
120
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/core.win32-ia32-msvc.node");
|
|
121
121
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/package.json").version;
|
|
122
|
-
if (bindingPackageVersion !== "1.0.
|
|
122
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
123
123
|
return binding;
|
|
124
124
|
} catch (e) {
|
|
125
125
|
loadErrors.push(e);
|
|
@@ -133,7 +133,7 @@ function requireNative() {
|
|
|
133
133
|
try {
|
|
134
134
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/core.win32-arm64-msvc.node");
|
|
135
135
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/package.json").version;
|
|
136
|
-
if (bindingPackageVersion !== "1.0.
|
|
136
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
137
137
|
return binding;
|
|
138
138
|
} catch (e) {
|
|
139
139
|
loadErrors.push(e);
|
|
@@ -148,7 +148,7 @@ function requireNative() {
|
|
|
148
148
|
try {
|
|
149
149
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/core.darwin-universal.node");
|
|
150
150
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/package.json").version;
|
|
151
|
-
if (bindingPackageVersion !== "1.0.
|
|
151
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
152
152
|
return binding;
|
|
153
153
|
} catch (e) {
|
|
154
154
|
loadErrors.push(e);
|
|
@@ -162,7 +162,7 @@ function requireNative() {
|
|
|
162
162
|
try {
|
|
163
163
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/core.darwin-x64.node");
|
|
164
164
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/package.json").version;
|
|
165
|
-
if (bindingPackageVersion !== "1.0.
|
|
165
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
166
166
|
return binding;
|
|
167
167
|
} catch (e) {
|
|
168
168
|
loadErrors.push(e);
|
|
@@ -176,7 +176,7 @@ function requireNative() {
|
|
|
176
176
|
try {
|
|
177
177
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/core.darwin-arm64.node");
|
|
178
178
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/package.json").version;
|
|
179
|
-
if (bindingPackageVersion !== "1.0.
|
|
179
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
180
180
|
return binding;
|
|
181
181
|
} catch (e) {
|
|
182
182
|
loadErrors.push(e);
|
|
@@ -191,7 +191,7 @@ function requireNative() {
|
|
|
191
191
|
try {
|
|
192
192
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/core.freebsd-x64.node");
|
|
193
193
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/package.json").version;
|
|
194
|
-
if (bindingPackageVersion !== "1.0.
|
|
194
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
195
195
|
return binding;
|
|
196
196
|
} catch (e) {
|
|
197
197
|
loadErrors.push(e);
|
|
@@ -205,7 +205,7 @@ function requireNative() {
|
|
|
205
205
|
try {
|
|
206
206
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/core.freebsd-arm64.node");
|
|
207
207
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/package.json").version;
|
|
208
|
-
if (bindingPackageVersion !== "1.0.
|
|
208
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
209
209
|
return binding;
|
|
210
210
|
} catch (e) {
|
|
211
211
|
loadErrors.push(e);
|
|
@@ -220,7 +220,7 @@ function requireNative() {
|
|
|
220
220
|
try {
|
|
221
221
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/core.linux-x64-musl.node");
|
|
222
222
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/package.json").version;
|
|
223
|
-
if (bindingPackageVersion !== "1.0.
|
|
223
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
224
224
|
return binding;
|
|
225
225
|
} catch (e) {
|
|
226
226
|
loadErrors.push(e);
|
|
@@ -234,7 +234,7 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/core.linux-x64-gnu.node");
|
|
236
236
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/package.json").version;
|
|
237
|
-
if (bindingPackageVersion !== "1.0.
|
|
237
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
238
238
|
return binding;
|
|
239
239
|
} catch (e) {
|
|
240
240
|
loadErrors.push(e);
|
|
@@ -249,7 +249,7 @@ function requireNative() {
|
|
|
249
249
|
try {
|
|
250
250
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/core.linux-arm64-musl.node");
|
|
251
251
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/package.json").version;
|
|
252
|
-
if (bindingPackageVersion !== "1.0.
|
|
252
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
253
253
|
return binding;
|
|
254
254
|
} catch (e) {
|
|
255
255
|
loadErrors.push(e);
|
|
@@ -263,7 +263,7 @@ function requireNative() {
|
|
|
263
263
|
try {
|
|
264
264
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/core.linux-arm64-gnu.node");
|
|
265
265
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/package.json").version;
|
|
266
|
-
if (bindingPackageVersion !== "1.0.
|
|
266
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
267
267
|
return binding;
|
|
268
268
|
} catch (e) {
|
|
269
269
|
loadErrors.push(e);
|
|
@@ -278,7 +278,7 @@ function requireNative() {
|
|
|
278
278
|
try {
|
|
279
279
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/core.linux-arm-musleabihf.node");
|
|
280
280
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/package.json").version;
|
|
281
|
-
if (bindingPackageVersion !== "1.0.
|
|
281
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
282
282
|
return binding;
|
|
283
283
|
} catch (e) {
|
|
284
284
|
loadErrors.push(e);
|
|
@@ -292,7 +292,7 @@ function requireNative() {
|
|
|
292
292
|
try {
|
|
293
293
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/core.linux-arm-gnueabihf.node");
|
|
294
294
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/package.json").version;
|
|
295
|
-
if (bindingPackageVersion !== "1.0.
|
|
295
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
296
296
|
return binding;
|
|
297
297
|
} catch (e) {
|
|
298
298
|
loadErrors.push(e);
|
|
@@ -307,7 +307,7 @@ function requireNative() {
|
|
|
307
307
|
try {
|
|
308
308
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/core.linux-loong64-musl.node");
|
|
309
309
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/package.json").version;
|
|
310
|
-
if (bindingPackageVersion !== "1.0.
|
|
310
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
311
311
|
return binding;
|
|
312
312
|
} catch (e) {
|
|
313
313
|
loadErrors.push(e);
|
|
@@ -321,7 +321,7 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/core.linux-loong64-gnu.node");
|
|
323
323
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/package.json").version;
|
|
324
|
-
if (bindingPackageVersion !== "1.0.
|
|
324
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
325
325
|
return binding;
|
|
326
326
|
} catch (e) {
|
|
327
327
|
loadErrors.push(e);
|
|
@@ -336,7 +336,7 @@ function requireNative() {
|
|
|
336
336
|
try {
|
|
337
337
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/core.linux-riscv64-musl.node");
|
|
338
338
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/package.json").version;
|
|
339
|
-
if (bindingPackageVersion !== "1.0.
|
|
339
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
340
340
|
return binding;
|
|
341
341
|
} catch (e) {
|
|
342
342
|
loadErrors.push(e);
|
|
@@ -350,7 +350,7 @@ function requireNative() {
|
|
|
350
350
|
try {
|
|
351
351
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/core.linux-riscv64-gnu.node");
|
|
352
352
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/package.json").version;
|
|
353
|
-
if (bindingPackageVersion !== "1.0.
|
|
353
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
354
354
|
return binding;
|
|
355
355
|
} catch (e) {
|
|
356
356
|
loadErrors.push(e);
|
|
@@ -365,7 +365,7 @@ function requireNative() {
|
|
|
365
365
|
try {
|
|
366
366
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/core.linux-ppc64-gnu.node");
|
|
367
367
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/package.json").version;
|
|
368
|
-
if (bindingPackageVersion !== "1.0.
|
|
368
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
369
369
|
return binding;
|
|
370
370
|
} catch (e) {
|
|
371
371
|
loadErrors.push(e);
|
|
@@ -379,7 +379,7 @@ function requireNative() {
|
|
|
379
379
|
try {
|
|
380
380
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/core.linux-s390x-gnu.node");
|
|
381
381
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/package.json").version;
|
|
382
|
-
if (bindingPackageVersion !== "1.0.
|
|
382
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
383
383
|
return binding;
|
|
384
384
|
} catch (e) {
|
|
385
385
|
loadErrors.push(e);
|
|
@@ -394,7 +394,7 @@ function requireNative() {
|
|
|
394
394
|
try {
|
|
395
395
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/core.openharmony-arm64.node");
|
|
396
396
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/package.json").version;
|
|
397
|
-
if (bindingPackageVersion !== "1.0.
|
|
397
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
398
398
|
return binding;
|
|
399
399
|
} catch (e) {
|
|
400
400
|
loadErrors.push(e);
|
|
@@ -408,7 +408,7 @@ function requireNative() {
|
|
|
408
408
|
try {
|
|
409
409
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/core.openharmony-x64.node");
|
|
410
410
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/package.json").version;
|
|
411
|
-
if (bindingPackageVersion !== "1.0.
|
|
411
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
412
412
|
return binding;
|
|
413
413
|
} catch (e) {
|
|
414
414
|
loadErrors.push(e);
|
|
@@ -422,7 +422,7 @@ function requireNative() {
|
|
|
422
422
|
try {
|
|
423
423
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/core.openharmony-arm.node");
|
|
424
424
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/package.json").version;
|
|
425
|
-
if (bindingPackageVersion !== "1.0.
|
|
425
|
+
if (bindingPackageVersion !== "1.0.10" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
426
426
|
return binding;
|
|
427
427
|
} catch (e) {
|
|
428
428
|
loadErrors.push(e);
|
|
@@ -469,9 +469,19 @@ const { Renderer: Renderer$1, AnimationOutputFormat, DitheringAlgorithm, OutputF
|
|
|
469
469
|
var Renderer = class extends Renderer$1 {
|
|
470
470
|
fontsMark = /* @__PURE__ */ new Set();
|
|
471
471
|
fontBuffersMark = /* @__PURE__ */ new WeakSet();
|
|
472
|
+
persistentImageSrcMark = /* @__PURE__ */ new Set();
|
|
473
|
+
pendingPersistentImages = /* @__PURE__ */ new Map();
|
|
472
474
|
async putPersistentImage(source, signal) {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
+
if (!this.isNewPersistentImage(source.src)) return this.pendingPersistentImages.get(source.src);
|
|
476
|
+
const pending = resolveImageLoader(source).then(async (resolved) => {
|
|
477
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted) return;
|
|
478
|
+
await super.putPersistentImage(resolved, signal);
|
|
479
|
+
this.persistentImageSrcMark.add(source.src);
|
|
480
|
+
}).finally(() => {
|
|
481
|
+
this.pendingPersistentImages.delete(source.src);
|
|
482
|
+
});
|
|
483
|
+
this.pendingPersistentImages.set(source.src, pending);
|
|
484
|
+
return pending;
|
|
475
485
|
}
|
|
476
486
|
async loadFonts(fonts, signal) {
|
|
477
487
|
const batchFontsMark = /* @__PURE__ */ new Set();
|
|
@@ -505,6 +515,11 @@ var Renderer = class extends Renderer$1 {
|
|
|
505
515
|
super.loadFontSync(resolved);
|
|
506
516
|
this.checkAndMarkFont(font);
|
|
507
517
|
}
|
|
518
|
+
clearImageStore() {
|
|
519
|
+
super.clearImageStore();
|
|
520
|
+
this.persistentImageSrcMark.clear();
|
|
521
|
+
this.pendingPersistentImages.clear();
|
|
522
|
+
}
|
|
508
523
|
checkAndMarkFont(font) {
|
|
509
524
|
const key = createFontKey(font);
|
|
510
525
|
if (isBuffer(key)) {
|
|
@@ -520,6 +535,9 @@ var Renderer = class extends Renderer$1 {
|
|
|
520
535
|
const key = createFontKey(font);
|
|
521
536
|
return isBuffer(key) ? !this.fontBuffersMark.has(key) : !this.fontsMark.has(key);
|
|
522
537
|
}
|
|
538
|
+
isNewPersistentImage(src) {
|
|
539
|
+
return !this.persistentImageSrcMark.has(src) && !this.pendingPersistentImages.has(src);
|
|
540
|
+
}
|
|
523
541
|
};
|
|
524
542
|
function createFontKey(font) {
|
|
525
543
|
var _font$name, _font$style, _font$weight;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takumi-rs/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"css",
|
|
6
6
|
"image",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"bench": "bun tests/bench/index.tsx"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@takumi-rs/helpers": "1.0.
|
|
49
|
+
"@takumi-rs/helpers": "1.0.10"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@napi-rs/cli": "3.6.1",
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
"node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
|
|
79
79
|
},
|
|
80
80
|
"optionalDependencies": {
|
|
81
|
-
"@takumi-rs/core-darwin-x64": "1.0.
|
|
82
|
-
"@takumi-rs/core-darwin-arm64": "1.0.
|
|
83
|
-
"@takumi-rs/core-linux-arm64-gnu": "1.0.
|
|
84
|
-
"@takumi-rs/core-linux-arm64-musl": "1.0.
|
|
85
|
-
"@takumi-rs/core-win32-arm64-msvc": "1.0.
|
|
86
|
-
"@takumi-rs/core-linux-x64-gnu": "1.0.
|
|
87
|
-
"@takumi-rs/core-linux-x64-musl": "1.0.
|
|
88
|
-
"@takumi-rs/core-win32-x64-msvc": "1.0.
|
|
81
|
+
"@takumi-rs/core-darwin-x64": "1.0.10",
|
|
82
|
+
"@takumi-rs/core-darwin-arm64": "1.0.10",
|
|
83
|
+
"@takumi-rs/core-linux-arm64-gnu": "1.0.10",
|
|
84
|
+
"@takumi-rs/core-linux-arm64-musl": "1.0.10",
|
|
85
|
+
"@takumi-rs/core-win32-arm64-msvc": "1.0.10",
|
|
86
|
+
"@takumi-rs/core-linux-x64-gnu": "1.0.10",
|
|
87
|
+
"@takumi-rs/core-linux-x64-musl": "1.0.10",
|
|
88
|
+
"@takumi-rs/core-win32-x64-msvc": "1.0.10"
|
|
89
89
|
}
|
|
90
90
|
}
|