Abbreviate lengthy TypeScript Types

353 views Asked by At

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
1

There are 1 answers

0
SET001 On BEST ANSWER

You can define new alias type:

type Sheet = GoogleAppsScript.Spreadsheet.Sheet