title: How type URLSearchParams in typescript to receive an object?
body: <p>I have a function that receive via param an object and this object goes inside the URLSearchParams, after this, I make a toString() and get the answer below:</p>
  <pre><code>const object = {
      name: 'Test',
      age: 20
  };
  
  function exampleFunction(objectExample) {
  
     const url = new URLSearchParams(objectExample);
     return url.toString();
  };
  
  console.log(exampleFunction(object));
  // result: name=Test&amp;age=20
  </code></pre>
  <p>The answer result is what i expected, the problem is when I tried to type this param creating an interface, like:</p>
  <pre><code>interface ObjectTest { name: string, age: number }
  
   function exampleFunction(objectExample: ObjectTest) {
      
         const url = new URLSearchParams(objectExample: ObjectTest) &lt;&lt; /* error, URLSearchParams expect a type Record&lt;string, string&gt; */;
         return url.toString();
      };
  </code></pre>
  <p>Whitout typing, the code works fine,my question is: how can I type this params to receive an object if my URLSearchParams expect other thing?
  I already try pass an object stringfy (like JSON.stringfy(object), but the result is something like // %7B%22ma,e%22%3A%22Test%22%2C%22age%age%22#A@)%70= instead of name=Test&amp;age=20 )</p>