Readonly<T> marks properties as non-writable at the type level. ReadonlyArray<T> marks the array as non-mutable. While the runtime objects are still plain JS, these types prevent accidental writes during development.
// Example: a readonly view of items
function snapshot(items: T[]): ReadonlyArray<Readonly<T>>;Create a readonly snapshot of products.
type Product = { id: string; name: string; price: number }.snapshot(items: Product[]): ReadonlyArray<Readonly<Product>>.