```ts
/**
 * Finds the k-th smallest distinct value in a list of integers.
 * @param values - An array of integers.
 * @param k - A positive integer representing the rank.
 * @returns The k-th smallest distinct value.
 * @throws Error if the input is invalid.
 */
export function kthDistinct(values: number[], k: number): number {
  if (!Array.isArray(values) || !values.every(Number.isInteger)) {
    throw new Error("Input list must contain only integers.");
  }
  if (k <= 0 || !Number.isInteger(k)) {
    throw new Error("Rank must be a positive integer.");
  }
  if (values.length === 0) {
    throw new Error("Input list cannot be empty.");
  }

  const distinctValues = Array.from(new Set(values)).sort((a, b) => a - b);
  if (k > distinctValues.length) {
    throw new Error("Rank exceeds the number of distinct values.");
  }

  return distinctValues[k - 1];
}
```