import { DSLQuery } from '@lingxiteam/dsl'; import { DSLNode } from '@lingxiteam/dsl/lib/core/PropType'; export declare type CanvasMode = 'normal' | 'disabled' | 'flexible'; export interface isAllowDragParam { nodeId?: string; dslNode?: DSLNode; } declare type RangeType = 'onlySelf' | 'includeChild'; declare type Type = 'CompName' | 'NodeId'; export interface DataType { value: string; type: Type; rangeType: RangeType; } /** * operate 操作类型 * compType 控件类型 * compValue 控件值 */ export interface CanvasDragConfig extends DataType { operateType: 'onlyCanDrag' | 'onlyCanDrop' | 'notAllowDrag' | 'notAllowDrop'; } declare class CanvasDragMode { private canvasMode; private onlyCanDrag; private onlyCanDrop; private notAllowDrag; private notAllowDrop; DSLCore: DSLQuery; constructor({ DSLCore, canvasDragConfig }: { DSLCore: DSLQuery; canvasDragConfig: CanvasDragConfig[]; }); private addToList; /** * 移除配置 * @param id keys * @param listKeyName */ private removeFromList; private getOnlySelfCompsAndIds; private getIncludeChildrenList; private getNodeParentCompName; /** * 通用查找逻辑 * @param list 规则list * @param dslNode 当前匹配列表 * @returns */ private includeDataTypes; private commonJudge; isAllowDrag(nodeId: string | undefined): boolean; isAllowComputed(nodeId: string | undefined): boolean; changeMode(mode: CanvasMode): this; addOnlyCanDrag(type: Type, keys: string | string[], rangeType?: RangeType): this; addOnlyCanDrop(type: Type, keys: string | string[], rangeType?: RangeType): this; addNotAllowDrag(type: Type, keys: string | string[], rangeType?: RangeType): this; addNotAllowDrop(type: Type, keys: string | string[], rangeType?: RangeType): this; removeOnlyCanDrag(keys: string | string[]): this; removeOnlyCanDrop(keys: string | string[]): this; removeNotAllowDrag(keys: string | string[]): this; removeNotAllowDrop(keys: string | string[]): this; removeDropConfig(keys: string | string[]): this; removeDragConfig(keys: string | string[]): this; cleanDragConfig(): this; cleanDropConfig(): this; cleanConfig(): this; } export default CanvasDragMode;