@takumi-rs/core 0.30.2 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +57 -56
  3. package/package.json +10 -10
package/index.d.ts CHANGED
@@ -49,7 +49,8 @@ export type OutputFormat = 'webp'|
49
49
  'WebP'|
50
50
  'Avif'|
51
51
  'Jpeg'|
52
- 'Png';
52
+ 'Png'|
53
+ 'raw';
53
54
 
54
55
  export interface PersistentImage {
55
56
  src: string
package/index.js CHANGED
@@ -3,8 +3,9 @@
3
3
  // @ts-nocheck
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- const { createRequire } = require('node:module')
7
- require = createRequire(__filename)
6
+ import { createRequire } from 'node:module'
7
+ const require = createRequire(import.meta.url)
8
+ const __dirname = new URL('.', import.meta.url).pathname
8
9
 
9
10
  const { readFileSync } = require('node:fs')
10
11
  let nativeBinding = null
@@ -80,8 +81,8 @@ function requireNative() {
80
81
  try {
81
82
  const binding = require('@takumi-rs/core-android-arm64')
82
83
  const bindingPackageVersion = require('@takumi-rs/core-android-arm64/package.json').version
83
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
84
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
84
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
85
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
85
86
  }
86
87
  return binding
87
88
  } catch (e) {
@@ -96,8 +97,8 @@ function requireNative() {
96
97
  try {
97
98
  const binding = require('@takumi-rs/core-android-arm-eabi')
98
99
  const bindingPackageVersion = require('@takumi-rs/core-android-arm-eabi/package.json').version
99
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
100
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
100
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
101
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
101
102
  }
102
103
  return binding
103
104
  } catch (e) {
@@ -116,8 +117,8 @@ function requireNative() {
116
117
  try {
117
118
  const binding = require('@takumi-rs/core-win32-x64-msvc')
118
119
  const bindingPackageVersion = require('@takumi-rs/core-win32-x64-msvc/package.json').version
119
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
120
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
120
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
121
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
121
122
  }
122
123
  return binding
123
124
  } catch (e) {
@@ -132,8 +133,8 @@ function requireNative() {
132
133
  try {
133
134
  const binding = require('@takumi-rs/core-win32-ia32-msvc')
134
135
  const bindingPackageVersion = require('@takumi-rs/core-win32-ia32-msvc/package.json').version
135
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
136
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
136
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
137
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
137
138
  }
138
139
  return binding
139
140
  } catch (e) {
@@ -148,8 +149,8 @@ function requireNative() {
148
149
  try {
149
150
  const binding = require('@takumi-rs/core-win32-arm64-msvc')
150
151
  const bindingPackageVersion = require('@takumi-rs/core-win32-arm64-msvc/package.json').version
151
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
152
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
153
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
153
154
  }
154
155
  return binding
155
156
  } catch (e) {
@@ -167,8 +168,8 @@ function requireNative() {
167
168
  try {
168
169
  const binding = require('@takumi-rs/core-darwin-universal')
169
170
  const bindingPackageVersion = require('@takumi-rs/core-darwin-universal/package.json').version
170
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
171
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
172
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172
173
  }
173
174
  return binding
174
175
  } catch (e) {
@@ -183,8 +184,8 @@ function requireNative() {
183
184
  try {
184
185
  const binding = require('@takumi-rs/core-darwin-x64')
185
186
  const bindingPackageVersion = require('@takumi-rs/core-darwin-x64/package.json').version
186
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
187
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
188
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
188
189
  }
189
190
  return binding
190
191
  } catch (e) {
@@ -199,8 +200,8 @@ function requireNative() {
199
200
  try {
200
201
  const binding = require('@takumi-rs/core-darwin-arm64')
201
202
  const bindingPackageVersion = require('@takumi-rs/core-darwin-arm64/package.json').version
202
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
203
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
204
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
204
205
  }
205
206
  return binding
206
207
  } catch (e) {
@@ -219,8 +220,8 @@ function requireNative() {
219
220
  try {
220
221
  const binding = require('@takumi-rs/core-freebsd-x64')
221
222
  const bindingPackageVersion = require('@takumi-rs/core-freebsd-x64/package.json').version
222
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
223
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
224
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
224
225
  }
225
226
  return binding
226
227
  } catch (e) {
@@ -235,8 +236,8 @@ function requireNative() {
235
236
  try {
236
237
  const binding = require('@takumi-rs/core-freebsd-arm64')
237
238
  const bindingPackageVersion = require('@takumi-rs/core-freebsd-arm64/package.json').version
238
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
239
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
240
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
240
241
  }
241
242
  return binding
242
243
  } catch (e) {
@@ -256,8 +257,8 @@ function requireNative() {
256
257
  try {
257
258
  const binding = require('@takumi-rs/core-linux-x64-musl')
258
259
  const bindingPackageVersion = require('@takumi-rs/core-linux-x64-musl/package.json').version
259
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
260
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
260
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
261
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
261
262
  }
262
263
  return binding
263
264
  } catch (e) {
@@ -272,8 +273,8 @@ function requireNative() {
272
273
  try {
273
274
  const binding = require('@takumi-rs/core-linux-x64-gnu')
274
275
  const bindingPackageVersion = require('@takumi-rs/core-linux-x64-gnu/package.json').version
275
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
276
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
277
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
277
278
  }
278
279
  return binding
279
280
  } catch (e) {
@@ -290,8 +291,8 @@ function requireNative() {
290
291
  try {
291
292
  const binding = require('@takumi-rs/core-linux-arm64-musl')
292
293
  const bindingPackageVersion = require('@takumi-rs/core-linux-arm64-musl/package.json').version
293
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
294
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
294
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
295
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
295
296
  }
296
297
  return binding
297
298
  } catch (e) {
@@ -306,8 +307,8 @@ function requireNative() {
306
307
  try {
307
308
  const binding = require('@takumi-rs/core-linux-arm64-gnu')
308
309
  const bindingPackageVersion = require('@takumi-rs/core-linux-arm64-gnu/package.json').version
309
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
310
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
311
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
311
312
  }
312
313
  return binding
313
314
  } catch (e) {
@@ -324,8 +325,8 @@ function requireNative() {
324
325
  try {
325
326
  const binding = require('@takumi-rs/core-linux-arm-musleabihf')
326
327
  const bindingPackageVersion = require('@takumi-rs/core-linux-arm-musleabihf/package.json').version
327
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
328
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
328
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
329
330
  }
330
331
  return binding
331
332
  } catch (e) {
@@ -340,8 +341,8 @@ function requireNative() {
340
341
  try {
341
342
  const binding = require('@takumi-rs/core-linux-arm-gnueabihf')
342
343
  const bindingPackageVersion = require('@takumi-rs/core-linux-arm-gnueabihf/package.json').version
343
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
344
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
345
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
345
346
  }
346
347
  return binding
347
348
  } catch (e) {
@@ -358,8 +359,8 @@ function requireNative() {
358
359
  try {
359
360
  const binding = require('@takumi-rs/core-linux-loong64-musl')
360
361
  const bindingPackageVersion = require('@takumi-rs/core-linux-loong64-musl/package.json').version
361
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
362
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
362
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
363
364
  }
364
365
  return binding
365
366
  } catch (e) {
@@ -374,8 +375,8 @@ function requireNative() {
374
375
  try {
375
376
  const binding = require('@takumi-rs/core-linux-loong64-gnu')
376
377
  const bindingPackageVersion = require('@takumi-rs/core-linux-loong64-gnu/package.json').version
377
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
378
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
379
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
379
380
  }
380
381
  return binding
381
382
  } catch (e) {
@@ -392,8 +393,8 @@ function requireNative() {
392
393
  try {
393
394
  const binding = require('@takumi-rs/core-linux-riscv64-musl')
394
395
  const bindingPackageVersion = require('@takumi-rs/core-linux-riscv64-musl/package.json').version
395
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
396
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
396
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
397
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
397
398
  }
398
399
  return binding
399
400
  } catch (e) {
@@ -408,8 +409,8 @@ function requireNative() {
408
409
  try {
409
410
  const binding = require('@takumi-rs/core-linux-riscv64-gnu')
410
411
  const bindingPackageVersion = require('@takumi-rs/core-linux-riscv64-gnu/package.json').version
411
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
412
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
413
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
413
414
  }
414
415
  return binding
415
416
  } catch (e) {
@@ -425,8 +426,8 @@ function requireNative() {
425
426
  try {
426
427
  const binding = require('@takumi-rs/core-linux-ppc64-gnu')
427
428
  const bindingPackageVersion = require('@takumi-rs/core-linux-ppc64-gnu/package.json').version
428
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
429
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
429
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
430
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
430
431
  }
431
432
  return binding
432
433
  } catch (e) {
@@ -441,8 +442,8 @@ function requireNative() {
441
442
  try {
442
443
  const binding = require('@takumi-rs/core-linux-s390x-gnu')
443
444
  const bindingPackageVersion = require('@takumi-rs/core-linux-s390x-gnu/package.json').version
444
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
445
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
446
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
446
447
  }
447
448
  return binding
448
449
  } catch (e) {
@@ -461,8 +462,8 @@ function requireNative() {
461
462
  try {
462
463
  const binding = require('@takumi-rs/core-openharmony-arm64')
463
464
  const bindingPackageVersion = require('@takumi-rs/core-openharmony-arm64/package.json').version
464
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
465
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
465
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
466
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
466
467
  }
467
468
  return binding
468
469
  } catch (e) {
@@ -477,8 +478,8 @@ function requireNative() {
477
478
  try {
478
479
  const binding = require('@takumi-rs/core-openharmony-x64')
479
480
  const bindingPackageVersion = require('@takumi-rs/core-openharmony-x64/package.json').version
480
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
481
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
482
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
482
483
  }
483
484
  return binding
484
485
  } catch (e) {
@@ -493,8 +494,8 @@ function requireNative() {
493
494
  try {
494
495
  const binding = require('@takumi-rs/core-openharmony-arm')
495
496
  const bindingPackageVersion = require('@takumi-rs/core-openharmony-arm/package.json').version
496
- if (bindingPackageVersion !== '0.30.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
497
- throw new Error(`Native binding package version mismatch, expected 0.30.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
+ if (bindingPackageVersion !== '0.31.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
498
+ throw new Error(`Native binding package version mismatch, expected 0.31.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
498
499
  }
499
500
  return binding
500
501
  } catch (e) {
@@ -556,7 +557,7 @@ if (!nativeBinding) {
556
557
  throw new Error(`Failed to load native binding`)
557
558
  }
558
559
 
559
- module.exports = nativeBinding
560
- module.exports.Renderer = nativeBinding.Renderer
561
- module.exports.FontStyleInput = nativeBinding.FontStyleInput
562
- module.exports.OutputFormat = nativeBinding.OutputFormat
560
+ const { Renderer, FontStyleInput, OutputFormat } = nativeBinding
561
+ export { Renderer }
562
+ export { FontStyleInput }
563
+ export { OutputFormat }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/core",
3
- "version": "0.30.2",
3
+ "version": "0.31.1",
4
4
  "author": {
5
5
  "email": "me@kane.tw",
6
6
  "name": "Kane Wang",
@@ -45,22 +45,22 @@
45
45
  "dtsHeaderFile": "./src/dts-header.d.ts"
46
46
  },
47
47
  "scripts": {
48
- "build": "napi build --release --platform --strip --no-const-enum",
48
+ "build": "napi build --release --platform --esm --strip --no-const-enum",
49
49
  "build:debug": "napi build",
50
50
  "prepublishOnly": "bunx napi prepublish -t npm --no-gh-release",
51
51
  "artifacts": "napi create-npm-dirs && napi artifacts",
52
52
  "version": "napi version",
53
53
  "bench": "bun tests/bench/index.ts"
54
54
  },
55
- "type": "commonjs",
55
+ "type": "module",
56
56
  "types": "index.d.ts",
57
57
  "optionalDependencies": {
58
- "@takumi-rs/core-darwin-arm64": "0.30.2",
59
- "@takumi-rs/core-linux-arm64-gnu": "0.30.2",
60
- "@takumi-rs/core-linux-arm64-musl": "0.30.2",
61
- "@takumi-rs/core-win32-arm64-msvc": "0.30.2",
62
- "@takumi-rs/core-linux-x64-gnu": "0.30.2",
63
- "@takumi-rs/core-linux-x64-musl": "0.30.2",
64
- "@takumi-rs/core-win32-x64-msvc": "0.30.2"
58
+ "@takumi-rs/core-darwin-arm64": "0.31.1",
59
+ "@takumi-rs/core-linux-arm64-gnu": "0.31.1",
60
+ "@takumi-rs/core-linux-arm64-musl": "0.31.1",
61
+ "@takumi-rs/core-win32-arm64-msvc": "0.31.1",
62
+ "@takumi-rs/core-linux-x64-gnu": "0.31.1",
63
+ "@takumi-rs/core-linux-x64-musl": "0.31.1",
64
+ "@takumi-rs/core-win32-x64-msvc": "0.31.1"
65
65
  }
66
66
  }