unicode-input-toolconverter 0.2.0 → 0.2.3
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/.nyc_output/out.json +8980 -1849
- package/CHANGES.md +15 -1
- package/README.md +6 -11
- package/_locales/en-US/messages.json +153 -6
- package/_locales/hu-HU/messages.json +153 -6
- package/_locales/pt-BR/messages.json +153 -6
- package/_locales/sv-SE/messages.json +153 -6
- package/babel.config.json +0 -1
- package/browser_action/characterSelection.js +18 -11
- package/browser_action/charrefConverters.js +286 -79
- package/browser_action/chartBuild.js +97 -27
- package/browser_action/encodingBehaviors.js +10 -7
- package/browser_action/entityBehaviors.js +42 -16
- package/browser_action/index-es.html +13 -1
- package/browser_action/index-instrumented.html +13 -1
- package/browser_action/index-pages.html +13 -1
- package/browser_action/index.html +13 -1
- package/browser_action/index.iife.min.js +9 -1
- package/browser_action/index.iife.min.js.map +1 -1
- package/browser_action/index.instrumented.iife.min.js +1 -1
- package/browser_action/index.instrumented.iife.min.js.map +1 -1
- package/browser_action/index.js +5 -5
- package/browser_action/preferences/prefDefaults.js +12 -3
- package/browser_action/service-worker/sw-activateCallback.js +1 -2
- package/browser_action/service-worker/sw-resources.json +6 -4
- package/browser_action/templateUtils/elements.js +12 -1
- package/browser_action/templateUtils/fill.js +6 -0
- package/browser_action/templateUtils/validation.js +4 -1
- package/browser_action/templates/chartBuild.js +167 -102
- package/browser_action/templates/index.js +227 -53
- package/browser_action/templatesElementCustomization/widgets.js +40 -15
- package/browser_action/unicode/UnicodeConverter.js +99 -73
- package/browser_action/unicode/charrefunicodeDb.js +100 -50
- package/browser_action/unicode/getScriptInfoForCodePoint.js +13 -4
- package/browser_action/unicode/hangul.js +27 -20
- package/browser_action/unicode/lastScriptNames.json +1 -1
- package/browser_action/unicode/parseUnihanFromTextFileStrings.js +44 -25
- package/browser_action/unicode/unicodeFieldInfo.js +112 -90
- package/browser_action/unicode/unicodeScripts.js +409 -35
- package/browser_action/unicode/unihan.js +4 -3
- package/browser_action/unicode/unihanDbPopulate.js +7 -2
- package/browser_action/unicode/unihanFields.js +34 -0
- package/browser_action/unicodecharref.js +353 -190
- package/browser_action/utils/DOMUtils.js +95 -34
- package/browser_action/utils/FetchUtils.js +7 -6
- package/browser_action/utils/TextUtils.js +4 -4
- package/browser_action/utils/TypedArrayUtils.js +9 -5
- package/browser_action/utils/semicolonSeparatedToArray.js +3 -3
- package/browser_action/utils/setupServiceWorker.js +2 -2
- package/eslint.config.js +11 -0
- package/icons/openWindow16.png +0 -0
- package/icons/openWindow24.png +0 -0
- package/lib/background.html +7 -0
- package/lib/background.js +2 -2
- package/package.json +80 -70
- package/pnpm-workspace.yaml +8 -0
- package/server.js +66 -51
- package/sw.js +97 -56
- package/tools/entities-import.js +4 -1
- package/tools/findEsResources.js +33 -10
- package/tools/fix-sw-resources-vendor-paths.js +60 -0
- package/tools/list-locales.js +2 -2
- package/tools/parseUnicodeCharts.js +126 -60
- package/tools/ucd-import.js +1 -10
- package/tools/unicode-charts.html +49 -20
- package/tools/unihan-import.js +45 -15
- package/tools/write-sw-version.js +16 -0
- package/tsconfig.json +23 -0
- package/typings/__coverage__.d.ts +5 -0
- package/typings/apple-system-profiler.d.ts +17 -0
- package/typings/commands.d.ts +19 -0
- package/typings/json-6.d.ts +4 -0
- package/typings/rollup-plugin-istanbul.d.ts +3 -0
- package/vendor/camelcase/index.d.ts +154 -0
- package/vendor/camelcase/index.js +137 -23
- package/vendor/fflate/esm/browser.d.ts +1539 -0
- package/vendor/fflate/esm/browser.js +82 -55
- package/vendor/intl-dom/dist/Formatter.d.ts +120 -0
- package/vendor/intl-dom/dist/Formatter.d.ts.map +1 -0
- package/vendor/intl-dom/dist/collation.d.ts +42 -0
- package/vendor/intl-dom/dist/collation.d.ts.map +1 -0
- package/vendor/intl-dom/dist/defaultAllSubstitutions.d.ts +52 -0
- package/vendor/intl-dom/dist/defaultAllSubstitutions.d.ts.map +1 -0
- package/vendor/intl-dom/dist/defaultInsertNodes.d.ts +96 -0
- package/vendor/intl-dom/dist/defaultInsertNodes.d.ts.map +1 -0
- package/vendor/intl-dom/dist/defaultKeyCheckerConverter.d.ts +17 -0
- package/vendor/intl-dom/dist/defaultKeyCheckerConverter.d.ts.map +1 -0
- package/vendor/intl-dom/dist/defaultLocaleResolver.d.ts +285 -0
- package/vendor/intl-dom/dist/defaultLocaleResolver.d.ts.map +1 -0
- package/vendor/intl-dom/dist/findLocaleStrings.d.ts +88 -0
- package/vendor/intl-dom/dist/findLocaleStrings.d.ts.map +1 -0
- package/vendor/intl-dom/dist/getDOMForLocaleString.d.ts +67 -0
- package/vendor/intl-dom/dist/getDOMForLocaleString.d.ts.map +1 -0
- package/vendor/intl-dom/dist/getMessageForKeyByStyle.d.ts +73 -0
- package/vendor/intl-dom/dist/getMessageForKeyByStyle.d.ts.map +1 -0
- package/vendor/intl-dom/dist/getStringFromMessageAndDefaults.d.ts +26 -0
- package/vendor/intl-dom/dist/getStringFromMessageAndDefaults.d.ts.map +1 -0
- package/vendor/intl-dom/dist/i18n.d.ts +113 -0
- package/vendor/intl-dom/dist/i18n.d.ts.map +1 -0
- package/vendor/intl-dom/dist/index.d.ts +92 -0
- package/vendor/intl-dom/dist/index.d.ts.map +1 -0
- package/vendor/intl-dom/dist/index.esm.d.ts +34 -0
- package/vendor/intl-dom/dist/index.esm.js +854 -896
- package/vendor/intl-dom/dist/index.esm.min.js +4 -0
- package/vendor/intl-dom/dist/index.esm.min.js.map +1 -0
- package/vendor/intl-dom/dist/index.umd.js +2953 -0
- package/vendor/intl-dom/dist/index.umd.min.js +4 -0
- package/vendor/intl-dom/dist/index.umd.min.js.map +1 -0
- package/vendor/intl-dom/dist/promiseChainForValues.d.ts +34 -0
- package/vendor/intl-dom/dist/promiseChainForValues.d.ts.map +1 -0
- package/vendor/intl-dom/dist/shared.d.ts +20 -0
- package/vendor/intl-dom/dist/shared.d.ts.map +1 -0
- package/vendor/intl-dom/dist/utils.d.ts +53 -0
- package/vendor/intl-dom/dist/utils.d.ts.map +1 -0
- package/vendor/jamilih/dist/jml.d.mts +468 -0
- package/vendor/jamilih/dist/{jml-es.js → jml.mjs} +1489 -343
- package/vendor/jquery/dist/jquery.js +1677 -2713
- package/vendor/json-6/dist/index.mjs +2 -0
- package/vendor/miller-columns/CHANGES.md +185 -0
- package/vendor/miller-columns/LICENSE-MIT.txt +21 -0
- package/vendor/miller-columns/README.md +249 -0
- package/vendor/miller-columns/demos/index.html +69 -0
- package/vendor/miller-columns/demos/index.js +72 -0
- package/vendor/miller-columns/dist/index-es.js +748 -0
- package/vendor/miller-columns/dist/index-es.min.d.ts +25 -0
- package/vendor/miller-columns/dist/index-es.min.js +7 -1
- package/vendor/miller-columns/dist/index-umd.js +757 -0
- package/vendor/miller-columns/dist/index-umd.min.js +7 -0
- package/vendor/miller-columns/dist/index.d.ts +25 -0
- package/vendor/miller-columns/dist/millerColumns.d.ts +10 -0
- package/vendor/miller-columns/eslint.config.js +46 -0
- package/vendor/miller-columns/fix-declarations.js +18 -0
- package/vendor/miller-columns/miller-columns.css +24 -1
- package/vendor/miller-columns/package.json +73 -0
- package/vendor/miller-columns/pnpm-workspace.yaml +2 -0
- package/vendor/miller-columns/src/index.js +642 -0
- package/vendor/miller-columns/src/millerColumns.ts +12 -0
- package/vendor/miller-columns/tsconfig-prod.json +23 -0
- package/vendor/miller-columns/tsconfig.json +21 -0
- package/vendor/simple-prefs/dist/index.esm.d.ts +1 -0
- package/vendor/simple-prefs/dist/index.esm.js +164 -216
- package/vendor/simple-prefs/dist/simple-prefs.d.ts +117 -0
- package/lgtm.yml +0 -5
|
@@ -192,7 +192,7 @@ var ec = [
|
|
|
192
192
|
'invalid distance',
|
|
193
193
|
'stream finished',
|
|
194
194
|
'no stream handler',
|
|
195
|
-
,
|
|
195
|
+
, // determined by compression function
|
|
196
196
|
'no callback',
|
|
197
197
|
'invalid UTF-8 data',
|
|
198
198
|
'extra field too long',
|
|
@@ -909,12 +909,12 @@ var cbify = function (dat, opts, fns, init, id, cb) {
|
|
|
909
909
|
var astrm = function (strm) {
|
|
910
910
|
strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };
|
|
911
911
|
return function (ev) {
|
|
912
|
-
if (ev.data
|
|
912
|
+
if (ev.data[0]) {
|
|
913
913
|
strm.push(ev.data[0], ev.data[1]);
|
|
914
914
|
postMessage([ev.data[0].length]);
|
|
915
915
|
}
|
|
916
916
|
else
|
|
917
|
-
strm.flush();
|
|
917
|
+
strm.flush(ev.data[1]);
|
|
918
918
|
};
|
|
919
919
|
};
|
|
920
920
|
// async stream attach
|
|
@@ -944,17 +944,19 @@ var astrmify = function (fns, strm, opts, init, id, flush, ext) {
|
|
|
944
944
|
if (t)
|
|
945
945
|
strm.ondata(err(4, 0, 1), null, !!f);
|
|
946
946
|
strm.queuedSize += d.length;
|
|
947
|
-
|
|
947
|
+
// can fail for cross-realm Uint8Array, but ok - only a small performance penalty
|
|
948
|
+
w.postMessage([d, t = f], d.buffer instanceof ArrayBuffer ? [d.buffer] : []);
|
|
948
949
|
};
|
|
949
950
|
strm.terminate = function () { w.terminate(); };
|
|
950
951
|
if (flush) {
|
|
951
|
-
strm.flush = function () { w.postMessage([]); };
|
|
952
|
+
strm.flush = function (sync) { w.postMessage([0, sync]); };
|
|
952
953
|
}
|
|
953
954
|
};
|
|
954
955
|
// read 2 bytes
|
|
955
956
|
var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };
|
|
956
957
|
// read 4 bytes
|
|
957
958
|
var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };
|
|
959
|
+
// read 8 bytes
|
|
958
960
|
var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };
|
|
959
961
|
// write bytes
|
|
960
962
|
var wbytes = function (d, b, v) {
|
|
@@ -1075,18 +1077,37 @@ var Deflate = /*#__PURE__*/ (function () {
|
|
|
1075
1077
|
this.p(this.b, final || false);
|
|
1076
1078
|
this.s.w = this.s.i, this.s.i -= 2;
|
|
1077
1079
|
}
|
|
1080
|
+
if (final) {
|
|
1081
|
+
// cleanup unneeded buffers/state to reduce memory usage
|
|
1082
|
+
this.s = this.o = {};
|
|
1083
|
+
this.b = et;
|
|
1084
|
+
}
|
|
1078
1085
|
};
|
|
1079
1086
|
/**
|
|
1080
1087
|
* Flushes buffered uncompressed data. Useful to immediately retrieve the
|
|
1081
1088
|
* deflated output for small inputs.
|
|
1089
|
+
* @param sync Whether to flush to a byte boundary. A sync flush takes 4-5
|
|
1090
|
+
* extra bytes, but guarantees all pushed data is immediately
|
|
1091
|
+
* decompressible. A separate DEFLATE stream may be concatenated
|
|
1092
|
+
* with the current output after a sync flush.
|
|
1082
1093
|
*/
|
|
1083
|
-
Deflate.prototype.flush = function () {
|
|
1094
|
+
Deflate.prototype.flush = function (sync) {
|
|
1084
1095
|
if (!this.ondata)
|
|
1085
1096
|
err(5);
|
|
1086
1097
|
if (this.s.l)
|
|
1087
1098
|
err(4);
|
|
1088
1099
|
this.p(this.b, false);
|
|
1089
1100
|
this.s.w = this.s.i, this.s.i -= 2;
|
|
1101
|
+
// could technically skip writing the type-0 block for (this.s.r & 7) == 0,
|
|
1102
|
+
// but the deterministic trailer (00 00 FF FF) is useful in some situations
|
|
1103
|
+
if (sync) {
|
|
1104
|
+
var c = new u8(6);
|
|
1105
|
+
c[0] = this.s.r >> 3;
|
|
1106
|
+
// write empty, non-final type-0 block
|
|
1107
|
+
var ep = wfblk(c, this.s.r, et);
|
|
1108
|
+
this.s.r = 0;
|
|
1109
|
+
this.ondata(c.subarray(0, ep >> 3), false);
|
|
1110
|
+
}
|
|
1090
1111
|
};
|
|
1091
1112
|
return Deflate;
|
|
1092
1113
|
}());
|
|
@@ -1197,12 +1218,6 @@ export function inflate(data, opts, cb) {
|
|
|
1197
1218
|
bInflt
|
|
1198
1219
|
], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);
|
|
1199
1220
|
}
|
|
1200
|
-
/**
|
|
1201
|
-
* Expands DEFLATE data with no wrapper
|
|
1202
|
-
* @param data The data to decompress
|
|
1203
|
-
* @param opts The decompression options
|
|
1204
|
-
* @returns The decompressed version of the data
|
|
1205
|
-
*/
|
|
1206
1221
|
export function inflateSync(data, opts) {
|
|
1207
1222
|
return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
|
|
1208
1223
|
}
|
|
@@ -1238,9 +1253,12 @@ var Gzip = /*#__PURE__*/ (function () {
|
|
|
1238
1253
|
/**
|
|
1239
1254
|
* Flushes buffered uncompressed data. Useful to immediately retrieve the
|
|
1240
1255
|
* GZIPped output for small inputs.
|
|
1256
|
+
* @param sync Whether to flush to a byte boundary. A sync flush takes 4-5
|
|
1257
|
+
* extra bytes, but guarantees all pushed data is immediately
|
|
1258
|
+
* decompressible.
|
|
1241
1259
|
*/
|
|
1242
|
-
Gzip.prototype.flush = function () {
|
|
1243
|
-
Deflate.prototype.flush.call(this);
|
|
1260
|
+
Gzip.prototype.flush = function (sync) {
|
|
1261
|
+
Deflate.prototype.flush.call(this, sync);
|
|
1244
1262
|
};
|
|
1245
1263
|
return Gzip;
|
|
1246
1264
|
}());
|
|
@@ -1318,14 +1336,17 @@ var Gunzip = /*#__PURE__*/ (function () {
|
|
|
1318
1336
|
}
|
|
1319
1337
|
// necessary to prevent TS from using the closure value
|
|
1320
1338
|
// This allows for workerization to function correctly
|
|
1321
|
-
Inflate.prototype.c.call(this,
|
|
1339
|
+
Inflate.prototype.c.call(this, 0);
|
|
1322
1340
|
// process concatenated GZIP
|
|
1323
|
-
if (this.s.f && !this.s.l
|
|
1341
|
+
if (this.s.f && !this.s.l) {
|
|
1324
1342
|
this.v = shft(this.s.p) + 9;
|
|
1325
1343
|
this.s = { i: 0 };
|
|
1326
1344
|
this.o = new u8(0);
|
|
1327
1345
|
this.push(new u8(0), final);
|
|
1328
1346
|
}
|
|
1347
|
+
else if (final) {
|
|
1348
|
+
Inflate.prototype.c.call(this, final);
|
|
1349
|
+
}
|
|
1329
1350
|
};
|
|
1330
1351
|
return Gunzip;
|
|
1331
1352
|
}());
|
|
@@ -1360,12 +1381,6 @@ export function gunzip(data, opts, cb) {
|
|
|
1360
1381
|
function () { return [gunzipSync]; }
|
|
1361
1382
|
], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);
|
|
1362
1383
|
}
|
|
1363
|
-
/**
|
|
1364
|
-
* Expands GZIP data
|
|
1365
|
-
* @param data The data to decompress
|
|
1366
|
-
* @param opts The decompression options
|
|
1367
|
-
* @returns The decompressed version of the data
|
|
1368
|
-
*/
|
|
1369
1384
|
export function gunzipSync(data, opts) {
|
|
1370
1385
|
var st = gzs(data);
|
|
1371
1386
|
if (st + 8 > data.length)
|
|
@@ -1401,9 +1416,12 @@ var Zlib = /*#__PURE__*/ (function () {
|
|
|
1401
1416
|
/**
|
|
1402
1417
|
* Flushes buffered uncompressed data. Useful to immediately retrieve the
|
|
1403
1418
|
* zlibbed output for small inputs.
|
|
1419
|
+
* @param sync Whether to flush to a byte boundary. A sync flush takes 4-5
|
|
1420
|
+
* extra bytes, but guarantees all pushed data is immediately
|
|
1421
|
+
* decompressible.
|
|
1404
1422
|
*/
|
|
1405
|
-
Zlib.prototype.flush = function () {
|
|
1406
|
-
Deflate.prototype.flush.call(this);
|
|
1423
|
+
Zlib.prototype.flush = function (sync) {
|
|
1424
|
+
Deflate.prototype.flush.call(this, sync);
|
|
1407
1425
|
};
|
|
1408
1426
|
return Zlib;
|
|
1409
1427
|
}());
|
|
@@ -1510,12 +1528,6 @@ export function unzlib(data, opts, cb) {
|
|
|
1510
1528
|
function () { return [unzlibSync]; }
|
|
1511
1529
|
], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);
|
|
1512
1530
|
}
|
|
1513
|
-
/**
|
|
1514
|
-
* Expands Zlib data
|
|
1515
|
-
* @param data The data to decompress
|
|
1516
|
-
* @param opts The decompression options
|
|
1517
|
-
* @returns The decompressed version of the data
|
|
1518
|
-
*/
|
|
1519
1531
|
export function unzlibSync(data, opts) {
|
|
1520
1532
|
return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);
|
|
1521
1533
|
}
|
|
@@ -1636,7 +1648,7 @@ var fltn = function (d, p, t, o) {
|
|
|
1636
1648
|
var val = d[k], n = p + k, op = o;
|
|
1637
1649
|
if (Array.isArray(val))
|
|
1638
1650
|
op = mrg(o, val[1]), val = val[0];
|
|
1639
|
-
if (val
|
|
1651
|
+
if (ArrayBuffer.isView(val))
|
|
1640
1652
|
t[n] = [val, op];
|
|
1641
1653
|
else {
|
|
1642
1654
|
t[n += '/'] = [new u8(0), op];
|
|
@@ -1821,15 +1833,30 @@ var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };
|
|
|
1821
1833
|
var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };
|
|
1822
1834
|
// read zip header
|
|
1823
1835
|
var zh = function (d, b, z) {
|
|
1824
|
-
var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl
|
|
1825
|
-
var _a =
|
|
1826
|
-
return [b2(d, b + 10), sc, su, fn, es +
|
|
1836
|
+
var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl;
|
|
1837
|
+
var _a = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a[0], su = _a[1], off = _a[2];
|
|
1838
|
+
return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off];
|
|
1827
1839
|
};
|
|
1828
|
-
// read zip64
|
|
1829
|
-
var
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1840
|
+
// read zip64 header sizes
|
|
1841
|
+
var z64hs = function (d, b, l, z, sc, su, off) {
|
|
1842
|
+
var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l;
|
|
1843
|
+
var nf = nsc + nsu + noff;
|
|
1844
|
+
if (z && nf) {
|
|
1845
|
+
for (; b + 4 < e; b += 4 + b2(d, b + 2)) {
|
|
1846
|
+
if (b2(d, b) == 1) {
|
|
1847
|
+
return [
|
|
1848
|
+
nsc ? b8(d, b + 4 + 8 * nsu) : sc,
|
|
1849
|
+
nsu ? b8(d, b + 4) : su,
|
|
1850
|
+
noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off,
|
|
1851
|
+
1
|
|
1852
|
+
];
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
// z == 2 for unknown whether or not zip64
|
|
1856
|
+
if (z < 2)
|
|
1857
|
+
err(13);
|
|
1858
|
+
}
|
|
1859
|
+
return [sc, su, off, 0];
|
|
1833
1860
|
};
|
|
1834
1861
|
// extra field length
|
|
1835
1862
|
var exfl = function (ex) {
|
|
@@ -1931,6 +1958,8 @@ var ZipPassThrough = /*#__PURE__*/ (function () {
|
|
|
1931
1958
|
this.size += chunk.length;
|
|
1932
1959
|
if (final)
|
|
1933
1960
|
this.crc = this.c.d();
|
|
1961
|
+
// we shouldn't really do this cast, but properly handling ArrayBufferLike
|
|
1962
|
+
// makes the API unergonomic with Buffer
|
|
1934
1963
|
this.process(chunk, final || false);
|
|
1935
1964
|
};
|
|
1936
1965
|
return ZipPassThrough;
|
|
@@ -2310,8 +2339,9 @@ export function zipSync(data, opts) {
|
|
|
2310
2339
|
var UnzipPassThrough = /*#__PURE__*/ (function () {
|
|
2311
2340
|
function UnzipPassThrough() {
|
|
2312
2341
|
}
|
|
2313
|
-
UnzipPassThrough.prototype.push = function (
|
|
2314
|
-
|
|
2342
|
+
UnzipPassThrough.prototype.push = function (chunk, final) {
|
|
2343
|
+
// same as ZipPassThrough: cast to retain Buffer ergonomics
|
|
2344
|
+
this.ondata(null, chunk, final);
|
|
2315
2345
|
};
|
|
2316
2346
|
UnzipPassThrough.compression = 0;
|
|
2317
2347
|
return UnzipPassThrough;
|
|
@@ -2331,9 +2361,9 @@ var UnzipInflate = /*#__PURE__*/ (function () {
|
|
|
2331
2361
|
_this.ondata(null, dat, final);
|
|
2332
2362
|
});
|
|
2333
2363
|
}
|
|
2334
|
-
UnzipInflate.prototype.push = function (
|
|
2364
|
+
UnzipInflate.prototype.push = function (chunk, final) {
|
|
2335
2365
|
try {
|
|
2336
|
-
this.i.push(
|
|
2366
|
+
this.i.push(chunk, final);
|
|
2337
2367
|
}
|
|
2338
2368
|
catch (e) {
|
|
2339
2369
|
this.ondata(e, null, final);
|
|
@@ -2364,10 +2394,10 @@ var AsyncUnzipInflate = /*#__PURE__*/ (function () {
|
|
|
2364
2394
|
this.terminate = this.i.terminate;
|
|
2365
2395
|
}
|
|
2366
2396
|
}
|
|
2367
|
-
AsyncUnzipInflate.prototype.push = function (
|
|
2397
|
+
AsyncUnzipInflate.prototype.push = function (chunk, final) {
|
|
2368
2398
|
if (this.i.terminate)
|
|
2369
|
-
|
|
2370
|
-
this.i.push(
|
|
2399
|
+
chunk = slc(chunk, 0);
|
|
2400
|
+
this.i.push(chunk, final);
|
|
2371
2401
|
};
|
|
2372
2402
|
AsyncUnzipInflate.compression = 8;
|
|
2373
2403
|
return AsyncUnzipInflate;
|
|
@@ -2424,7 +2454,6 @@ var Unzip = /*#__PURE__*/ (function () {
|
|
|
2424
2454
|
}
|
|
2425
2455
|
var l = buf.length, oc = this.c, add = oc && this.d;
|
|
2426
2456
|
var _loop_2 = function () {
|
|
2427
|
-
var _a;
|
|
2428
2457
|
var sig = b4(buf, i);
|
|
2429
2458
|
if (sig == 0x4034B50) {
|
|
2430
2459
|
f = 1, is = i;
|
|
@@ -2435,13 +2464,11 @@ var Unzip = /*#__PURE__*/ (function () {
|
|
|
2435
2464
|
var chks_3 = [];
|
|
2436
2465
|
this_1.k.unshift(chks_3);
|
|
2437
2466
|
f = 2;
|
|
2438
|
-
var
|
|
2467
|
+
var lsc = b4(buf, i + 18), lsu = b4(buf, i + 22);
|
|
2439
2468
|
var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
else if (dd)
|
|
2444
|
-
sc_1 = -1;
|
|
2469
|
+
var _a = z64hs(buf, i, es, 2, lsc, lsu, 0), sc_1 = _a[0], su_1 = _a[1], z64 = _a[3];
|
|
2470
|
+
if (dd)
|
|
2471
|
+
sc_1 = -1 - z64;
|
|
2445
2472
|
i += es;
|
|
2446
2473
|
this_1.c = sc_1;
|
|
2447
2474
|
var d_1;
|
|
@@ -2554,7 +2581,7 @@ export function unzip(data, opts, cb) {
|
|
|
2554
2581
|
if (lft) {
|
|
2555
2582
|
var c = lft;
|
|
2556
2583
|
var o = b4(data, e + 16);
|
|
2557
|
-
var z =
|
|
2584
|
+
var z = b4(data, e - 20) == 0x7064B50;
|
|
2558
2585
|
if (z) {
|
|
2559
2586
|
var ze = b4(data, e - 12);
|
|
2560
2587
|
z = b4(data, ze) == 0x6064B50;
|
|
@@ -2634,7 +2661,7 @@ export function unzipSync(data, opts) {
|
|
|
2634
2661
|
if (!c)
|
|
2635
2662
|
return {};
|
|
2636
2663
|
var o = b4(data, e + 16);
|
|
2637
|
-
var z =
|
|
2664
|
+
var z = b4(data, e - 20) == 0x7064B50;
|
|
2638
2665
|
if (z) {
|
|
2639
2666
|
var ze = b4(data, e - 12);
|
|
2640
2667
|
z = b4(data, ze) == 0x6064B50;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for formatting.
|
|
3
|
+
*/
|
|
4
|
+
export declare class Formatter {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Formatter for local variables.
|
|
8
|
+
*/
|
|
9
|
+
export declare class LocalFormatter extends Formatter {
|
|
10
|
+
locals: import("./getMessageForKeyByStyle.js").LocaleBody;
|
|
11
|
+
/**
|
|
12
|
+
* @param {string} key
|
|
13
|
+
* @returns {boolean}
|
|
14
|
+
*/
|
|
15
|
+
static isMatchingKey(key: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @param {import('./getMessageForKeyByStyle.js').LocalObject} locals
|
|
18
|
+
*/
|
|
19
|
+
constructor(locals: import('./getMessageForKeyByStyle.js').LocalObject);
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} key
|
|
22
|
+
* @returns {string|Element}
|
|
23
|
+
*/
|
|
24
|
+
getSubstitution(key: string): string | Element;
|
|
25
|
+
/**
|
|
26
|
+
* @param {string} key
|
|
27
|
+
* @returns {boolean}
|
|
28
|
+
*/
|
|
29
|
+
isMatch(key: string): boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Formatter for regular variables.
|
|
33
|
+
*/
|
|
34
|
+
export declare class RegularFormatter extends Formatter {
|
|
35
|
+
substitutions: import("./defaultLocaleResolver.js").SubstitutionObject;
|
|
36
|
+
/**
|
|
37
|
+
* @param {string} key
|
|
38
|
+
* @returns {boolean}
|
|
39
|
+
*/
|
|
40
|
+
static isMatchingKey(key: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @param {import('./defaultLocaleResolver.js').SubstitutionObject
|
|
43
|
+
* } substitutions
|
|
44
|
+
*/
|
|
45
|
+
constructor(substitutions: import('./defaultLocaleResolver.js').SubstitutionObject);
|
|
46
|
+
/**
|
|
47
|
+
* @param {string} key
|
|
48
|
+
* @returns {boolean}
|
|
49
|
+
*/
|
|
50
|
+
isMatch(key: string): boolean;
|
|
51
|
+
}
|
|
52
|
+
export type SwitchMatch = [
|
|
53
|
+
objKey?: string,
|
|
54
|
+
body?: import('./getMessageForKeyByStyle.js').LocaleBody,
|
|
55
|
+
keySegment?: string
|
|
56
|
+
];
|
|
57
|
+
export type Integer = number;
|
|
58
|
+
/**
|
|
59
|
+
* Formatter for switch variables.
|
|
60
|
+
*/
|
|
61
|
+
export declare class SwitchFormatter extends Formatter {
|
|
62
|
+
switches: import("./defaultLocaleResolver.js").Switches;
|
|
63
|
+
substitutions: import("./defaultLocaleResolver.js").SubstitutionObject;
|
|
64
|
+
/**
|
|
65
|
+
* @param {string} key
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
static isMatchingKey(key: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* @param {string} key
|
|
71
|
+
* @returns {string}
|
|
72
|
+
*/
|
|
73
|
+
static getKey(key: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* @param {import('./defaultLocaleResolver.js').Switches} switches
|
|
76
|
+
* @param {object} cfg
|
|
77
|
+
* @param {import('./defaultLocaleResolver.js').
|
|
78
|
+
* SubstitutionObject} cfg.substitutions
|
|
79
|
+
*/
|
|
80
|
+
constructor(switches: import('./defaultLocaleResolver.js').Switches, { substitutions }: {
|
|
81
|
+
substitutions: import('./defaultLocaleResolver.js').SubstitutionObject;
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* @param {string} key
|
|
85
|
+
* @param {object} cfg
|
|
86
|
+
* @param {string} cfg.locale
|
|
87
|
+
* @param {(string|undefined)[]} cfg.usedKeys
|
|
88
|
+
* @param {string} cfg.arg
|
|
89
|
+
* @param {import('./getDOMForLocaleString.js').
|
|
90
|
+
* MissingSuppliedFormattersCallback} cfg.missingSuppliedFormatters
|
|
91
|
+
* @returns {string}
|
|
92
|
+
*/
|
|
93
|
+
getSubstitution(key: string, { locale, usedKeys, arg, missingSuppliedFormatters }: {
|
|
94
|
+
locale: string;
|
|
95
|
+
usedKeys: (string | undefined)[];
|
|
96
|
+
arg: string;
|
|
97
|
+
missingSuppliedFormatters: import('./getDOMForLocaleString.js').MissingSuppliedFormattersCallback;
|
|
98
|
+
}): string;
|
|
99
|
+
/**
|
|
100
|
+
* @param {string} key
|
|
101
|
+
* @returns {boolean}
|
|
102
|
+
*/
|
|
103
|
+
isMatch(key: string): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* @typedef {[
|
|
106
|
+
* objKey?: string,
|
|
107
|
+
* body?: import('./getMessageForKeyByStyle.js').LocaleBody,
|
|
108
|
+
* keySegment?: string
|
|
109
|
+
* ]} SwitchMatch
|
|
110
|
+
*/
|
|
111
|
+
/**
|
|
112
|
+
* @typedef {number} Integer
|
|
113
|
+
*/
|
|
114
|
+
/**
|
|
115
|
+
* @param {string} ky
|
|
116
|
+
* @returns {SwitchMatch}
|
|
117
|
+
*/
|
|
118
|
+
getMatch(ky: string): SwitchMatch;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=Formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Formatter.d.ts","sourceRoot":"","sources":["../src/Formatter.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,qBAAa,SAAS;CACrB;AAuBD;;GAEG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAcpC,MAAM;IAbb;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAE,GAAG,EAHd,MAGc,GAFZ,OAAO,CAInB;IAED;;OAEG;IACH,YAAa,MAAM,EAFR,OAAO,8BAA8B,EAAE,WAE/B,EAGlB;IACD;;;OAGG;IACH,eAAe,CAAE,GAAG,EAHT,MAGS,GAFP,MAAM,GAAC,OAAO,CAM1B;IACD;;;OAGG;IACH,OAAO,CAAE,GAAG,EAHD,MAGC,GAFC,OAAO,CA6BnB;CACF;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;IAetC,aAAa;IAdpB;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAE,GAAG,EAHd,MAGc,GAFZ,OAAO,CAInB;IAED;;;OAGG;IACH,YAAa,aAAa,EAHf,OAAO,4BAA4B,EAAE,kBAGtB,EAGzB;IACD;;;OAGG;IACH,OAAO,CAAE,GAAG,EAHD,MAGC,GAFC,OAAO,CAMnB;CACF;AAyNI,YAIG,WAAW,GAJJ;IACR,MAAM,CAAC,EAAE,MAAM;IACf,IAAI,CAAC,EAAE,OAAO,8BAA8B,EAAE,UAAU;IACxD,UAAU,CAAC,EAAE,MAAM;CACpB,CAAa;AAId,YAAkB,OAAO,GAAf,MAAM,CAAS;AA/N9B;;GAEG;AACH,qBAAa,eAAgB,SAAQ,SAAS;IAyBrC,QAAQ;IACR,aAAa;IAzBpB;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAE,GAAG,EAHd,MAGc,GAFZ,OAAO,CAInB;IACD;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAE,GAAG,EAHP,MAGO,GAFL,MAAM,CAKlB;IAED;;;;;OAKG;IACH,YAAa,QAAQ,EALV,OAAO,4BAA4B,EAAE,QAK3B,EAAE,EAAC,aAAa,EAAC,EAHnC;QAC0B,aAAa,EAD/B,OAAO,4BAA4B,EACzC,kBAAkB,CACtB;KACqC,EAIrC;IAED;;;;;;;;;OASG;IACH,eAAe,CAAE,GAAG,EATT,MASS,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,yBAAyB,EAAC,EAPrE;QAAoB,MAAM,EAAlB,MAAM,CACd;QAAkC,QAAQ,EAAlC,CAAC,MAAM,GAAC,SAAS,CAAC,EAAE,CAC5B;QAAoB,GAAG,EAAf,MAAM,CACd;QACyC,yBAAyB,EAD1D,OAAO,4BAA4B,EACzC,iCAAiC,CACnC;KAEqE,GAF3D,MAAM,CA+JlB;IAED;;;OAGG;IACH,OAAO,CAAE,GAAG,EAHD,MAGC,GAFC,OAAO,CASnB;IAED;;;;;;OAMG;IAEH;;OAEG;IAEH;;;OAGG;IACH,QAAQ,CAAE,EAAE,EAHD,MAGC,GAFC,WAAW,CA6CvB;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export { setDocument, getDocument } from './shared.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {string} locale
|
|
5
|
+
* @param {string[]} arrayOfItems
|
|
6
|
+
* @param {Intl.CollatorOptions|undefined} options
|
|
7
|
+
* @returns {string[]}
|
|
8
|
+
*/
|
|
9
|
+
export declare const sort: (locale: string, arrayOfItems: string[], options: Intl.CollatorOptions | undefined) => string[];
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param {string} locale
|
|
13
|
+
* @param {string[]} arrayOfItems
|
|
14
|
+
* @param {Intl.ListFormatOptions|undefined} [options]
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
export declare const list: (locale: string, arrayOfItems: string[], options?: Intl.ListFormatOptions | undefined) => string;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param {string} locale
|
|
21
|
+
* @param {string[]} arrayOfItems
|
|
22
|
+
* @param {Intl.ListFormatOptions|undefined} [listOptions]
|
|
23
|
+
* @param {Intl.CollatorOptions|undefined} [collationOptions]
|
|
24
|
+
* @returns {string}
|
|
25
|
+
*/
|
|
26
|
+
export declare const sortListSimple: (locale: string, arrayOfItems: string[], listOptions?: Intl.ListFormatOptions | undefined, collationOptions?: Intl.CollatorOptions | undefined) => string;
|
|
27
|
+
export type Integer = number;
|
|
28
|
+
/**
|
|
29
|
+
* @typedef {number} Integer
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param {string} locale
|
|
34
|
+
* @param {string[]} arrayOfItems
|
|
35
|
+
* @param {import('./index.js').SortListMapper|
|
|
36
|
+
* Intl.ListFormatOptions|undefined} map
|
|
37
|
+
* @param {Intl.ListFormatOptions|undefined} [listOptions]
|
|
38
|
+
* @param {Intl.CollatorOptions|undefined} [collationOptions]
|
|
39
|
+
* @returns {DocumentFragment|string}
|
|
40
|
+
*/
|
|
41
|
+
export declare const sortList: (locale: string, arrayOfItems: string[], map: import('./index.js').SortListMapper | Intl.ListFormatOptions | undefined, listOptions?: Intl.ListFormatOptions | undefined, collationOptions?: Intl.CollatorOptions | undefined) => DocumentFragment | string;
|
|
42
|
+
//# sourceMappingURL=collation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collation.d.ts","sourceRoot":"","sources":["../src/collation.js"],"names":[],"mappings":"AAGA,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAuBrD;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,WALN,MAAM,gBACN,MAAM,EAAE,WACR,IAAI,CAAC,eAAe,GAAC,SAAS,KAC5B,MAAM,EAQlB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,WALN,MAAM,gBACN,MAAM,EAAE,YACR,IAAI,CAAC,iBAAiB,GAAC,SAAS,KAC9B,MAMZ,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,WANhB,MAAM,gBACN,MAAM,EAAE,gBACR,IAAI,CAAC,iBAAiB,GAAC,SAAS,qBAChC,IAAI,CAAC,eAAe,GAAC,SAAS,KAC5B,MAOZ,CAAC;AAGC,YAAkB,OAAO,GAAf,MAAM,CAAS;AAD5B;;GAEG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,WARV,MAAM,gBACN,MAAM,EAAE,OACR,OAAO,YAAY,EAAE,cAAc,GACzC,IAAI,CAAC,iBAAiB,GAAC,SAAS,gBAC1B,IAAI,CAAC,iBAAiB,GAAC,SAAS,qBAChC,IAAI,CAAC,eAAe,GAAC,SAAS,KAC5B,gBAAgB,GAAC,MA6C7B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type Integer = number;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {number} Integer
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @param {{
|
|
7
|
+
* object: import('./defaultLocaleResolver.js').DateRangeValueArray|
|
|
8
|
+
* import('./defaultLocaleResolver.js').ListValueArray|
|
|
9
|
+
* import('./defaultLocaleResolver.js').RelativeValueArray|
|
|
10
|
+
* import('./defaultLocaleResolver.js').ValueArray
|
|
11
|
+
* }} cfg
|
|
12
|
+
* @returns {{
|
|
13
|
+
* value: number|string|string[]|Date,
|
|
14
|
+
* options?: Intl.NumberFormatOptions|Intl.PluralRulesOptions|
|
|
15
|
+
* string|Date|number,
|
|
16
|
+
* extraOpts?: object,
|
|
17
|
+
* callback?: (item: string, i: Integer) => Element
|
|
18
|
+
* }}
|
|
19
|
+
*/
|
|
20
|
+
export declare const getFormatterInfo: ({ object }: {
|
|
21
|
+
object: import('./defaultLocaleResolver.js').DateRangeValueArray | import('./defaultLocaleResolver.js').ListValueArray | import('./defaultLocaleResolver.js').RelativeValueArray | import('./defaultLocaleResolver.js').ValueArray;
|
|
22
|
+
}) => {
|
|
23
|
+
value: number | string | string[] | Date;
|
|
24
|
+
options?: Intl.NumberFormatOptions | Intl.PluralRulesOptions | string | Date | number;
|
|
25
|
+
extraOpts?: object;
|
|
26
|
+
callback?: (item: string, i: Integer) => Element;
|
|
27
|
+
};
|
|
28
|
+
export type AllSubstitutionCallback = (info: {
|
|
29
|
+
value: import('./defaultLocaleResolver.js').SubstitutionObjectValue;
|
|
30
|
+
arg?: string;
|
|
31
|
+
key?: string;
|
|
32
|
+
locale?: string;
|
|
33
|
+
}) => string | Node;
|
|
34
|
+
/**
|
|
35
|
+
* Callback to give replacement text based on a substitution value.
|
|
36
|
+
*
|
|
37
|
+
* `value` - contains the value returned by the individual substitution.
|
|
38
|
+
* `arg` - See `cfg.arg` of {@link SubstitutionCallback}.
|
|
39
|
+
* `key` - The substitution key Not currently in use
|
|
40
|
+
* `locale` - The locale.
|
|
41
|
+
* @typedef {(info: {
|
|
42
|
+
* value: import('./defaultLocaleResolver.js').SubstitutionObjectValue
|
|
43
|
+
* arg?: string,
|
|
44
|
+
* key?: string,
|
|
45
|
+
* locale?: string
|
|
46
|
+
* }) => string|Node} AllSubstitutionCallback
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* @type {AllSubstitutionCallback}
|
|
50
|
+
*/
|
|
51
|
+
export declare const defaultAllSubstitutions: AllSubstitutionCallback;
|
|
52
|
+
//# sourceMappingURL=defaultAllSubstitutions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultAllSubstitutions.d.ts","sourceRoot":"","sources":["../src/defaultAllSubstitutions.js"],"names":[],"mappings":"AAIG,YAAkB,OAAO,GAAf,MAAM,CAAS;AAD5B;;GAEG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,eAdlB;IACN,MAAM,EAAE,OAAO,4BAA4B,EAAE,mBAAmB,GACpE,OAAa,4BAA4B,EAAE,cAAc,GACzD,OAAa,4BAA4B,EAAE,kBAAkB,GAC7D,OAAa,4BAA4B,EAAE,UAAU,CAAA;CAClD,KACS;IACR,KAAK,EAAE,MAAM,GAAC,MAAM,GAAC,MAAM,EAAE,GAAC,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAC,IAAI,CAAC,kBAAkB,GAC9D,MAAY,GAAC,IAAI,GAAC,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,KAAK,OAAO,CAAA;CAoBpD,CAAC;AASC,YAKmB,uBAAuB,GALhC,CAAC,IAAI,EAAE;IACf,KAAK,EAAE,OAAO,4BAA4B,EAAE,uBAAuB,CAAA;IACnE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,KAAK,MAAM,GAAC,IAAI,CAAyB;AAZ7C;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAF1B,uBAoNT,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export type Integer = number;
|
|
2
|
+
export type Replace = (cfg: {
|
|
3
|
+
str: string;
|
|
4
|
+
substs?: import('./defaultLocaleResolver.js').SubstitutionObject;
|
|
5
|
+
formatter?: import('./Formatter.js').RegularFormatter | import('./Formatter.js').LocalFormatter | import('./Formatter.js').SwitchFormatter;
|
|
6
|
+
}) => string;
|
|
7
|
+
export type ProcessSubstitutions = (cfg: {
|
|
8
|
+
str: string;
|
|
9
|
+
substs?: import('./defaultLocaleResolver.js').SubstitutionObject;
|
|
10
|
+
formatter?: import('./Formatter.js').RegularFormatter | import('./Formatter.js').LocalFormatter | import('./Formatter.js').SwitchFormatter;
|
|
11
|
+
}) => (string | Node)[];
|
|
12
|
+
export type InsertNodesCallback = (cfg: {
|
|
13
|
+
string: string;
|
|
14
|
+
dom?: boolean;
|
|
15
|
+
usedKeys: string[];
|
|
16
|
+
substitutions: import('./defaultLocaleResolver.js').SubstitutionObject;
|
|
17
|
+
allSubstitutions?: (import('./defaultAllSubstitutions.js').AllSubstitutionCallback | import('./defaultAllSubstitutions.js').AllSubstitutionCallback[]) | null;
|
|
18
|
+
locale: string | undefined;
|
|
19
|
+
locals?: import('./getMessageForKeyByStyle.js').LocalObject | undefined;
|
|
20
|
+
switches: import('./defaultLocaleResolver.js').Switches | undefined;
|
|
21
|
+
maximumLocalNestingDepth?: Integer;
|
|
22
|
+
missingSuppliedFormatters: import('./getDOMForLocaleString.js').MissingSuppliedFormattersCallback;
|
|
23
|
+
checkExtraSuppliedFormatters: import('./getDOMForLocaleString.js').CheckExtraSuppliedFormattersCallback;
|
|
24
|
+
}) => string | (Node | string)[];
|
|
25
|
+
/**
|
|
26
|
+
* @typedef {number} Integer
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* @callback Replace
|
|
30
|
+
* @param {{
|
|
31
|
+
* str: string,
|
|
32
|
+
* substs?: import('./defaultLocaleResolver.js').SubstitutionObject,
|
|
33
|
+
* formatter?: import('./Formatter.js').RegularFormatter|
|
|
34
|
+
* import('./Formatter.js').LocalFormatter|
|
|
35
|
+
* import('./Formatter.js').SwitchFormatter
|
|
36
|
+
* }} cfg
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @callback ProcessSubstitutions
|
|
41
|
+
* @param {{
|
|
42
|
+
* str: string,
|
|
43
|
+
* substs?: import('./defaultLocaleResolver.js').SubstitutionObject,
|
|
44
|
+
* formatter?: import('./Formatter.js').RegularFormatter|
|
|
45
|
+
* import('./Formatter.js').LocalFormatter|
|
|
46
|
+
* import('./Formatter.js').SwitchFormatter
|
|
47
|
+
* }} cfg
|
|
48
|
+
* @returns {(string|Node)[]}
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* Callback to return a string or array of nodes and strings based on
|
|
52
|
+
* a localized string, substitutions object, and other metadata.
|
|
53
|
+
*
|
|
54
|
+
* `string` - The localized string.
|
|
55
|
+
* `dom` - If substitutions known to contain DOM, can be set
|
|
56
|
+
* to `true` to optimize.
|
|
57
|
+
* `usedKeys` - Array for tracking which keys have been used. Defaults
|
|
58
|
+
* to empty array.
|
|
59
|
+
* `substitutions` - The formatting substitutions object.
|
|
60
|
+
* `allSubstitutions` - The
|
|
61
|
+
* callback or array composed thereof for applying to each substitution.
|
|
62
|
+
* `locale` - The successfully resolved locale
|
|
63
|
+
* `locals` - The local section.
|
|
64
|
+
* `switches` - The switch section.
|
|
65
|
+
* `maximumLocalNestingDepth` - Depth of local variable resolution to
|
|
66
|
+
* check before reporting a recursion error. Defaults to 3.
|
|
67
|
+
* `missingSuppliedFormatters` - Callback
|
|
68
|
+
* supplied key to throw if the supplied key is present (if
|
|
69
|
+
* `throwOnMissingSuppliedFormatters` is enabled). Defaults to no-op.
|
|
70
|
+
* `checkExtraSuppliedFormatters` - No
|
|
71
|
+
* argument callback to check if any formatters are not present in `string`
|
|
72
|
+
* (if `throwOnExtraSuppliedFormatters` is enabled). Defaults to no-op.
|
|
73
|
+
* @typedef {(cfg: {
|
|
74
|
+
* string: string,
|
|
75
|
+
* dom?: boolean,
|
|
76
|
+
* usedKeys: string[],
|
|
77
|
+
* substitutions: import('./defaultLocaleResolver.js').SubstitutionObject,
|
|
78
|
+
* allSubstitutions?: ?(
|
|
79
|
+
* import('./defaultAllSubstitutions.js').AllSubstitutionCallback|
|
|
80
|
+
* import('./defaultAllSubstitutions.js').AllSubstitutionCallback[]
|
|
81
|
+
* )
|
|
82
|
+
* locale: string|undefined,
|
|
83
|
+
* locals?: import('./getMessageForKeyByStyle.js').LocalObject|undefined,
|
|
84
|
+
* switches: import('./defaultLocaleResolver.js').Switches|undefined,
|
|
85
|
+
* maximumLocalNestingDepth?: Integer,
|
|
86
|
+
* missingSuppliedFormatters: import('./getDOMForLocaleString.js').
|
|
87
|
+
* MissingSuppliedFormattersCallback,
|
|
88
|
+
* checkExtraSuppliedFormatters: import('./getDOMForLocaleString.js').
|
|
89
|
+
* CheckExtraSuppliedFormattersCallback
|
|
90
|
+
* }) => string|(Node|string)[]} InsertNodesCallback
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* @type {InsertNodesCallback}
|
|
94
|
+
*/
|
|
95
|
+
export declare const defaultInsertNodes: InsertNodesCallback;
|
|
96
|
+
//# sourceMappingURL=defaultInsertNodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultInsertNodes.d.ts","sourceRoot":"","sources":["../src/defaultInsertNodes.js"],"names":[],"mappings":"AAOG,YAAkB,OAAO,GAAf,MAAM,CAAS;AAIzB,YAAU,OAAO,GACjB,CAMG,GAAG,EANE;IACN,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,4BAA4B,EAAE,kBAAkB,CAAC;IACjE,SAAS,CAAC,EAAE,OAAO,gBAAgB,EAAE,gBAAgB,GACzD,OAAa,gBAAgB,EAAE,cAAc,GAC7C,OAAa,gBAAgB,EAAE,eAAe,CAAA;CAE5C,KAAU,MACZ,CAAA;AAGE,YAAU,oBAAoB,GAC9B,CAMG,GAAG,EANE;IACN,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,4BAA4B,EAAE,kBAAkB,CAAC;IACjE,SAAS,CAAC,EAAE,OAAO,gBAAgB,EAAE,gBAAgB,GACzD,OAAa,gBAAgB,EAAE,cAAc,GAC7C,OAAa,gBAAgB,EAAE,eAAe,CAAA;CAE5C,KAAU,CAAC,MAAM,GAAC,IAAI,CAAC,EACzB,CAAA;AAyBE,YAiB8B,mBAAmB,GAjBvC,CAAC,GAAG,EAAE;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,OAAO,4BAA4B,EAAE,kBAAkB,CAAC;IACvE,gBAAgB,CAAC,EAAG,CACxB,OAAa,8BAA8B,EAAE,uBAAuB,GACpE,OAAa,8BAA8B,EAAE,uBAAuB,EAAE,CACjE,OAAA,CAAA;IACD,MAAM,EAAE,MAAM,GAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,8BAA8B,EAAE,WAAW,GAAC,SAAS,CAAC;IACtE,QAAQ,EAAE,OAAO,4BAA4B,EAAE,QAAQ,GAAC,SAAS,CAAC;IAClE,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,yBAAyB,EAAE,OAAO,4BAA4B,EAC5D,iCAAiC,CAAC;IACpC,4BAA4B,EAAE,OAAO,4BAA4B,EAC/D,oCAAoC,CAAA;CACvC,KAAK,MAAM,GAAC,CAAC,IAAI,GAAC,MAAM,CAAC,EAAE,CAAqB;AApEpD;;GAEG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAFrB,mBAsST,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @callback KeyCheckerConverterCallback
|
|
3
|
+
* @param {string|string[]} key By default may be an array (if the type ends
|
|
4
|
+
* with "Nested") or a string, but a non-default validator may do otherwise.
|
|
5
|
+
* @param {"plain"|"plainNested"|"rich"|
|
|
6
|
+
* "richNested"|
|
|
7
|
+
* import('./getMessageForKeyByStyle.js').MessageStyleCallback
|
|
8
|
+
* } messageStyle
|
|
9
|
+
* @throws {TypeError}
|
|
10
|
+
* @returns {string} The converted (or unconverted) key
|
|
11
|
+
*/
|
|
12
|
+
export type KeyCheckerConverterCallback = (key: string | string[], messageStyle: "plain" | "plainNested" | "rich" | "richNested" | import('./getMessageForKeyByStyle.js').MessageStyleCallback) => any;
|
|
13
|
+
/**
|
|
14
|
+
* @type {KeyCheckerConverterCallback}
|
|
15
|
+
*/
|
|
16
|
+
export declare const defaultKeyCheckerConverter: KeyCheckerConverterCallback;
|
|
17
|
+
//# sourceMappingURL=defaultKeyCheckerConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultKeyCheckerConverter.d.ts","sourceRoot":"","sources":["../src/defaultKeyCheckerConverter.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AATA,YAAU,2BAA2B,GACrC,CAAyB,GAAG,EAApB,MAAM,GAAC,MAAM,EAErB,EAGE,YAAY,EAHN,OAAO,GAAC,aAAa,GAAC,MAAM,GACtC,YAAgB,GAChB,OAAW,8BAA8B,EAAE,oBAEzC,QAAA,CAAA;AAIH;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAF7B,2BAqBT,CAAC"}
|