@shikijs/twoslash 3.17.1 → 3.19.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/core.d.mts +2 -2
- package/dist/core.mjs +1 -1
- package/package.json +4 -4
package/dist/core.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeToHastOptions, ShikiTransformerContext, ShikiTransformerContextMeta,
|
|
1
|
+
import { CodeToHastOptions, ShikiTransformerContextCommon, ShikiTransformerContext, ShikiTransformerContextMeta, ShikiTransformer } from '@shikijs/types';
|
|
2
2
|
import { TwoslashReturn, TwoslashExecuteOptions, TwoslashGenericFunction, TwoslashOptions, NodeError, NodeTag, NodeQuery, NodeCompletion, NodeHover, NodeHighlight } from 'twoslash';
|
|
3
3
|
import { ElementContent, Element, Text } from 'hast';
|
|
4
4
|
|
|
@@ -56,7 +56,7 @@ interface TransformerTwoslashOptions {
|
|
|
56
56
|
* Custom filter function to apply this transformer to
|
|
57
57
|
* When specified, `langs`, `explicitTrigger`, and `disableTriggers` will be ignored
|
|
58
58
|
*/
|
|
59
|
-
filter?: (lang: string, code: string, options: CodeToHastOptions) => boolean;
|
|
59
|
+
filter?: (lang: string, code: string, options: CodeToHastOptions, context?: ShikiTransformerContextCommon) => boolean;
|
|
60
60
|
/**
|
|
61
61
|
* Custom instance of twoslasher function
|
|
62
62
|
*/
|
package/dist/core.mjs
CHANGED
|
@@ -1144,7 +1144,7 @@ function createTransformerFactory(defaultTwoslasher, defaultRenderer) {
|
|
|
1144
1144
|
let lang = this.options.lang;
|
|
1145
1145
|
if (lang in langAlias)
|
|
1146
1146
|
lang = langAlias[this.options.lang];
|
|
1147
|
-
if (filter(lang, code, this.options)) {
|
|
1147
|
+
if (filter(lang, code, this.options, this)) {
|
|
1148
1148
|
try {
|
|
1149
1149
|
const codeWithIncludes = includes.applyInclude(code);
|
|
1150
1150
|
const include = parseIncludeMeta(this.options.meta?.__raw);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shikijs/twoslash",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.19.0",
|
|
5
5
|
"description": "Shiki transformer for twoslash",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"twoslash": "^0.3.4",
|
|
39
|
-
"@shikijs/
|
|
40
|
-
"@shikijs/
|
|
39
|
+
"@shikijs/types": "3.19.0",
|
|
40
|
+
"@shikijs/core": "3.19.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@iconify-json/carbon": "^1.2.14",
|
|
44
44
|
"@iconify-json/codicon": "^1.2.34",
|
|
45
45
|
"hast-util-from-html": "^2.0.3",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
|
-
"@shikijs/twoslash": "3.
|
|
47
|
+
"@shikijs/twoslash": "3.19.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "unbuild",
|