doGet/doPost 触发器函数事件对象是否有类型定义?

Dus*_*els 3 triggers web-applications google-apps-script typescript clasp

我正在尝试使用 CLASP将 Google Script 转换为Web App

doGet(e)/doPost(e)中的“e”对象是否有现有的类型定义,我可以在打字稿 /clasp 方面使用它?

The*_*ter 7

更新:

最新定义包括events. 你可以使用这样的事件:

function doGet(e: GoogleAppsScript.Events.DoGet){
Run Code Online (Sandbox Code Playgroud)

Events似乎正在进行中。它还没有 webapps doget 事件。同时,您可以安装最新的类型(@types/google-apps-script@latest)并在 google-apps-script-events.d.ts 的 Events 模块中添加以下接口

  export interface WebAppsDoGet { //should be inside module Events
    queryString: string,
    parameter: {[key: string]: string; },
    contextPath: string,
    parameters: {
     [key: string]: string[]; },
    contentLength: number
  }
Run Code Online (Sandbox Code Playgroud)

然后你可以像这样使用它:

function doGet(e: GoogleAppsScript.Events.WebAppsDoGet){
Run Code Online (Sandbox Code Playgroud)