A typescript plugin to enable typescript autocompletion and typechecking for tgas-local.
npm install typescript-plugin-tgas-localpnpm install -D typescript-plugin-tgas-local @types/google-apps-script typescript
json
{
// ...rest of your compilerOptions
"plugins": [
{
"name": "typescript-plugin-tgas-local",
"apps-script-directory": "./RELATIVE_PATH_TO_YOUR_GAS_FILES"
}
]
}
`
How it works
Essentially, the plugin searches your files for the gasRequire() function from tgas-local package. Once it finds that, it generates a type file (.d.ts) based on the top level declarations inside of your GAS files. It then applies those types as the return object of gasRequire()`