Skip to content

Commit

Permalink
fix(plugin-sfc): expose MarkdownSfcBlocks type
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Jul 26, 2022
1 parent e507e55 commit c2a91de
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/plugin-sfc/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ export interface SfcBlock {
tagClose: string;
}

export interface MarkdownSfcBlocks {
template: SfcBlock | null;
script: SfcBlock | null;
scriptSetup: SfcBlock | null;
styles: SfcBlock[];
customBlocks: SfcBlock[];
}

declare module '@mdit-vue/types' {
interface MarkdownItEnv {
/**
* SFC blocks that extracted by `@mdit-vue/plugin-sfc`
*/
sfcBlocks?: {
template: SfcBlock | null;
script: SfcBlock | null;
scriptSetup: SfcBlock | null;
styles: SfcBlock[];
customBlocks: SfcBlock[];
};
sfcBlocks?: MarkdownSfcBlocks;
}
}

0 comments on commit c2a91de

Please sign in to comment.