forked from 77media/video-flow
31 lines
503 B
TypeScript
31 lines
503 B
TypeScript
|
|
import { ScriptEditKey } from "../usecase/ScriptEditUseCase";
|
|
/**
|
|
* 渲染数据转换器
|
|
* @param key
|
|
* @param headerName
|
|
* @param scriptText
|
|
* @returns
|
|
*/
|
|
export function parseScriptBlock(
|
|
key: ScriptEditKey,
|
|
headerName: string,
|
|
scriptText: string,
|
|
contentType?: 'paragraph' | 'bold' | 'italic' | 'heading' | 'tag',
|
|
) {
|
|
return {
|
|
id: key,
|
|
title: headerName,
|
|
content: [
|
|
{
|
|
type: contentType || "paragraph",
|
|
text: scriptText,
|
|
},
|
|
],
|
|
};
|
|
}
|
|
|
|
|
|
|
|
|