1

I'm developing a Google Apps Script (GAS) using Typescript (via the clasp tool).

I imported type definitions by running npm i -S @types/google-apps-script.

Some types are quite lengthy, for example:

let sheet: GoogleAppsScript.Spreadsheet.Sheet

Is there a way to define an abbreviation within a file? e.g.,

declare Sheet = GoogleAppsScript.Spreadsheet.Sheet
tehhowch
  • 9,645
  • 4
  • 24
  • 42
Dustin Michels
  • 2,951
  • 2
  • 19
  • 31
  • 1
    You don't have to annotate every variable. Types are inferred by default. If not, refer https://stackoverflow.com/questions/49015874/enabling-autocomplete-for-google-apps-script-in-locally-installed-ide – TheMaster Nov 08 '18 at 14:56

1 Answers1

8

You can define new alias type:

type Sheet = GoogleAppsScript.Spreadsheet.Sheet
SET001
  • 11,480
  • 6
  • 52
  • 76