28 lines
523 B
TypeScript

import { ScriptBlock, ScriptData } from "@/components/script-renderer/types";
import { ScriptEditKey } from "../usecase/ScriptEditUseCase";
/**
* 渲染数据转换器
* @param key
* @param headerName
* @param scriptText
* @returns
*/
export function parseScriptBlock(
key: ScriptEditKey,
headerName: string,
scriptText: string
): ScriptBlock {
return {
id: key,
title: headerName,
type: "core",
content: [
{
type: "paragraph",
text: scriptText,
},
],
};
}