From a3c1ef3768783ba65a31348b3cb81dd5d9947b97 Mon Sep 17 00:00:00 2001 From: Pcrab Date: Sat, 1 Apr 2023 17:29:07 +0800 Subject: [PATCH] fix: wrong type for args and options --- lib/extend/syntax_highlight.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/extend/syntax_highlight.ts b/lib/extend/syntax_highlight.ts index a9a519396c..1ece414224 100644 --- a/lib/extend/syntax_highlight.ts +++ b/lib/extend/syntax_highlight.ts @@ -1,28 +1,26 @@ -import Hexo from '../hexo'; +import type Hexo from '../hexo'; export interface HighlightOptions { + lang: string | undefined, + caption: string | undefined, + lines_length: number, + // plulgins/filter/before_post_render/backtick_code_block - lang: string, - caption: string, - lines_length?: number, firstLineNumber?: string | number - - language_attr?: boolean; + // plugins/tag/code.ts + language_attr?: boolean | undefined; firstLine?: number; - line_number?: boolean; - line_threshold?: number; + line_number?: boolean | undefined; + line_threshold?: number | undefined; mark?: number[]; - wrap?: boolean; + wrap?: boolean | undefined; } interface HighlightExecArgs { context?: Hexo; - args?: [ - content: string, - options: HighlightOptions, - ]; + args?: [string, HighlightOptions]; } interface StoreFunction {