```typescript
export function slotHits(keys: number[], slots: number): number {
  if (!Array.isArray(keys) || !Number.isInteger(slots)) {
    throw new Error("Invalid input");
  }
  if (slots <= 0) {
    throw new Error("Slot count must be a positive integer");
  }

  const hitCount = keys.reduce((count, key) => {
    if (!Number.isInteger(key)) {
      throw new Error("Key must be an integer");
    }

    const slot = Math.abs(key % slots);
    if (slot === 0 && key < 0) {
      // Special case for negative numbers: -1 mod n is n-1
      return count + 1;
    } else if (key === 0) {
      // Positive zero behaves like positive number zero
      return count + 1;
    }

    const currentSlotValue = key % slots;
    if (currentSlotValue === slot) {
      return count + 1;
    }

    return count;
  }, 0);

  return hitCount;
}
```