declarations
Version:
[](https://www.npmjs.com/package/declarations)
1,148 lines (1,127 loc) • 161 kB
TypeScript
// Type definitions for Google Apps Script 2015-11-12
// Project: https://developers.google.com/apps-script/
// Definitions by: motemen <https://github.com/motemen/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
export module UI {
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* An absolute panel positions all of its children absolutely, allowing them to overlap.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var button = app.createButton("a button");
* var panel = app.createAbsolutePanel();
* // add a widget at position (10, 20)
* panel.add(button, 10, 20);
* app.add(panel);
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the AbsolutePanel documentation here.
*/
export interface AbsolutePanel {
add(widget: Widget): AbsolutePanel;
add(widget: Widget, left: Integer, top: Integer): AbsolutePanel;
addStyleDependentName(styleName: string): AbsolutePanel;
addStyleName(styleName: string): AbsolutePanel;
clear(): AbsolutePanel;
getId(): string;
getTag(): string;
getType(): string;
remove(index: Integer): AbsolutePanel;
remove(widget: Widget): AbsolutePanel;
setHeight(height: string): AbsolutePanel;
setId(id: string): AbsolutePanel;
setLayoutData(layout: Object): AbsolutePanel;
setPixelSize(width: Integer, height: Integer): AbsolutePanel;
setSize(width: string, height: string): AbsolutePanel;
setStyleAttribute(attribute: string, value: string): AbsolutePanel;
setStyleAttributes(attributes: Object): AbsolutePanel;
setStyleName(styleName: string): AbsolutePanel;
setStylePrimaryName(styleName: string): AbsolutePanel;
setTag(tag: string): AbsolutePanel;
setTitle(title: string): AbsolutePanel;
setVisible(visible: boolean): AbsolutePanel;
setWidgetPosition(widget: Widget, left: Integer, top: Integer): AbsolutePanel;
setWidth(width: string): AbsolutePanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A widget that represents a simple <a> element. That is, a hyperlink to a different page.
*
* By design, these hyperlinks always open in a new page. Links that reload the current page are
* not allowed.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* // Creates a link to your favorite search engine.
* var anchor = app.createAnchor("a link", "http://www.google.com");
* app.add(anchor);
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the Anchor documentation here.
*/
export interface Anchor {
addBlurHandler(handler: Handler): Anchor;
addClickHandler(handler: Handler): Anchor;
addFocusHandler(handler: Handler): Anchor;
addKeyDownHandler(handler: Handler): Anchor;
addKeyPressHandler(handler: Handler): Anchor;
addKeyUpHandler(handler: Handler): Anchor;
addMouseDownHandler(handler: Handler): Anchor;
addMouseMoveHandler(handler: Handler): Anchor;
addMouseOutHandler(handler: Handler): Anchor;
addMouseOverHandler(handler: Handler): Anchor;
addMouseUpHandler(handler: Handler): Anchor;
addMouseWheelHandler(handler: Handler): Anchor;
addStyleDependentName(styleName: string): Anchor;
addStyleName(styleName: string): Anchor;
getId(): string;
getTag(): string;
getType(): string;
setAccessKey(accessKey: Char): Anchor;
setDirection(direction: Component): Anchor;
setEnabled(enabled: boolean): Anchor;
setFocus(focus: boolean): Anchor;
setHTML(html: string): Anchor;
setHeight(height: string): Anchor;
setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): Anchor;
setHref(href: string): Anchor;
setId(id: string): Anchor;
setLayoutData(layout: Object): Anchor;
setName(name: string): Anchor;
setPixelSize(width: Integer, height: Integer): Anchor;
setSize(width: string, height: string): Anchor;
setStyleAttribute(attribute: string, value: string): Anchor;
setStyleAttributes(attributes: Object): Anchor;
setStyleName(styleName: string): Anchor;
setStylePrimaryName(styleName: string): Anchor;
setTabIndex(index: Integer): Anchor;
setTag(tag: string): Anchor;
setTarget(target: string): Anchor;
setText(text: string): Anchor;
setTitle(title: string): Anchor;
setVisible(visible: boolean): Anchor;
setWidth(width: string): Anchor;
setWordWrap(wordWrap: boolean): Anchor;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A standard push-button widget.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* // create a button and give it a click handler
* var button = app.createButton("click me!").setId("button");
* button.addClickHandler(app.createServerHandler("handlerFunction"));
* app.add(button);
* return app;
* }
*
* function handlerFunction(eventInfo) {
* var app = UiApp.getActiveApplication();
* app.getElementById("button").setText("I was clicked!");
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the Button documentation here.
*/
export interface Button {
addBlurHandler(handler: Handler): Button;
addClickHandler(handler: Handler): Button;
addFocusHandler(handler: Handler): Button;
addKeyDownHandler(handler: Handler): Button;
addKeyPressHandler(handler: Handler): Button;
addKeyUpHandler(handler: Handler): Button;
addMouseDownHandler(handler: Handler): Button;
addMouseMoveHandler(handler: Handler): Button;
addMouseOutHandler(handler: Handler): Button;
addMouseOverHandler(handler: Handler): Button;
addMouseUpHandler(handler: Handler): Button;
addMouseWheelHandler(handler: Handler): Button;
addStyleDependentName(styleName: string): Button;
addStyleName(styleName: string): Button;
getId(): string;
getTag(): string;
getType(): string;
setAccessKey(accessKey: Char): Button;
setEnabled(enabled: boolean): Button;
setFocus(focus: boolean): Button;
setHTML(html: string): Button;
setHeight(height: string): Button;
setId(id: string): Button;
setLayoutData(layout: Object): Button;
setPixelSize(width: Integer, height: Integer): Button;
setSize(width: string, height: string): Button;
setStyleAttribute(attribute: string, value: string): Button;
setStyleAttributes(attributes: Object): Button;
setStyleName(styleName: string): Button;
setStylePrimaryName(styleName: string): Button;
setTabIndex(index: Integer): Button;
setTag(tag: string): Button;
setText(text: string): Button;
setTitle(title: string): Button;
setVisible(visible: boolean): Button;
setWidth(width: string): Button;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A panel that wraps its contents in a border with a caption that appears in the upper left
* corner of the border. This is an implementation of the fieldset HTML element.
*
* Note that this panel can contain at most one direct child widget. To add more children, make the
* child of this panel a different panel that can contain more than one child.
*
* Note also that the placement of the caption in a caption panel will vary slightly from browser to
* browser, so this widget is not a good choice when precise cross-browser layout is needed.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var panel = app.createCaptionPanel("my caption!");
* panel.add(app.createButton("a button inside..."));
* app.add(panel);
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the CaptionPanel documentation here.
*/
export interface CaptionPanel {
add(widget: Widget): CaptionPanel;
addStyleDependentName(styleName: string): CaptionPanel;
addStyleName(styleName: string): CaptionPanel;
clear(): CaptionPanel;
getId(): string;
getTag(): string;
getType(): string;
setCaptionText(text: string): CaptionPanel;
setContentWidget(widget: Widget): CaptionPanel;
setHeight(height: string): CaptionPanel;
setId(id: string): CaptionPanel;
setLayoutData(layout: Object): CaptionPanel;
setPixelSize(width: Integer, height: Integer): CaptionPanel;
setSize(width: string, height: string): CaptionPanel;
setStyleAttribute(attribute: string, value: string): CaptionPanel;
setStyleAttributes(attributes: Object): CaptionPanel;
setStyleName(styleName: string): CaptionPanel;
setStylePrimaryName(styleName: string): CaptionPanel;
setTag(tag: string): CaptionPanel;
setText(text: string): CaptionPanel;
setTitle(title: string): CaptionPanel;
setVisible(visible: boolean): CaptionPanel;
setWidget(widget: Widget): CaptionPanel;
setWidth(width: string): CaptionPanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A standard check box widget.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var handler = app.createServerHandler("change");
* var check = app.createCheckBox("click me").addValueChangeHandler(handler);
* app.add(check);
* return app;
* }
*
* function change() {
* var app = UiApp.getActiveApplication();
* app.add(app.createLabel("The value changed!"));
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the CheckBox documentation here.
*/
export interface CheckBox {
addBlurHandler(handler: Handler): CheckBox;
addClickHandler(handler: Handler): CheckBox;
addFocusHandler(handler: Handler): CheckBox;
addKeyDownHandler(handler: Handler): CheckBox;
addKeyPressHandler(handler: Handler): CheckBox;
addKeyUpHandler(handler: Handler): CheckBox;
addMouseDownHandler(handler: Handler): CheckBox;
addMouseMoveHandler(handler: Handler): CheckBox;
addMouseOutHandler(handler: Handler): CheckBox;
addMouseOverHandler(handler: Handler): CheckBox;
addMouseUpHandler(handler: Handler): CheckBox;
addMouseWheelHandler(handler: Handler): CheckBox;
addStyleDependentName(styleName: string): CheckBox;
addStyleName(styleName: string): CheckBox;
addValueChangeHandler(handler: Handler): CheckBox;
getId(): string;
getTag(): string;
getType(): string;
setAccessKey(accessKey: Char): CheckBox;
setEnabled(enabled: boolean): CheckBox;
setFocus(focus: boolean): CheckBox;
setFormValue(formValue: string): CheckBox;
setHTML(html: string): CheckBox;
setHeight(height: string): CheckBox;
setId(id: string): CheckBox;
setLayoutData(layout: Object): CheckBox;
setName(name: string): CheckBox;
setPixelSize(width: Integer, height: Integer): CheckBox;
setSize(width: string, height: string): CheckBox;
setStyleAttribute(attribute: string, value: string): CheckBox;
setStyleAttributes(attributes: Object): CheckBox;
setStyleName(styleName: string): CheckBox;
setStylePrimaryName(styleName: string): CheckBox;
setTabIndex(index: Integer): CheckBox;
setTag(tag: string): CheckBox;
setText(text: string): CheckBox;
setTitle(title: string): CheckBox;
setValue(value: boolean): CheckBox;
setValue(value: boolean, fireEvents: boolean): CheckBox;
setVisible(visible: boolean): CheckBox;
setWidth(width: string): CheckBox;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* An event handler that runs in the user's browser without needing a call back to the server.
* These will, in general, run much faster than ServerHandlers but they are also more
* limited in what they can do.
*
* Any method that accepts a "Handler" parameter can accept a ClientHandler.
*
* If you set validators on a ClientHandler, they will be checked before the handler performs its
* actions. The actions will only be performed if the validators succeed.
*
* If you have multiple ClientHandlers for the same event on the same widget, they will perform
* their actions in the order that they were added.
*
* An example of using client handlers:
*
* function doGet() {
* var app = UiApp.createApplication();
* var button = app.createButton("Say Hello");
*
* // Create a label with the "Hello World!" text and hide it for now
* var label = app.createLabel("Hello World!").setVisible(false);
*
* // Create a new handler that does not require the server.
* // We give the handler two actions to perform on different targets.
* // The first action disables the widget that invokes the handler
* // and the second displays the label.
* var handler = app.createClientHandler()
* .forEventSource().setEnabled(false)
* .forTargets(label).setVisible(true);
*
* // Add our new handler to be invoked when the button is clicked
* button.addClickHandler(handler);
*
* app.add(button);
* app.add(label);
* return app;
* }
*/
export interface ClientHandler {
forEventSource(): ClientHandler;
forTargets(...widgets: Object[]): ClientHandler;
getId(): string;
getTag(): string;
getType(): string;
setEnabled(enabled: boolean): ClientHandler;
setHTML(html: string): ClientHandler;
setId(id: string): ClientHandler;
setStyleAttribute(row: Integer, column: Integer, attribute: string, value: string): ClientHandler;
setStyleAttribute(attribute: string, value: string): ClientHandler;
setStyleAttributes(row: Integer, column: Integer, attributes: Object): ClientHandler;
setStyleAttributes(attributes: Object): ClientHandler;
setTag(tag: string): ClientHandler;
setText(text: string): ClientHandler;
setValue(value: boolean): ClientHandler;
setVisible(visible: boolean): ClientHandler;
validateEmail(widget: Widget): ClientHandler;
validateInteger(widget: Widget): ClientHandler;
validateLength(widget: Widget, min: Integer, max: Integer): ClientHandler;
validateMatches(widget: Widget, pattern: string): ClientHandler;
validateMatches(widget: Widget, pattern: string, flags: string): ClientHandler;
validateNotEmail(widget: Widget): ClientHandler;
validateNotInteger(widget: Widget): ClientHandler;
validateNotLength(widget: Widget, min: Integer, max: Integer): ClientHandler;
validateNotMatches(widget: Widget, pattern: string): ClientHandler;
validateNotMatches(widget: Widget, pattern: string, flags: string): ClientHandler;
validateNotNumber(widget: Widget): ClientHandler;
validateNotOptions(widget: Widget, options: String[]): ClientHandler;
validateNotRange(widget: Widget, min: Number, max: Number): ClientHandler;
validateNotSum(widgets: Widget[], sum: Integer): ClientHandler;
validateNumber(widget: Widget): ClientHandler;
validateOptions(widget: Widget, options: String[]): ClientHandler;
validateRange(widget: Widget, min: Number, max: Number): ClientHandler;
validateSum(widgets: Widget[], sum: Integer): ClientHandler;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A generic component object.
* Implementing classes
*
* NameBrief description
*
* AbsolutePanelAn absolute panel positions all of its children absolutely, allowing them to overlap.
*
* AnchorA widget that represents a simple <a> element.
*
* ButtonA standard push-button widget.
*
* CaptionPanelA panel that wraps its contents in a border with a caption that appears in the upper left
* corner of the border.
*
* ChartA Chart object, which can be embedded into documents, UI elements, or used as a static image.
*
* CheckBoxA standard check box widget.
*
* ClientHandlerAn event handler that runs in the user's browser without needing a call back to the server.
*
* ControlA user interface control object, that drives the data displayed by a DashboardPanel.
*
* DashboardPanelA dashboard is a visual structure that enables the organization and management
* of multiple charts that share the same underlying data.
*
* DateBoxA text box that shows a DatePicker when the user focuses on it.
*
* DatePickerA date picker widget.
*
* DecoratedStackPanelA StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add
* rounded corners.
*
* DecoratedTabBarA TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners.
*
* DecoratedTabPanelA TabPanel that uses a DecoratedTabBar with rounded corners.
*
* DecoratorPanelA SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded
* corners to a Widget.
*
* DialogBoxA form of popup that has a caption area at the top and can be dragged by the
* user.
*
* DocsListDialogA "file-open" dialog for Google Drive.
*
* EmbeddedChartRepresents a chart that has been embedded into a Spreadsheet.
*
* FileUploadA widget that wraps the HTML <input type='file'> element.
*
* FlexTableA flexible table that creates cells on demand.
*
* FlowPanelA panel that formats its child widgets using the default HTML layout behavior.
*
* FocusPanelA simple panel that makes its contents focusable, and adds the ability to catch mouse and
* keyboard events.
*
* FormPanelA panel that wraps its contents in an HTML <FORM> element.
*
* GridA rectangular grid that can contain text, html, or a child widget within its cells.
*
* HTMLA widget that contains arbitrary text, which is interpreted as HTML.
*
* HandlerBase interface for client and server handlers.
*
* HiddenRepresents a hidden field for storing data in the user's browser that can be passed back to a
* handler as a "callback element".
*
* HorizontalPanelA panel that lays all of its widgets out in a single horizontal column.
*
* ImageA widget that displays the image at a given URL.
*
* InlineLabelA widget that contains arbitrary text, not interpreted as HTML.
*
* LabelA widget that contains arbitrary text, not interpreted as HTML.
*
* ListBoxA widget that presents a list of choices to the user, either as a list box or
* as a drop-down list.
*
* MenuBarA standard menu bar widget.
*
* MenuItemAn entry in a MenuBar.
*
* MenuItemSeparatorA separator that can be placed in a MenuBar.
*
* PasswordTextBoxA text box that visually masks its input to prevent eavesdropping.
*
* PopupPanelA panel that can "pop up" over other widgets.
*
* PushButtonA normal push button with custom styling.
*
* RadioButtonA mutually-exclusive selection radio button widget.
*
* ResetButtonA standard push-button widget which will automatically reset its enclosing FormPanel if
* any.
*
* ScrollPanelA panel that wraps its contents in a scrollable element.
*
* ServerHandlerAn event handler that runs on the server.
*
* SimpleCheckBoxA simple checkbox widget, with no label.
*
* SimplePanelA panel that can contain only one widget.
*
* SimpleRadioButtonA simple radio button widget, with no label.
*
* SplitLayoutPanelA panel that adds user-positioned splitters between each of its child widgets.
*
* StackPanelA panel that stacks its children vertically, displaying only one at a time,
* with a header for each child which the user can click to display.
*
* SubmitButtonA standard push-button widget which will automatically submit its enclosing FormPanel if
* any.
*
* SuggestBoxA SuggestBox is a text box or text area which displays a
* pre-configured set of selections that match the user's input.
*
* TabBarA horizontal bar of folder-style tabs, most commonly used as part of a TabPanel.
*
* TabPanelA panel that represents a tabbed set of pages, each of which contains another
* widget.
*
* TextAreaA text box that allows multiple lines of text to be entered.
*
* TextBoxA standard single-line text box.
*
* ToggleButtonA ToggleButton is a stylish stateful button which allows the
* user to toggle between up and down states.
*
* TreeA standard hierarchical tree widget.
*
* TreeItemAn item that can be contained within a Tree.
*
* VerticalPanelA panel that lays all of its widgets out in a single vertical column.
*
* WidgetBase interface for UiApp widgets.
*/
export interface Component {
getId(): string;
getType(): string;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A text box that shows a DatePicker when the user focuses on it.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var handler = app.createServerHandler("change");
* var dateBox = app.createDateBox().addValueChangeHandler(handler).setId("datebox");
* app.add(dateBox);
* return app;
* }
*
* function change(eventInfo) {
* var app = UiApp.getActiveApplication();
* app.add(app.createLabel("The value of the date box changed to " +
* eventInfo.parameter.datebox));
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DateBox documentation here.
*/
export interface DateBox {
addStyleDependentName(styleName: string): DateBox;
addStyleName(styleName: string): DateBox;
addValueChangeHandler(handler: Handler): DateBox;
getId(): string;
getTag(): string;
getType(): string;
hideDatePicker(): DateBox;
setAccessKey(accessKey: Char): DateBox;
setEnabled(enabled: boolean): DateBox;
setFireEventsForInvalid(fireEvents: boolean): DateBox;
setFocus(focus: boolean): DateBox;
setFormat(dateTimeFormat: DateTimeFormat): DateBox;
setHeight(height: string): DateBox;
setId(id: string): DateBox;
setLayoutData(layout: Object): DateBox;
setName(name: string): DateBox;
setPixelSize(width: Integer, height: Integer): DateBox;
setSize(width: string, height: string): DateBox;
setStyleAttribute(attribute: string, value: string): DateBox;
setStyleAttributes(attributes: Object): DateBox;
setStyleName(styleName: string): DateBox;
setStylePrimaryName(styleName: string): DateBox;
setTabIndex(index: Integer): DateBox;
setTag(tag: string): DateBox;
setTitle(title: string): DateBox;
setValue(date: Date): DateBox;
setVisible(visible: boolean): DateBox;
setWidth(width: string): DateBox;
showDatePicker(): DateBox;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A date picker widget.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var handler = app.createServerHandler("change");
* var picker = app.createDatePicker().addValueChangeHandler(handler).setId("picker");
* app.add(picker);
* return app;
* }
*
* function change(eventInfo) {
* var app = UiApp.getActiveApplication();
* app.add(app.createLabel("The value of the date picker changed to " +
* eventInfo.parameter.picker));
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DatePicker documentation here.
*/
export interface DatePicker {
addStyleDependentName(styleName: string): DatePicker;
addStyleName(styleName: string): DatePicker;
addValueChangeHandler(handler: Handler): DatePicker;
getId(): string;
getTag(): string;
getType(): string;
setCurrentMonth(date: Date): DatePicker;
setHeight(height: string): DatePicker;
setId(id: string): DatePicker;
setLayoutData(layout: Object): DatePicker;
setName(name: string): DatePicker;
setPixelSize(width: Integer, height: Integer): DatePicker;
setSize(width: string, height: string): DatePicker;
setStyleAttribute(attribute: string, value: string): DatePicker;
setStyleAttributes(attributes: Object): DatePicker;
setStyleName(styleName: string): DatePicker;
setStylePrimaryName(styleName: string): DatePicker;
setTag(tag: string): DatePicker;
setTitle(title: string): DatePicker;
setValue(date: Date): DatePicker;
setVisible(visible: boolean): DatePicker;
setWidth(width: string): DatePicker;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* Date and time format constants for widgets such as
* DateBox.
*
* These correspond to the predefined constants from the Google Web Toolkit. You can read
* more about these constants
* here.
*/
export enum DateTimeFormat { ISO_8601, RFC_2822, DATE_FULL, DATE_LONG, DATE_MEDIUM, DATE_SHORT, TIME_FULL, TIME_LONG, TIME_MEDIUM, TIME_SHORT, DATE_TIME_FULL, DATE_TIME_LONG, DATE_TIME_MEDIUM, DATE_TIME_SHORT, DAY, HOUR_MINUTE, HOUR_MINUTE_SECOND, HOUR24_MINUTE, HOUR24_MINUTE_SECOND, MINUTE_SECOND, MONTH, MONTH_ABBR, MONTH_ABBR_DAY, MONTH_DAY, MONTH_NUM_DAY, MONTH_WEEKDAY_DAY, YEAR, YEAR_MONTH, YEAR_MONTH_ABBR, YEAR_MONTH_ABBR_DAY, YEAR_MONTH_DAY, YEAR_MONTH_NUM, YEAR_MONTH_NUM_DAY, YEAR_MONTH_WEEKDAY_DAY, YEAR_QUARTER, YEAR_QUARTER_ABBR }
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add
* rounded corners.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DecoratedStackPanel documentation here.
*/
export interface DecoratedStackPanel {
add(widget: Widget): DecoratedStackPanel;
add(widget: Widget, text: string): DecoratedStackPanel;
add(widget: Widget, text: string, asHtml: boolean): DecoratedStackPanel;
addStyleDependentName(styleName: string): DecoratedStackPanel;
addStyleName(styleName: string): DecoratedStackPanel;
clear(): DecoratedStackPanel;
getId(): string;
getTag(): string;
getType(): string;
remove(index: Integer): DecoratedStackPanel;
remove(widget: Widget): DecoratedStackPanel;
setHeight(height: string): DecoratedStackPanel;
setId(id: string): DecoratedStackPanel;
setLayoutData(layout: Object): DecoratedStackPanel;
setPixelSize(width: Integer, height: Integer): DecoratedStackPanel;
setSize(width: string, height: string): DecoratedStackPanel;
setStackText(index: Integer, text: string): DecoratedStackPanel;
setStackText(index: Integer, text: string, asHtml: boolean): DecoratedStackPanel;
setStyleAttribute(attribute: string, value: string): DecoratedStackPanel;
setStyleAttributes(attributes: Object): DecoratedStackPanel;
setStyleName(styleName: string): DecoratedStackPanel;
setStylePrimaryName(styleName: string): DecoratedStackPanel;
setTag(tag: string): DecoratedStackPanel;
setTitle(title: string): DecoratedStackPanel;
setVisible(visible: boolean): DecoratedStackPanel;
setWidth(width: string): DecoratedStackPanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DecoratedTabBar documentation here.
*/
export interface DecoratedTabBar {
addBeforeSelectionHandler(handler: Handler): DecoratedTabBar;
addSelectionHandler(handler: Handler): DecoratedTabBar;
addStyleDependentName(styleName: string): DecoratedTabBar;
addStyleName(styleName: string): DecoratedTabBar;
addTab(title: string): DecoratedTabBar;
addTab(title: string, asHtml: boolean): DecoratedTabBar;
addTab(widget: Widget): DecoratedTabBar;
getId(): string;
getTag(): string;
getType(): string;
selectTab(index: Integer): DecoratedTabBar;
setHeight(height: string): DecoratedTabBar;
setId(id: string): DecoratedTabBar;
setLayoutData(layout: Object): DecoratedTabBar;
setPixelSize(width: Integer, height: Integer): DecoratedTabBar;
setSize(width: string, height: string): DecoratedTabBar;
setStyleAttribute(attribute: string, value: string): DecoratedTabBar;
setStyleAttributes(attributes: Object): DecoratedTabBar;
setStyleName(styleName: string): DecoratedTabBar;
setStylePrimaryName(styleName: string): DecoratedTabBar;
setTabEnabled(index: Integer, enabled: boolean): DecoratedTabBar;
setTabText(index: Integer, text: string): DecoratedTabBar;
setTag(tag: string): DecoratedTabBar;
setTitle(title: string): DecoratedTabBar;
setVisible(visible: boolean): DecoratedTabBar;
setWidth(width: string): DecoratedTabBar;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A TabPanel that uses a DecoratedTabBar with rounded corners.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DecoratedTabPanel documentation here.
*/
export interface DecoratedTabPanel {
add(widget: Widget): DecoratedTabPanel;
add(widget: Widget, text: string): DecoratedTabPanel;
add(widget: Widget, text: string, asHtml: boolean): DecoratedTabPanel;
add(widget: Widget, tabWidget: Widget): DecoratedTabPanel;
addBeforeSelectionHandler(handler: Handler): DecoratedTabPanel;
addSelectionHandler(handler: Handler): DecoratedTabPanel;
addStyleDependentName(styleName: string): DecoratedTabPanel;
addStyleName(styleName: string): DecoratedTabPanel;
getId(): string;
getTag(): string;
getType(): string;
selectTab(index: Integer): DecoratedTabPanel;
setAnimationEnabled(animationEnabled: boolean): DecoratedTabPanel;
setHeight(height: string): DecoratedTabPanel;
setId(id: string): DecoratedTabPanel;
setLayoutData(layout: Object): DecoratedTabPanel;
setPixelSize(width: Integer, height: Integer): DecoratedTabPanel;
setSize(width: string, height: string): DecoratedTabPanel;
setStyleAttribute(attribute: string, value: string): DecoratedTabPanel;
setStyleAttributes(attributes: Object): DecoratedTabPanel;
setStyleName(styleName: string): DecoratedTabPanel;
setStylePrimaryName(styleName: string): DecoratedTabPanel;
setTag(tag: string): DecoratedTabPanel;
setTitle(title: string): DecoratedTabPanel;
setVisible(visible: boolean): DecoratedTabPanel;
setWidth(width: string): DecoratedTabPanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded
* corners to a Widget.
*
* Note that this panel can contain at most one direct child widget. To add more children, make the
* child of this panel a different panel that can contain more than one child.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DecoratorPanel documentation here.
*/
export interface DecoratorPanel {
add(widget: Widget): DecoratorPanel;
addStyleDependentName(styleName: string): DecoratorPanel;
addStyleName(styleName: string): DecoratorPanel;
clear(): DecoratorPanel;
getId(): string;
getTag(): string;
getType(): string;
setHeight(height: string): DecoratorPanel;
setId(id: string): DecoratorPanel;
setLayoutData(layout: Object): DecoratorPanel;
setPixelSize(width: Integer, height: Integer): DecoratorPanel;
setSize(width: string, height: string): DecoratorPanel;
setStyleAttribute(attribute: string, value: string): DecoratorPanel;
setStyleAttributes(attributes: Object): DecoratorPanel;
setStyleName(styleName: string): DecoratorPanel;
setStylePrimaryName(styleName: string): DecoratorPanel;
setTag(tag: string): DecoratorPanel;
setTitle(title: string): DecoratorPanel;
setVisible(visible: boolean): DecoratorPanel;
setWidget(widget: Widget): DecoratorPanel;
setWidth(width: string): DecoratorPanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A form of popup that has a caption area at the top and can be dragged by the
* user. Unlike a PopupPanel, calls to setWidth(width) and
* setHeight(height) will set the width and height of the dialog box
* itself, even if a widget has not been added as yet.
*
* In general it's not recommended to add this panel as a child of another widget or of the app
* as that will make it behave like any other inline panel and not act as a popup. Instead, create
* the popup and then use its show() and hide() methods to show and hide it. See
* the example below.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DialogBox documentation here.
*
* Here is an example showing how to use the dialog box widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* // Create a dialog box.
* var dialog = app.createDialogBox();
* // Set the position and dimensions.
* dialog.setPopupPosition(100, 100).setSize(500, 500);
* // Show the dialog. Note that it does not have to be "added" to the UiInstance.
* dialog.show();
* return app;
* }
*/
export interface DialogBox {
add(widget: Widget): DialogBox;
addAutoHidePartner(partner: Component): DialogBox;
addCloseHandler(handler: Handler): DialogBox;
addStyleDependentName(styleName: string): DialogBox;
addStyleName(styleName: string): DialogBox;
clear(): DialogBox;
getId(): string;
getTag(): string;
getType(): string;
hide(): DialogBox;
setAnimationEnabled(animationEnabled: boolean): DialogBox;
setAutoHideEnabled(enabled: boolean): DialogBox;
setGlassEnabled(enabled: boolean): DialogBox;
setGlassStyleName(styleName: string): DialogBox;
setHTML(html: string): DialogBox;
setHeight(height: string): DialogBox;
setId(id: string): DialogBox;
setLayoutData(layout: Object): DialogBox;
setModal(modal: boolean): DialogBox;
setPixelSize(width: Integer, height: Integer): DialogBox;
setPopupPosition(left: Integer, top: Integer): DialogBox;
setPopupPositionAndShow(a: Component): DialogBox;
setPreviewingAllNativeEvents(previewing: boolean): DialogBox;
setSize(width: string, height: string): DialogBox;
setStyleAttribute(attribute: string, value: string): DialogBox;
setStyleAttributes(attributes: Object): DialogBox;
setStyleName(styleName: string): DialogBox;
setStylePrimaryName(styleName: string): DialogBox;
setTag(tag: string): DialogBox;
setText(text: string): DialogBox;
setTitle(title: string): DialogBox;
setVisible(visible: boolean): DialogBox;
setWidget(widget: Widget): DialogBox;
setWidth(width: string): DialogBox;
show(): DialogBox;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A "file-open" dialog for Google Drive. Unlike most UiApp objects, DocsListDialog
* should not be added to the UiInstance. The
* example below shows how to display a DocsListDialog in the
* new version of Google Sheets.
*
* Note that HTML service offers a similar but superior
* feature, Google Picker. In almost all
* cases, using Google Picker is preferable.
*
* function onOpen() {
* SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
* .createMenu('Custom Menu')
* .addItem('Select file', 'showDialog')
* .addToUi();
* }
*
* function showDialog() {
* // Dummy call to DriveApp to ensure the OAuth dialog requests Google Drive scope, so that the
* // getOAuthToken() call below returns a token with the necessary permissions.
* DriveApp.getRootFolder();
*
* var app = UiApp.createApplication()
* .setWidth(570)
* .setHeight(352);
*
* var serverHandler = app.createServerHandler('pickerHandler');
*
* app.createDocsListDialog()
* .addCloseHandler(serverHandler)
* .addSelectionHandler(serverHandler)
* .setOAuthToken(ScriptApp.getOAuthToken())
* .showDocsPicker();
*
* SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
* .showModalDialog(app,' ');
* }
*
* function pickerHandler(e) {
* var action = e.parameter.eventType;
* var app = UiApp.getActiveApplication();
*
* if (action == 'selection') {
* var doc = e.parameter.items[0];
* var id = doc.id;
* var name = doc.name;
* var url = doc.url;
* app.add(app.createLabel('You picked '));
* app.add(app.createAnchor(name, url));
* app.add(app.createLabel('(ID: ' + id + ').'));
* } else if (action == 'close') {
* app.add(app.createLabel('You clicked "Cancel".'));
* }
*
* return app;
* }
*/
export interface DocsListDialog {
addCloseHandler(handler: Handler): DocsListDialog;
addSelectionHandler(handler: Handler): DocsListDialog;
addView(fileType: FileType): DocsListDialog;
getId(): string;
getType(): string;
setDialogTitle(title: string): DocsListDialog;
setHeight(height: Integer): DocsListDialog;
setInitialView(fileType: FileType): DocsListDialog;
setMultiSelectEnabled(multiSelectEnabled: boolean): DocsListDialog;
setOAuthToken(oAuthToken: string): DocsListDialog;
setWidth(width: Integer): DocsListDialog;
showDocsPicker(): DocsListDialog;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* File type constants for the
* DocsListDialog.
*/
export enum FileType { ALL, ALL_DOCS, DRAWINGS, DOCUMENTS, SPREADSHEETS, FOLDERS, RECENTLY_PICKED, PRESENTATIONS, FORMS, PHOTOS, PHOTO_ALBUMS, PDFS }
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A widget that wraps the HTML <input type='file'> element. This widget
* must be used within a FormPanel.
*
* The result of a FileUpload is a "Blob" which can we used in various other functions. Below is an
* example of how to use FileUpload.
*
* function doGet(e) {
*
* var app = UiApp.createApplication().setTitle("Upload CSV to Sheet");
* var formContent = app.createVerticalPanel();
* formContent.add(app.createFileUpload().setName('thefile'));
* formContent.add(app.createSubmitButton());
* var form = app.createFormPanel();
* form.add(formContent);
* app.add(form);
* return app;
* }
*
* function doPost(e) {
* // data returned is a blob for FileUpload widget
* var fileBlob = e.parameter.thefile;
* var doc = DocsList.createFile(fileBlob);
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the FileUpload documentation here.
*/
export interface FileUpload {
addChangeHandler(handler: Handler): FileUpload;
addStyleDependentName(styleName: string): FileUpload;
addStyleName(styleName: string): FileUpload;
getId(): string;
getTag(): string;
getType(): string;
setEnabled(enabled: boolean): FileUpload;
setHeight(height: string): FileUpload;
setId(id: string): FileUpload;
setLayoutData(layout: Object): FileUpload;
setName(name: string): FileUpload;
setPixelSize(width: Integer, height: Integer): FileUpload;
setSize(width: string, height: string): FileUpload;
setStyleAttribute(attribute: string, value: string): FileUpload;
setStyleAttributes(attributes: Object): FileUpload;
setStyleName(styleName: string): FileUpload;
setStylePrimaryName(styleName: string): FileUpload;
setTag(tag: string): FileUpload;
setTitle(title: string): FileUpload;
setVisible(visible: boolean): FileUpload;
setWidth(width: string): FileUpload;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A flexible table that creates cells on demand. It can be jagged (that is,
* each row can contain a different number of cells) and individual cells can be
* set to span multiple rows or columns.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* app.add(app.createFlexTable()
* .insertRow(0).insertRow(0).insertRow(0)
* .insertCell(0, 0)
* .insertCell(0, 1)
* .insertCell(0, 2)
* .insertCell(1, 0)
* .insertCell(1, 1)
* .insertCell(2, 0)
* .setBorderWidth(5).setCellPadding(10).setCellSpacing(10));
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the FlexTable documentation here.
*/
export interface FlexTable {
addCell(row: Integer): FlexTable;
addClickHandler(handler: Handler): FlexTable;
addStyleDependentName(styleName: string): FlexTable;
addStyleName(styleName: string): FlexTable;
clear(): FlexTable;
getId(): string;
getTag(): string;
getType(): string;
insertCell(beforeRow: Integer, beforeColumn: Integer): FlexTable;
insertRow(beforeRow: Integer): FlexTable;
removeCell(row: Integer, column: Integer): FlexTable;
removeCells(row: Integer, column: Integer, num: Integer): FlexTable;
removeRow(row: Integer): FlexTable;
setBorderWidth(width: Integer): FlexTable;
setCellPadding(padding: Integer): FlexTable;
setCellSpacing(spacing: Integer): FlexTable;
setColumnStyleAttribute(column: Integer, attribute: string, value: string): FlexTable;
setColumnStyleAttributes(column: Integer, attributes: Object): FlexTable;
setHeight(height: string): FlexTable;
setId(id: string): FlexTable;
setLayoutData(layout: Object): FlexTable;
setPixelSize(width: Integer, height: Integer): FlexTable;
setRowStyleAttribute(row: Integer, attribute: string, value: string): FlexTable;
setRowStyleAttributes(row: Integer, attributes: Object): FlexTable;
setSize(width: string, height: string): FlexTable;
setStyleAttribute(row: Integer, column: Integer, attribute: string, value: string): FlexTable;
setStyleAttribute(attribute: string, value: string): FlexTable;
setStyleAttributes(row: Integer, column: Integer, attributes: Object): FlexTable;
setStyleAttributes(attributes: Object): FlexTable;
setStyleName(styleName: string): FlexTable;
setStylePrimaryName(styleName: string): FlexTable;
setTag(tag: string): FlexTable;
setText(row: Integer, column: Integer, text: string): FlexTable;
setTitle(title: string): FlexTable;
setVisible(visible: boolean): FlexTable;
setWidget(row: Integer, column: Integer, widget: Widget): FlexTable;
setWidth(width: string): FlexTable;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A panel that formats its child widgets using the default HTML layout behavior.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var panel = app.createFlowPanel();
* panel.add(app.createButton("button 1"));
*