title: Extend the window.top through ts type, improve vscode tips
body: <p>The old project is developed using <code>iframe</code>. There are many private attributes on the top-level window, and other pages communicate through top. Now I want to extend the top type in the iframe page through ts. how can I change the following code to avoid errors</p>
  <pre><code>interface TopWindow extends Window {
      createMP: (key?: string) =&gt; CustomPlayer;
  }
  
  declare var top: TopWindow | null;
  </code></pre>
  <p>The above code will cause an ts(2403) error</p>