title: How to make a typescript type for an object that must have nullable property values?
body: <p><strong>Motivation:</strong>
  For debugging purposes I want to make a utility function that takes an object of possibly null values, and produces an error message if any of the values are null.</p>
  
  <p><strong>Question:</strong>
  How can I make a typescript type that accepts any object where all of the values have the possibility of being null? I'd like a type error if I accidentally give this function an object that has a value that can't be null.</p>
  
  <p><strong>What I've tried:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>interface CheckNullsDictionary {
      [id: string]: any; 
  }
  
  function anyNullErrorMessage(dict: CheckNullsDictionary): string | null {
    // Accepting an object is nice because the error message this produces will 
    // reference the keys that are null.
  }
  </code></pre>
  
  <p>This is almost what I want, but I want it to be a type error if i'm giving it an object
  with values that can't be null, because why check at all then?
  Example:</p>
  
  <pre class="lang-js prettyprint-override"><code>const name = "dustin";
  const address: string | null = lookupAddressFor(name);
  const phoneNumber: string | null = lookupPhoneNumberFor(name);
  
  // Typescript can see that these are nullable, so it should
  // allow this call.
  if (anyNullErrorMessage({address, phoneNumber}) {
  
  }
  
  // Typescript knows that it's impossible for name to be null,
  // so I want this to be a type error
  if (anyNullErrorMessage({name}) {
    //react to the error
  }
  </code></pre>