|
1 |
| -import type { IGrammar, IRawGrammar, IRawTheme } from 'vscode-textmate' |
| 1 | +import type { |
| 2 | + IGrammar as Grammar, |
| 3 | + IRawGrammar as RawGrammar, |
| 4 | + IRawTheme as RawTheme, |
| 5 | +} from 'vscode-textmate' |
2 | 6 | import type { IRawThemeSetting } from 'vscode-textmate/release/theme'
|
3 | 7 | import type { Element, Root } from 'hast'
|
4 | 8 | import type { bundledThemes } from './themes'
|
5 | 9 | import type { bundledLanguages } from './assets/langs'
|
6 | 10 | import type { FontStyle } from './core/stackElementMetadata'
|
7 | 11 | import type { OnigurumaLoadOptions } from './oniguruma'
|
8 | 12 |
|
9 |
| -export { IRawGrammar, IGrammar, FontStyle } |
| 13 | +export { |
| 14 | + Grammar, |
| 15 | + RawGrammar, |
| 16 | + FontStyle, |
| 17 | + // TODO: move these in the next major version |
| 18 | + Grammar as IGrammar, |
| 19 | + RawGrammar as IRawGrammar, |
| 20 | +} |
10 | 21 |
|
11 | 22 | export type BuiltinLanguage = keyof typeof bundledLanguages
|
12 | 23 | export type BuiltinTheme = keyof typeof bundledThemes
|
@@ -42,7 +53,7 @@ export interface ShikiContext {
|
42 | 53 | }
|
43 | 54 |
|
44 | 55 | getTheme(name: string | ThemeRegistration | ThemeRegistrationRaw): ThemeRegistration
|
45 |
| - getLangGrammar(name: string): IGrammar |
| 56 | + getLangGrammar(name: string): Grammar |
46 | 57 |
|
47 | 58 | getLoadedThemes(): string[]
|
48 | 59 | getLoadedLanguages(): string[]
|
@@ -155,7 +166,7 @@ export interface BundledHighlighterOptions<L extends string, T extends string> {
|
155 | 166 | langAlias?: Record<string, StringLiteralUnion<L>>
|
156 | 167 | }
|
157 | 168 |
|
158 |
| -export interface LanguageRegistration extends IRawGrammar { |
| 169 | +export interface LanguageRegistration extends RawGrammar { |
159 | 170 | name: string
|
160 | 171 | scopeName: string
|
161 | 172 | displayName?: string
|
@@ -290,9 +301,7 @@ export type CodeToHastOptions<Languages extends string = string, Themes extends
|
290 | 301 | & CodeOptionsThemes<Themes>
|
291 | 302 | & CodeOptionsMeta
|
292 | 303 |
|
293 |
| -export interface ThemeRegistrationRaw extends IRawTheme { |
294 |
| - |
295 |
| -} |
| 304 | +export interface ThemeRegistrationRaw extends RawTheme {} |
296 | 305 |
|
297 | 306 | export interface ThemeRegistration extends ThemeRegistrationRaw {
|
298 | 307 | /**
|
|
0 commit comments