@fontmin-rs/binding 1.1.0 → 1.2.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/src-js/bindings.js +244 -79
- package/src-js/index.d.ts +68 -0
- package/src-js/index.js +16 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fontmin-rs/binding",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-rc.2",
|
|
4
4
|
"description": "Native binding for fontmin-rs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"vitest": "^4.1.
|
|
28
|
+
"vitest": "^4.1.11"
|
|
29
29
|
},
|
|
30
30
|
"optionalDependencies": {
|
|
31
|
-
"@fontmin-rs/binding-darwin-arm64": "1.
|
|
32
|
-
"@fontmin-rs/binding-darwin-x64": "1.
|
|
33
|
-
"@fontmin-rs/binding-linux-arm64-gnu": "1.
|
|
34
|
-
"@fontmin-rs/binding-linux-arm64-musl": "1.
|
|
35
|
-
"@fontmin-rs/binding-linux-x64-
|
|
36
|
-
"@fontmin-rs/binding-
|
|
37
|
-
"@fontmin-rs/binding-
|
|
38
|
-
"@fontmin-rs/binding-win32-
|
|
31
|
+
"@fontmin-rs/binding-darwin-arm64": "1.2.0-rc.2",
|
|
32
|
+
"@fontmin-rs/binding-darwin-x64": "1.2.0-rc.2",
|
|
33
|
+
"@fontmin-rs/binding-linux-arm64-gnu": "1.2.0-rc.2",
|
|
34
|
+
"@fontmin-rs/binding-linux-arm64-musl": "1.2.0-rc.2",
|
|
35
|
+
"@fontmin-rs/binding-linux-x64-musl": "1.2.0-rc.2",
|
|
36
|
+
"@fontmin-rs/binding-win32-x64-msvc": "1.2.0-rc.2",
|
|
37
|
+
"@fontmin-rs/binding-linux-x64-gnu": "1.2.0-rc.2",
|
|
38
|
+
"@fontmin-rs/binding-win32-arm64-msvc": "1.2.0-rc.2"
|
|
39
39
|
},
|
|
40
40
|
"napi": {
|
|
41
41
|
"binaryName": "fontmin_rs",
|
package/src-js/bindings.js
CHANGED
|
@@ -85,12 +85,12 @@ function requireNative() {
|
|
|
85
85
|
const bindingPackageVersion =
|
|
86
86
|
require('@fontmin-rs/binding-android-arm64/package.json').version
|
|
87
87
|
if (
|
|
88
|
-
bindingPackageVersion !== '1.
|
|
88
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
89
89
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
90
90
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
91
91
|
) {
|
|
92
92
|
throw new Error(
|
|
93
|
-
`Native binding package version mismatch, expected 1.
|
|
93
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
94
94
|
)
|
|
95
95
|
}
|
|
96
96
|
return binding
|
|
@@ -108,12 +108,12 @@ function requireNative() {
|
|
|
108
108
|
const bindingPackageVersion =
|
|
109
109
|
require('@fontmin-rs/binding-android-arm-eabi/package.json').version
|
|
110
110
|
if (
|
|
111
|
-
bindingPackageVersion !== '1.
|
|
111
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
112
112
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
113
113
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
114
114
|
) {
|
|
115
115
|
throw new Error(
|
|
116
|
-
`Native binding package version mismatch, expected 1.
|
|
116
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
117
117
|
)
|
|
118
118
|
}
|
|
119
119
|
return binding
|
|
@@ -145,12 +145,12 @@ function requireNative() {
|
|
|
145
145
|
const bindingPackageVersion =
|
|
146
146
|
require('@fontmin-rs/binding-win32-x64-gnu/package.json').version
|
|
147
147
|
if (
|
|
148
|
-
bindingPackageVersion !== '1.
|
|
148
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
149
149
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
150
150
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
151
151
|
) {
|
|
152
152
|
throw new Error(
|
|
153
|
-
`Native binding package version mismatch, expected 1.
|
|
153
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
154
154
|
)
|
|
155
155
|
}
|
|
156
156
|
return binding
|
|
@@ -168,12 +168,12 @@ function requireNative() {
|
|
|
168
168
|
const bindingPackageVersion =
|
|
169
169
|
require('@fontmin-rs/binding-win32-x64-msvc/package.json').version
|
|
170
170
|
if (
|
|
171
|
-
bindingPackageVersion !== '1.
|
|
171
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
172
172
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
173
173
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
174
174
|
) {
|
|
175
175
|
throw new Error(
|
|
176
|
-
`Native binding package version mismatch, expected 1.
|
|
176
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
177
177
|
)
|
|
178
178
|
}
|
|
179
179
|
return binding
|
|
@@ -192,12 +192,12 @@ function requireNative() {
|
|
|
192
192
|
const bindingPackageVersion =
|
|
193
193
|
require('@fontmin-rs/binding-win32-ia32-msvc/package.json').version
|
|
194
194
|
if (
|
|
195
|
-
bindingPackageVersion !== '1.
|
|
195
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
196
196
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
197
197
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
198
198
|
) {
|
|
199
199
|
throw new Error(
|
|
200
|
-
`Native binding package version mismatch, expected 1.
|
|
200
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
201
201
|
)
|
|
202
202
|
}
|
|
203
203
|
return binding
|
|
@@ -215,12 +215,12 @@ function requireNative() {
|
|
|
215
215
|
const bindingPackageVersion =
|
|
216
216
|
require('@fontmin-rs/binding-win32-arm64-msvc/package.json').version
|
|
217
217
|
if (
|
|
218
|
-
bindingPackageVersion !== '1.
|
|
218
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
219
219
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
220
220
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
221
221
|
) {
|
|
222
222
|
throw new Error(
|
|
223
|
-
`Native binding package version mismatch, expected 1.
|
|
223
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
224
224
|
)
|
|
225
225
|
}
|
|
226
226
|
return binding
|
|
@@ -243,12 +243,12 @@ function requireNative() {
|
|
|
243
243
|
const bindingPackageVersion =
|
|
244
244
|
require('@fontmin-rs/binding-darwin-universal/package.json').version
|
|
245
245
|
if (
|
|
246
|
-
bindingPackageVersion !== '1.
|
|
246
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
247
247
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
248
248
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
249
249
|
) {
|
|
250
250
|
throw new Error(
|
|
251
|
-
`Native binding package version mismatch, expected 1.
|
|
251
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
252
252
|
)
|
|
253
253
|
}
|
|
254
254
|
return binding
|
|
@@ -266,12 +266,12 @@ function requireNative() {
|
|
|
266
266
|
const bindingPackageVersion =
|
|
267
267
|
require('@fontmin-rs/binding-darwin-x64/package.json').version
|
|
268
268
|
if (
|
|
269
|
-
bindingPackageVersion !== '1.
|
|
269
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
270
270
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
271
271
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
272
272
|
) {
|
|
273
273
|
throw new Error(
|
|
274
|
-
`Native binding package version mismatch, expected 1.
|
|
274
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
275
275
|
)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
@@ -289,12 +289,12 @@ function requireNative() {
|
|
|
289
289
|
const bindingPackageVersion =
|
|
290
290
|
require('@fontmin-rs/binding-darwin-arm64/package.json').version
|
|
291
291
|
if (
|
|
292
|
-
bindingPackageVersion !== '1.
|
|
292
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
293
293
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
294
294
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
295
295
|
) {
|
|
296
296
|
throw new Error(
|
|
297
|
-
`Native binding package version mismatch, expected 1.
|
|
297
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
298
298
|
)
|
|
299
299
|
}
|
|
300
300
|
return binding
|
|
@@ -318,12 +318,12 @@ function requireNative() {
|
|
|
318
318
|
const bindingPackageVersion =
|
|
319
319
|
require('@fontmin-rs/binding-freebsd-x64/package.json').version
|
|
320
320
|
if (
|
|
321
|
-
bindingPackageVersion !== '1.
|
|
321
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
322
322
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
323
323
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
324
324
|
) {
|
|
325
325
|
throw new Error(
|
|
326
|
-
`Native binding package version mismatch, expected 1.
|
|
326
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
327
327
|
)
|
|
328
328
|
}
|
|
329
329
|
return binding
|
|
@@ -341,12 +341,12 @@ function requireNative() {
|
|
|
341
341
|
const bindingPackageVersion =
|
|
342
342
|
require('@fontmin-rs/binding-freebsd-arm64/package.json').version
|
|
343
343
|
if (
|
|
344
|
-
bindingPackageVersion !== '1.
|
|
344
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
345
345
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
346
346
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
347
347
|
) {
|
|
348
348
|
throw new Error(
|
|
349
|
-
`Native binding package version mismatch, expected 1.
|
|
349
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
350
350
|
)
|
|
351
351
|
}
|
|
352
352
|
return binding
|
|
@@ -371,12 +371,12 @@ function requireNative() {
|
|
|
371
371
|
const bindingPackageVersion =
|
|
372
372
|
require('@fontmin-rs/binding-linux-x64-musl/package.json').version
|
|
373
373
|
if (
|
|
374
|
-
bindingPackageVersion !== '1.
|
|
374
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
375
375
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
376
376
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
377
377
|
) {
|
|
378
378
|
throw new Error(
|
|
379
|
-
`Native binding package version mismatch, expected 1.
|
|
379
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
380
380
|
)
|
|
381
381
|
}
|
|
382
382
|
return binding
|
|
@@ -394,12 +394,12 @@ function requireNative() {
|
|
|
394
394
|
const bindingPackageVersion =
|
|
395
395
|
require('@fontmin-rs/binding-linux-x64-gnu/package.json').version
|
|
396
396
|
if (
|
|
397
|
-
bindingPackageVersion !== '1.
|
|
397
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
398
398
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
399
399
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
400
400
|
) {
|
|
401
401
|
throw new Error(
|
|
402
|
-
`Native binding package version mismatch, expected 1.
|
|
402
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
403
403
|
)
|
|
404
404
|
}
|
|
405
405
|
return binding
|
|
@@ -419,12 +419,12 @@ function requireNative() {
|
|
|
419
419
|
const bindingPackageVersion =
|
|
420
420
|
require('@fontmin-rs/binding-linux-arm64-musl/package.json').version
|
|
421
421
|
if (
|
|
422
|
-
bindingPackageVersion !== '1.
|
|
422
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
423
423
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
424
424
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
425
425
|
) {
|
|
426
426
|
throw new Error(
|
|
427
|
-
`Native binding package version mismatch, expected 1.
|
|
427
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
428
428
|
)
|
|
429
429
|
}
|
|
430
430
|
return binding
|
|
@@ -442,12 +442,12 @@ function requireNative() {
|
|
|
442
442
|
const bindingPackageVersion =
|
|
443
443
|
require('@fontmin-rs/binding-linux-arm64-gnu/package.json').version
|
|
444
444
|
if (
|
|
445
|
-
bindingPackageVersion !== '1.
|
|
445
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
446
446
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
447
447
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
448
448
|
) {
|
|
449
449
|
throw new Error(
|
|
450
|
-
`Native binding package version mismatch, expected 1.
|
|
450
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
451
451
|
)
|
|
452
452
|
}
|
|
453
453
|
return binding
|
|
@@ -467,12 +467,12 @@ function requireNative() {
|
|
|
467
467
|
const bindingPackageVersion =
|
|
468
468
|
require('@fontmin-rs/binding-linux-arm-musleabihf/package.json').version
|
|
469
469
|
if (
|
|
470
|
-
bindingPackageVersion !== '1.
|
|
470
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
471
471
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
472
472
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
473
473
|
) {
|
|
474
474
|
throw new Error(
|
|
475
|
-
`Native binding package version mismatch, expected 1.
|
|
475
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
476
476
|
)
|
|
477
477
|
}
|
|
478
478
|
return binding
|
|
@@ -490,12 +490,12 @@ function requireNative() {
|
|
|
490
490
|
const bindingPackageVersion =
|
|
491
491
|
require('@fontmin-rs/binding-linux-arm-gnueabihf/package.json').version
|
|
492
492
|
if (
|
|
493
|
-
bindingPackageVersion !== '1.
|
|
493
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
494
494
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
495
495
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
496
496
|
) {
|
|
497
497
|
throw new Error(
|
|
498
|
-
`Native binding package version mismatch, expected 1.
|
|
498
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
499
499
|
)
|
|
500
500
|
}
|
|
501
501
|
return binding
|
|
@@ -515,12 +515,12 @@ function requireNative() {
|
|
|
515
515
|
const bindingPackageVersion =
|
|
516
516
|
require('@fontmin-rs/binding-linux-loong64-musl/package.json').version
|
|
517
517
|
if (
|
|
518
|
-
bindingPackageVersion !== '1.
|
|
518
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
519
519
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
520
520
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
521
521
|
) {
|
|
522
522
|
throw new Error(
|
|
523
|
-
`Native binding package version mismatch, expected 1.
|
|
523
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
524
524
|
)
|
|
525
525
|
}
|
|
526
526
|
return binding
|
|
@@ -538,12 +538,12 @@ function requireNative() {
|
|
|
538
538
|
const bindingPackageVersion =
|
|
539
539
|
require('@fontmin-rs/binding-linux-loong64-gnu/package.json').version
|
|
540
540
|
if (
|
|
541
|
-
bindingPackageVersion !== '1.
|
|
541
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
542
542
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
543
543
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
544
544
|
) {
|
|
545
545
|
throw new Error(
|
|
546
|
-
`Native binding package version mismatch, expected 1.
|
|
546
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
547
547
|
)
|
|
548
548
|
}
|
|
549
549
|
return binding
|
|
@@ -563,12 +563,12 @@ function requireNative() {
|
|
|
563
563
|
const bindingPackageVersion =
|
|
564
564
|
require('@fontmin-rs/binding-linux-riscv64-musl/package.json').version
|
|
565
565
|
if (
|
|
566
|
-
bindingPackageVersion !== '1.
|
|
566
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
567
567
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
568
568
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
569
569
|
) {
|
|
570
570
|
throw new Error(
|
|
571
|
-
`Native binding package version mismatch, expected 1.
|
|
571
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
572
572
|
)
|
|
573
573
|
}
|
|
574
574
|
return binding
|
|
@@ -586,12 +586,12 @@ function requireNative() {
|
|
|
586
586
|
const bindingPackageVersion =
|
|
587
587
|
require('@fontmin-rs/binding-linux-riscv64-gnu/package.json').version
|
|
588
588
|
if (
|
|
589
|
-
bindingPackageVersion !== '1.
|
|
589
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
590
590
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
591
591
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
592
592
|
) {
|
|
593
593
|
throw new Error(
|
|
594
|
-
`Native binding package version mismatch, expected 1.
|
|
594
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
595
595
|
)
|
|
596
596
|
}
|
|
597
597
|
return binding
|
|
@@ -610,12 +610,12 @@ function requireNative() {
|
|
|
610
610
|
const bindingPackageVersion =
|
|
611
611
|
require('@fontmin-rs/binding-linux-ppc64-gnu/package.json').version
|
|
612
612
|
if (
|
|
613
|
-
bindingPackageVersion !== '1.
|
|
613
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
614
614
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
615
615
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
616
616
|
) {
|
|
617
617
|
throw new Error(
|
|
618
|
-
`Native binding package version mismatch, expected 1.
|
|
618
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
619
619
|
)
|
|
620
620
|
}
|
|
621
621
|
return binding
|
|
@@ -633,12 +633,12 @@ function requireNative() {
|
|
|
633
633
|
const bindingPackageVersion =
|
|
634
634
|
require('@fontmin-rs/binding-linux-s390x-gnu/package.json').version
|
|
635
635
|
if (
|
|
636
|
-
bindingPackageVersion !== '1.
|
|
636
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
637
637
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
638
638
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
639
639
|
) {
|
|
640
640
|
throw new Error(
|
|
641
|
-
`Native binding package version mismatch, expected 1.
|
|
641
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
642
642
|
)
|
|
643
643
|
}
|
|
644
644
|
return binding
|
|
@@ -662,12 +662,12 @@ function requireNative() {
|
|
|
662
662
|
const bindingPackageVersion =
|
|
663
663
|
require('@fontmin-rs/binding-openharmony-arm64/package.json').version
|
|
664
664
|
if (
|
|
665
|
-
bindingPackageVersion !== '1.
|
|
665
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
666
666
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
667
667
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
668
668
|
) {
|
|
669
669
|
throw new Error(
|
|
670
|
-
`Native binding package version mismatch, expected 1.
|
|
670
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
671
671
|
)
|
|
672
672
|
}
|
|
673
673
|
return binding
|
|
@@ -685,12 +685,12 @@ function requireNative() {
|
|
|
685
685
|
const bindingPackageVersion =
|
|
686
686
|
require('@fontmin-rs/binding-openharmony-x64/package.json').version
|
|
687
687
|
if (
|
|
688
|
-
bindingPackageVersion !== '1.
|
|
688
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
689
689
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
690
690
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
691
691
|
) {
|
|
692
692
|
throw new Error(
|
|
693
|
-
`Native binding package version mismatch, expected 1.
|
|
693
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
694
694
|
)
|
|
695
695
|
}
|
|
696
696
|
return binding
|
|
@@ -708,12 +708,12 @@ function requireNative() {
|
|
|
708
708
|
const bindingPackageVersion =
|
|
709
709
|
require('@fontmin-rs/binding-openharmony-arm/package.json').version
|
|
710
710
|
if (
|
|
711
|
-
bindingPackageVersion !== '1.
|
|
711
|
+
bindingPackageVersion !== '1.2.0-rc.2' &&
|
|
712
712
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
713
713
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
714
714
|
) {
|
|
715
715
|
throw new Error(
|
|
716
|
-
`Native binding package version mismatch, expected 1.
|
|
716
|
+
`Native binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
717
717
|
)
|
|
718
718
|
}
|
|
719
719
|
return binding
|
|
@@ -734,50 +734,186 @@ function requireNative() {
|
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
|
|
737
|
-
|
|
737
|
+
function createLoadErrorChain(errors) {
|
|
738
|
+
return errors.reduce((previous, current) => {
|
|
739
|
+
let message
|
|
740
|
+
try {
|
|
741
|
+
message =
|
|
742
|
+
current && typeof current.message === 'string'
|
|
743
|
+
? current.message
|
|
744
|
+
: String(current)
|
|
745
|
+
} catch {
|
|
746
|
+
message = 'Unknown error'
|
|
747
|
+
}
|
|
748
|
+
const error = new Error(message)
|
|
749
|
+
error.cause = previous
|
|
750
|
+
return error
|
|
751
|
+
}, null)
|
|
752
|
+
}
|
|
738
753
|
|
|
739
754
|
// NAPI_RS_FORCE_WASI is a tri-state flag:
|
|
740
755
|
// unset / any other value → native binding preferred, WASI is only a fallback
|
|
741
|
-
// 'true' →
|
|
742
|
-
// 'error' →
|
|
756
|
+
// 'true' → prefer WASI, but retain native as a lazy fallback
|
|
757
|
+
// 'error' → require WASI without initializing a native fallback
|
|
743
758
|
// Treating any non-empty string as truthy (the historical behavior) meant
|
|
744
759
|
// NAPI_RS_FORCE_WASI=false, NAPI_RS_FORCE_WASI=0, etc. inadvertently triggered
|
|
745
760
|
// the WASI path, causing ENOENT for packages shipped without a .wasi.cjs file.
|
|
761
|
+
//
|
|
762
|
+
// NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
|
|
763
|
+
// WASI loading. It never crosses into another flavor or falls back to native.
|
|
764
|
+
const __napiWasiFlavors = ['wasm32-wasi']
|
|
765
|
+
const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR
|
|
766
|
+
const __napiWasiFlavorRequested =
|
|
767
|
+
typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0
|
|
768
|
+
if (
|
|
769
|
+
__napiWasiFlavorRequested &&
|
|
770
|
+
__napiWasiFlavors.indexOf(__napiWasiFlavor) === -1
|
|
771
|
+
) {
|
|
772
|
+
throw new Error(
|
|
773
|
+
'Unsupported WASI flavor "' +
|
|
774
|
+
__napiWasiFlavor +
|
|
775
|
+
'". Available flavors: ' +
|
|
776
|
+
__napiWasiFlavors.join(', '),
|
|
777
|
+
)
|
|
778
|
+
}
|
|
779
|
+
const forceWasiError = process.env.NAPI_RS_FORCE_WASI === 'error'
|
|
746
780
|
const forceWasi =
|
|
747
781
|
process.env.NAPI_RS_FORCE_WASI === 'true' ||
|
|
748
|
-
|
|
782
|
+
forceWasiError ||
|
|
783
|
+
__napiWasiFlavorRequested
|
|
784
|
+
|
|
785
|
+
if (!forceWasi) {
|
|
786
|
+
nativeBinding = requireNative()
|
|
787
|
+
}
|
|
749
788
|
|
|
750
789
|
if (!nativeBinding || forceWasi) {
|
|
751
790
|
let wasiBinding = null
|
|
752
|
-
let
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
791
|
+
let wasiBindingLoaded = false
|
|
792
|
+
const wasiBindingErrors = []
|
|
793
|
+
const __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
|
|
794
|
+
try {
|
|
795
|
+
require.resolve(specifier)
|
|
796
|
+
} catch (resolveError) {
|
|
797
|
+
if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
|
|
798
|
+
throw resolveError
|
|
799
|
+
}
|
|
800
|
+
if (isPackage) {
|
|
801
|
+
try {
|
|
802
|
+
require.resolve(specifier + '/package.json')
|
|
803
|
+
} catch (packageError) {
|
|
804
|
+
if (packageError && packageError.code === 'MODULE_NOT_FOUND') {
|
|
805
|
+
return resolveError
|
|
806
|
+
}
|
|
807
|
+
// An exports restriction proves the package exists even when its
|
|
808
|
+
// package.json is not public. Preserve the root resolution failure.
|
|
809
|
+
throw resolveError
|
|
810
|
+
}
|
|
811
|
+
// The package exists but its main/export target is broken.
|
|
812
|
+
throw resolveError
|
|
813
|
+
}
|
|
814
|
+
return resolveError
|
|
759
815
|
}
|
|
816
|
+
if (localArtifacts) {
|
|
817
|
+
let artifactError = null
|
|
818
|
+
for (let i = 0; i < localArtifacts.length; i++) {
|
|
819
|
+
try {
|
|
820
|
+
require.resolve(localArtifacts[i])
|
|
821
|
+
return null
|
|
822
|
+
} catch (resolveError) {
|
|
823
|
+
if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
|
|
824
|
+
throw resolveError
|
|
825
|
+
}
|
|
826
|
+
artifactError = resolveError
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
return artifactError
|
|
830
|
+
}
|
|
831
|
+
return null
|
|
760
832
|
}
|
|
761
|
-
if (
|
|
833
|
+
if (
|
|
834
|
+
!wasiBindingLoaded &&
|
|
835
|
+
(!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')
|
|
836
|
+
) {
|
|
837
|
+
let candidateError = null
|
|
838
|
+
let candidateFailed = false
|
|
762
839
|
try {
|
|
763
|
-
|
|
764
|
-
|
|
840
|
+
candidateError = __napiWasiResolveCandidate(
|
|
841
|
+
'./fontmin_rs.wasi.cjs',
|
|
842
|
+
false,
|
|
843
|
+
[
|
|
844
|
+
'./fontmin_rs.wasm32-wasi.debug.wasm',
|
|
845
|
+
'./fontmin_rs.wasm32-wasi.wasm',
|
|
846
|
+
],
|
|
847
|
+
)
|
|
848
|
+
candidateFailed = candidateError !== null
|
|
849
|
+
if (!candidateFailed) {
|
|
850
|
+
wasiBinding = require('./fontmin_rs.wasi.cjs')
|
|
851
|
+
nativeBinding = wasiBinding
|
|
852
|
+
wasiBindingLoaded = true
|
|
853
|
+
}
|
|
765
854
|
} catch (err) {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
855
|
+
candidateError = err
|
|
856
|
+
candidateFailed = true
|
|
857
|
+
}
|
|
858
|
+
if (candidateFailed) {
|
|
859
|
+
wasiBindingErrors.push(candidateError)
|
|
860
|
+
loadErrors.push(candidateError)
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
if (
|
|
864
|
+
!wasiBindingLoaded &&
|
|
865
|
+
(!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')
|
|
866
|
+
) {
|
|
867
|
+
let candidateError = null
|
|
868
|
+
let candidateFailed = false
|
|
869
|
+
try {
|
|
870
|
+
candidateError = __napiWasiResolveCandidate(
|
|
871
|
+
'@fontmin-rs/binding-wasm32-wasi',
|
|
872
|
+
true,
|
|
873
|
+
undefined,
|
|
874
|
+
)
|
|
875
|
+
candidateFailed = candidateError !== null
|
|
876
|
+
if (!candidateFailed) {
|
|
877
|
+
if (
|
|
878
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
879
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
880
|
+
) {
|
|
881
|
+
const bindingPackageVersion =
|
|
882
|
+
require('@fontmin-rs/binding-wasm32-wasi/package.json').version
|
|
883
|
+
if (bindingPackageVersion !== '1.2.0-rc.2') {
|
|
884
|
+
throw new Error(
|
|
885
|
+
`WASI binding package version mismatch, expected 1.2.0-rc.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
886
|
+
)
|
|
887
|
+
}
|
|
771
888
|
}
|
|
772
|
-
|
|
889
|
+
wasiBinding = require('@fontmin-rs/binding-wasm32-wasi')
|
|
890
|
+
nativeBinding = wasiBinding
|
|
891
|
+
wasiBindingLoaded = true
|
|
773
892
|
}
|
|
893
|
+
} catch (err) {
|
|
894
|
+
candidateError = err
|
|
895
|
+
candidateFailed = true
|
|
774
896
|
}
|
|
897
|
+
if (candidateFailed) {
|
|
898
|
+
wasiBindingErrors.push(candidateError)
|
|
899
|
+
loadErrors.push(candidateError)
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
if (
|
|
903
|
+
!wasiBindingLoaded &&
|
|
904
|
+
forceWasi &&
|
|
905
|
+
!forceWasiError &&
|
|
906
|
+
!__napiWasiFlavorRequested
|
|
907
|
+
) {
|
|
908
|
+
nativeBinding = requireNative()
|
|
775
909
|
}
|
|
776
|
-
if (
|
|
910
|
+
if ((forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
|
|
777
911
|
const error = new Error(
|
|
778
|
-
|
|
912
|
+
__napiWasiFlavorRequested
|
|
913
|
+
? 'WASI binding for flavor "' + __napiWasiFlavor + '" not found'
|
|
914
|
+
: 'WASI binding not found and NAPI_RS_FORCE_WASI is set to error',
|
|
779
915
|
)
|
|
780
|
-
error.cause =
|
|
916
|
+
error.cause = createLoadErrorChain(wasiBindingErrors)
|
|
781
917
|
throw error
|
|
782
918
|
}
|
|
783
919
|
}
|
|
@@ -791,10 +927,7 @@ if (!nativeBinding) {
|
|
|
791
927
|
)
|
|
792
928
|
// assign instead of the `new Error(message, { cause })` options form,
|
|
793
929
|
// which Node < 16.9 silently ignores
|
|
794
|
-
error.cause = loadErrors
|
|
795
|
-
cur.cause = err
|
|
796
|
-
return cur
|
|
797
|
-
})
|
|
930
|
+
error.cause = createLoadErrorChain(loadErrors)
|
|
798
931
|
throw error
|
|
799
932
|
}
|
|
800
933
|
throw new Error(`Failed to load native binding`)
|
|
@@ -802,49 +935,81 @@ if (!nativeBinding) {
|
|
|
802
935
|
|
|
803
936
|
const {
|
|
804
937
|
analyzeCoverage,
|
|
938
|
+
analyzeCoverageAsync,
|
|
805
939
|
createTtfSubsetPlan,
|
|
806
940
|
eotToTtf,
|
|
941
|
+
eotToTtfAsync,
|
|
807
942
|
extractCollectionFace,
|
|
808
943
|
generateFontFaceCss,
|
|
944
|
+
generateFontFaceCssAsync,
|
|
809
945
|
inspectCapabilities,
|
|
810
946
|
inspectCollection,
|
|
811
947
|
inspectFont,
|
|
948
|
+
inspectFontAsync,
|
|
812
949
|
instantiateFont,
|
|
950
|
+
instantiateFontAsync,
|
|
813
951
|
otfToTtf,
|
|
952
|
+
otfToTtfAsync,
|
|
814
953
|
reduceVariationSpace,
|
|
954
|
+
reduceVariationSpaceAsync,
|
|
815
955
|
subsetTtf,
|
|
956
|
+
subsetTtfAsync,
|
|
816
957
|
subsetTtfWithPlan,
|
|
817
958
|
subsetTtfWithReport,
|
|
818
959
|
svgFontToTtf,
|
|
960
|
+
svgFontToTtfAsync,
|
|
819
961
|
svgsToTtf,
|
|
962
|
+
svgsToTtfAsync,
|
|
820
963
|
ttfToEot,
|
|
964
|
+
ttfToEotAsync,
|
|
821
965
|
ttfToSvg,
|
|
966
|
+
ttfToSvgAsync,
|
|
822
967
|
ttfToWoff,
|
|
823
968
|
ttfToWoff2,
|
|
969
|
+
ttfToWoff2Async,
|
|
970
|
+
ttfToWoffAsync,
|
|
824
971
|
validateWoff2,
|
|
825
972
|
woff2ToTtf,
|
|
973
|
+
woff2ToTtfAsync,
|
|
826
974
|
woffToTtf,
|
|
975
|
+
woffToTtfAsync,
|
|
827
976
|
} = nativeBinding
|
|
828
977
|
export { analyzeCoverage }
|
|
978
|
+
export { analyzeCoverageAsync }
|
|
829
979
|
export { createTtfSubsetPlan }
|
|
830
980
|
export { eotToTtf }
|
|
981
|
+
export { eotToTtfAsync }
|
|
831
982
|
export { extractCollectionFace }
|
|
832
983
|
export { generateFontFaceCss }
|
|
984
|
+
export { generateFontFaceCssAsync }
|
|
833
985
|
export { inspectCapabilities }
|
|
834
986
|
export { inspectCollection }
|
|
835
987
|
export { inspectFont }
|
|
988
|
+
export { inspectFontAsync }
|
|
836
989
|
export { instantiateFont }
|
|
990
|
+
export { instantiateFontAsync }
|
|
837
991
|
export { otfToTtf }
|
|
992
|
+
export { otfToTtfAsync }
|
|
838
993
|
export { reduceVariationSpace }
|
|
994
|
+
export { reduceVariationSpaceAsync }
|
|
839
995
|
export { subsetTtf }
|
|
996
|
+
export { subsetTtfAsync }
|
|
840
997
|
export { subsetTtfWithPlan }
|
|
841
998
|
export { subsetTtfWithReport }
|
|
842
999
|
export { svgFontToTtf }
|
|
1000
|
+
export { svgFontToTtfAsync }
|
|
843
1001
|
export { svgsToTtf }
|
|
1002
|
+
export { svgsToTtfAsync }
|
|
844
1003
|
export { ttfToEot }
|
|
1004
|
+
export { ttfToEotAsync }
|
|
845
1005
|
export { ttfToSvg }
|
|
1006
|
+
export { ttfToSvgAsync }
|
|
846
1007
|
export { ttfToWoff }
|
|
847
1008
|
export { ttfToWoff2 }
|
|
1009
|
+
export { ttfToWoff2Async }
|
|
1010
|
+
export { ttfToWoffAsync }
|
|
848
1011
|
export { validateWoff2 }
|
|
849
1012
|
export { woff2ToTtf }
|
|
1013
|
+
export { woff2ToTtfAsync }
|
|
850
1014
|
export { woffToTtf }
|
|
1015
|
+
export { woffToTtfAsync }
|
package/src-js/index.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ export declare function analyzeCoverage(
|
|
|
5
5
|
options?: JsCoverageOptions | undefined | null,
|
|
6
6
|
): JsCoverageReport
|
|
7
7
|
|
|
8
|
+
export declare function analyzeCoverageAsync(
|
|
9
|
+
input: Buffer,
|
|
10
|
+
options?: JsCoverageOptions | undefined | null,
|
|
11
|
+
): Promise<JsCoverageReport>
|
|
12
|
+
|
|
8
13
|
export declare function createTtfSubsetPlan(
|
|
9
14
|
input: Buffer,
|
|
10
15
|
options?: JsSubsetOptions | undefined | null,
|
|
@@ -12,6 +17,8 @@ export declare function createTtfSubsetPlan(
|
|
|
12
17
|
|
|
13
18
|
export declare function eotToTtf(input: Buffer): Buffer
|
|
14
19
|
|
|
20
|
+
export declare function eotToTtfAsync(input: Buffer): Promise<Buffer>
|
|
21
|
+
|
|
15
22
|
export declare function extractCollectionFace(
|
|
16
23
|
input: Buffer,
|
|
17
24
|
faceIndex: number,
|
|
@@ -22,6 +29,11 @@ export declare function generateFontFaceCss(
|
|
|
22
29
|
options?: JsCssOptions | undefined | null,
|
|
23
30
|
): string
|
|
24
31
|
|
|
32
|
+
export declare function generateFontFaceCssAsync(
|
|
33
|
+
sources: Array<JsCssFontSource>,
|
|
34
|
+
options?: JsCssOptions | undefined | null,
|
|
35
|
+
): Promise<string>
|
|
36
|
+
|
|
25
37
|
export declare function inspectCapabilities(
|
|
26
38
|
input: Buffer,
|
|
27
39
|
): JsFontCapabilityReport
|
|
@@ -30,11 +42,18 @@ export declare function inspectCollection(input: Buffer): JsFontCollectionInfo
|
|
|
30
42
|
|
|
31
43
|
export declare function inspectFont(input: Buffer): JsFontInfo
|
|
32
44
|
|
|
45
|
+
export declare function inspectFontAsync(input: Buffer): Promise<JsFontInfo>
|
|
46
|
+
|
|
33
47
|
export declare function instantiateFont(
|
|
34
48
|
input: Buffer,
|
|
35
49
|
options?: JsInstanceOptions | undefined | null,
|
|
36
50
|
): Buffer
|
|
37
51
|
|
|
52
|
+
export declare function instantiateFontAsync(
|
|
53
|
+
input: Buffer,
|
|
54
|
+
options?: JsInstanceOptions | undefined | null,
|
|
55
|
+
): Promise<Buffer>
|
|
56
|
+
|
|
38
57
|
export interface JsAxisRange {
|
|
39
58
|
min: number
|
|
40
59
|
max: number
|
|
@@ -275,16 +294,31 @@ export declare function otfToTtf(
|
|
|
275
294
|
options?: JsOtf2TtfOptions | undefined | null,
|
|
276
295
|
): Buffer
|
|
277
296
|
|
|
297
|
+
export declare function otfToTtfAsync(
|
|
298
|
+
input: Buffer,
|
|
299
|
+
options?: JsOtf2TtfOptions | undefined | null,
|
|
300
|
+
): Promise<Buffer>
|
|
301
|
+
|
|
278
302
|
export declare function reduceVariationSpace(
|
|
279
303
|
input: Buffer,
|
|
280
304
|
options?: JsVariationSpaceOptions | undefined | null,
|
|
281
305
|
): Buffer
|
|
282
306
|
|
|
307
|
+
export declare function reduceVariationSpaceAsync(
|
|
308
|
+
input: Buffer,
|
|
309
|
+
options?: JsVariationSpaceOptions | undefined | null,
|
|
310
|
+
): Promise<Buffer>
|
|
311
|
+
|
|
283
312
|
export declare function subsetTtf(
|
|
284
313
|
input: Buffer,
|
|
285
314
|
options?: JsSubsetOptions | undefined | null,
|
|
286
315
|
): Buffer
|
|
287
316
|
|
|
317
|
+
export declare function subsetTtfAsync(
|
|
318
|
+
input: Buffer,
|
|
319
|
+
options?: JsSubsetOptions | undefined | null,
|
|
320
|
+
): Promise<Buffer>
|
|
321
|
+
|
|
288
322
|
export declare function subsetTtfWithPlan(
|
|
289
323
|
input: Buffer,
|
|
290
324
|
plan: JsSubsetPlan,
|
|
@@ -300,21 +334,41 @@ export declare function svgFontToTtf(
|
|
|
300
334
|
options?: JsSvg2TtfOptions | undefined | null,
|
|
301
335
|
): Buffer
|
|
302
336
|
|
|
337
|
+
export declare function svgFontToTtfAsync(
|
|
338
|
+
input: string,
|
|
339
|
+
options?: JsSvg2TtfOptions | undefined | null,
|
|
340
|
+
): Promise<Buffer>
|
|
341
|
+
|
|
303
342
|
export declare function svgsToTtf(
|
|
304
343
|
inputs: Array<JsSvgIcon>,
|
|
305
344
|
options?: JsSvgs2TtfOptions | undefined | null,
|
|
306
345
|
): Buffer
|
|
307
346
|
|
|
347
|
+
export declare function svgsToTtfAsync(
|
|
348
|
+
inputs: Array<JsSvgIcon>,
|
|
349
|
+
options?: JsSvgs2TtfOptions | undefined | null,
|
|
350
|
+
): Promise<Buffer>
|
|
351
|
+
|
|
308
352
|
export declare function ttfToEot(
|
|
309
353
|
input: Buffer,
|
|
310
354
|
options?: JsEotOptions | undefined | null,
|
|
311
355
|
): Buffer
|
|
312
356
|
|
|
357
|
+
export declare function ttfToEotAsync(
|
|
358
|
+
input: Buffer,
|
|
359
|
+
options?: JsEotOptions | undefined | null,
|
|
360
|
+
): Promise<Buffer>
|
|
361
|
+
|
|
313
362
|
export declare function ttfToSvg(
|
|
314
363
|
input: Buffer,
|
|
315
364
|
options?: JsSvgOptions | undefined | null,
|
|
316
365
|
): string
|
|
317
366
|
|
|
367
|
+
export declare function ttfToSvgAsync(
|
|
368
|
+
input: Buffer,
|
|
369
|
+
options?: JsSvgOptions | undefined | null,
|
|
370
|
+
): Promise<string>
|
|
371
|
+
|
|
318
372
|
export declare function ttfToWoff(
|
|
319
373
|
input: Buffer,
|
|
320
374
|
options?: JsWoffOptions | undefined | null,
|
|
@@ -325,8 +379,22 @@ export declare function ttfToWoff2(
|
|
|
325
379
|
options?: JsWoff2Options | undefined | null,
|
|
326
380
|
): Buffer
|
|
327
381
|
|
|
382
|
+
export declare function ttfToWoff2Async(
|
|
383
|
+
input: Buffer,
|
|
384
|
+
options?: JsWoff2Options | undefined | null,
|
|
385
|
+
): Promise<Buffer>
|
|
386
|
+
|
|
387
|
+
export declare function ttfToWoffAsync(
|
|
388
|
+
input: Buffer,
|
|
389
|
+
options?: JsWoffOptions | undefined | null,
|
|
390
|
+
): Promise<Buffer>
|
|
391
|
+
|
|
328
392
|
export declare function validateWoff2(input: Buffer): void
|
|
329
393
|
|
|
330
394
|
export declare function woff2ToTtf(input: Buffer): Buffer
|
|
331
395
|
|
|
396
|
+
export declare function woff2ToTtfAsync(input: Buffer): Promise<Buffer>
|
|
397
|
+
|
|
332
398
|
export declare function woffToTtf(input: Buffer): Buffer
|
|
399
|
+
|
|
400
|
+
export declare function woffToTtfAsync(input: Buffer): Promise<Buffer>
|
package/src-js/index.js
CHANGED
|
@@ -5,26 +5,42 @@ const binding = require('./bindings.js')
|
|
|
5
5
|
|
|
6
6
|
export const {
|
|
7
7
|
analyzeCoverage,
|
|
8
|
+
analyzeCoverageAsync,
|
|
8
9
|
createTtfSubsetPlan,
|
|
9
10
|
eotToTtf,
|
|
11
|
+
eotToTtfAsync,
|
|
10
12
|
extractCollectionFace,
|
|
11
13
|
generateFontFaceCss,
|
|
14
|
+
generateFontFaceCssAsync,
|
|
12
15
|
inspectCollection,
|
|
13
16
|
inspectCapabilities,
|
|
14
17
|
inspectFont,
|
|
18
|
+
inspectFontAsync,
|
|
15
19
|
instantiateFont,
|
|
20
|
+
instantiateFontAsync,
|
|
16
21
|
otfToTtf,
|
|
22
|
+
otfToTtfAsync,
|
|
17
23
|
reduceVariationSpace,
|
|
24
|
+
reduceVariationSpaceAsync,
|
|
18
25
|
subsetTtf,
|
|
26
|
+
subsetTtfAsync,
|
|
19
27
|
subsetTtfWithPlan,
|
|
20
28
|
subsetTtfWithReport,
|
|
21
29
|
svgFontToTtf,
|
|
30
|
+
svgFontToTtfAsync,
|
|
22
31
|
svgsToTtf,
|
|
32
|
+
svgsToTtfAsync,
|
|
23
33
|
ttfToEot,
|
|
34
|
+
ttfToEotAsync,
|
|
24
35
|
ttfToSvg,
|
|
36
|
+
ttfToSvgAsync,
|
|
25
37
|
ttfToWoff,
|
|
38
|
+
ttfToWoffAsync,
|
|
26
39
|
ttfToWoff2,
|
|
40
|
+
ttfToWoff2Async,
|
|
27
41
|
validateWoff2,
|
|
28
42
|
woff2ToTtf,
|
|
43
|
+
woff2ToTtfAsync,
|
|
29
44
|
woffToTtf,
|
|
45
|
+
woffToTtfAsync,
|
|
30
46
|
} = binding
|