4646 "type" : " BundledTheme | undefined" ,
4747 "reactive" : true
4848 },
49+ {
50+ "name" : " decorates" ,
51+ "summary" : " 装饰器名称\n\n " ,
52+ "remarks" : " 该值可由\n `getDecorates`\n 获取。\n\n " ,
53+ "type" : " string[] | undefined"
54+ },
4955 {
5056 "name" : " palette" ,
5157 "summary" : " 指定当前组件采用的色盘\n\n " ,
97103 {
98104 "name" : " html" ,
99105 "summary" : " 高亮代码\n\n " ,
100- "type" : " html(code: string, lang: BundledLanguage, ln?: number, wrap?: boolean, cls?: string, style?: BaseProps['style'], theme?: BundledTheme): string" ,
106+ "type" : " html(code: string, lang: BundledLanguage, ln?: number, wrap?: boolean, cls?: string, style?: BaseProps['style'], theme?: BundledTheme, decorate?: string ): string" ,
101107 "params" : [
102108 {
103109 "name" : " code" ,
133139 "name" : " theme" ,
134140 "summary" : " 主题名称。可以为空,表示使用默认主题,默认主题会根据整个框架的主题而变化;\n\n " ,
135141 "type" : " BundledTheme | undefined"
142+ },
143+ {
144+ "name" : " decorate" ,
145+ "summary" : " 装饰器名称,仅作记录,需要后续调用 withDecorate 才能在内容上有所显示,如果要指定多个,可以使用半角逗号分隔;\n\n " ,
146+ "type" : " string | undefined"
136147 }
137148 ],
138149 "return" : {
180191 "name" : " Code.highlight" ,
181192 "summary" : " 高亮代码\n\n " ,
182193 "remarks" : " 用户需要自己在 package.json 的 dependencies 中导入\n [shiki](https://shiki.tmrs.site/) 该包才有高亮功能。\n\n " ,
183- "type" : " declare function highlight(code: string, lang?: BundledLanguage, ln?: number, wrap?: boolean, cls?: string, style?: BaseProps['style'], theme?: BundledTheme): Promise<string>" ,
194+ "type" : " declare function highlight(code: string, lang?: BundledLanguage, ln?: number, wrap?: boolean, cls?: string, style?: BaseProps['style'], theme?: BundledTheme, decorate?: string ): Promise<string>" ,
184195 "params" : [
185196 {
186197 "name" : " code" ,
216227 "name" : " theme" ,
217228 "summary" : " 主题名称。可以为空,表示使用默认主题,默认主题会根据整个框架的主题而变化;\n\n " ,
218229 "type" : " BundledTheme | undefined"
230+ },
231+ {
232+ "name" : " decorate" ,
233+ "summary" : " 装饰器名称,仅作记录,需要后续调用 withDecorate 才能在内容上有所显示,如果要指定多个,可以使用半角逗号分隔;\n\n " ,
234+ "type" : " string | undefined"
219235 }
220236 ],
221237 "return" : {
222238 "summary" : " 高亮后的 HTML 代码;\n\n " ,
223239 "type" : " Promise<string>"
224240 },
225241 "pkg" : " @cmfx/components"
242+ },
243+ {
244+ "kind" : " function" ,
245+ "name" : " Code.decorates" ,
246+ "summary" : " 获取装饰器的名称列表\n\n " ,
247+ "type" : " declare function getDecorates(): Array<string>" ,
248+ "return" : {
249+ "type" : " string[]"
250+ },
251+ "pkg" : " @cmfx/components"
252+ },
253+ {
254+ "kind" : " function" ,
255+ "name" : " Code.registerDecorate" ,
256+ "summary" : " 注册装饰器\n\n " ,
257+ "type" : " declare function registerDecorate(name: string, decorate: Decorate): void" ,
258+ "params" : [
259+ {
260+ "name" : " name" ,
261+ "summary" : " 装饰器的名称;\n\n " ,
262+ "type" : " string"
263+ },
264+ {
265+ "name" : " decorate" ,
266+ "summary" : " 装饰器的实例;\n\n " ,
267+ "type" : " Decorate"
268+ }
269+ ],
270+ "return" : {
271+ "type" : " void"
272+ },
273+ "pkg" : " @cmfx/components"
274+ },
275+ {
276+ "kind" : " function" ,
277+ "name" : " Code.withDecorate" ,
278+ "summary" : " 为 elem 及其子元素中的所有 shiki 代码块添加指定的组件\n\n " ,
279+ "remarks" : " 装饰器根据\n `highlight`\n 的 decorate 参数而定。\n 此操作会改变上下文环境,如果需要使用 Context 的相关信息,请使用 runWithOwner 创建上下文环境。\n\n " ,
280+ "type" : " declare function withDecorate(elem: HTMLElement): void" ,
281+ "params" : [
282+ {
283+ "name" : " elem" ,
284+ "type" : " HTMLElement"
285+ }
286+ ],
287+ "return" : {
288+ "type" : " void"
289+ },
290+ "pkg" : " @cmfx/components"
226291 }
227292]
0 commit comments