```ts
/**
 * Calculates the cost of a single line based on its unit price and quantity.
 * @param price - The unit price of the item.
 * @param quantity - The quantity of the item.
 * @returns The total cost for the line.
 */
export function lineCost(price: number, quantity: number): number {
  if (isNaN(price) || isNaN(quantity)) {
    throw new Error('Price and quantity must be numbers.');
  }
  return price * quantity;
}

/**
 * Calculates the total cost of a basket after applying a whole-percent discount.
 * @param lines - An array of line items, each with a price and quantity.
 * @param discount - The whole-percent discount to apply (0-100).
 * @returns The total cost of the basket after the discount.
 */
export function basketCost(lines: { price: number; quantity: number }[], discount: number): number {
  if (!Array.isArray(lines) || lines.some(line => typeof line.price !== 'number' || typeof line.quantity !== 'number')) {
    throw new Error('Lines must be an array of objects with numeric price and quantity.');
  }
  if (isNaN(discount) || discount < 0 || discount > 100) {
    throw new Error('Discount must be a whole number between 0 and 100.');
  }

  const totalCost = lines.reduce((acc, line) => acc + lineCost(line.price, line.quantity), 0);
  const discountedCost = totalCost * (1 - discount / 100);
  return Math.floor(discountedCost);
}
```