```typescript
export function applyCharges(caps: Record<string, [number, number]>, charges: [string, string, number][]): { left: Record<string, number>; refused: [string, string][] } {
  const left: Record<string, number> = {};
  const refused: [string, string][] = [];

  charges.forEach(([id, bucketName, amount]) => {
    if (amount <= 0) {
      throw new Error("Charge amount must be a positive whole number");
    }

    const [allowance, singleCharge] = caps[bucketName] || [0, 0];
    let reason: string | null = null;

    if (!caps[bucketName]) {
      reason = "unknown";
    } else if (amount > singleCharge) {
      reason = "single";
    } else if (amount > allowance) {
      reason = "cap";
    }

    if (reason) {
      refused.push([id, reason]);
      return;
    }

    left[bucketName] = allowance - amount;
  });

  return { left, refused };
}
```