Creates a new type by excluding specific properties from an existing type.
type OmittedType = Omit<OriginalType, 'key1' | 'key2'>;
id and timestamps when creating new records.interface User {
id: number;
name: string;
email: string;
password: string;
createdAt: Date;
updatedAt: Date;
}
*// For creating new users - no id or timestamps*
type CreateUserRequest = Omit<User, 'id' | 'createdAt' | 'updatedAt'>;
*// For public display - no password*
type PublicUser = Omit<User, 'password'>;
const newUser: CreateUserRequest = {
name: "Alice",
email: "alice@example.com",
password: "secret123"
*// id, createdAt, updatedAt not allowed*
};