import{ax as i,z as a,A as l,b5 as e}from"./chunks/framework.V2ssSR2R.js";const g=JSON.parse('{"title":"codeBlockService方法","description":"","frontmatter":{},"headers":[],"relativePath":"api/editor/codeBlockServiceMethods.md","filePath":"api/editor/codeBlockServiceMethods.md"}'),n={name:"api/editor/codeBlockServiceMethods.md"};function t(h,s,p,k,d,r){return l(),a("div",null,[...s[0]||(s[0]=[e(`

codeBlockService方法

写入历史栈的方法(setCodeDslByIdsetCodeDslByIdSyncdeleteCodeDslByIds 等)的 options 支持 historyDescription / historySource,会透传到 historyService.pushCodeBlockhistoryDescription / source 字段。

setCodeDsl

getCodeDsl

getCodeContentById

setCodeDslById

setCodeDslByIdSync

getCodeDslByIds

getEditStatus

setEditStatus

setCombineIds

getCombineIds

getUndeletableList

setUndeleteableList

setCodeDraft

getCodeDraft

removeCodeDraft

deleteCodeDslByIds

undo

js
import { codeBlockService } from "@tmagic/editor";

if (codeBlockService.canUndo("code_1234")) {
  await codeBlockService.undo("code_1234");
}

redo

canUndo

canRedo

setParamsColConfig

getParamsColConfig

getUniqueId

copyWithRelated

paste

resetState

destroy

usePlugin

每个支持扩展的方法都支持定制before、after两个hook来干预原有方法的行为,before可以用于修改传入参数,after可以用于修改返回的值

removeAllPlugins

删掉当前设置的所有扩展

`,63)])])}const c=i(n,[["render",t]]);export{g as __pageData,c as default};