user_email to userEmail causes dozens of runtime errors deep in your test runs. In TypeScript, your editor catches this instantly before you even trigger a browser session.---
export interface UserCredentials {
readonly email: string;
readonly passwordHash: string;
readonly role: "ADMIN" | "QA" | "VIEWER";
readonly rememberMe?: boolean;
}export interface ApiResponse<T> {
status: number;
message: string;
data: T;
}
---
export const TIMEOUTS = {
SHORT: 5_000,
MEDIUM: 15_000,
LONG: 30_000,
} as const;export interface EnvironmentConfig {
baseUrl: string;
apiUrl: string;
defaultTimeout: number;
}
export const ENV_CONFIG: Record<string, EnvironmentConfig> = {
staging: {
baseUrl: "https://staging.targetqa.com",
apiUrl: "https://api.staging.targetqa.com",
defaultTimeout: TIMEOUTS.MEDIUM,
},
production: {
baseUrl: "https://targetqa.com",
apiUrl: "https://api.targetqa.com",
defaultTimeout: TIMEOUTS.LONG,
},
};
---
export class StringFormatter {
public static extractOrderId(text: string): string {
const match = text.match(/Order #(\d+)/);
if (!match) throw new Error(Failed to parse Order ID from text: ${text});
return match[1];
}
}