@shikijs/types 1.18.0 → 1.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/index.d.mts +9 -2
- package/dist/index.d.ts +9 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -360,8 +360,13 @@ interface TokenStyles {
|
|
|
360
360
|
/**
|
|
361
361
|
* Override with custom inline style for HTML renderer.
|
|
362
362
|
* When specified, `color` and `fontStyle` will be ignored.
|
|
363
|
+
* Prefer use object style for merging with other styles.
|
|
363
364
|
*/
|
|
364
|
-
htmlStyle?: string
|
|
365
|
+
htmlStyle?: string | Record<string, string>;
|
|
366
|
+
/**
|
|
367
|
+
* Extra HTML attributes for the token.
|
|
368
|
+
*/
|
|
369
|
+
htmlAttrs?: Record<string, string>;
|
|
365
370
|
}
|
|
366
371
|
interface ThemedTokenWithVariants extends TokenBase {
|
|
367
372
|
/**
|
|
@@ -513,7 +518,7 @@ interface ShikiTransformer {
|
|
|
513
518
|
/**
|
|
514
519
|
* Transform each token `<span>` element.
|
|
515
520
|
*/
|
|
516
|
-
span?: (this: ShikiTransformerContext, hast: Element, line: number, col: number, lineElement: Element) => Element | void;
|
|
521
|
+
span?: (this: ShikiTransformerContext, hast: Element, line: number, col: number, lineElement: Element, token: ThemedToken) => Element | void;
|
|
517
522
|
/**
|
|
518
523
|
* Transform the generated HTML string before returning.
|
|
519
524
|
* This hook will only be called with `codeToHtml`.
|
|
@@ -546,6 +551,8 @@ interface HighlighterCoreOptions<Sync extends boolean = false> {
|
|
|
546
551
|
warnings?: boolean;
|
|
547
552
|
/**
|
|
548
553
|
* Load wasm file from a custom path or using a custom function.
|
|
554
|
+
*
|
|
555
|
+
* @deprecated Use `engine: createWasmOnigEngine(loadWasm)` instead.
|
|
549
556
|
*/
|
|
550
557
|
loadWasm?: Sync extends true ? never : LoadWasmOptions;
|
|
551
558
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -360,8 +360,13 @@ interface TokenStyles {
|
|
|
360
360
|
/**
|
|
361
361
|
* Override with custom inline style for HTML renderer.
|
|
362
362
|
* When specified, `color` and `fontStyle` will be ignored.
|
|
363
|
+
* Prefer use object style for merging with other styles.
|
|
363
364
|
*/
|
|
364
|
-
htmlStyle?: string
|
|
365
|
+
htmlStyle?: string | Record<string, string>;
|
|
366
|
+
/**
|
|
367
|
+
* Extra HTML attributes for the token.
|
|
368
|
+
*/
|
|
369
|
+
htmlAttrs?: Record<string, string>;
|
|
365
370
|
}
|
|
366
371
|
interface ThemedTokenWithVariants extends TokenBase {
|
|
367
372
|
/**
|
|
@@ -513,7 +518,7 @@ interface ShikiTransformer {
|
|
|
513
518
|
/**
|
|
514
519
|
* Transform each token `<span>` element.
|
|
515
520
|
*/
|
|
516
|
-
span?: (this: ShikiTransformerContext, hast: Element, line: number, col: number, lineElement: Element) => Element | void;
|
|
521
|
+
span?: (this: ShikiTransformerContext, hast: Element, line: number, col: number, lineElement: Element, token: ThemedToken) => Element | void;
|
|
517
522
|
/**
|
|
518
523
|
* Transform the generated HTML string before returning.
|
|
519
524
|
* This hook will only be called with `codeToHtml`.
|
|
@@ -546,6 +551,8 @@ interface HighlighterCoreOptions<Sync extends boolean = false> {
|
|
|
546
551
|
warnings?: boolean;
|
|
547
552
|
/**
|
|
548
553
|
* Load wasm file from a custom path or using a custom function.
|
|
554
|
+
*
|
|
555
|
+
* @deprecated Use `engine: createWasmOnigEngine(loadWasm)` instead.
|
|
549
556
|
*/
|
|
550
557
|
loadWasm?: Sync extends true ? never : LoadWasmOptions;
|
|
551
558
|
}
|