In the previous project, an iframe
was used for development. The top-level window contains several private attributes, and other pages interact through it. I now need to enhance the type of top in the iframe page using TypeScript. How should I modify the code below to prevent errors?
interface TopWindow extends Window {
createMP: (key?: string) => CustomPlayer;
}
declare var top: TopWindow | null;
The existing code is triggering a ts(2403) error.