```ts
/**
 * A heading dressed for print.
 */
export function titleLine(text: string, quiet: string[]): string {
  if (typeof text !== "string" || text.trim() === "") {
    throw new Error("Invalid heading");
  }
  if (!Array.isArray(quiet)) {
    throw new Error("Quiet list must be an array");
  }
  const tokens = text.split(" ");
  if (tokens.some((token) => token === "" || /[^a-zA-Z0-9'-]/.test(token))) {
    throw new Error("Invalid token in heading");
  }
  if (tokens[0] === "" || tokens[tokens.length - 1] === "") {
    throw new Error("Heading cannot start or end with a space");
  }
  const isQuiet = (token: string) =>
    quiet.some((q) => q === token.toLowerCase());

  return tokens
    .map((token, index) => {
      if (
        /^[A-Z]+$/g.test(token) &&
        token.length > 1 &&
        !isQuiet(token.toLowerCase())
      ) {
        return token;
      }
      if (index !== 0 && index !== tokens.length - 1 && isQuiet(token)) {
        return token.toLowerCase();
      }
      return token
        .split(/(['-])/)
        .map((piece, i, pieces) =>
          i === 0 || i === pieces.length - 1
            ? piece.toLowerCase()
            : piece[0].toUpperCase() + piece.slice(1).toLowerCase(),
        )
        .join("");
    })
    .join(" ");
}
```