@@ -4,16 +4,16 @@ import { processAST, type SyntaxLine } from "./processAST";
44
55import type { codeToHast } from "shiki" ;
66
7- export type AST = DePromise < ReturnType < typeof codeToHast > > ;
7+ export type DiffAST = DePromise < ReturnType < typeof codeToHast > > ;
88
9- export type Highlighter = {
9+ export type DiffHighlighter = {
1010 name : string ;
1111 maxLineToIgnoreSyntax : number ;
1212 setMaxLineToIgnoreSyntax : ( v : number ) => void ;
1313 ignoreSyntaxHighlightList : ( string | RegExp ) [ ] ;
1414 setIgnoreSyntaxHighlightList : ( v : ( string | RegExp ) [ ] ) => void ;
15- getAST : ( raw : string , fileName ?: string , lang ?: string ) => AST ;
16- processAST : ( ast : AST ) => { syntaxFileObject : Record < number , SyntaxLine > ; syntaxFileLineNumber : number } ;
15+ getAST : ( raw : string , fileName ?: string , lang ?: string ) => DiffAST ;
16+ processAST : ( ast : DiffAST ) => { syntaxFileObject : Record < number , SyntaxLine > ; syntaxFileLineNumber : number } ;
1717} ;
1818
1919let internal : DePromise < ReturnType < typeof getHighlighter > > | null = null ;
@@ -106,14 +106,14 @@ Object.defineProperty(instance, "getAST", {
106106} ) ;
107107
108108Object . defineProperty ( instance , "processAST" , {
109- value : ( ast : AST ) => {
109+ value : ( ast : DiffAST ) => {
110110 return processAST ( ast ) ;
111111 } ,
112112} ) ;
113113
114- const highlighter : Highlighter = instance as Highlighter ;
114+ const highlighter : DiffHighlighter = instance as DiffHighlighter ;
115115
116- export const highlighterReady = new Promise < Highlighter > ( ( r ) => {
116+ export const highlighterReady = new Promise < DiffHighlighter > ( ( r ) => {
117117 if ( internal ) {
118118 r ( highlighter ) ;
119119 } else {
@@ -125,4 +125,6 @@ export const highlighterReady = new Promise<Highlighter>((r) => {
125125 }
126126} ) ;
127127
128+ export { processAST } from "./processAST" ;
129+
128130export * from "shiki" ;
0 commit comments