@takumi-rs/core 2.0.0-beta.5 → 2.0.0-beta.7
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/dist/export.cjs +76 -47
- package/dist/export.d.cts +15 -6
- package/dist/export.d.mts +15 -6
- package/dist/export.mjs +76 -42
- package/package.json +10 -20
package/dist/export.cjs
CHANGED
|
@@ -59,7 +59,7 @@ function requireNative() {
|
|
|
59
59
|
try {
|
|
60
60
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/core.android-arm64.node");
|
|
61
61
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/package.json").version;
|
|
62
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
62
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 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$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/core.android-arm-eabi.node");
|
|
75
75
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/package.json").version;
|
|
76
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
76
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
77
77
|
return binding;
|
|
78
78
|
} catch (e) {
|
|
79
79
|
loadErrors.push(e);
|
|
@@ -88,7 +88,7 @@ function requireNative() {
|
|
|
88
88
|
try {
|
|
89
89
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/core.win32-x64-gnu.node");
|
|
90
90
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/package.json").version;
|
|
91
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
91
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
92
92
|
return binding;
|
|
93
93
|
} catch (e) {
|
|
94
94
|
loadErrors.push(e);
|
|
@@ -102,7 +102,7 @@ function requireNative() {
|
|
|
102
102
|
try {
|
|
103
103
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/core.win32-x64-msvc.node");
|
|
104
104
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/package.json").version;
|
|
105
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
105
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
106
106
|
return binding;
|
|
107
107
|
} catch (e) {
|
|
108
108
|
loadErrors.push(e);
|
|
@@ -117,7 +117,7 @@ function requireNative() {
|
|
|
117
117
|
try {
|
|
118
118
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/core.win32-ia32-msvc.node");
|
|
119
119
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/package.json").version;
|
|
120
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
120
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
121
121
|
return binding;
|
|
122
122
|
} catch (e) {
|
|
123
123
|
loadErrors.push(e);
|
|
@@ -131,7 +131,7 @@ function requireNative() {
|
|
|
131
131
|
try {
|
|
132
132
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/core.win32-arm64-msvc.node");
|
|
133
133
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/package.json").version;
|
|
134
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
134
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
135
135
|
return binding;
|
|
136
136
|
} catch (e) {
|
|
137
137
|
loadErrors.push(e);
|
|
@@ -146,7 +146,7 @@ function requireNative() {
|
|
|
146
146
|
try {
|
|
147
147
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/core.darwin-universal.node");
|
|
148
148
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/package.json").version;
|
|
149
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
149
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
150
150
|
return binding;
|
|
151
151
|
} catch (e) {
|
|
152
152
|
loadErrors.push(e);
|
|
@@ -160,7 +160,7 @@ function requireNative() {
|
|
|
160
160
|
try {
|
|
161
161
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/core.darwin-x64.node");
|
|
162
162
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/package.json").version;
|
|
163
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
163
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
164
164
|
return binding;
|
|
165
165
|
} catch (e) {
|
|
166
166
|
loadErrors.push(e);
|
|
@@ -174,7 +174,7 @@ function requireNative() {
|
|
|
174
174
|
try {
|
|
175
175
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/core.darwin-arm64.node");
|
|
176
176
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/package.json").version;
|
|
177
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
177
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
178
178
|
return binding;
|
|
179
179
|
} catch (e) {
|
|
180
180
|
loadErrors.push(e);
|
|
@@ -189,7 +189,7 @@ function requireNative() {
|
|
|
189
189
|
try {
|
|
190
190
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/core.freebsd-x64.node");
|
|
191
191
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/package.json").version;
|
|
192
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
192
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
193
193
|
return binding;
|
|
194
194
|
} catch (e) {
|
|
195
195
|
loadErrors.push(e);
|
|
@@ -203,7 +203,7 @@ function requireNative() {
|
|
|
203
203
|
try {
|
|
204
204
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/core.freebsd-arm64.node");
|
|
205
205
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/package.json").version;
|
|
206
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
206
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
207
207
|
return binding;
|
|
208
208
|
} catch (e) {
|
|
209
209
|
loadErrors.push(e);
|
|
@@ -218,7 +218,7 @@ function requireNative() {
|
|
|
218
218
|
try {
|
|
219
219
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/core.linux-x64-musl.node");
|
|
220
220
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/package.json").version;
|
|
221
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
221
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
222
222
|
return binding;
|
|
223
223
|
} catch (e) {
|
|
224
224
|
loadErrors.push(e);
|
|
@@ -232,7 +232,7 @@ function requireNative() {
|
|
|
232
232
|
try {
|
|
233
233
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/core.linux-x64-gnu.node");
|
|
234
234
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/package.json").version;
|
|
235
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
235
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
236
236
|
return binding;
|
|
237
237
|
} catch (e) {
|
|
238
238
|
loadErrors.push(e);
|
|
@@ -247,7 +247,7 @@ function requireNative() {
|
|
|
247
247
|
try {
|
|
248
248
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/core.linux-arm64-musl.node");
|
|
249
249
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/package.json").version;
|
|
250
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
250
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
251
251
|
return binding;
|
|
252
252
|
} catch (e) {
|
|
253
253
|
loadErrors.push(e);
|
|
@@ -261,7 +261,7 @@ function requireNative() {
|
|
|
261
261
|
try {
|
|
262
262
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/core.linux-arm64-gnu.node");
|
|
263
263
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/package.json").version;
|
|
264
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
264
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
265
265
|
return binding;
|
|
266
266
|
} catch (e) {
|
|
267
267
|
loadErrors.push(e);
|
|
@@ -276,7 +276,7 @@ function requireNative() {
|
|
|
276
276
|
try {
|
|
277
277
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/core.linux-arm-musleabihf.node");
|
|
278
278
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/package.json").version;
|
|
279
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
279
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
280
280
|
return binding;
|
|
281
281
|
} catch (e) {
|
|
282
282
|
loadErrors.push(e);
|
|
@@ -290,7 +290,7 @@ function requireNative() {
|
|
|
290
290
|
try {
|
|
291
291
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/core.linux-arm-gnueabihf.node");
|
|
292
292
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/package.json").version;
|
|
293
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
293
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
294
294
|
return binding;
|
|
295
295
|
} catch (e) {
|
|
296
296
|
loadErrors.push(e);
|
|
@@ -305,7 +305,7 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/core.linux-loong64-musl.node");
|
|
307
307
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/package.json").version;
|
|
308
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
308
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
309
309
|
return binding;
|
|
310
310
|
} catch (e) {
|
|
311
311
|
loadErrors.push(e);
|
|
@@ -319,7 +319,7 @@ function requireNative() {
|
|
|
319
319
|
try {
|
|
320
320
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/core.linux-loong64-gnu.node");
|
|
321
321
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/package.json").version;
|
|
322
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
322
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
323
323
|
return binding;
|
|
324
324
|
} catch (e) {
|
|
325
325
|
loadErrors.push(e);
|
|
@@ -334,7 +334,7 @@ function requireNative() {
|
|
|
334
334
|
try {
|
|
335
335
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/core.linux-riscv64-musl.node");
|
|
336
336
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/package.json").version;
|
|
337
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
337
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
338
338
|
return binding;
|
|
339
339
|
} catch (e) {
|
|
340
340
|
loadErrors.push(e);
|
|
@@ -348,7 +348,7 @@ function requireNative() {
|
|
|
348
348
|
try {
|
|
349
349
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/core.linux-riscv64-gnu.node");
|
|
350
350
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/package.json").version;
|
|
351
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
351
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
352
352
|
return binding;
|
|
353
353
|
} catch (e) {
|
|
354
354
|
loadErrors.push(e);
|
|
@@ -363,7 +363,7 @@ function requireNative() {
|
|
|
363
363
|
try {
|
|
364
364
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/core.linux-ppc64-gnu.node");
|
|
365
365
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/package.json").version;
|
|
366
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
366
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
367
367
|
return binding;
|
|
368
368
|
} catch (e) {
|
|
369
369
|
loadErrors.push(e);
|
|
@@ -377,7 +377,7 @@ function requireNative() {
|
|
|
377
377
|
try {
|
|
378
378
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/core.linux-s390x-gnu.node");
|
|
379
379
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/package.json").version;
|
|
380
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
380
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
381
381
|
return binding;
|
|
382
382
|
} catch (e) {
|
|
383
383
|
loadErrors.push(e);
|
|
@@ -392,7 +392,7 @@ function requireNative() {
|
|
|
392
392
|
try {
|
|
393
393
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/core.openharmony-arm64.node");
|
|
394
394
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/package.json").version;
|
|
395
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
395
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
396
396
|
return binding;
|
|
397
397
|
} catch (e) {
|
|
398
398
|
loadErrors.push(e);
|
|
@@ -406,7 +406,7 @@ function requireNative() {
|
|
|
406
406
|
try {
|
|
407
407
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/core.openharmony-x64.node");
|
|
408
408
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/package.json").version;
|
|
409
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
409
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
410
410
|
return binding;
|
|
411
411
|
} catch (e) {
|
|
412
412
|
loadErrors.push(e);
|
|
@@ -420,7 +420,7 @@ function requireNative() {
|
|
|
420
420
|
try {
|
|
421
421
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/core.openharmony-arm.node");
|
|
422
422
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/package.json").version;
|
|
423
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
423
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
424
424
|
return binding;
|
|
425
425
|
} catch (e) {
|
|
426
426
|
loadErrors.push(e);
|
|
@@ -479,8 +479,20 @@ async function resolveImageLoaders(images) {
|
|
|
479
479
|
})));
|
|
480
480
|
}
|
|
481
481
|
var Renderer = class {
|
|
482
|
-
|
|
482
|
+
fontsByKey = /* @__PURE__ */ new Map();
|
|
483
|
+
fontsByData = /* @__PURE__ */ new WeakMap();
|
|
483
484
|
inner = new Renderer$1();
|
|
485
|
+
getFont(key) {
|
|
486
|
+
return typeof key === "string" ? this.fontsByKey.get(key) : this.fontsByData.get(key);
|
|
487
|
+
}
|
|
488
|
+
setFont(key, family) {
|
|
489
|
+
if (typeof key === "string") this.fontsByKey.set(key, family);
|
|
490
|
+
else this.fontsByData.set(key, family);
|
|
491
|
+
}
|
|
492
|
+
deleteFont(key) {
|
|
493
|
+
if (typeof key === "string") this.fontsByKey.delete(key);
|
|
494
|
+
else this.fontsByData.delete(key);
|
|
495
|
+
}
|
|
484
496
|
async prepareFonts(fonts) {
|
|
485
497
|
if (!fonts) return;
|
|
486
498
|
const families = await Promise.all(fonts.map(this.registerFont.bind(this)));
|
|
@@ -496,40 +508,62 @@ var Renderer = class {
|
|
|
496
508
|
};
|
|
497
509
|
}
|
|
498
510
|
async render(node, options) {
|
|
499
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
500
|
-
const resolved = await this.resolveResources(
|
|
511
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
512
|
+
const resolved = await this.resolveResources((0, _takumi_rs_helpers.pickFonts)({
|
|
513
|
+
fonts,
|
|
514
|
+
source: node,
|
|
515
|
+
subset
|
|
516
|
+
}), images, fontFamilies);
|
|
501
517
|
return this.inner.render(node, {
|
|
502
518
|
...rest,
|
|
503
519
|
...resolved
|
|
504
520
|
}, signal);
|
|
505
521
|
}
|
|
506
522
|
async renderSvg(node, options) {
|
|
507
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
508
|
-
const resolved = await this.resolveResources(
|
|
523
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
524
|
+
const resolved = await this.resolveResources((0, _takumi_rs_helpers.pickFonts)({
|
|
525
|
+
fonts,
|
|
526
|
+
source: node,
|
|
527
|
+
subset
|
|
528
|
+
}), images, fontFamilies);
|
|
509
529
|
return this.inner.renderSvg(node, {
|
|
510
530
|
...rest,
|
|
511
531
|
...resolved
|
|
512
532
|
}, signal);
|
|
513
533
|
}
|
|
514
534
|
async measure(node, options) {
|
|
515
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
516
|
-
const resolved = await this.resolveResources(
|
|
535
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
536
|
+
const resolved = await this.resolveResources((0, _takumi_rs_helpers.pickFonts)({
|
|
537
|
+
fonts,
|
|
538
|
+
source: node,
|
|
539
|
+
subset
|
|
540
|
+
}), images, fontFamilies);
|
|
517
541
|
return this.inner.measure(node, {
|
|
518
542
|
...rest,
|
|
519
543
|
...resolved
|
|
520
544
|
}, signal);
|
|
521
545
|
}
|
|
522
546
|
async renderAnimation(options) {
|
|
523
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options;
|
|
524
|
-
const
|
|
547
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options;
|
|
548
|
+
const nodes = options.scenes.map((scene) => scene.node);
|
|
549
|
+
const resolved = await this.resolveResources((0, _takumi_rs_helpers.pickFonts)({
|
|
550
|
+
fonts,
|
|
551
|
+
source: nodes,
|
|
552
|
+
subset
|
|
553
|
+
}), images, fontFamilies);
|
|
525
554
|
return this.inner.renderAnimation({
|
|
526
555
|
...rest,
|
|
527
556
|
...resolved
|
|
528
557
|
}, signal);
|
|
529
558
|
}
|
|
530
559
|
async encodeFrames(frames, options) {
|
|
531
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options;
|
|
532
|
-
const
|
|
560
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options;
|
|
561
|
+
const nodes = frames.map((frame) => frame.node);
|
|
562
|
+
const resolved = await this.resolveResources((0, _takumi_rs_helpers.pickFonts)({
|
|
563
|
+
fonts,
|
|
564
|
+
source: nodes,
|
|
565
|
+
subset
|
|
566
|
+
}), images, fontFamilies);
|
|
533
567
|
return this.inner.encodeFrames(frames, {
|
|
534
568
|
...rest,
|
|
535
569
|
...resolved
|
|
@@ -537,7 +571,7 @@ var Renderer = class {
|
|
|
537
571
|
}
|
|
538
572
|
async registerFont(font) {
|
|
539
573
|
const key = createFontKey(font);
|
|
540
|
-
const cached = this.
|
|
574
|
+
const cached = this.getFont(key);
|
|
541
575
|
if (cached) return cached;
|
|
542
576
|
const extracted = extractFontBuffer(font);
|
|
543
577
|
const register = (data) => this.inner.registerFont(isBuffer(font) ? data : {
|
|
@@ -546,14 +580,14 @@ var Renderer = class {
|
|
|
546
580
|
});
|
|
547
581
|
if (isBuffer(extracted)) {
|
|
548
582
|
const binded = register(extracted);
|
|
549
|
-
this.
|
|
583
|
+
this.setFont(key, Promise.resolve(binded));
|
|
550
584
|
return binded;
|
|
551
585
|
}
|
|
552
586
|
const promise = extracted.then(register).catch((error) => {
|
|
553
|
-
this.
|
|
587
|
+
this.deleteFont(key);
|
|
554
588
|
throw error;
|
|
555
589
|
});
|
|
556
|
-
this.
|
|
590
|
+
this.setFont(key, promise);
|
|
557
591
|
return promise;
|
|
558
592
|
}
|
|
559
593
|
};
|
|
@@ -576,9 +610,4 @@ function isBuffer(data) {
|
|
|
576
610
|
}
|
|
577
611
|
//#endregion
|
|
578
612
|
exports.Renderer = Renderer;
|
|
579
|
-
|
|
580
|
-
enumerable: true,
|
|
581
|
-
get: function() {
|
|
582
|
-
return _takumi_rs_helpers.extractResourceUrls;
|
|
583
|
-
}
|
|
584
|
-
});
|
|
613
|
+
exports.extractResourceUrls = _takumi_rs_helpers.extractResourceUrls;
|
package/dist/export.d.cts
CHANGED
|
@@ -261,7 +261,8 @@ interface SvgRenderOptions$1 {
|
|
|
261
261
|
//#endregion
|
|
262
262
|
//#region src/export.d.ts
|
|
263
263
|
type FontLoader = Font | (Omit<FontDetails, "data"> & {
|
|
264
|
-
data: () => Promise<FontDetails["data"]> | FontDetails["data"];
|
|
264
|
+
data: () => Promise<FontDetails["data"]> | FontDetails["data"]; /** Inclusive codepoint ranges this face covers; lets `render` skip it when unused. */
|
|
265
|
+
ranges?: [number, number][];
|
|
265
266
|
} & ({
|
|
266
267
|
key: string;
|
|
267
268
|
} | {
|
|
@@ -294,7 +295,8 @@ type OutputFormatOptions = {
|
|
|
294
295
|
type RenderOptions = Omit<RenderOptions$1, "images" | "format" | "quality" | "lossless"> & OutputFormatOptions & {
|
|
295
296
|
fonts?: FontLoader[];
|
|
296
297
|
signal?: AbortSignal;
|
|
297
|
-
images?: ImageLoader[];
|
|
298
|
+
images?: ImageLoader[]; /** Register only the `fonts` subsets the content renders. @default true */
|
|
299
|
+
subset?: boolean;
|
|
298
300
|
};
|
|
299
301
|
/**
|
|
300
302
|
* Animation output format. `quality` and `lossless` are WebP-only; for WebP,
|
|
@@ -313,21 +315,28 @@ type AnimationOutputFormatOptions = {
|
|
|
313
315
|
type RenderAnimationOptions = Omit<RenderAnimationOptions$1, "images" | "format" | "quality" | "lossless"> & AnimationOutputFormatOptions & {
|
|
314
316
|
fonts?: FontLoader[];
|
|
315
317
|
signal?: AbortSignal;
|
|
316
|
-
images?: ImageLoader[];
|
|
318
|
+
images?: ImageLoader[]; /** Register only the `fonts` subsets the content renders. @default true */
|
|
319
|
+
subset?: boolean;
|
|
317
320
|
};
|
|
318
321
|
type EncodeFramesOptions = Omit<EncodeFramesOptions$1, "images" | "format" | "quality" | "lossless"> & AnimationOutputFormatOptions & {
|
|
319
322
|
fonts?: FontLoader[];
|
|
320
323
|
signal?: AbortSignal;
|
|
321
|
-
images?: ImageLoader[];
|
|
324
|
+
images?: ImageLoader[]; /** Register only the `fonts` subsets the content renders. @default true */
|
|
325
|
+
subset?: boolean;
|
|
322
326
|
};
|
|
323
327
|
type SvgRenderOptions = Omit<SvgRenderOptions$1, "images"> & {
|
|
324
328
|
fonts?: FontLoader[];
|
|
325
329
|
signal?: AbortSignal;
|
|
326
|
-
images?: ImageLoader[];
|
|
330
|
+
images?: ImageLoader[]; /** Register only the `fonts` subsets the content renders. @default true */
|
|
331
|
+
subset?: boolean;
|
|
327
332
|
};
|
|
328
333
|
declare class Renderer {
|
|
329
|
-
private
|
|
334
|
+
private fontsByKey;
|
|
335
|
+
private fontsByData;
|
|
330
336
|
private inner;
|
|
337
|
+
private getFont;
|
|
338
|
+
private setFont;
|
|
339
|
+
private deleteFont;
|
|
331
340
|
private prepareFonts;
|
|
332
341
|
/** Registers `fonts` and resolves lazy `images`, yielding the `images`/`fontFamilies`
|
|
333
342
|
* the napi binding expects. Explicit `fontFamilies` wins over the registered set. */
|
package/dist/export.d.mts
CHANGED
|
@@ -261,7 +261,8 @@ interface SvgRenderOptions$1 {
|
|
|
261
261
|
//#endregion
|
|
262
262
|
//#region src/export.d.ts
|
|
263
263
|
type FontLoader = Font | (Omit<FontDetails, "data"> & {
|
|
264
|
-
data: () => Promise<FontDetails["data"]> | FontDetails["data"];
|
|
264
|
+
data: () => Promise<FontDetails["data"]> | FontDetails["data"]; /** Inclusive codepoint ranges this face covers; lets `render` skip it when unused. */
|
|
265
|
+
ranges?: [number, number][];
|
|
265
266
|
} & ({
|
|
266
267
|
key: string;
|
|
267
268
|
} | {
|
|
@@ -294,7 +295,8 @@ type OutputFormatOptions = {
|
|
|
294
295
|
type RenderOptions = Omit<RenderOptions$1, "images" | "format" | "quality" | "lossless"> & OutputFormatOptions & {
|
|
295
296
|
fonts?: FontLoader[];
|
|
296
297
|
signal?: AbortSignal;
|
|
297
|
-
images?: ImageLoader[];
|
|
298
|
+
images?: ImageLoader[]; /** Register only the `fonts` subsets the content renders. @default true */
|
|
299
|
+
subset?: boolean;
|
|
298
300
|
};
|
|
299
301
|
/**
|
|
300
302
|
* Animation output format. `quality` and `lossless` are WebP-only; for WebP,
|
|
@@ -313,21 +315,28 @@ type AnimationOutputFormatOptions = {
|
|
|
313
315
|
type RenderAnimationOptions = Omit<RenderAnimationOptions$1, "images" | "format" | "quality" | "lossless"> & AnimationOutputFormatOptions & {
|
|
314
316
|
fonts?: FontLoader[];
|
|
315
317
|
signal?: AbortSignal;
|
|
316
|
-
images?: ImageLoader[];
|
|
318
|
+
images?: ImageLoader[]; /** Register only the `fonts` subsets the content renders. @default true */
|
|
319
|
+
subset?: boolean;
|
|
317
320
|
};
|
|
318
321
|
type EncodeFramesOptions = Omit<EncodeFramesOptions$1, "images" | "format" | "quality" | "lossless"> & AnimationOutputFormatOptions & {
|
|
319
322
|
fonts?: FontLoader[];
|
|
320
323
|
signal?: AbortSignal;
|
|
321
|
-
images?: ImageLoader[];
|
|
324
|
+
images?: ImageLoader[]; /** Register only the `fonts` subsets the content renders. @default true */
|
|
325
|
+
subset?: boolean;
|
|
322
326
|
};
|
|
323
327
|
type SvgRenderOptions = Omit<SvgRenderOptions$1, "images"> & {
|
|
324
328
|
fonts?: FontLoader[];
|
|
325
329
|
signal?: AbortSignal;
|
|
326
|
-
images?: ImageLoader[];
|
|
330
|
+
images?: ImageLoader[]; /** Register only the `fonts` subsets the content renders. @default true */
|
|
331
|
+
subset?: boolean;
|
|
327
332
|
};
|
|
328
333
|
declare class Renderer {
|
|
329
|
-
private
|
|
334
|
+
private fontsByKey;
|
|
335
|
+
private fontsByData;
|
|
330
336
|
private inner;
|
|
337
|
+
private getFont;
|
|
338
|
+
private setFont;
|
|
339
|
+
private deleteFont;
|
|
331
340
|
private prepareFonts;
|
|
332
341
|
/** Registers `fonts` and resolves lazy `images`, yielding the `images`/`fontFamilies`
|
|
333
342
|
* the napi binding expects. Explicit `fontFamilies` wins over the registered set. */
|
package/dist/export.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "module";
|
|
2
|
-
import { extractResourceUrls } from "@takumi-rs/helpers";
|
|
2
|
+
import { extractResourceUrls, pickFonts } from "@takumi-rs/helpers";
|
|
3
3
|
//#region index.js
|
|
4
4
|
const require = createRequire(import.meta.url);
|
|
5
5
|
new URL(".", import.meta.url).pathname;
|
|
@@ -58,7 +58,7 @@ function requireNative() {
|
|
|
58
58
|
try {
|
|
59
59
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/core.android-arm64.node");
|
|
60
60
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/package.json").version;
|
|
61
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
61
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
62
62
|
return binding;
|
|
63
63
|
} catch (e) {
|
|
64
64
|
loadErrors.push(e);
|
|
@@ -72,7 +72,7 @@ function requireNative() {
|
|
|
72
72
|
try {
|
|
73
73
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/core.android-arm-eabi.node");
|
|
74
74
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/package.json").version;
|
|
75
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
75
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
76
76
|
return binding;
|
|
77
77
|
} catch (e) {
|
|
78
78
|
loadErrors.push(e);
|
|
@@ -87,7 +87,7 @@ function requireNative() {
|
|
|
87
87
|
try {
|
|
88
88
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/core.win32-x64-gnu.node");
|
|
89
89
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/package.json").version;
|
|
90
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
90
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
91
91
|
return binding;
|
|
92
92
|
} catch (e) {
|
|
93
93
|
loadErrors.push(e);
|
|
@@ -101,7 +101,7 @@ function requireNative() {
|
|
|
101
101
|
try {
|
|
102
102
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/core.win32-x64-msvc.node");
|
|
103
103
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/package.json").version;
|
|
104
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
104
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
105
105
|
return binding;
|
|
106
106
|
} catch (e) {
|
|
107
107
|
loadErrors.push(e);
|
|
@@ -116,7 +116,7 @@ function requireNative() {
|
|
|
116
116
|
try {
|
|
117
117
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/core.win32-ia32-msvc.node");
|
|
118
118
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/package.json").version;
|
|
119
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
119
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
120
120
|
return binding;
|
|
121
121
|
} catch (e) {
|
|
122
122
|
loadErrors.push(e);
|
|
@@ -130,7 +130,7 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/core.win32-arm64-msvc.node");
|
|
132
132
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/package.json").version;
|
|
133
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
133
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
134
134
|
return binding;
|
|
135
135
|
} catch (e) {
|
|
136
136
|
loadErrors.push(e);
|
|
@@ -145,7 +145,7 @@ function requireNative() {
|
|
|
145
145
|
try {
|
|
146
146
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/core.darwin-universal.node");
|
|
147
147
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/package.json").version;
|
|
148
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
148
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
149
149
|
return binding;
|
|
150
150
|
} catch (e) {
|
|
151
151
|
loadErrors.push(e);
|
|
@@ -159,7 +159,7 @@ function requireNative() {
|
|
|
159
159
|
try {
|
|
160
160
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/core.darwin-x64.node");
|
|
161
161
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/package.json").version;
|
|
162
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
162
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
163
163
|
return binding;
|
|
164
164
|
} catch (e) {
|
|
165
165
|
loadErrors.push(e);
|
|
@@ -173,7 +173,7 @@ function requireNative() {
|
|
|
173
173
|
try {
|
|
174
174
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/core.darwin-arm64.node");
|
|
175
175
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/package.json").version;
|
|
176
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
176
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
177
177
|
return binding;
|
|
178
178
|
} catch (e) {
|
|
179
179
|
loadErrors.push(e);
|
|
@@ -188,7 +188,7 @@ function requireNative() {
|
|
|
188
188
|
try {
|
|
189
189
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/core.freebsd-x64.node");
|
|
190
190
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/package.json").version;
|
|
191
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
191
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
192
192
|
return binding;
|
|
193
193
|
} catch (e) {
|
|
194
194
|
loadErrors.push(e);
|
|
@@ -202,7 +202,7 @@ function requireNative() {
|
|
|
202
202
|
try {
|
|
203
203
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/core.freebsd-arm64.node");
|
|
204
204
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/package.json").version;
|
|
205
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
205
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
206
206
|
return binding;
|
|
207
207
|
} catch (e) {
|
|
208
208
|
loadErrors.push(e);
|
|
@@ -217,7 +217,7 @@ function requireNative() {
|
|
|
217
217
|
try {
|
|
218
218
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/core.linux-x64-musl.node");
|
|
219
219
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/package.json").version;
|
|
220
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
220
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
221
221
|
return binding;
|
|
222
222
|
} catch (e) {
|
|
223
223
|
loadErrors.push(e);
|
|
@@ -231,7 +231,7 @@ function requireNative() {
|
|
|
231
231
|
try {
|
|
232
232
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/core.linux-x64-gnu.node");
|
|
233
233
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/package.json").version;
|
|
234
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
234
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
235
235
|
return binding;
|
|
236
236
|
} catch (e) {
|
|
237
237
|
loadErrors.push(e);
|
|
@@ -246,7 +246,7 @@ function requireNative() {
|
|
|
246
246
|
try {
|
|
247
247
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/core.linux-arm64-musl.node");
|
|
248
248
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/package.json").version;
|
|
249
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
249
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
250
250
|
return binding;
|
|
251
251
|
} catch (e) {
|
|
252
252
|
loadErrors.push(e);
|
|
@@ -260,7 +260,7 @@ function requireNative() {
|
|
|
260
260
|
try {
|
|
261
261
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/core.linux-arm64-gnu.node");
|
|
262
262
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/package.json").version;
|
|
263
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
263
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
264
264
|
return binding;
|
|
265
265
|
} catch (e) {
|
|
266
266
|
loadErrors.push(e);
|
|
@@ -275,7 +275,7 @@ function requireNative() {
|
|
|
275
275
|
try {
|
|
276
276
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/core.linux-arm-musleabihf.node");
|
|
277
277
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/package.json").version;
|
|
278
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
278
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
279
279
|
return binding;
|
|
280
280
|
} catch (e) {
|
|
281
281
|
loadErrors.push(e);
|
|
@@ -289,7 +289,7 @@ function requireNative() {
|
|
|
289
289
|
try {
|
|
290
290
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/core.linux-arm-gnueabihf.node");
|
|
291
291
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/package.json").version;
|
|
292
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
292
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
293
293
|
return binding;
|
|
294
294
|
} catch (e) {
|
|
295
295
|
loadErrors.push(e);
|
|
@@ -304,7 +304,7 @@ function requireNative() {
|
|
|
304
304
|
try {
|
|
305
305
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/core.linux-loong64-musl.node");
|
|
306
306
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/package.json").version;
|
|
307
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
307
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
308
308
|
return binding;
|
|
309
309
|
} catch (e) {
|
|
310
310
|
loadErrors.push(e);
|
|
@@ -318,7 +318,7 @@ function requireNative() {
|
|
|
318
318
|
try {
|
|
319
319
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/core.linux-loong64-gnu.node");
|
|
320
320
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/package.json").version;
|
|
321
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
321
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
322
322
|
return binding;
|
|
323
323
|
} catch (e) {
|
|
324
324
|
loadErrors.push(e);
|
|
@@ -333,7 +333,7 @@ function requireNative() {
|
|
|
333
333
|
try {
|
|
334
334
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/core.linux-riscv64-musl.node");
|
|
335
335
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/package.json").version;
|
|
336
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
336
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
337
337
|
return binding;
|
|
338
338
|
} catch (e) {
|
|
339
339
|
loadErrors.push(e);
|
|
@@ -347,7 +347,7 @@ function requireNative() {
|
|
|
347
347
|
try {
|
|
348
348
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/core.linux-riscv64-gnu.node");
|
|
349
349
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/package.json").version;
|
|
350
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
350
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
351
351
|
return binding;
|
|
352
352
|
} catch (e) {
|
|
353
353
|
loadErrors.push(e);
|
|
@@ -362,7 +362,7 @@ function requireNative() {
|
|
|
362
362
|
try {
|
|
363
363
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/core.linux-ppc64-gnu.node");
|
|
364
364
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/package.json").version;
|
|
365
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
365
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
366
366
|
return binding;
|
|
367
367
|
} catch (e) {
|
|
368
368
|
loadErrors.push(e);
|
|
@@ -376,7 +376,7 @@ function requireNative() {
|
|
|
376
376
|
try {
|
|
377
377
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/core.linux-s390x-gnu.node");
|
|
378
378
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/package.json").version;
|
|
379
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
379
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
380
380
|
return binding;
|
|
381
381
|
} catch (e) {
|
|
382
382
|
loadErrors.push(e);
|
|
@@ -391,7 +391,7 @@ function requireNative() {
|
|
|
391
391
|
try {
|
|
392
392
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/core.openharmony-arm64.node");
|
|
393
393
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/package.json").version;
|
|
394
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
394
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
395
395
|
return binding;
|
|
396
396
|
} catch (e) {
|
|
397
397
|
loadErrors.push(e);
|
|
@@ -405,7 +405,7 @@ function requireNative() {
|
|
|
405
405
|
try {
|
|
406
406
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/core.openharmony-x64.node");
|
|
407
407
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/package.json").version;
|
|
408
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
408
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
409
409
|
return binding;
|
|
410
410
|
} catch (e) {
|
|
411
411
|
loadErrors.push(e);
|
|
@@ -419,7 +419,7 @@ function requireNative() {
|
|
|
419
419
|
try {
|
|
420
420
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/core.openharmony-arm.node");
|
|
421
421
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/package.json").version;
|
|
422
|
-
if (bindingPackageVersion !== "2.0.0-beta.
|
|
422
|
+
if (bindingPackageVersion !== "2.0.0-beta.7" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.0.0-beta.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
423
423
|
return binding;
|
|
424
424
|
} catch (e) {
|
|
425
425
|
loadErrors.push(e);
|
|
@@ -478,8 +478,20 @@ async function resolveImageLoaders(images) {
|
|
|
478
478
|
})));
|
|
479
479
|
}
|
|
480
480
|
var Renderer = class {
|
|
481
|
-
|
|
481
|
+
fontsByKey = /* @__PURE__ */ new Map();
|
|
482
|
+
fontsByData = /* @__PURE__ */ new WeakMap();
|
|
482
483
|
inner = new Renderer$1();
|
|
484
|
+
getFont(key) {
|
|
485
|
+
return typeof key === "string" ? this.fontsByKey.get(key) : this.fontsByData.get(key);
|
|
486
|
+
}
|
|
487
|
+
setFont(key, family) {
|
|
488
|
+
if (typeof key === "string") this.fontsByKey.set(key, family);
|
|
489
|
+
else this.fontsByData.set(key, family);
|
|
490
|
+
}
|
|
491
|
+
deleteFont(key) {
|
|
492
|
+
if (typeof key === "string") this.fontsByKey.delete(key);
|
|
493
|
+
else this.fontsByData.delete(key);
|
|
494
|
+
}
|
|
483
495
|
async prepareFonts(fonts) {
|
|
484
496
|
if (!fonts) return;
|
|
485
497
|
const families = await Promise.all(fonts.map(this.registerFont.bind(this)));
|
|
@@ -495,40 +507,62 @@ var Renderer = class {
|
|
|
495
507
|
};
|
|
496
508
|
}
|
|
497
509
|
async render(node, options) {
|
|
498
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
499
|
-
const resolved = await this.resolveResources(
|
|
510
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
511
|
+
const resolved = await this.resolveResources(pickFonts({
|
|
512
|
+
fonts,
|
|
513
|
+
source: node,
|
|
514
|
+
subset
|
|
515
|
+
}), images, fontFamilies);
|
|
500
516
|
return this.inner.render(node, {
|
|
501
517
|
...rest,
|
|
502
518
|
...resolved
|
|
503
519
|
}, signal);
|
|
504
520
|
}
|
|
505
521
|
async renderSvg(node, options) {
|
|
506
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
507
|
-
const resolved = await this.resolveResources(
|
|
522
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
523
|
+
const resolved = await this.resolveResources(pickFonts({
|
|
524
|
+
fonts,
|
|
525
|
+
source: node,
|
|
526
|
+
subset
|
|
527
|
+
}), images, fontFamilies);
|
|
508
528
|
return this.inner.renderSvg(node, {
|
|
509
529
|
...rest,
|
|
510
530
|
...resolved
|
|
511
531
|
}, signal);
|
|
512
532
|
}
|
|
513
533
|
async measure(node, options) {
|
|
514
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
515
|
-
const resolved = await this.resolveResources(
|
|
534
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options !== null && options !== void 0 ? options : {};
|
|
535
|
+
const resolved = await this.resolveResources(pickFonts({
|
|
536
|
+
fonts,
|
|
537
|
+
source: node,
|
|
538
|
+
subset
|
|
539
|
+
}), images, fontFamilies);
|
|
516
540
|
return this.inner.measure(node, {
|
|
517
541
|
...rest,
|
|
518
542
|
...resolved
|
|
519
543
|
}, signal);
|
|
520
544
|
}
|
|
521
545
|
async renderAnimation(options) {
|
|
522
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options;
|
|
523
|
-
const
|
|
546
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options;
|
|
547
|
+
const nodes = options.scenes.map((scene) => scene.node);
|
|
548
|
+
const resolved = await this.resolveResources(pickFonts({
|
|
549
|
+
fonts,
|
|
550
|
+
source: nodes,
|
|
551
|
+
subset
|
|
552
|
+
}), images, fontFamilies);
|
|
524
553
|
return this.inner.renderAnimation({
|
|
525
554
|
...rest,
|
|
526
555
|
...resolved
|
|
527
556
|
}, signal);
|
|
528
557
|
}
|
|
529
558
|
async encodeFrames(frames, options) {
|
|
530
|
-
const { fonts, fontFamilies, signal, images, ...rest } = options;
|
|
531
|
-
const
|
|
559
|
+
const { fonts, fontFamilies, signal, images, subset, ...rest } = options;
|
|
560
|
+
const nodes = frames.map((frame) => frame.node);
|
|
561
|
+
const resolved = await this.resolveResources(pickFonts({
|
|
562
|
+
fonts,
|
|
563
|
+
source: nodes,
|
|
564
|
+
subset
|
|
565
|
+
}), images, fontFamilies);
|
|
532
566
|
return this.inner.encodeFrames(frames, {
|
|
533
567
|
...rest,
|
|
534
568
|
...resolved
|
|
@@ -536,7 +570,7 @@ var Renderer = class {
|
|
|
536
570
|
}
|
|
537
571
|
async registerFont(font) {
|
|
538
572
|
const key = createFontKey(font);
|
|
539
|
-
const cached = this.
|
|
573
|
+
const cached = this.getFont(key);
|
|
540
574
|
if (cached) return cached;
|
|
541
575
|
const extracted = extractFontBuffer(font);
|
|
542
576
|
const register = (data) => this.inner.registerFont(isBuffer(font) ? data : {
|
|
@@ -545,14 +579,14 @@ var Renderer = class {
|
|
|
545
579
|
});
|
|
546
580
|
if (isBuffer(extracted)) {
|
|
547
581
|
const binded = register(extracted);
|
|
548
|
-
this.
|
|
582
|
+
this.setFont(key, Promise.resolve(binded));
|
|
549
583
|
return binded;
|
|
550
584
|
}
|
|
551
585
|
const promise = extracted.then(register).catch((error) => {
|
|
552
|
-
this.
|
|
586
|
+
this.deleteFont(key);
|
|
553
587
|
throw error;
|
|
554
588
|
});
|
|
555
|
-
this.
|
|
589
|
+
this.setFont(key, promise);
|
|
556
590
|
return promise;
|
|
557
591
|
}
|
|
558
592
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takumi-rs/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.7",
|
|
4
4
|
"description": "Native Node.js bindings for the Takumi Rust image rendering engine.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
"publish-lint": "attw --pack . && publint --strict ."
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@takumi-rs/helpers": "2.0.0-beta.
|
|
73
|
+
"@takumi-rs/helpers": "2.0.0-beta.7"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@napi-rs/cli": "3.7.2",
|
|
77
|
-
"@types/bun": "
|
|
78
|
-
"@types/react": "
|
|
79
|
-
"@types/react-dom": "
|
|
77
|
+
"@types/bun": "^1.3.14",
|
|
78
|
+
"@types/react": "19.2.17",
|
|
79
|
+
"@types/react-dom": "^19.2.3",
|
|
80
80
|
"csstype": "^3.2.3",
|
|
81
|
-
"lucide-react": "
|
|
81
|
+
"lucide-react": "^1.21.0",
|
|
82
82
|
"mitata": "^1.0.34",
|
|
83
|
-
"react": "
|
|
84
|
-
"tsdown": "
|
|
85
|
-
"unrun": "
|
|
83
|
+
"react": "^19.2.7",
|
|
84
|
+
"tsdown": "^0.22.3",
|
|
85
|
+
"unrun": "^0.3.1"
|
|
86
86
|
},
|
|
87
87
|
"napi": {
|
|
88
88
|
"binaryName": "core",
|
|
@@ -100,15 +100,5 @@
|
|
|
100
100
|
},
|
|
101
101
|
"engines": {
|
|
102
102
|
"node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
|
|
103
|
-
},
|
|
104
|
-
"optionalDependencies": {
|
|
105
|
-
"@takumi-rs/core-darwin-x64": "2.0.0-beta.5",
|
|
106
|
-
"@takumi-rs/core-darwin-arm64": "2.0.0-beta.5",
|
|
107
|
-
"@takumi-rs/core-linux-arm64-gnu": "2.0.0-beta.5",
|
|
108
|
-
"@takumi-rs/core-linux-arm64-musl": "2.0.0-beta.5",
|
|
109
|
-
"@takumi-rs/core-win32-arm64-msvc": "2.0.0-beta.5",
|
|
110
|
-
"@takumi-rs/core-linux-x64-gnu": "2.0.0-beta.5",
|
|
111
|
-
"@takumi-rs/core-linux-x64-musl": "2.0.0-beta.5",
|
|
112
|
-
"@takumi-rs/core-win32-x64-msvc": "2.0.0-beta.5"
|
|
113
103
|
}
|
|
114
|
-
}
|
|
104
|
+
}
|