Typescriptの一般的な構文エラー


  • Property 'attachEvent' does not exist on type 'Window' 
  • (window).attachEvent("onmessage", callback);

     
  • does not exist on type of GlobalEventHandlers
  • const el: HTMLElement | null = document.querySelector('xxx');
  • Parameter 'el' implicitly has an 'any' type.
    //Parameter 'el' implicitly has an 'any' type.
    const parentKey = root.find(el => el === node).parent;
    //   :
    const parentKey = root.find((el:any) => el === node).parent;
    
    
     
  • Property 'name' has no initializer and is not definitely assigned in the constructor.
    name!:string;    //        ,     name:string