NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/@antv/g2/esm/interaction/grammar-interaction.d.ts

149 lines
3.1 KiB
TypeScript
Raw Normal View History

2023-09-14 14:47:11 +08:00
import { View } from '../chart';
import { ActionCallback, IAction, IInteractionContext } from '../interface';
import Interaction from './interaction';
/** 交互环节的定义 */
export interface InteractionStep {
/**
* viewchart documentwindow
*/
trigger: string;
/**
* action
* @param context -
*/
isEnable?: (context: IInteractionContext) => boolean;
/**
*
* - action:method : action
* - [action1:method1, action2:method]
* - ActionCallback: 回调函数
*/
action: string | string[] | ActionCallback;
/**
* action
*/
callback?: (context: IInteractionContext) => void;
/**
* @private
*
*/
actionObject?: ActionObject | ActionObject[];
/**
*
*/
once?: boolean;
/**
*
*/
throttle?: ThrottleOption;
/**
*
*/
debounce?: DebounceOption;
}
/**
* debounce
*/
export interface DebounceOption {
/**
*
*/
wait: number;
/**
*
*/
immediate?: boolean;
}
/**
* throttle
*/
export interface ThrottleOption {
/**
*
*/
wait: number;
/**
*
*/
leading?: boolean;
/**
*
*/
trailing?: boolean;
}
/** 缓存 action 对象,仅用于当前文件 */
interface ActionObject {
/**
* action
*/
action: IAction;
/**
* action
*/
methodName: string;
}
/** 交互的所有环节 */
export interface InteractionSteps {
/**
*
*/
showEnable?: InteractionStep[];
/**
*
*/
start?: InteractionStep[];
/**
*
*/
processing?: InteractionStep[];
/**
*
*/
end?: InteractionStep[];
/**
*
*/
rollback?: InteractionStep[];
}
/**
*
*/
export default class GrammarInteraction extends Interaction {
private steps;
/** 当前执行到的阶段 */
currentStepName: string;
/**
*
*/
context: IInteractionContext;
private callbackCaches;
private emitCaches;
constructor(view: View, steps: InteractionSteps);
/**
*
*/
init(): void;
/**
*
*/
destroy(): void;
/**
*
*/
protected initEvents(): void;
/**
*
*/
protected clearEvents(): void;
private initContext;
private isAllowStep;
private isAllowExcute;
private enterStep;
private afterExecute;
private getKey;
private getActionCallback;
private bindEvent;
private offEvent;
}
export {};