title: ExcelJs adding common style function with typescript
body: <p>I am trying to add a function that would apply styles dynamically to rows.</p>
  <pre><code>  import ExcelJS, { Row, Column, Style }  from 'exceljs';
      const addCommonStyles = (row: Row , applyRowStyles: string[]) =&gt; {
          const styles: Style = {
              font: { name: 'Calibri', family: 4, size: 14, bold: true, color: excelExportStyles.BLACK_COLOR },
              fill: { type: 'pattern', pattern: 'solid', fgColor: { argb: `FF${excelExportStyles.WHITE_COLOR}` } },
              border: { left: { style: 'thick', color: excelExportStyles.BLACK_COLOR } },
              alignment: {},
              protection: {},
              numFmt:'',
          }
          Object.keys(styles).forEach((style)=&gt;{
          if(applyRowStyles.includes(style)){
              row[style as keyof Style] = styles[ style as keyof Style ] as any;
          }
      });
        return row;
      }
  </code></pre>
  <p>Usage:</p>
  <pre><code>addCommonStyles(row, ['font','border']);
  </code></pre>
  <p>While this works, I want to avoid using type <code>any</code>.</p>
  <p>I am a bit new to Typescript and unable to wrap my head around how I can get this working without adding <code>any</code></p>