```ts
/**
 * A heading dressed for print.
 */
export function titleLine(text: string, quiet: string[]): string {
  if (typeof text !== "string" || text.trim() === "") {
    throw new Error("Heading must be a non-empty string.");
  }
  if (!Array.isArray(quiet)) {
    throw new Error("Quiet list must be an array.");
  }
  if (!quiet.every((item) => typeof item === "string" && /^[a-z0-9-']*$/.test(item))) {
    throw new Error("Quiet list must contain strings of small letters only.");
  }

  const tokens = text.split(" ");
  if (tokens.some((token) => token === "" || /^\s+|\s+$|\s{2,}/.test(token))) {
    throw new Error("Heading contains invalid spaces.");
  }
  if (!tokens.every((token) =>
    /^[A-Za-z0-9-' ]*$/.test(token) &&
    !/^[-'][A-Za-z0-9-']*$|^[A-Za-z0-9-']*$[ '-]$/.test(token)
  )) {
    throw new Error("Heading contains invalid characters or starts/ends with hyphen/apostrophe.");
  }

  return tokens
    .map((token) => {
      if (quiet.includes(token.toLowerCase()) && token.length >= 2) {
        return token.toLowerCase();
      } else if (
        !tokens[0].includes(token) &&
        !tokens[tokens.length - 1].includes(token) &&
        quiet.includes(token.toLowerCase())
      ) {
        return token.toLowerCase();
      } else {
        return token
          .split(/(['-])/)
          .map((piece, index, pieces) => {
            if (index === 0 || index === pieces.length - 1) {
              return piece.toLowerCase();
            }
            return (
              piece[0].toUpperCase() +
              piece.slice(1).toLowerCase()
            );
          })
          .join("");
      }
    })
    .join(" ");
}
```