diff --git a/src/components/Highlighter/index.tsx b/src/components/Highlighter/index.tsx index 1abb516..f44a7f3 100644 --- a/src/components/Highlighter/index.tsx +++ b/src/components/Highlighter/index.tsx @@ -11,6 +11,11 @@ import { LanguageKeys } from './language'; import { useStyles } from './style'; export { Prism } from './Prism'; +export interface HighlighterSyntaxTheme { + shiki?: Partial; + prism?: Partial; +} + export interface HighlighterProps { children: string; language: LanguageKeys | string; @@ -31,10 +36,7 @@ export interface HighlighterProps { */ trim?: string; style?: CSSProperties; - syntaxThemes?: { - shiki?: Partial; - prism?: Partial; - }; + syntaxThemes?: HighlighterSyntaxTheme; /** * 是否可拷贝 */ diff --git a/src/types.ts b/src/types.ts index c2ddeb6..246ea69 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,7 @@ import type { CSSProperties } from 'react'; +export type { HighlighterSyntaxTheme } from './components/Highlighter'; + export type ImageContainerType = 'light' | 'primary' | 'soon'; export interface IFeature {