export interface FolderHooks {
    version: string;
    beforeAll?: TestStep[];
    afterAll?: TestStep[];
    beforeEach?: TestStep[];
    afterEach?: TestStep[];
}
export interface TestFile {
    version: string;
    name: string;
    description?: string;
    variables?: Record<string, VariableDefinition>;
    beforeAll?: TestStep[];
    afterAll?: TestStep[];
    beforeEach?: TestStep[];
    afterEach?: TestStep[];
    procedures?: Record<string, ProcedureDefinition>;
    tests: TestCase[];
    metadata?: Record<string, unknown>;
}
export interface VariableDefinition {
    type: 'string' | 'number' | 'boolean' | 'object' | 'array';
    default?: unknown;
    description?: string;
}
export interface ProcedureDefinition {
    name: string;
    description?: string;
    params?: ProcedureParam[];
    returnType?: string;
    steps: TestStep[];
}
export interface ProcedureParam {
    name: string;
    type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'any';
    default?: unknown;
    description?: string;
}
export interface TestCase {
    id: string;
    name: string;
    description?: string;
    data?: TestDataSet[];
    dataFile?: string;
    beforeEach?: TestStep[];
    afterEach?: TestStep[];
    steps: TestStep[];
    tags?: string[];
    softAssertions?: boolean;
}
export interface TestDataSet {
    name?: string;
    values: Record<string, unknown>;
}
export interface TestStep {
    id: string;
    type: string;
    params: Record<string, unknown>;
    children?: TestStep[];
}
export interface BlockDefinition {
    type: string;
    category: string;
    color: string;
    tooltip?: string;
    helpUrl?: string;
    inputs: BlockInput[];
    output?: BlockOutput;
    previousStatement?: boolean;
    nextStatement?: boolean;
    execute: (params: Record<string, unknown>, context: ExecutionContext) => Promise<unknown>;
}
export interface BlockInput {
    name: string;
    type: 'value' | 'statement' | 'field';
    fieldType?: 'text' | 'number' | 'dropdown' | 'checkbox' | 'variable' | 'multiline';
    options?: Array<[string, string]>;
    check?: string | string[];
    default?: unknown;
    required?: boolean;
}
export interface BlockOutput {
    type: string | string[];
}
export interface SoftAssertionError {
    message: string;
    stepId?: string;
    stepType?: string;
    expected?: unknown;
    actual?: unknown;
    timestamp: string;
}
export interface ExecutionContext {
    variables: Map<string, unknown>;
    results: TestResult[];
    browser?: unknown;
    page?: unknown;
    apiClient?: unknown;
    logger: Logger;
    plugins: Map<string, Plugin>;
    abortSignal?: AbortSignal;
    procedures?: Map<string, ProcedureDefinition>;
    currentData?: TestDataSet;
    dataIndex?: number;
    testIdAttribute?: string;
    softAssertions?: boolean;
    softAssertionErrors?: SoftAssertionError[];
}
export interface Logger {
    info(message: string, data?: unknown): void;
    warn(message: string, data?: unknown): void;
    error(message: string, data?: unknown): void;
    debug(message: string, data?: unknown): void;
}
export interface TestResult {
    testId: string;
    testName: string;
    status: 'passed' | 'failed' | 'skipped' | 'error';
    duration: number;
    steps: StepResult[];
    error?: ErrorInfo;
    startedAt: string;
    finishedAt: string;
    dataIteration?: {
        index: number;
        name?: string;
        data: Record<string, unknown>;
    };
    isLifecycle?: boolean;
    lifecycleType?: 'beforeAll' | 'afterAll' | 'beforeEach' | 'afterEach';
    softAssertionErrors?: SoftAssertionError[];
}
export interface StepResult {
    stepId: string;
    stepType: string;
    status: 'passed' | 'failed' | 'skipped' | 'error';
    duration: number;
    output?: unknown;
    error?: ErrorInfo;
    screenshot?: string;
}
export interface ErrorInfo {
    message: string;
    stack?: string;
    code?: string;
}
export interface Plugin {
    name: string;
    version: string;
    description?: string;
    blocks: BlockDefinition[];
    hooks?: PluginHooks;
}
export interface PluginHooks {
    beforeAll?: (context: ExecutionContext) => Promise<void>;
    afterAll?: (context: ExecutionContext) => Promise<void>;
    beforeTest?: (context: ExecutionContext, test: TestCase) => Promise<void>;
    afterTest?: (context: ExecutionContext, test: TestCase, result: TestResult) => Promise<void>;
    beforeStep?: (context: ExecutionContext, step: TestStep) => Promise<void>;
    afterStep?: (context: ExecutionContext, step: TestStep, result: StepResult) => Promise<void>;
}
export interface CLIConfig {
    testFiles: string[];
    outputDir?: string;
    reporter?: 'console' | 'json' | 'junit' | 'html';
    parallel?: number;
    timeout?: number;
    headless?: boolean;
    baseUrl?: string;
    variables?: Record<string, unknown>;
    plugins?: string[];
}
