Complete the code to declare a type alias in TypeScript.
type Name = [1];In TypeScript, string is a type keyword used only at compile time to describe the type of a variable.
Complete the code to define an interface in TypeScript.
interface Person { name: [1]; age: number; }The string type describes text data and exists only at compile time in TypeScript.
Fix the error in this type assertion that uses a compile-time only type.
const value = "hello" as [1];
String instead of string.Type assertions use compile-time types like string without quotes.
Fill both blanks to create a mapped type that exists only at compile time.
type Readonly[1]<[2]> = { readonly [K in keyof [2]]: [2][K] };
This mapped type creates a readonly version of a generic type T. Both Props and T are compile-time only types.
Fill all three blanks to define a conditional type that exists only at compile time.
type IsString[1]<[2]> = [2] extends string ? true : [3];
boolean instead of false in the false branch.This conditional type checks if T is string. It returns true or false, all compile-time types.