Skip to content

HoldYourWaffle/office-scripts-typings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

office-scripts-typings

npm version license

TypeScript type definitions for Office Scripts.

Generator

The Office Scripts runtime environment is a little odd, so we need to generate some type definitions. You need two sets of typings:

  1. excel.d.ts, which contains the types for the Office Scripts API. Unfortunately this file is not conveniently available.
  2. misc.d.ts, which contains some miscellaneous type definitions that are missing from the standard ES lib files, such as console.log.

The office-scripts-typings script will take care of this for you. Run the following command:

npx office-scripts-typings generate [output]

The generated type definitions will be put in the output directory. The default value is @types/office-scripts. Make sure output is listed in your tsconfig's typeRoots so the compiler sees them.