diff --git a/types/google-apps-script/google-apps-script.card-service.d.ts b/types/google-apps-script/google-apps-script.card-service.d.ts index 00d13ae366f13a..d68bea53ef0e72 100644 --- a/types/google-apps-script/google-apps-script.card-service.d.ts +++ b/types/google-apps-script/google-apps-script.card-service.d.ts @@ -831,13 +831,19 @@ declare namespace GoogleAppsScript { /** * An enum that specifies the style for TextButton. * - * TEXT is the default; it renders a simple text button with clear background. + * OUTLINED is the default; it renders a simple text button with clear background. * FILLED buttons have a background color you can set with * TextButton.setBackgroundColor(backgroundColor). + * + * To call an enum, you call its parent class, name, and property. + * For example, CardService.TextButtonStyle.OUTLINED. */ enum TextButtonStyle { - TEXT, + OUTLINED, + /** @deprecated DO NOT USE */ TEXT, FILLED, + FILLED_TONAL, + BORDERLESS, } /** * A input field widget that accepts text input. diff --git a/types/google-apps-script/google-apps-script.gmail.d.ts b/types/google-apps-script/google-apps-script.gmail.d.ts index 05b881825a73e5..f26515ece17bf8 100644 --- a/types/google-apps-script/google-apps-script.gmail.d.ts +++ b/types/google-apps-script/google-apps-script.gmail.d.ts @@ -183,6 +183,15 @@ declare namespace GoogleAppsScript { */ replyTo?: string | undefined; } + /** + * Options for a Gmail draft reply. + */ + interface GmailReplyOptions extends GmailAdvancedOptions { + /** + * The subject line for the reply draft (up to 250 characters). + */ + subject?: string | undefined; + } /** alias to GmailAdvancedOptions */ type GmailDraftOptions = GmailAdvancedOptions; /** @@ -220,9 +229,9 @@ declare namespace GoogleAppsScript { */ interface GmailMessage { createDraftReply(body: string): GmailDraft; - createDraftReply(body: string, options: GmailAdvancedOptions): GmailDraft; + createDraftReply(body: string, options: GmailReplyOptions): GmailDraft; createDraftReplyAll(body: string): GmailDraft; - createDraftReplyAll(body: string, options: GmailAdvancedOptions): GmailDraft; + createDraftReplyAll(body: string, options: GmailReplyOptions): GmailDraft; forward(recipient: string): GmailMessage; forward(recipient: string, options: GmailAdvancedOptions): GmailMessage; getAttachments(): GmailAttachment[]; @@ -264,9 +273,9 @@ declare namespace GoogleAppsScript { interface GmailThread { addLabel(label: GmailLabel): GmailThread; createDraftReply(body: string): GmailDraft; - createDraftReply(body: string, options: GmailAdvancedOptions): GmailDraft; + createDraftReply(body: string, options: GmailReplyOptions): GmailDraft; createDraftReplyAll(body: string): GmailDraft; - createDraftReplyAll(body: string, options: GmailAdvancedOptions): GmailDraft; + createDraftReplyAll(body: string, options: GmailReplyOptions): GmailDraft; getFirstMessageSubject(): string; getId(): string; getLabels(): GmailLabel[]; diff --git a/types/google-apps-script/test/google-apps-script-tests.ts b/types/google-apps-script/test/google-apps-script-tests.ts index 49f146bad30d35..bcd1d38e7c76e4 100644 --- a/types/google-apps-script/test/google-apps-script-tests.ts +++ b/types/google-apps-script/test/google-apps-script-tests.ts @@ -599,6 +599,11 @@ CardService.newAction().setInteraction(CardService.Interaction.OPEN_DIALOG); // CardService.newTextButton().setAltText("alt text"); // $ExpectType TextButton +CardService.newTextButton().setTextButtonStyle(CardService.TextButtonStyle.OUTLINED); // $ExpectType TextButton +CardService.newTextButton().setTextButtonStyle(CardService.TextButtonStyle.FILLED); // $ExpectType TextButton +CardService.newTextButton().setTextButtonStyle(CardService.TextButtonStyle.FILLED_TONAL); // $ExpectType TextButton +CardService.newTextButton().setTextButtonStyle(CardService.TextButtonStyle.BORDERLESS); // $ExpectType TextButton + CardService.newLinkPreview().setTitle("Smart chip title"); // $ExpectType LinkPreview CardService.newDecoratedText(); // $ExpectType DecoratedText @@ -1536,3 +1541,50 @@ function optionalFields() { console.log("Found an element"); } } + +// GmailMessage.createDraftReply and createDraftReplyAll with subject option +function testGmailDraftReplyWithSubject() { + const message = GmailApp.getMessageById("message-id"); + const thread = GmailApp.getThreadById("thread-id"); + + // Test GmailMessage.createDraftReply with subject option + message.createDraftReply("Reply body"); // $ExpectType GmailDraft + message.createDraftReply("Reply body", { subject: "Custom subject" }); // $ExpectType GmailDraft + // $ExpectType GmailDraft + message.createDraftReply("Reply body", { + subject: "Custom subject", + cc: "cc@example.com", + bcc: "bcc@example.com", + htmlBody: "

HTML reply

", + }); + + // Test GmailMessage.createDraftReplyAll with subject option + message.createDraftReplyAll("Reply all body"); // $ExpectType GmailDraft + message.createDraftReplyAll("Reply all body", { subject: "Custom subject for all" }); // $ExpectType GmailDraft + // $ExpectType GmailDraft + message.createDraftReplyAll("Reply all body", { + subject: "Custom subject for all", + cc: "cc@example.com", + htmlBody: "

HTML reply all

", + }); + + // Test GmailThread.createDraftReply with subject option + thread.createDraftReply("Thread reply body"); // $ExpectType GmailDraft + thread.createDraftReply("Thread reply body", { subject: "Thread custom subject" }); // $ExpectType GmailDraft + // $ExpectType GmailDraft + thread.createDraftReply("Thread reply body", { + subject: "Thread custom subject", + from: "from@example.com", + name: "Custom Name", + }); + + // Test GmailThread.createDraftReplyAll with subject option + thread.createDraftReplyAll("Thread reply all body"); // $ExpectType GmailDraft + thread.createDraftReplyAll("Thread reply all body", { subject: "Thread custom subject for all" }); // $ExpectType GmailDraft + // $ExpectType GmailDraft + thread.createDraftReplyAll("Thread reply all body", { + subject: "Thread custom subject for all", + replyTo: "replyto@example.com", + attachments: [DriveApp.getFileById("file-id").getBlob()], + }); +} diff --git a/types/leaflet.gridlayer.googlemutant/index.d.ts b/types/leaflet.gridlayer.googlemutant/index.d.ts index c2c51d5839ad1d..597f83827b69cc 100644 --- a/types/leaflet.gridlayer.googlemutant/index.d.ts +++ b/types/leaflet.gridlayer.googlemutant/index.d.ts @@ -87,6 +87,8 @@ declare module "leaflet" { * Google's map styles. */ styles?: GoogleMutantStyle[] | undefined; + + mapId?: string | undefined; } function googleMutant(options?: GoogleMutantOptions): GoogleMutant; diff --git a/types/leaflet.gridlayer.googlemutant/leaflet.gridlayer.googlemutant-tests.ts b/types/leaflet.gridlayer.googlemutant/leaflet.gridlayer.googlemutant-tests.ts index 1f2e0ccc579184..3b09a14ad4b84a 100644 --- a/types/leaflet.gridlayer.googlemutant/leaflet.gridlayer.googlemutant-tests.ts +++ b/types/leaflet.gridlayer.googlemutant/leaflet.gridlayer.googlemutant-tests.ts @@ -22,3 +22,10 @@ const styled = L.gridLayer styled.addGoogleLayer("TrafficLayer").then(nativeTrafficLayer => { styled.removeGoogleLayer("TrafficLayer"); }); + +const withMapId = L.gridLayer + .googleMutant({ + type: "roadmap", + mapId: "mapId", + }) + .addTo(map);