Skip to content

Commit 7f5903e

Browse files
🤖 Merge PR DefinitelyTyped#73851 Updated TextButtonStyle enum by @YamanquiChacala
Co-authored-by: Yamanqui García Rosales <[email protected]>
1 parent 6b10eb5 commit 7f5903e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

types/google-apps-script/google-apps-script.card-service.d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,13 +831,19 @@ declare namespace GoogleAppsScript {
831831
/**
832832
* An enum that specifies the style for TextButton.
833833
*
834-
* TEXT is the default; it renders a simple text button with clear background.
834+
* OUTLINED is the default; it renders a simple text button with clear background.
835835
* FILLED buttons have a background color you can set with
836836
* TextButton.setBackgroundColor(backgroundColor).
837+
*
838+
* To call an enum, you call its parent class, name, and property.
839+
* For example, CardService.TextButtonStyle.OUTLINED.
837840
*/
838841
enum TextButtonStyle {
839-
TEXT,
842+
OUTLINED,
843+
/** @deprecated DO NOT USE */ TEXT,
840844
FILLED,
845+
FILLED_TONAL,
846+
BORDERLESS,
841847
}
842848
/**
843849
* A input field widget that accepts text input.

types/google-apps-script/test/google-apps-script-tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,11 @@ CardService.newAction().setInteraction(CardService.Interaction.OPEN_DIALOG); //
599599

600600
CardService.newTextButton().setAltText("alt text"); // $ExpectType TextButton
601601

602+
CardService.newTextButton().setTextButtonStyle(CardService.TextButtonStyle.OUTLINED); // $ExpectType TextButton
603+
CardService.newTextButton().setTextButtonStyle(CardService.TextButtonStyle.FILLED); // $ExpectType TextButton
604+
CardService.newTextButton().setTextButtonStyle(CardService.TextButtonStyle.FILLED_TONAL); // $ExpectType TextButton
605+
CardService.newTextButton().setTextButtonStyle(CardService.TextButtonStyle.BORDERLESS); // $ExpectType TextButton
606+
602607
CardService.newLinkPreview().setTitle("Smart chip title"); // $ExpectType LinkPreview
603608

604609
CardService.newDecoratedText(); // $ExpectType DecoratedText

0 commit comments

Comments
 (0)