import { ExecutionTask, DetailedLocateParam, PlanningActionParamScroll } from '@midscene_spp/core';

declare function typeStr(task: ExecutionTask): any;
declare function getKeyCommands(value: string | string[]): Array<{
    key: string;
    command?: string;
}>;
declare function locateParamStr(locate?: DetailedLocateParam): string;
declare function scrollParamStr(scrollParam?: PlanningActionParamScroll): string;
declare function taskTitleStr(type: 'Tap' | 'Hover' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Action' | 'Query' | 'Assert' | 'WaitFor' | 'Locate' | 'Boolean' | 'Number' | 'String', prompt: string): string;
declare function paramStr(task: ExecutionTask): string;
declare const limitOpenNewTabScript = "\nif (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {\n  window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__ = true;\n\n  // Intercept the window.open method (only once)\n  window.open = function(url) {\n    console.log('Blocked window.open:', url);\n    window.location.href = url;\n    return null;\n  };\n\n  // Block all a tag clicks with target=\"_blank\" (only once)\n  document.addEventListener('click', function(e) {\n    const target = e.target.closest('a');\n    if (target && target.target === '_blank') {\n      e.preventDefault();\n      console.log('Blocked new tab:', target.href);\n      window.location.href = target.href;\n      target.removeAttribute('target');\n    }\n  }, true);\n}\n";

export { getKeyCommands, limitOpenNewTabScript, locateParamStr, paramStr, scrollParamStr, taskTitleStr, typeStr };
