Define the shape of objects inline or with type aliases:
// Inline
function printUser(user: { name: string; age: number }) {
console.log(user.name);
}
// Type alias
type User = {
name: string;
age: number;
};
function printUser(user: User) {
console.log(user.name);
}