I am trying to turn a Google Script into a Web App, using CLASP.
Is there an existing type definition for the "e" object in doGet(e)
/ doPost(e)
that I can use in the typescript /clasp side of things?
I am trying to turn a Google Script into a Web App, using CLASP.
Is there an existing type definition for the "e" object in doGet(e)
/ doPost(e)
that I can use in the typescript /clasp side of things?
Latest definitions include events
.
You may use events like this:
function doGet(e: GoogleAppsScript.Events.DoGet){
Events
seem to be in the works. It doesn't have webapps doget event yet. In the mean time, You can install the latest type(@types/google-apps-script@latest) and add the following interface in the Events module inside google-apps-script-events.d.ts
export interface WebAppsDoGet { //should be inside module Events
queryString: string,
parameter: {[key: string]: string; },
contextPath: string,
parameters: {
[key: string]: string[]; },
contentLength: number
}
You can then use it like this:
function doGet(e: GoogleAppsScript.Events.WebAppsDoGet){
e
are documented under "Request parameters" in the link you provided. My answer in the question you linked also provides a full demo of the webapp capabilities. –
Heliotherapy © 2022 - 2024 — McMap. All rights reserved.