string, number, boolean
- Special: void (functions returning nothing), any (disables type checking - avoid!), unknown (type-safe any)// Literal union type: only these 3 strings are allowed!
type BrowserName = "chromium" | "firefox" | "webkit";// Union type:
type LocatorTarget = string | number;
interface TestConfig {
baseUrl: string;
timeout?: number; // Optional property (indicated by ?)
readonly retries: number; // Cannot be reassigned after creation
}as)const responseData = (rawJson as { token: string }).token;