Intersections combine multiple object types into one value that has all properties. If A is { id: string } and B is { createdAt: number }, then A & B has both id and createdAt. Use this to enrich a base record with audit fields.
type A = { id: string };
type B = { createdAt: number; updatedAt: number };
// A & B has both id and the audit fieldsReturn a new object rather than mutating inputs so callers can reuse both.
Build a merged record with all fields from base and audit.
type Base = { id: string; name: string } and type Audit = { createdAt: number; updatedAt: number }.addAudit(base: Base, audit: Audit): Base & Audit.