import React from "react"; import type { TransformProperty } from "../../component-parser"; import { InputControlProps } from "../../type"; import "./function-editor.scss"; interface FunctionMeta { name: string; parameters: { name: string; }[]; } interface Props extends InputControlProps { /** 脚本文件路径(相对于 page-scripts 目录),缺省按当前页面名推导:${pageName}.ts */ scriptPath?: string; } interface State { functions: FunctionMeta[]; scriptPath: string | null; loading: boolean; error?: string; dialogVisible: boolean; editingText: string; originalText: string; loadedName: string | null; saving: boolean; executeArgs: string; output: string; executing: boolean; } export declare class FunctionEditor extends React.Component { constructor(props: Props); componentDidMount(): void; /** 按页面路径推导脚本文件:先试 .tsx 再试 .ts(页面脚本可能用任一种扩展名),都无内容则默认 .ts */ private resolveScriptPath; /** 解析脚本路径:显式指定优先;否则按当前页面名推导脚本文件(支持 .tsx / .ts),再加载函数列表 */ private initScriptPath; private getFunctionName; private loadFunctions; private handleSelectChange; private openDialog; private save; private handleCancel; private execute; render(): React.JSX.Element; } export default FunctionEditor;