import { OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { NotifyService } from '@farris/ui-notify'; import { BsModalRef } from '@farris/ui-modal'; import { LoadingService } from '@farris/ui-loading'; import { MessagerService } from '@farris/ui-messager'; import { GridEditorComponent } from '../grid-editor/grid-editor.component'; import { ResourceService } from './resource.service'; import { TemplateLog, CellValue, ResourceData } from '../template-editor.interface'; import { GlobalVariableService } from '../global-variable'; /** * 当前类型下各个模板的编辑值记忆 * @description * 其中id为模板标识 */ interface CurValueMap { [id: string]: { value: CellValue; trusted: boolean; }; } export declare class TemplateEditorComponent implements OnInit { private notifyService; private resourceService; private loadingService; private messagerService; globalService: GlobalVariableService; _previewMode: boolean; _customMode: boolean; customCode: string; codeEditorOptions: any; _codeEditorOptions: { theme: string; language: string; formatOnType: boolean; foldingStrategy: string; folding: boolean; showFoldingControls: string; automaticLayout: boolean; }; previewMode: boolean; customMode: boolean; private updateCodeEditorOptions; gridEditor: GridEditorComponent; templateClass: string; templateClassError: boolean; _dialogRef: BsModalRef; templateLog: TemplateLog; saveCallback: (log: TemplateLog) => Observable; resourceData: ResourceData; TEMPLATE_DESC_INDEX: any; templateDesc: any; template: string; initValue: CellValue; templatePreviewImageUrl: string; previewImageError: boolean; previewMaximum: boolean; navData: any[]; activeNavId: string; initialNavId: string; curValueMap: CurValueMap; initValueTrusted: boolean; modalFooter: any; dialogRef: any; constructor(notifyService: NotifyService, resourceService: ResourceService, loadingService: LoadingService, messagerService: MessagerService, globalService: GlobalVariableService); ngOnInit(): void; private setNavData; handleNavChange(item: any): void; /** * 阻止图片拖拽事件 */ imageDragstart(): boolean; /** * 代码编辑器初始化回调 */ onMonacoInit(): void; /** * 关闭模板编辑器 */ close(): void; /** * 完成编辑 * @description * 执行生成逻辑并调用保存回调函数 */ save(): void; /** * 进行模式切换 * @description * 可视化模式 <-> 自定义模式 */ switchMode(): void; /** * 切换到可视化模式 */ private switchToEasyMode; /** * 切换到自定义模式 */ private switchToCustomMode; /** * 处理预览按钮点击事件 * @description * 进入或退出预览模式 */ handlePreviewClick(): void; } export {};