import { ToolbarButtonConfig } from '../toolbar'
import { GridRenderParams } from './renderer'

declare function commandsFunc(params: CommandsParams, ...args: any[]): any;

/**
 * 全局指令
 */
export class VhbGlobalCommands {
  mixin(map: { [type: string]: typeof commandsFunc }): VhbGlobalCommands;
  get(type: string): typeof commandsFunc;
  add(type: string, callback: typeof commandsFunc): VhbGlobalCommands;
  delete(type: string): VhbGlobalCommands;
}

export interface CommandsParams extends GridRenderParams {
  code: string;
  button?: ToolbarButtonConfig;
}
