import { InjectionToken } from '@angular/core'; import { TestCaseStepConfig } from '../test-case-step.models'; /** * API-driven field configuration for the Step Details Drawer. * When type is undefined or unknown, treat as 'string' (text input / textfield). */ export interface DynamicFieldConfig { key: string; label: string; /** Rendered control: string (textfield), number, boolean, dropdown, textarea, code. When omitted, defaults to 'string'. */ type?: 'string' | 'number' | 'boolean' | 'dropdown' | 'textarea' | 'code'; section?: 'main' | 'constraints' | 'advanced'; options?: { label: string; value: unknown; }[]; placeholder?: string; required?: boolean; rows?: number; /** Optional default value when step has no value for this key. */ defaultValue?: unknown; /** Optional sub-label for toggles (e.g. "Only use elements from the attached context"). */ subLabel?: string; /** Optional tip text below the field. */ tip?: string; } /** * API variable schema (e.g. from natural_test_actions[].variables). */ export interface ApiVariableSchema { path?: string; default?: unknown; mutable?: boolean; type?: string; /** Dropdown options: array of strings (value and label) or { label, value }[]. */ options?: string[] | { label: string; value: unknown; }[]; } /** Map of variable key → API variable schema. */ export declare type ApiVariablesMap = Record; /** * Humanizes a variable key for use as label (e.g. "iFrameLocator" → "I Frame Locator"). */ export declare function humanizeVariableKey(key: string): string; /** * Maps API variables (e.g. natural_test_actions[].variables) to DynamicFieldConfig[]. * Use when the drawer is driven by API response instead of legacy step-type config. */ export declare function mapApiVariablesToDynamicFields(variables: ApiVariablesMap | null | undefined, options?: { labels?: Record; section?: DynamicFieldConfig['section']; }): DynamicFieldConfig[]; export interface StepDetailsDrawerData { step: TestCaseStepConfig; stepNumber: number | string; /** Dynamic field definitions (e.g. from API natural_test_actions.variables). When provided, drawer renders from this array only. */ dynamicFields: DynamicFieldConfig[]; /** Optional drawer title (e.g. "API Step Details"). When omitted, defaults to "Step Details". */ title?: string; /** Optional pwLocator array for "Other Locators" section. */ pwLocator?: string[]; } export declare const STEP_DETAILS_DRAWER_DATA: InjectionToken;