Files
esengine/packages/editor-core/src/Services/ICompiler.ts
yhh ad96edfad0 fix: 恢复 @esengine/ecs-framework 包名
上一个提交错误地将 npm 包名也改了,这里恢复正确的包名。
只更新 GitHub 仓库 URL,不改变 npm 包名。
2025-12-08 21:26:35 +08:00

34 lines
971 B
TypeScript

export interface CompileResult {
success: boolean;
message: string;
outputFiles?: string[];
errors?: string[];
}
import type { IFileSystem } from './IFileSystem';
import type { IDialog } from './IDialog';
import type { IService, ServiceType } from '@esengine/ecs-framework';
export interface CompilerModuleContext {
fileSystem: IFileSystem;
dialog: IDialog;
}
export interface CompilerContext {
projectPath: string | null;
moduleContext: CompilerModuleContext;
getService<T extends IService>(serviceClass: ServiceType<T>): T | undefined;
}
export interface ICompiler<TOptions = unknown> {
readonly id: string;
readonly name: string;
readonly description: string;
compile(options: TOptions, context: CompilerContext): Promise<CompileResult>;
createConfigUI?(onOptionsChange: (options: TOptions) => void, context: CompilerContext): React.ReactElement;
validateOptions?(options: TOptions): string | null;
}