// Sample TypeScript module — samplefiles.com export interface Customer { readonly id: number; name: string; balance: number; tags?: string[]; } export const isVip = (c: Customer): boolean => c.balance >= 10_000; export function totalBalance(customers: readonly Customer[]): number { return customers.reduce((sum, c) => sum + c.balance, 0); } const customers: Customer[] = [ { id: 1, name: 'Ada', balance: 12_500 }, { id: 2, name: 'Grace', balance: 830.5, tags: ['new'] }, { id: 3, name: 'Linus', balance: 10_000 }, ]; for (const c of customers) { console.log(`${c.name.padEnd(6)} ${c.balance.toFixed(2).padStart(10)} ${isVip(c) ? 'VIP' : ''}`); } console.log(`Total: ${totalBalance(customers).toFixed(2)}`);