@shikijs/engine-oniguruma 1.18.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -2,6 +2,19 @@ import { L as LoadWasmOptions, R as RegexEngine } from './chunk-index.d.mjs';
2
2
 
3
3
  declare function loadWasm(options: LoadWasmOptions): Promise<void>;
4
4
 
5
+ /**
6
+ * Set the default wasm loader for `loadWasm`.
7
+ * @internal
8
+ */
9
+ declare function setDefaultWasmLoader(_loader: LoadWasmOptions): void;
10
+ /**
11
+ * @internal
12
+ */
13
+ declare function getDefaultWasmLoader(): LoadWasmOptions | undefined;
14
+ declare function createOnigurumaEngine(options?: LoadWasmOptions | null): Promise<RegexEngine>;
15
+ /**
16
+ * Deprecated. Use `createOnigurumaEngine` instead.
17
+ */
5
18
  declare function createWasmOnigEngine(options?: LoadWasmOptions | null): Promise<RegexEngine>;
6
19
 
7
- export { createWasmOnigEngine, loadWasm };
20
+ export { createOnigurumaEngine, createWasmOnigEngine, getDefaultWasmLoader, loadWasm, setDefaultWasmLoader };
package/dist/index.mjs CHANGED
@@ -469,7 +469,21 @@ function _makeResponseNonStreamingLoader(data) {
469
469
  // defaultDebugCall = _defaultDebugCall
470
470
  // }
471
471
 
472
- async function createWasmOnigEngine(options) {
472
+ let _defaultWasmLoader;
473
+ /**
474
+ * Set the default wasm loader for `loadWasm`.
475
+ * @internal
476
+ */
477
+ function setDefaultWasmLoader(_loader) {
478
+ _defaultWasmLoader = _loader;
479
+ }
480
+ /**
481
+ * @internal
482
+ */
483
+ function getDefaultWasmLoader() {
484
+ return _defaultWasmLoader;
485
+ }
486
+ async function createOnigurumaEngine(options) {
473
487
  if (options)
474
488
  await loadWasm(options);
475
489
  return {
@@ -481,5 +495,11 @@ async function createWasmOnigEngine(options) {
481
495
  },
482
496
  };
483
497
  }
498
+ /**
499
+ * Deprecated. Use `createOnigurumaEngine` instead.
500
+ */
501
+ async function createWasmOnigEngine(options) {
502
+ return createOnigurumaEngine(options);
503
+ }
484
504
 
485
- export { createWasmOnigEngine, loadWasm };
505
+ export { createOnigurumaEngine, createWasmOnigEngine, getDefaultWasmLoader, loadWasm, setDefaultWasmLoader };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/engine-oniguruma",
3
3
  "type": "module",
4
- "version": "1.18.0",
4
+ "version": "1.20.0",
5
5
  "description": "Engine for Shiki using Oniguruma RegExp engine in WebAssembly",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@shikijs/vscode-textmate": "^9.2.2",
50
- "@shikijs/types": "1.18.0"
50
+ "@shikijs/types": "1.20.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "vscode-oniguruma": "^1.7.0"