replace internal module to namespace

This commit is contained in:
vvakame
2016-03-17 02:18:10 +09:00
parent 2f47c75835
commit 14fe4313f4
1139 changed files with 179639 additions and 179639 deletions
+30 -30
View File
@@ -5,7 +5,7 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Base {
/**
* A data interchange object for Apps Script services.
@@ -31,35 +31,35 @@ declare module GoogleAppsScript {
/**
* Interface for objects that can export their data as a Blob.
* Implementing classes
*
*
* NameBrief description
*
*
* AttachmentA Sites Attachment such as a file attached to a page.
*
*
* BlobA data interchange object for Apps Script services.
*
*
* ChartA Chart object, which can be embedded into documents, UI elements, or used as a static image.
*
*
* DocumentA document, containing rich text and elements such as tables and lists.
*
*
* EmbeddedChartRepresents a chart that has been embedded into a Spreadsheet.
*
*
* FileA file in Google Drive.
*
*
* GmailAttachmentAn attachment from Gmail.
*
*
* HTTPResponseThis class allows users to access specific information on HTTP responses.
*
*
* HtmlOutputAn HtmlOutput object that can be served from a script.
*
*
* InlineImageAn element representing an embedded image.
*
*
* JdbcBlobA JDBC Blob.
*
*
* JdbcClobA JDBC Clob.
*
*
* SpreadsheetThis class allows users to access and modify Google Sheets files.
*
*
* StaticMapAllows for the creation and decoration of static map images.
*/
export interface BlobSource {
@@ -69,10 +69,10 @@ declare module GoogleAppsScript {
/**
* This class provides access to Google Apps specific dialog boxes.
*
*
* The methods in this class are only available for use in the context of a Google Spreadsheet.
* See also
*
*
* ButtonSet
*/
export interface Browser {
@@ -91,11 +91,11 @@ declare module GoogleAppsScript {
* indicate which button in a dialog the user clicked. These values cannot be set; to add buttons to
* an alert or
* prompt, use ButtonSet instead.
*
*
* // Display a dialog box with a message and "Yes" and "No" buttons.
* var ui = DocumentApp.getUi();
* var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO);
*
*
* // Process the user's response.
* if (response == ui.Button.YES) {
* Logger.log('The user clicked "Yes."');
@@ -110,11 +110,11 @@ declare module GoogleAppsScript {
* added to an alert or a
* prompt. To determine which button the user
* clicked, use Button.
*
*
* // Display a dialog box with a message and "Yes" and "No" buttons.
* var ui = DocumentApp.getUi();
* var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO);
*
*
* // Process the user's response.
* if (response == ui.Button.YES) {
* Logger.log('The user clicked "Yes."');
@@ -139,7 +139,7 @@ declare module GoogleAppsScript {
* with the UI for the current instance of an open document or form, and only if the script is
* container-bound to the document or form. For more
* information, see the guide to menus.
*
*
* // Add a custom menu to the active spreadsheet, including a separator and a sub-menu.
* function onOpen(e) {
* SpreadsheetApp.getUi()
@@ -164,14 +164,14 @@ declare module GoogleAppsScript {
* explicitly. Any method that expects a MIME type rendered as a string (for example,
* 'image/png') will also accept one of the values below, so long as the method
* supports the underlying MIME type.
*
*
* // Use MimeType enum to log the name of every Google Doc in the user's Drive.
* var docs = DriveApp.getFilesByType(MimeType.GOOGLE_DOCS);
* while (docs.hasNext()) {
* var doc = docs.next();
* Logger.log(doc.getName())
* }
*
*
* // Use plain string to log the size of every PNG in the user's Drive.
* var pngs = DriveApp.getFilesByType('image/png');
* while (pngs.hasNext()) {
@@ -190,12 +190,12 @@ declare module GoogleAppsScript {
* A response to a prompt dialog displayed in the
* user-interface environment for a Google App. The response contains any text the user entered in
* the dialog's input field and indicates which button the user clicked to dismiss the dialog.
*
*
* // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The
* // user can also close the dialog by clicking the close button in its title bar.
* var ui = DocumentApp.getUi();
* var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO);
*
*
* // Process the user's response.
* if (response.getSelectedButton() == ui.Button.YES) {
* Logger.log('The user\'s name is %s.', response.getResponseText());
@@ -228,12 +228,12 @@ declare module GoogleAppsScript {
* features like menus, dialogs, and sidebars. A script can only interact with the UI for the
* current instance of an open editor, and only if the script is
* container-bound to the editor.
*
*
* // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The
* // user can also close the dialog by clicking the close button in its title bar.
* var ui = SpreadsheetApp.getUi();
* var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO);
*
*
* // Process the user's response.
* if (response.getSelectedButton() == ui.Button.YES) {
* Logger.log('The user\'s name is %s.', response.getResponseText());
@@ -280,4 +280,4 @@ declare var Browser: GoogleAppsScript.Base.Browser;
declare var Logger: GoogleAppsScript.Base.Logger;
// conflicts with MimeType in lib.d.ts
// declare var MimeType: GoogleAppsScript.Base.MimeType;
declare var Session: GoogleAppsScript.Base.Session;
declare var Session: GoogleAppsScript.Base.Session;
+5 -5
View File
@@ -5,16 +5,16 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Cache {
/**
* A reference to a particular cache.
*
*
* This class allows you to insert, retrieve, and remove items from a cache. This can be
* particularly useful when you want frequent access to an expensive or slow resource. For
* example, say you have an RSS feed at example.com that takes 20 seconds to fetch, but you want
* to speed up access on an average request.
*
*
* function getRssFeed() {
* var cache = CacheService.getPublicCache();
* var cached = cache.get("rss-feed-contents");
@@ -40,7 +40,7 @@ declare module GoogleAppsScript {
/**
* CacheService allows you to access a cache for short term storage of data.
*
*
* This class lets you get a specific cache instance. Public caches are for things that are not
* dependent on which user is accessing your script. Private caches are for things which are
* user-specific, like settings or recent activity.
@@ -54,4 +54,4 @@ declare module GoogleAppsScript {
}
}
declare var CacheService: GoogleAppsScript.Cache.CacheService;
declare var CacheService: GoogleAppsScript.Cache.CacheService;
+5 -5
View File
@@ -6,7 +6,7 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Calendar {
/**
* Represents a calendar that the user owns or is subscribed to.
@@ -246,12 +246,12 @@ declare module GoogleAppsScript {
/**
* Represents a recurrence rule for an event series.
*
*
* Note that this class also behaves like the EventRecurrence that it belongs
* to, allowing you to chain rule creation together like so:
*
*
* recurrence.addDailyRule().times(3).interval(2).addWeeklyExclusion().times(2);
*
*
* times(times)
* interval(interval)
*/
@@ -291,4 +291,4 @@ declare module GoogleAppsScript {
}
}
declare var CalendarApp: GoogleAppsScript.Calendar.CalendarApp;
declare var CalendarApp: GoogleAppsScript.Calendar.CalendarApp;
+108 -108
View File
@@ -7,14 +7,14 @@
/// <reference path="google-apps-script.base.d.ts" />
/// <reference path="google-apps-script.ui.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Charts {
/**
* Builder for area charts. For more details, see the
* Builder for area charts. For more details, see the
* Google Charts documentation.
*
*
* Here is an example that shows how to build an area chart.
*
*
* function doGet() {
* // Create a data table with some sample data.
* var sampleData = Charts.newDataTable()
@@ -34,7 +34,7 @@ declare module GoogleAppsScript {
* .addRow(["Nov", 58, 388])
* .addRow(["Dec", 63, 400])
* .build();
*
*
* var chart = Charts.newAreaChart()
* .setTitle('Yearly Spending')
* .setXAxisTitle('Month')
@@ -44,7 +44,7 @@ declare module GoogleAppsScript {
* .setColors(['red', 'green'])
* .setDataTable(sampleData)
* .build();
*
*
* return UiApp.createApplication().add(chart);
* }
*/
@@ -76,18 +76,18 @@ declare module GoogleAppsScript {
}
/**
* Builder for bar charts. For more details, see the
* Builder for bar charts. For more details, see the
* Google Charts documentation.
*
* Here is an example that shows how to build a bar chart. The data is
*
*
* Here is an example that shows how to build a bar chart. The data is
*
* imported from a Google spreadsheet.
*
*
* function doGet() {
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=B1%3AC11' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=0&headers=-1';
*
*
* var chartBuilder = Charts.newBarChart()
* .setTitle('Top Grossing Films in US and Canada')
* .setXAxisTitle('USD')
@@ -95,7 +95,7 @@ declare module GoogleAppsScript {
* .setDimensions(600, 500)
* .setLegendPosition(Charts.Position.BOTTOM)
* .setDataSourceUrl(dataSourceUrl);
*
*
* var chart = chartBuilder.build();
* return UiApp.createApplication().add(chart);
* }
@@ -129,14 +129,14 @@ declare module GoogleAppsScript {
/**
* A builder for category filter controls.
*
*
* A category filter is a picker to choose one or more between a set of defined values.
* Given a column of type string, this control will filter out the rows that
* don't match any of the picked values.
*
*
* Here is an example that creates a table chart a binds a category filter to it. This allows the
* user to filter the data the table displays.
*
*
* function doGet() {
* var app = UiApp.createApplication();
* var sampleData = Charts.newDataTable()
@@ -156,11 +156,11 @@ declare module GoogleAppsScript {
* .addRow(["Nov", 58, 388])
* .addRow(["Dec", 63, 400])
* .build();
*
*
* var chart = Charts.newTableChart()
* .setDimensions(600, 500)
* .build();
*
*
* var categoryFilter = Charts.newCategoryFilter()
* .setFilterColumnLabel("Month")
* .setAllowMultiple(true)
@@ -168,20 +168,20 @@ declare module GoogleAppsScript {
* .setLabelStacking(Charts.Orientation.VERTICAL)
* .setCaption('Choose categories...')
* .build();
*
*
* var panel = app.createVerticalPanel().setSpacing(10);
* panel.add(categoryFilter).add(chart);
*
*
* var dashboard = Charts.newDashboardPanel()
* .setDataTable(sampleData)
* .bind(categoryFilter, chart)
* .build();
*
*
* dashboard.add(panel);
* app.add(dashboard);
* return app;
* }
*
*
* documentation
*/
export interface CategoryFilterBuilder {
@@ -218,11 +218,11 @@ declare module GoogleAppsScript {
/**
* Exposes options currently configured for a Chart, such as height, color, etc.
*
*
* Please see the visualization
* reference documentation for information on what options are available. Specific options for
* each chart can be found by clicking on the specific chart in the chart gallery.
*
*
* These options are immutable.
*/
export interface ChartOptions {
@@ -236,10 +236,10 @@ declare module GoogleAppsScript {
/**
* Entry point for creating Charts in scripts.
*
*
* This example creates a basic data table, populates an area chart with the data, and adds it into
* a UiApp:
*
*
* function doGet() {
* var data = Charts.newDataTable()
* .addColumn(Charts.ColumnType.STRING, "Month")
@@ -251,14 +251,14 @@ declare module GoogleAppsScript {
* .addRow(["April", 25, 3])
* .addRow(["May", 30, 4])
* .build();
*
*
* var chart = Charts.newAreaChart()
* .setDataTable(data)
* .setStacked()
* .setRange(0, 40)
* .setTitle("Sales per Month")
* .build();
*
*
* var uiApp = UiApp.createApplication().setTitle("My Chart");
* uiApp.add(chart);
* return uiApp;
@@ -290,11 +290,11 @@ declare module GoogleAppsScript {
}
/**
* Builder for column charts. For more details, see the
* Builder for column charts. For more details, see the
* Google Charts documentation.
*
*
* This example shows how to create a column chart with data from a data table.
*
*
* function doGet() {
* var sampleData = Charts.newDataTable()
* .addColumn(Charts.ColumnType.STRING, "Year")
@@ -310,7 +310,7 @@ declare module GoogleAppsScript {
* .addRow(["2011", 910, 700])
* .addRow(["2012", 1230, 840])
* .build();
*
*
* var chart = Charts.newColumnChart()
* .setTitle('Sales vs. Expenses')
* .setXAxisTitle('Year')
@@ -318,7 +318,7 @@ declare module GoogleAppsScript {
* .setDimensions(600, 500)
* .setDataTable(sampleData)
* .build();
*
*
* return UiApp.createApplication().add(chart);
* }
*/
@@ -355,7 +355,7 @@ declare module GoogleAppsScript {
/**
* A user interface control object, that drives the data displayed by a DashboardPanel.
*
*
* A control can be embedded in a UI application. Controls are user interface widgets (category
* pickers, range sliders, autocompleters, etc.) users interact with in order to drive the data
* managed by a dashboard and the charts that are part of it.
@@ -364,9 +364,9 @@ declare module GoogleAppsScript {
* Given a data table, a control will filter out the data that doesn't comply with the
* conditions implied by its current state, and will expose the filtered data table as
* an output.
*
*
* For more details, see the Gviz
*
*
* documentation.
*/
export interface Control {
@@ -383,26 +383,26 @@ declare module GoogleAppsScript {
/**
* A dashboard is a visual structure that enables the organization and management
* of multiple charts that share the same underlying data.
*
*
* Controls are user interface widgets (category pickers, range sliders, autocompleters, etc.)
* users interact with in order to drive the data managed by a dashboard and the charts that
* are part of it. For example, a string filter control is a simple text input field that lets
* the user filter data via string matching. Given a column and matching options, the control
* will filter out the rows that don't match the term that's in the input field.
*
*
* The Gviz API defines a dashboard as a set of charts and controls bound together. The
* bindings between the different components define the data flow, the state of the
* controls filters views of the data which propagate in the dashboard and are
* eventually visualized with charts. For more details, see the Gviz
*
*
* documentation.
*
*
* The dashboard panel has two purposes, one is being a container for the charts and
* controls objects that compose the dashboard, and the other is holding the data and use
* as an interface for binding controls to charts.
*
*
* Here's an example of creating a dashboard and showing it in a UI app:
*
*
* function doGet() {
* // Create a data table with some sample data.
* var data = Charts.newDataTable()
@@ -417,27 +417,27 @@ declare module GoogleAppsScript {
* .addRow(["Miranda", 22])
* .addRow(["May", 20])
* .build();
*
*
* var chart = Charts.newBarChart()
* .setTitle("Ages")
* .build();
*
*
* var control = Charts.newStringFilter()
* .setFilterColumnLabel("Name")
* .build();
*
*
* // Bind the control to the chart in a dashboard panel.
* var dashboard = Charts.newDashboardPanel()
* .setDataTable(data)
* .bind(control, chart)
* .build();
*
*
* var uiApp = UiApp.createApplication().setTitle("My Dashboard");
*
*
* var panel = uiApp.createHorizontalPanel()
* .setVerticalAlignment(UiApp.VerticalAlignment.MIDDLE)
* .setSpacing(50);
*
*
* panel.add(control);
* panel.add(chart);
* dashboard.add(panel);
@@ -455,9 +455,9 @@ declare module GoogleAppsScript {
/**
* A builder for a dashboard panel object. For an example of how to use
* DashboardPanelBuilder, refer to DashboardPanel.
*
*
* For more details, see the Gviz
*
*
* documentation.
*/
export interface DashboardPanelBuilder {
@@ -479,7 +479,7 @@ declare module GoogleAppsScript {
/**
* Builder of DataTable objects. Building a data table consists of first specifying its columns,
* and then adding its rows, one at a time. Example:
*
*
* var data = Charts.newDataTable()
* .addColumn(Charts.ColumnType.STRING, "Month")
* .addColumn(Charts.ColumnType.NUMBER, "In Store")
@@ -501,11 +501,11 @@ declare module GoogleAppsScript {
/**
* Interface for objects that can represent their data as a DataTable.
* Implementing classes
*
*
* NameBrief description
*
*
* DataTableA Data Table to be used in charts.
*
*
* RangeAccess and modify spreadsheet ranges.
*/
export interface DataTableSource {
@@ -514,7 +514,7 @@ declare module GoogleAppsScript {
/**
* A data view definition for visualizing chart data.
*
*
* Data view definition can be set for charts to visualize a view derived from the given data table
* and not the data table itself. For example if the view definition of a chart states that the view
* columns are [0, 3], only the first and the third columns of the data table will be taken into
@@ -526,9 +526,9 @@ declare module GoogleAppsScript {
/**
* Builder for DataViewDefinition objects.
*
*
* Here's an example of using the builder. The data is imported from a Google spreadsheet.
*
*
* function doGet() {
* // This example creates two table charts side by side. One uses a data view definition to
* // restrict the number of displayed columns.
@@ -536,13 +536,13 @@ declare module GoogleAppsScript {
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AF' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1';
*
*
* // Create a chart to display all of the data.
* var originalChart = Charts.newTableChart()
* .setDimensions(600, 500)
* .setDataSourceUrl(dataSourceUrl)
* .build();
*
*
* // Create another chart to display a subset of the data (only columns 1 and 4).
* var dataViewDefinition = Charts.newDataViewDefinition().setColumns([0, 3]);
* var limitedChart = Charts.newTableChart()
@@ -550,7 +550,7 @@ declare module GoogleAppsScript {
* .setDataSourceUrl(dataSourceUrl)
* .setDataViewDefinition(dataViewDefinition)
* .build();
*
*
* var panel = app.createHorizontalPanel().setSpacing(15);
* panel.add(originalChart).add(limitedChart);
* return app.add(panel);
@@ -562,17 +562,17 @@ declare module GoogleAppsScript {
}
/**
* Builder for line charts. For more details, see the
* Builder for line charts. For more details, see the
* Google Charts documentation.
*
*
* Here is an example that shows how to build a line chart. The data is
* imported from a Google spreadsheet.
*
*
* function doGet() {
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AG5' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=2&headers=-1';
*
*
* var chartBuilder = Charts.newLineChart()
* .setTitle('Yearly Rainfall')
* .setXAxisTitle('Month')
@@ -581,7 +581,7 @@ declare module GoogleAppsScript {
* .setCurveStyle(Charts.CurveStyle.SMOOTH)
* .setPointStyle(Charts.PointStyle.MEDIUM)
* .setDataSourceUrl(dataSourceUrl);
*
*
* var chart = chartBuilder.build();
* return UiApp.createApplication().add(chart);
* }
@@ -617,11 +617,11 @@ declare module GoogleAppsScript {
* An enumeration of how a string value should be matched.
* Matching a string is a boolean operation. Given a string, a match term (string), and a match
* type, the operation will output true in the following cases:
*
*
* If the match type equals EXACT and the match term equals the string.
* If the match type equals PREFIX and the match term is a prefix of the string.
* If the match type equals ANY and the match term is a substring of the string.
*
*
* This enumeration can be used in by a string filter control to decide which rows to filter out
* of the data table. Given a column to filter on, leave only the rows that match the value
* entered in the filter input box, using one of the above matching types.
@@ -630,44 +630,44 @@ declare module GoogleAppsScript {
/**
* A builder for number range filter controls.
*
*
* A number range filter is a slider with two thumbs that lets the user select ranges of
* numeric values. Given a column of type number and matching options, this control will
* filter out the rows that don't match the range that was selected.
*
*
* This example creates a table chart bound to a number range filter:
*
*
* function doGet() {
* var app = UiApp.createApplication();
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AF' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1';
* var data = SpreadsheetApp.openByUrl(dataSourceUrl).getSheetByName('US_GDP').getRange("A1:F");
*
*
* var chart = Charts.newTableChart()
* .setDimensions(600, 500)
* .build();
*
*
* var numberRangeFilter = Charts.newNumberRangeFilter()
* .setFilterColumnLabel("Year")
* .setShowRangeValues(true)
* .setLabel("Restrict year range")
* .build();
*
*
* var panel = app.createVerticalPanel().setSpacing(10);
* panel.add(numberRangeFilter).add(chart);
*
*
* // Create a new dashboard panel to bind the filter and chart together.
* var dashboard = Charts.newDashboardPanel()
* .setDataTable(data)
* .bind(numberRangeFilter, chart)
* .build();
*
*
* dashboard.add(panel);
* app.add(dashboard);
* return app;
* }
*
*
* documentation
*/
export interface NumberRangeFilterBuilder {
@@ -697,23 +697,23 @@ declare module GoogleAppsScript {
export enum PickerValuesLayout { ASIDE, BELOW, BELOW_WRAPPING, BELOW_STACKED }
/**
* A builder for pie charts. For more details, see the
* A builder for pie charts. For more details, see the
* Google Charts documentation.
*
* Here is an example that shows how to build a pie chart. The data is
*
* Here is an example that shows how to build a pie chart. The data is
* imported from a Google spreadsheet.
*
*
* function doGet() {
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AB8' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=3&headers=-1';
*
*
* var chartBuilder = Charts.newPieChart()
* .setTitle('World Population by Continent')
* .setDimensions(600, 500)
* .set3D()
* .setDataSourceUrl(dataSourceUrl);
*
*
* var chart = chartBuilder.build();
* return UiApp.createApplication().add(chart);
* }
@@ -747,17 +747,17 @@ declare module GoogleAppsScript {
export enum Position { TOP, RIGHT, BOTTOM, NONE }
/**
* Builder for scatter charts. For more details, see the
* Builder for scatter charts. For more details, see the
* Google Charts documentation.
*
*
* Here is an example that shows how to build a scatter chart. The data is
* imported from a Google spreadsheet.
*
*
* function doGet() {
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=C1%3AD' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1';
*
*
* var chartBuilder = Charts.newScatterChart()
* .setTitle('Adjusted GDP vs. U.S. Population')
* .setXAxisTitle('U.S. Population (millions)')
@@ -765,7 +765,7 @@ declare module GoogleAppsScript {
* .setDimensions(600, 500)
* .setLegendPosition(Charts.Position.NONE)
* .setDataSourceUrl(dataSourceUrl);
*
*
* var chart = chartBuilder.build();
* return UiApp.createApplication().add(chart);
* }
@@ -799,14 +799,14 @@ declare module GoogleAppsScript {
/**
* A builder for string filter controls.
*
*
* A string filter is a simple text input field that lets the user filter data via string matching.
* Given a column of type string and matching options, this control will filter out the rows that
* don't match the term that's in the input field.
*
*
* This example creates a table chart and binds it to a string filter. Using the filter, it is
* possible to change the table chart to display a subset of its data.
*
*
* function doGet() {
* var app = UiApp.createApplication();
* var sampleData = Charts.newDataTable()
@@ -826,32 +826,32 @@ declare module GoogleAppsScript {
* .addRow(["Nov", 58, 388])
* .addRow(["Dec", 63, 400])
* .build();
*
*
* var chart = Charts.newTableChart()
* .setDimensions(600, 500)
* .build();
*
*
* var stringFilter = Charts.newStringFilter()
* .setFilterColumnLabel("Month")
* .setRealtimeTrigger(true)
* .setCaseSensitive(true)
* .setLabel("Filter months shown")
* .build();
*
*
* var panel = app.createVerticalPanel().setSpacing(10);
* panel.add(stringFilter).add(chart);
*
*
* // Create a dashboard panel to bind the filter and the chart together.
* var dashboard = Charts.newDashboardPanel()
* .setDataTable(sampleData)
* .bind(stringFilter, chart)
* .build();
*
*
* dashboard.add(panel);
* app.add(dashboard);
* return app;
* }
*
*
* documentation
*/
export interface StringFilterBuilder {
@@ -869,22 +869,22 @@ declare module GoogleAppsScript {
}
/**
* A builder for table charts. For more details, see the
* A builder for table charts. For more details, see the
* Google Charts documentation.
*
*
* Here is an example that shows how to build a table chart. The data is
* imported from a Google spreadsheet.
*
*
* function doGet() {
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AF' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1';
*
*
* var chartBuilder = Charts.newTableChart()
* .setDimensions(600, 500)
* .enablePaging(20)
* .setDataSourceUrl(dataSourceUrl);
*
*
* var chart = chartBuilder.build();
* return UiApp.createApplication().add(chart);
* }
@@ -912,7 +912,7 @@ declare module GoogleAppsScript {
/**
* A text style configuration object. Used in charts options to configure text style for
* elements that accepts it, such as title, horizontal axis, vertical axis, legend and tooltip.
*
*
* // This example creates a chart specifying different text styles for the title and axes.
* function doGet() {
* var sampleData = Charts.newDataTable()
@@ -923,14 +923,14 @@ declare module GoogleAppsScript {
* .addRow(["Summer", 8])
* .addRow(["Fall", 8])
* .build();
*
*
* var titleTextStyleBuilder = Charts.newTextStyle()
* .setColor('#0000FF').setFontSize(26).setFontName('Ariel');
* var axisTextStyleBuilder = Charts.newTextStyle()
* .setColor('#3A3A3A').setFontSize(20).setFontName('Ariel');
* var titleTextStyle = titleTextStyleBuilder.build();
* var axisTextStyle = axisTextStyleBuilder.build();
*
*
* var chart = Charts.newLineChart()
* .setTitleTextStyle(titleTextStyle)
* .setXAxisTitleTextStyle(axisTextStyle)
@@ -940,7 +940,7 @@ declare module GoogleAppsScript {
* .setYAxisTitle('Number of Rainy Days')
* .setDataTable(sampleData)
* .build();
*
*
* return UiApp.createApplication().add(chart);
* }
*/
@@ -953,10 +953,10 @@ declare module GoogleAppsScript {
/**
* A builder used to create TextStyle objects. It allows configuration of the text's
* properties such as name, color, and size.
*
*
* The following example shows how to create a text style using the builder. For a more complete
* example, refer to the documentation for TextStyle.
*
*
* // Creates a new text style that uses 26-point, blue, Ariel font.
* var textStyleBuilder = Charts.newTextStyle()
* .setColor('#0000FF').setFontName('Ariel').setFontSize(26);
@@ -972,4 +972,4 @@ declare module GoogleAppsScript {
}
}
declare var Charts: GoogleAppsScript.Charts.Charts;
declare var Charts: GoogleAppsScript.Charts.Charts;
+2 -2
View File
@@ -6,7 +6,7 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Contacts {
/**
* Address field in a contact.
@@ -296,4 +296,4 @@ declare module GoogleAppsScript {
}
}
declare var ContactsApp: GoogleAppsScript.Contacts.ContactsApp;
declare var ContactsApp: GoogleAppsScript.Contacts.ContactsApp;
+8 -8
View File
@@ -5,13 +5,13 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Content {
/**
* Service for returning text content from a script.
*
*
* You can serve up text in various forms. For example, publish this script as a web app.
*
*
* function doGet() {
* return ContentService.createTextOutput("Hello World");
* }
@@ -29,17 +29,17 @@ declare module GoogleAppsScript {
/**
* A TextOutput object that can be served from a script.
*
*
* Due to security considerations, scripts cannot directly return text content to a browser.
* Instead, the browser is redirected to googleusercontent.com, which will display it without any
* further sanitization or manipulation.
*
*
* You can return text content like this:
*
*
* function doGet() {
* return ContentService.createPlainTextOutput("hello world!");
* }
*
*
* ContentService
*/
export interface TextOutput {
@@ -56,4 +56,4 @@ declare module GoogleAppsScript {
}
}
declare var ContentService: GoogleAppsScript.Content.ContentService;
declare var ContentService: GoogleAppsScript.Content.ContentService;
+96 -96
View File
@@ -6,18 +6,18 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Document {
/**
* An enumeration of the element attributes.
*
*
* Use attributes to compose custom styles. For example:
*
*
* // Define a style with yellow background.
* var highlightStyle = {};
* highlightStyle[DocumentApp.Attribute.BACKGROUND_COLOR] = '#FFFF00';
* highlightStyle[DocumentApp.Attribute.BOLD] = true;
*
*
* // Insert "Hello", highlighted.
* DocumentApp.getActiveDocument().editAsText()
* .insertText(0, 'Hello\n')
@@ -30,13 +30,13 @@ declare module GoogleAppsScript {
* Paragraph, Table, and TableOfContents elements. For more information on
* document structure, see the
* guide to extending Google Docs.
*
*
* The Body typically contains the full document contents except for the
* HeaderSection, FooterSection, and any FootnoteSection elements.
*
*
* var doc = DocumentApp.getActiveDocument();
* var body = doc.getBody();
*
*
* // Append a paragraph and a page break to the document body section directly.
* body.appendParagraph("A paragraph.");
* body.appendPageBreak();
@@ -112,7 +112,7 @@ declare module GoogleAppsScript {
/**
* An object representing a bookmark.
*
*
* // Insert a bookmark at the cursor position and log its ID.
* var doc = DocumentApp.getActiveDocument();
* var cursor = doc.getCursor();
@@ -170,12 +170,12 @@ declare module GoogleAppsScript {
/**
* A document, containing rich text and elements such as tables and lists.
*
*
* Documents may be opened or created using DocumentApp.
*
*
* // Open a document by ID.
* var doc = DocumentApp.openById("<my-id>");
*
*
* // Create and open a document.
* doc = DocumentApp.create("Document Title");
*/
@@ -222,10 +222,10 @@ declare module GoogleAppsScript {
/**
* The document service creates and opens Documents that can be edited.
*
*
* // Open a document by ID.
* var doc = DocumentApp.openById('DOCUMENT_ID_GOES_HERE');
*
*
* // Create and open a document.
* doc = DocumentApp.create('Document Name');
*/
@@ -251,51 +251,51 @@ declare module GoogleAppsScript {
* are elements and inherit all of the methods defined by Element, such as
* getType().
* Implementing classes
*
*
* NameBrief description
*
*
* BodyAn element representing a document body.
*
*
* ContainerElementA generic element that may contain other elements.
*
*
* EquationAn element representing a mathematical expression.
*
*
* EquationFunctionAn element representing a function in a mathematical Equation.
*
*
* EquationFunctionArgumentSeparatorAn element representing a function separator in a mathematical Equation.
*
*
* EquationSymbolAn element representing a symbol in a mathematical Equation.
*
*
* FooterSectionAn element representing a footer section.
*
*
* FootnoteAn element representing a footnote.
*
*
* FootnoteSectionAn element representing a footnote section.
*
*
* HeaderSectionAn element representing a header section.
*
*
* HorizontalRuleAn element representing an horizontal rule.
*
*
* InlineDrawingAn element representing an embedded drawing.
*
*
* InlineImageAn element representing an embedded image.
*
*
* ListItemAn element representing a list item.
*
*
* PageBreakAn element representing a page break.
*
*
* ParagraphAn element representing a paragraph.
*
*
* TableAn element representing a table.
*
*
* TableCellAn element representing a table cell.
*
*
* TableOfContentsAn element containing a table of contents.
*
*
* TableRowAn element representing a table row.
*
*
* TextAn element representing a rich text region.
*
*
* UnsupportedElementAn element representing a region that is unknown or cannot be affected by a script, such as a
* page number.
*/
@@ -334,10 +334,10 @@ declare module GoogleAppsScript {
/**
* An enumeration of all the element types.
*
*
* Use the ElementType enumeration to check the type of a given
* element, for instance:
*
*
* var firstChild = DocumentApp.getActiveDocument().getBody().getChild(0);
* if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) {
* // It's a paragraph, apply a paragraph heading.
@@ -455,26 +455,26 @@ declare module GoogleAppsScript {
}
/**
*
*
* Deprecated. The methods getFontFamily() and setFontFamily(String) now use string
* names for fonts instead of this enum. Although this enum is deprecated, it will remain
* available for compatibility with older scripts.
* An enumeration of the supported fonts.
*
*
* Use the FontFamily enumeration to set the font for a range of
* text, element or document.
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Insert a paragraph at the start of the document.
* body.insertParagraph(0, "Hello, Apps Script!");
*
*
* // Set the document font to Calibri.
* body.editAsText().setFontFamily(DocumentApp.FontFamily.CALIBRI);
*
*
* // Set the first paragraph font to Arial.
* body.getParagraphs()[0].setFontFamily(DocumentApp.FontFamily.ARIAL);
*
*
* // Set "Apps Script" to Comic Sans MS.
* var text = 'Apps Script';
* var a = body.getText().indexOf(text);
@@ -607,15 +607,15 @@ declare module GoogleAppsScript {
/**
* An enumeration of the supported glyph types.
*
*
* Use the GlyphType enumeration to set the bullet type for list
* items.
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Insert at list item, with the default nesting level of zero.
* body.appendListItem("Item 1");
*
*
* // Append a second list item, with a nesting level of one, indented one inch.
* // The two items will have different bullet glyphs.
* body.appendListItem("Item 2").setNestingLevel(1).setIndentStart(72)
@@ -687,24 +687,24 @@ declare module GoogleAppsScript {
/**
* An enumeration of the supported horizontal alignment types.
*
*
* Use the HorizontalAlignment enumeration to manipulate the
* alignment of Paragraph contents.
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Insert a paragraph and a table at the start of document.
* var par1 = body.insertParagraph(0, "Center");
* var table = body.insertTable(1, [['Left', 'Right']]);
* var par2 = table.getCell(0, 0).getChild(0).asParagraph();
* var par3 = table.getCell(0, 0).getChild(0).asParagraph();
*
*
* // Center align the first paragraph.
* par1.setAlignment(DocumentApp.HorizontalAlignment.CENTER);
*
*
* // Left align the first cell.
* par2.setAlignment(DocumentApp.HorizontalAlignment.LEFT);
*
*
* // Right align the second cell.
* par3.setAlignment(DocumentApp.HorizontalAlignment.RIGHT);
*/
@@ -782,28 +782,28 @@ declare module GoogleAppsScript {
* HorizontalRule, InlineDrawing, InlineImage, PageBreak, and
* Text elements. For more information on document structure, see the
* guide to extending Google Docs.
*
*
* ListItems may not contain new-line characters. New-line characters ("\n") are
* converted to line-break characters ("\r").
*
*
* ListItems with the same list ID belong to the same list and are numbered accordingly.
* The ListItems for a given list are not required to be adjacent in the document or even
* have the same parent element. Two items belonging to the same list may exist anywhere in the
* document while maintaining consecutive numbering, as the following example illustrates:
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Append a new list item to the body.
* var item1 = body.appendListItem('Item 1');
*
*
* // Log the new list item's list ID.
* Logger.log(item1.getListId());
*
*
* // Append a table after the list item.
* body.appendTable([
* ['Cell 1', 'Cell 2']
* ]);
*
*
* // Append a second list item with the same list ID. The two items are treated as the same list,
* // despite not being consecutive.
* var item2 = body.appendListItem('Item 2');
@@ -882,10 +882,10 @@ declare module GoogleAppsScript {
* necessarily unique; several different ranges in the same document may share the same name, much
* like a class in HTML. By contrast, IDs are unique within the document, like an ID in HTML. Once a
* NamedRange has been added to a document, it cannot be modified, only removed.
*
*
* A NamedRange can be accessed by any script that accesses the document. To avoid
* unintended conflicts between scripts, consider prefixing range names with a unique string.
*
*
* // Create a named range that includes every table in the document.
* var doc = DocumentApp.getActiveDocument();
* var rangeBuilder = doc.newRange();
@@ -927,20 +927,20 @@ declare module GoogleAppsScript {
* Footnote, HorizontalRule, InlineDrawing, InlineImage,
* PageBreak, and Text elements. For more information on document structure, see the
* guide to extending Google Docs.
*
*
* Paragraphs may not contain new-line characters. New-line characters ("\n") are
* converted to line-break characters ("\r").
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Append a document header paragraph.
* var header = body.appendParagraph("A Document");
* header.setHeading(DocumentApp.ParagraphHeading.HEADING1);
*
*
* // Append a section header paragraph.
* var section = body.appendParagraph("Section 1");
* section.setHeading(DocumentApp.ParagraphHeading.HEADING2);
*
*
* // Append a regular paragraph.
* body.appendParagraph("This is a typical paragraph.");
*/
@@ -1008,20 +1008,20 @@ declare module GoogleAppsScript {
/**
* An enumeration of the standard paragraph headings.
*
*
* Use the ParagraphHeading enumeration to configure
* the heading style for ParagraphElement.
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Append a paragraph, with heading 1.
* var par1 = body.appendParagraph("Title");
* par1.setHeading(DocumentApp.ParagraphHeading.HEADING1);
*
*
* // Append a paragraph, with heading 2.
* var par2 = body.appendParagraph("SubTitle");
* par2.setHeading(DocumentApp.ParagraphHeading.HEADING2);
*
*
* // Append a paragraph, with normal heading.
* var par3 = body.appendParagraph("Text");
* par3.setHeading(DocumentApp.ParagraphHeading.NORMAL);
@@ -1033,7 +1033,7 @@ declare module GoogleAppsScript {
* represented as a Position, among other uses. Scripts can only access the cursor of the
* user who is running the script, and only if the script is
* bound to the document.
*
*
* // Insert some text at the cursor position and make it bold.
* var cursor = DocumentApp.getActiveDocument().getCursor();
* if (cursor) {
@@ -1064,18 +1064,18 @@ declare module GoogleAppsScript {
* Range, among other uses. Scripts can only access the selection of the user who is running
* the script, and only if the script is
* bound to the document.
*
*
* // Bold all selected text.
* var selection = DocumentApp.getActiveDocument().getSelection();
* if (selection) {
* var elements = selection.getRangeElements();
* for (var i = 0; i < elements.length; i++) {
* var element = elements[i];
*
*
* // Only modify elements that can be edited as text; skip images and other non-text elements.
* if (element.getElement().editAsText) {
* var text = element.getElement().editAsText();
*
*
* // Bold the selected part of the element, or the full element if it's completely selected.
* if (element.isPartial()) {
* text.setBold(element.getStartOffset(), element.getEndOffsetInclusive(), true);
@@ -1093,7 +1093,7 @@ declare module GoogleAppsScript {
/**
* A builder used to construct Range objects from document elements.
*
*
* // Change the user's selection to a range that includes every table in the document.
* var doc = DocumentApp.getActiveDocument();
* var rangeBuilder = doc.newRange();
@@ -1130,18 +1130,18 @@ declare module GoogleAppsScript {
* An element representing a table. A Table may only contain TableRow elements. For
* more information on document structure, see the
* guide to extending Google Docs.
*
*
* When creating a Table that contains a large number of rows or cells, consider building
* it from a string array, as shown in the following example.
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Create a two-dimensional array containing the cell contents.
* var cells = [
* ['Row 1, Cell 1', 'Row 1, Cell 2'],
* ['Row 2, Cell 1', 'Row 2, Cell 2']
* ];
*
*
* // Build a table from the array.
* body.appendTable(cells);
*/
@@ -1347,19 +1347,19 @@ declare module GoogleAppsScript {
* EquationFunction, ListItem, or Paragraph, but cannot itself contain any
* other element. For more information on document structure, see the
* guide to extending Google Docs.
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Use editAsText to obtain a single text element containing
* // all the characters in the document.
* var text = body.editAsText();
*
*
* // Insert text at the beginning of the document.
* text.insertText(0, 'Inserted text.\n');
*
*
* // Insert text at the end of the document.
* text.appendText('\nAppended text.');
*
*
* // Make the first half of the document blue.
* text.setForegroundColor(0, text.getText().length / 2, '#00FFFF');
*/
@@ -1430,7 +1430,7 @@ declare module GoogleAppsScript {
/**
* An enumeration of the type of text alignments.
*
*
* // Make the first character in the first paragraph be superscript.
* var text = DocumentApp.getActiveDocument().getBody().getParagraphs()[0].editAsText();
* text.setTextAlignment(0, 0, DocumentApp.TextAlignment.SUPERSCRIPT);
@@ -1456,21 +1456,21 @@ declare module GoogleAppsScript {
/**
* An enumeration of the supported vertical alignment types.
*
*
* Use the VerticalAlignment enumeration to set the vertical
* alignment of table cells.
*
*
* var body = DocumentApp.getActiveDocument().getBody();
*
*
* // Append table containing two cells.
* var table = body.appendTable([['Top', 'Center', 'Bottom']]);
*
*
* // Align the first cell's contents to the top.
* table.getCell(0, 0).setVerticalAlignment(DocumentApp.VerticalAlignment.TOP);
*
*
* // Align the second cell's contents to the center.
* table.getCell(0, 1).setVerticalAlignment(DocumentApp.VerticalAlignment.CENTER);
*
*
* // Align the third cell's contents to the bottom.
* table.getCell(0, 2).setVerticalAlignment(DocumentApp.VerticalAlignment.BOTTOM);
*/
@@ -1479,4 +1479,4 @@ declare module GoogleAppsScript {
}
}
declare var DocumentApp: GoogleAppsScript.Document.DocumentApp;
declare var DocumentApp: GoogleAppsScript.Document.DocumentApp;
+10 -10
View File
@@ -6,13 +6,13 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Drive {
/**
* An enum representing classes of users who can access a file or folder, besides any individual
* users who have been explicitly given access. These properties can be accessed from
* DriveApp.Access.
*
*
* // Creates a folder that anyone on the Internet can read from and write to. (Domain
* // administrators can prohibit this setting for users of Google Apps for Business, Google Apps
* // for Education, or Google Apps for Your Domain.)
@@ -23,7 +23,7 @@ declare module GoogleAppsScript {
/**
* Allows scripts to create, find, and modify files and folders in Google Drive.
*
*
* // Log the name of every file in the user's Drive.
* var files = DriveApp.getFiles();
* while (files.hasNext()) {
@@ -62,7 +62,7 @@ declare module GoogleAppsScript {
/**
* A file in Google Drive. Files can be accessed or created from DriveApp.
*
*
* // Trash every untitled spreadsheet that hasn't been updated in a week.
* var files = DriveApp.getFilesByName('Untitled spreadsheet');
* while (files.hasNext()) {
@@ -131,7 +131,7 @@ declare module GoogleAppsScript {
/**
* An iterator that allows scripts to iterate over a potentially large collection of files. File
* iterators can be acccessed from DriveApp or a Folder.
*
*
* // Log the name of every file in the user's Drive.
* var files = DriveApp.getFiles();
* while (files.hasNext()) {
@@ -147,7 +147,7 @@ declare module GoogleAppsScript {
/**
* A folder in Google Drive. Folders can be accessed or created from DriveApp.
*
*
* // Log the name of every folder in the user's Drive.
* var folders = DriveApp.getFolders();
* while (folders.hasNext()) {
@@ -214,7 +214,7 @@ declare module GoogleAppsScript {
/**
* An object that allows scripts to iterate over a potentially large collection of folders. Folder
* iterators can be acccessed from DriveApp, a File, or a Folder.
*
*
* // Log the name of every folder in the user's Drive.
* var folders = DriveApp.getFolders();
* while (folders.hasNext()) {
@@ -232,7 +232,7 @@ declare module GoogleAppsScript {
* An enum representing the permissions granted to users who can access a file or folder, besides
* any individual users who have been explicitly given access. These properties can be accessed from
* DriveApp.Permission.
*
*
* // Creates a folder that anyone on the Internet can read from and write to. (Domain
* // administrators can prohibit this setting for users of Google Apps for Business, Google Apps
* // for Education, or Google Apps for Your Domain.)
@@ -244,7 +244,7 @@ declare module GoogleAppsScript {
/**
* A user associated with a file in Google Drive. Users can be accessed from
* File.getEditors(), Folder.getViewers(), and other methods.
*
*
* // Log the email address of all users who have edit access to a file.
* var file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz');
* var editors = file.getEditors();
@@ -263,4 +263,4 @@ declare module GoogleAppsScript {
}
}
declare var DriveApp: GoogleAppsScript.Drive.DriveApp;
declare var DriveApp: GoogleAppsScript.Drive.DriveApp;
+44 -44
View File
@@ -6,12 +6,12 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Forms {
/**
* An enum representing the supported types of image alignment. Alignment types can be accessed from
* FormApp.Alignment.
*
*
* // Open a form by ID and add a new image item with alignment
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var img = UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png');
@@ -24,7 +24,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to select one or more checkboxes, as well as an
* optional "other" field. Items can be accessed or created from a Form.
*
*
* // Open a form by ID and add a new checkbox item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addCheckboxItem();
@@ -59,7 +59,7 @@ declare module GoogleAppsScript {
/**
* A single choice associated with a type of Item that supports choices, like
* CheckboxItem, ListItem, or MultipleChoiceItem.
*
*
* // Create a new form and add a multiple-choice item.
* var form = FormApp.create('Form Name');
* var item = form.addMultipleChoiceItem();
@@ -68,10 +68,10 @@ declare module GoogleAppsScript {
* item.createChoice('Cats', FormApp.PageNavigationType.CONTINUE),
* item.createChoice('Dogs', FormApp.PageNavigationType.RESTART)
* ]);
*
*
* // Add another page because navigation has no effect on the last page.
* form.addPageBreakItem().setTitle('You chose well!');
*
*
* // Log the navigation types that each choice results in.
* var choices = item.getChoices();
* for (var i = 0; i < choices.length; i++) {
@@ -89,7 +89,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to indicate a date. Items can be accessed or created
* from a Form.
*
*
* // Open a form by ID and add a new date item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addDateItem();
@@ -114,7 +114,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to indicate a date and time. Items can be accessed or
* created from a Form.
*
*
* // Open a form by ID and add a new date-time item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addDateTimeItem();
@@ -142,11 +142,11 @@ declare module GoogleAppsScript {
* save
* a copy of responses in the form's response store. Destination types can be accessed from
* FormApp.DestinationType.
*
*
* // Open a form by ID and create a new spreadsheet.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var ss = SpreadsheetApp.create('Spreadsheet Name');
*
*
* // Update the form's response destination.
* form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId());
*/
@@ -155,7 +155,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to indicate a length of time. Items can be accessed or
* created from a Form.
*
*
* // Open a form by ID and add a new duration item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addDurationItem();
@@ -179,18 +179,18 @@ declare module GoogleAppsScript {
* A form that contains overall properties (such as title, settings, and where responses are stored)
* and items (which includes question items like checkboxes and layout items like page breaks).
* Forms can be accessed or created from FormApp.
*
*
* // Open a form by ID and create a new spreadsheet.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var ss = SpreadsheetApp.create('Spreadsheet Name');
*
*
* // Update form properties via chaining.
* form.setTitle('Form Name')
* .setDescription('Description of form')
* .setConfirmationMessage('Thanks for responding!')
* .setAllowResponseEdits(true)
* .setAcceptingResponses(false);
*
*
* // Update the form's response destination.
* form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId());
*/
@@ -267,10 +267,10 @@ declare module GoogleAppsScript {
/**
* Allows a script to open existing Forms or create new ones.
*
*
* // Open a form by ID.
* var existingForm = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
*
*
* // Create and open a form.
* var newForm = FormApp.create('Form Name');
*/
@@ -292,7 +292,7 @@ declare module GoogleAppsScript {
* respond to the form (see withItemResponse(response) and submit()), and they
* can be used as a template to create a URL for the form with pre-filled answers. Form responses
* can be created or accessed from a Form.
*
*
* // Open a form by ID and log the responses to each question.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var formResponses = form.getResponses();
@@ -324,7 +324,7 @@ declare module GoogleAppsScript {
* A question item, presented as a grid of columns and rows, that allows the respondent to select
* one choice per row from a sequence of radio buttons. Items can be accessed or created from a
* Form.
*
*
* // Open a form by ID and add a new grid item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addGridItem();
@@ -352,7 +352,7 @@ declare module GoogleAppsScript {
/**
* A layout item that displays an image. Items can be accessed or created from a Form.
*
*
* // Open a form by ID and add a new image item
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var img = UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png');
@@ -381,19 +381,19 @@ declare module GoogleAppsScript {
/**
* A generic form item that contains properties common to all items, such as title and help text.
* Items can be accessed or created from a Form.
*
*
* To operate on type-specific properties, use getType() to check the item's
* ItemType, then cast the item to the
* appropriate class using a method like asCheckboxItem().
*
*
* // Create a new form and add a text item.
* var form = FormApp.create('Form Name');
* form.addTextItem();
*
*
* // Access the text item as a generic item.
* var items = form.getItems();
* var item = items[0];
*
*
* // Cast the generic item to the text-item class.
* if (item.getType() == 'TEXT') {
* var textItem = item.asTextItem();
@@ -430,7 +430,7 @@ declare module GoogleAppsScript {
* A response to one question item within a form. Item responses can be accessed from
* FormResponse and created from any Item that asks the respondent to answer a
* question.
*
*
* // Open a form by ID and log the responses to each question.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var formResponses = form.getResponses();
@@ -454,12 +454,12 @@ declare module GoogleAppsScript {
/**
* An enum representing the supported types of form items. Item types can be accessed from
* FormApp.ItemType.
*
*
* // Open a form by ID and add a new section header.
* var form = FormApp.create('Form Name');
* var item = form.addSectionHeaderItem();
* item.setTitle('Title of new section');
*
*
* // Check the item type.
* if (item.getType() == FormApp.ItemType.SECTION_HEADER) {
* item.setHelpText('Description of new section.');
@@ -470,7 +470,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to select one choice from a drop-down list. Items can
* be accessed or created from a Form.
*
*
* // Open a form by ID and add a new list item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addListItem();
@@ -503,7 +503,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to select one choice from a list of radio buttons or
* an optional "other" field. Items can be accessed or created from a Form.
*
*
* // Open a form by ID and add a new multiple choice item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addMultipleChoiceItem();
@@ -539,13 +539,13 @@ declare module GoogleAppsScript {
/**
* A layout item that marks the start of a page. Items can be accessed or
* created from a Form.
*
*
* // Create a form and add three page-break items.
* var form = FormApp.create('Form Name');
* var pageTwo = form.addPageBreakItem().setTitle('Page Two');
* var pageThree = form.addPageBreakItem().setTitle('Page Three');
*
* // Make the first two pages navigate elsewhere upon completion.
*
* // Make the first two pages navigate elsewhere upon completion.
* pageTwo.setGoToPage(pageThree); // At end of page one (start of page two), jump to page three
* pageThree.setGoToPage(FormApp.PageNavigationType.RESTART); // At end of page two, restart form
*/
@@ -567,23 +567,23 @@ declare module GoogleAppsScript {
/**
* An enum representing the supported types of page navigation. Page navigation types can be
* accessed from FormApp.PageNavigationType.
*
*
* The page navigation occurs after the respondent completes a page that contains the option, and
* only if the respondent chose that option. If the respondent chose multiple options with
* page-navigation instructions on the same page, only the last navigation option has any effect.
* Page navigation also has no effect on the last page of a form.
* Choices that use page navigation cannot be combined in the same item with choices that do not
* use page navigation.
*
*
* // Create a form and add a new multiple-choice item and a page-break item.
* var form = FormApp.create('Form Name');
* var item = form.addMultipleChoiceItem();
* var pageBreak = form.addPageBreakItem();
*
*
* // Set some choices with go-to-page logic.
* var rightChoice = item.createChoice('Vanilla', FormApp.PageNavigationType.SUBMIT);
* var wrongChoice = item.createChoice('Chocolate', FormApp.PageNavigationType.RESTART);
*
*
* // For GO_TO_PAGE, just pass in the page break item. For CONTINUE (normally the default), pass in
* // CONTINUE explicitly because page navigation cannot be mixed with non-navigation choices.
* var iffyChoice = item.createChoice('Peanut', pageBreak);
@@ -595,7 +595,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to enter a block of text. Items can be accessed or
* created from a Form.
*
*
* // Open a form by ID and add a new paragraph text item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addParagraphTextItem();
@@ -618,7 +618,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to choose one option from a numbered sequence of radio
* buttons. Items can be accessed or created from a Form.
*
*
* // Open a form by ID and add a new scale item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addScaleItem();
@@ -648,7 +648,7 @@ declare module GoogleAppsScript {
/**
* A layout item that visually indicates the start of a section. Items can be accessed or created
* from a Form.
*
*
* // Open a form by ID and add a new section header.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addSectionHeaderItem();
@@ -668,7 +668,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to enter a single line of text. Items can be accessed
* or created from a Form.
*
*
* // Open a form by ID and add a new text item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addTextItem();
@@ -691,7 +691,7 @@ declare module GoogleAppsScript {
/**
* A question item that allows the respondent to indicate a time of day. Items can be accessed or
* created from a Form.
*
*
* // Open a form by ID and add a new time item.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
* var item = form.addTimeItem();
@@ -713,7 +713,7 @@ declare module GoogleAppsScript {
/**
* A layout item that displays a video. Items can be accessed or created from a Form.
*
*
* // Open a form by ID and add three new video items, using a long URL,
* // a short URL, and a video ID.
* var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
@@ -721,12 +721,12 @@ declare module GoogleAppsScript {
* .setTitle('Video Title')
* .setHelpText('Video Caption')
* .setVideoUrl('www.youtube.com/watch?v=1234abcdxyz');
*
*
* form.addVideoItem()
* .setTitle('Video Title')
* .setHelpText('Video Caption')
* .setVideoUrl('youtu.be/1234abcdxyz');
*
*
* form.addVideoItem()
* .setTitle('Video Title')
* .setHelpText('Video Caption')
@@ -751,4 +751,4 @@ declare module GoogleAppsScript {
}
}
declare var FormApp: GoogleAppsScript.Forms.FormApp;
declare var FormApp: GoogleAppsScript.Forms.FormApp;
+3 -3
View File
@@ -6,7 +6,7 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Gmail {
/**
* Provides access to Gmail threads, messages, and labels.
@@ -79,7 +79,7 @@ declare module GoogleAppsScript {
* Blob except that it has an extra
* getSize() method that is faster than calling getBytes().length and does
* not count against the Gmail read quota.
*
*
* // Logs information about any attachments in the first 100 inbox threads.
* var threads = GmailApp.getInboxThreads(0, 100);
* var msgs = GmailApp.getMessagesForThreads(threads);
@@ -202,4 +202,4 @@ declare module GoogleAppsScript {
}
}
declare var GmailApp: GoogleAppsScript.Gmail.GmailApp;
declare var GmailApp: GoogleAppsScript.Gmail.GmailApp;
+7 -7
View File
@@ -6,15 +6,15 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Groups {
/**
* A group object whose members and those members' roles within the group
* can be queried.
*
*
* Here's an example which shows the members of a group. Before running it,
* replace the email address of the group with that of one on your domain.
*
*
* function listGroupMembers() {
* var group = GroupsApp.getGroupByEmail("example@googlegroups.com");
* var s = group.getEmail() + ': ';
@@ -39,9 +39,9 @@ declare module GoogleAppsScript {
* This class provides access to Google Groups information. It can be used to
* query information such as a group's email address, or the list of groups in
* which the user is a direct member.
*
*
* Here's an example that shows how many groups the current user is a member of:
*
*
* var groups = GroupsApp.getGroups();
* Logger.log('You belong to ' + groups.length + ' groups.');
*/
@@ -56,7 +56,7 @@ declare module GoogleAppsScript {
* Users subscribed to a group have exactly one role within the context of that
* group.
* See also
*
*
* Group.getRole(email)
*/
export enum Role { OWNER, MANAGER, MEMBER, INVITED, PENDING }
@@ -64,4 +64,4 @@ declare module GoogleAppsScript {
}
}
declare var GroupsApp: GoogleAppsScript.Groups.GroupsApp;
declare var GroupsApp: GoogleAppsScript.Groups.GroupsApp;
+9 -9
View File
@@ -6,17 +6,17 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module HTML {
/**
* An HtmlOutput object that can be served from a script. Due to security considerations,
* scripts cannot directly return HTML to a browser. Instead, they must sanitize it so that it
* cannot perform malicious actions. You can return sanitized HTML like this:
*
*
* function doGet() {
* return HtmlService.createHtmlOutput('<b>Hello, world!</b>');
* }
*
*
* HtmlOutput
* Google Caja
* guide to restrictions in HTML service
@@ -41,7 +41,7 @@ declare module GoogleAppsScript {
/**
* Service for returning HTML and other text content from a script.
*
*
* Due to security considerations, scripts cannot directly return content to a browser. Instead,
* they must sanitize the HTML so that it cannot perform malicious actions. See the description of
* HtmlOutput for what limitations this implies on what can be returned.
@@ -73,7 +73,7 @@ declare module GoogleAppsScript {
* An enum representing the sandbox modes that can be used for client-side HtmlService
* scripts. These values can be accessed from HtmlService.SandboxMode, and set by calling
* HtmlOutput.setSandboxMode(mode).
*
*
* To protect users from being served malicious HTML or JavaScript, client-side code served from
* HTML service executes in a security sandbox that imposes restrictions on the code. The method
* HtmlOutput.setSandboxMode(mode) allows script authors to choose between
@@ -88,13 +88,13 @@ declare module GoogleAppsScript {
* mode, most notably Internet Explorer 9. NATIVE mode is the middle ground. If
* NATIVE mode is set but not supported in the user's browser, the sandbox mode falls back
* to EMULATED mode for that user.
*
*
* // Serve HTML with a defined sandbox mode (in Apps Script server-side code).
* var output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');
* output.setSandboxMode(HtmlService.SandboxMode.IFRAME);
*
*
* google.script.sandbox.mode
*
*
* <!-- Read the sandbox mode (in a client-side script). -->
* <script>
* alert(google.script.sandbox.mode);
@@ -105,4 +105,4 @@ declare module GoogleAppsScript {
}
}
declare var HtmlService: GoogleAppsScript.HTML.HtmlService;
declare var HtmlService: GoogleAppsScript.HTML.HtmlService;
+4 -4
View File
@@ -6,7 +6,7 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module JDBC {
/**
* The JDBC service allows scripts to connect to Google Cloud SQL, MySQL,
@@ -63,7 +63,7 @@ declare module GoogleAppsScript {
* A JDBC CallableStatement. For documentation of this class, see
* java.sql.CallableStatement.
* See also
*
*
* CallableStatement
*/
export interface JdbcCallableStatement {
@@ -794,7 +794,7 @@ declare module GoogleAppsScript {
/**
* A JDBC Savepoint. For documentation of this class, see java.sql.Savepoint.
* See also
*
*
* Savepoint
*/
export interface JdbcSavepoint {
@@ -899,4 +899,4 @@ declare module GoogleAppsScript {
}
}
declare var Jdbc: GoogleAppsScript.JDBC.Jdbc;
declare var Jdbc: GoogleAppsScript.JDBC.Jdbc;
+3 -3
View File
@@ -5,11 +5,11 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Language {
/**
* The Language service provides scripts a way to compute automatic translations of text.
*
*
* // The code below will write "Esta es una prueba" to the log.
* var spanish = LanguageApp.translate('This is a test', 'en', 'es');
* Logger.log(spanish);
@@ -22,4 +22,4 @@ declare module GoogleAppsScript {
}
}
declare var LanguageApp: GoogleAppsScript.Language.LanguageApp;
declare var LanguageApp: GoogleAppsScript.Language.LanguageApp;
+10 -10
View File
@@ -5,35 +5,35 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Lock {
/**
* A representation of a mutual-exclusion lock.
*
*
* This class allows scripts to make sure that only one instance of the script is executing a given
* section of code at a time. This is particularly useful for callbacks and triggers, where a user
* action may cause changes to a shared resource and you want to ensure that aren't collisions.
*
*
* The following examples shows how to use a lock in a form submit handler.
*
*
* // Generates a unique ticket number for every form submission.
* function onFormSubmit(e) {
* var targetCell = e.range.offset(0, e.range.getNumColumns(), 1, 1);
*
*
* // Get a script lock, because we're about to modify a shared resource.
* var lock = LockService.getScriptLock();
* // Wait for up to 30 seconds for other processes to finish.
* lock.waitLock(30000);
*
*
* var ticketNumber = Number(ScriptProperties.getProperty('lastTicketNumber')) + 1;
* ScriptProperties.setProperty('lastTicketNumber', ticketNumber);
*
*
* // Release the lock so that other processes can continue.
* lock.releaseLock();
*
*
* targetCell.setValue(ticketNumber);
* }
*
*
* lastTicketNumber
* ScriptProperties
*/
@@ -57,4 +57,4 @@ declare module GoogleAppsScript {
}
}
declare var LockService: GoogleAppsScript.Lock.LockService;
declare var LockService: GoogleAppsScript.Lock.LockService;
+4 -4
View File
@@ -5,15 +5,15 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Mail {
/**
* Sends email.
*
*
* This service allows users to send emails with complete control over the
* content of the email. Unlike GmailApp, MailApp's sole purpose is sending email. MailApp cannot
* access a user's Gmail inbox.
*
*
* Changes to scripts written using GmailApp are more likely to trigger a re-authorization
* request from a user than MailApp scripts.
*/
@@ -28,4 +28,4 @@ declare module GoogleAppsScript {
}
}
declare var MailApp: GoogleAppsScript.Mail.MailApp;
declare var MailApp: GoogleAppsScript.Mail.MailApp;
+35 -35
View File
@@ -6,7 +6,7 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Maps {
/**
* An enum representing the types of restrictions to avoid when finding directions.
@@ -20,11 +20,11 @@ declare module GoogleAppsScript {
/**
* Allows for the retrieval of directions between locations.
*
*
* The example below shows how you can use this class to get the directions from Times Square to
* Central Park, stopping first at Lincoln Center, plot the locations and path on a map,
* and send the map in an email.
*
*
* // Get the directions.
* var directions = Maps.newDirectionFinder()
* .setOrigin('Times Square, New York, NY')
@@ -33,12 +33,12 @@ declare module GoogleAppsScript {
* .setMode(Maps.DirectionFinder.Mode.DRIVING)
* .getDirections();
* var route = directions.routes[0];
*
*
* // Set up marker styles.
* var markerSize = Maps.StaticMap.MarkerSize.MID;
* var markerColor = Maps.StaticMap.Color.GREEN
* var markerLetterCode = 'A'.charCodeAt();
*
*
* // Add markers to the map.
* var map = Maps.newStaticMap();
* for (var i = 0; i < route.legs.length; i++) {
@@ -53,10 +53,10 @@ declare module GoogleAppsScript {
* map.addMarker(leg.end_location.lat, leg.end_location.lng);
* markerLetterCode++;
* }
*
*
* // Add a path for the entire route.
* map.addPath(route.overview_polyline.points);
*
*
* // Send the map in an email.
* var toAddress = Session.getActiveUser().getEmail();
* MailApp.sendEmail(toAddress, 'Directions', 'Please open: ' + map.getMapUrl(), {
@@ -65,9 +65,9 @@ declare module GoogleAppsScript {
* mapImage: Utilities.newBlob(map.getMapImage(), 'image/png')
* }
* });
*
*
* See also
*
*
* Google Directions API
*/
export interface DirectionFinder {
@@ -99,10 +99,10 @@ declare module GoogleAppsScript {
/**
* Allows for the sampling of elevations at particular locations.
*
*
* The example below shows how you can use this class to determine the highest point along the route
* from Denver to Grand Junction in Colorado, plot it on a map, and save the map to Google Drive.
*
*
* // Get directions from Denver to Grand Junction.
* var directions = Maps.newDirectionFinder()
* .setOrigin('Denver, CO')
@@ -110,12 +110,12 @@ declare module GoogleAppsScript {
* .setMode(Maps.DirectionFinder.Mode.DRIVING)
* .getDirections();
* var route = directions.routes[0];
*
*
* // Get elevation samples along the route.
* var numberOfSamples = 30;
* var response = Maps.newElevationSampler()
* .samplePath(route.overview_polyline.points, numberOfSamples)
*
*
* // Determine highest point.
* var maxElevation = Number.MIN_VALUE;
* var highestPoint = null;
@@ -126,17 +126,17 @@ declare module GoogleAppsScript {
* highestPoint = sample.location;
* }
* }
*
*
* // Add the path and marker to a map.
* var map = Maps.newStaticMap()
* .addPath(route.overview_polyline.points)
* .addMarker(highestPoint.lat, highestPoint.lng);
*
*
* // Save the map to your drive
* DocsList.createFile(Utilities.newBlob(map.getMapImage(), 'image/png', 'map.png'));
*
*
* See also
*
*
* Google Elevation API
*/
export interface ElevationSampler {
@@ -150,27 +150,27 @@ declare module GoogleAppsScript {
/**
* An enum representing the format of the map image.
* See also
*
*
* Google Static Maps API
*/
export enum Format { PNG, PNG8, PNG32, GIF, JPG, JPG_BASELINE }
/**
* Allows for the conversion between an address and geographical coordinates.
*
*
* The example below shows how you can use this class find the top nine matches for the location
* "Main St" in Colorado, add them to a map, and then embed it in a new Google Doc.
*
*
* // Find the best matches for "Main St" in Colorado.
* var response = Maps.newGeocoder()
* // The latitudes and longitudes of southwest and northeast corners of Colorado, respectively.
* .setBounds(36.998166, -109.045486, 41.001666,-102.052002)
* .geocode('Main St');
*
*
* // Create a Google Doc and map.
* var doc = DocumentApp.create('My Map');
* var map = Maps.newStaticMap();
*
*
* // Add each result to the map and doc.
* for (var i = 0; i < response.results.length && i < 9; i++) {
* var result = response.results[i];
@@ -178,12 +178,12 @@ declare module GoogleAppsScript {
* map.addMarker(result.geometry.location.lat, result.geometry.location.lng);
* doc.appendListItem(result.formatted_address);
* }
*
*
* // Add the finished map to the doc.
* doc.appendImage(Utilities.newBlob(map.getMapImage(), 'image/png'));
*
*
* See also
*
*
* Google Geocoding API
*/
export interface Geocoder {
@@ -214,7 +214,7 @@ declare module GoogleAppsScript {
/**
* An enum representing the size of a marker added to a map.
* See also
*
*
* Google Static Maps API
*/
export enum MarkerSize { TINY, MID, SMALL }
@@ -226,21 +226,21 @@ declare module GoogleAppsScript {
/**
* Allows for the creation and decoration of static map images.
*
*
* The example below shows how you can use this class to create a map of New York City's Theatre
* District, including nearby train stations, and display it in a simple web app.
*
*
* function doGet(event) {
* // Create a map centered on Times Square.
* var map = Maps.newStaticMap()
* .setSize(600, 600)
* .setCenter('Times Square, New York, NY');
*
*
* // Add markers for the nearbye train stations.
* map.setMarkerStyle(Maps.StaticMap.MarkerSize.MID, Maps.StaticMap.Color.RED, 'T');
* map.addMarker('Grand Central Station, New York, NY');
* map.addMarker('Penn Station, New York, NY');
*
*
* // Show the boundaries of the Theatre District.
* var corners = [
* '8th Ave & 53rd St, New York, NY',
@@ -253,15 +253,15 @@ declare module GoogleAppsScript {
* for (var i = 0; i < corners.length; i++) {
* map.addAddress(corners[i]);
* }
*
*
* // Create the user interface and add the map image.
* var app = UiApp.createApplication().setTitle('NYC Theatre District');
* app.add(app.createImage(map.getMapUrl()));
* return app;
* }
*
*
* See also
*
*
* Google Static Maps API
*/
export interface StaticMap {
@@ -308,7 +308,7 @@ declare module GoogleAppsScript {
/**
* An enum representing the type of map to render.
* See also
*
*
* Google Static Maps API
*/
export enum Type { ROADMAP, SATELLITE, TERRAIN, HYBRID }
@@ -316,4 +316,4 @@ declare module GoogleAppsScript {
}
}
declare var Maps: GoogleAppsScript.Maps.Maps;
declare var Maps: GoogleAppsScript.Maps.Maps;
+46 -46
View File
@@ -5,18 +5,18 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Optimization {
/**
* Object storing a linear constraint of the form lowerBound ≤ Sum(a(i) x(i)) ≤ upperBound
* where lowerBound and upperBound are constants, a(i) are constant
* coefficients and x(i) are variables (unknowns).
*
*
* The example below creates one variable x with values between 0 and 5 and
* creates the constraint 0 ≤ 2 * x ≤ 5. This is done by first creating a constraint with
* the lower bound 5 and upper bound 5. Then the coefficient for variable x
* in this constraint is set to 2.
*
*
* var engine = LinearOptimizationService.createEngine();
* // Create a variable so we can add it to the constraint
* engine.addVariable('x', 0, 5);
@@ -33,46 +33,46 @@ declare module GoogleAppsScript {
/**
* The engine used to model and solve a linear program. The example below solves the following
* linear program:
*
*
* Two variables, x and y:
*
*
* 0 ≤ x ≤ 10
*
*
* 0 ≤ y ≤ 5
*
*
* Constraints:
*
*
* 0 ≤ 2 * x + 5 * y ≤ 10
*
*
* 0 ≤ 10 * x + 3 * y ≤ 20
*
*
* Objective:
* Maximize x + y
*
*
* var engine = LinearOptimizationService.createEngine();
*
*
* // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc
* // Add two variables, 0 <= x <= 10 and 0 <= y <= 5
* engine.addVariable('x', 0, 10);
* engine.addVariable('y', 0, 5);
*
*
* // Create the constraint: 0 <= 2 * x + 5 * y <= 10
* var constraint = engine.addConstraint(0, 10);
* constraint.setCoefficient('x', 2);
* constraint.setCoefficient('y', 5);
*
*
* // Create the constraint: 0 <= 10 * x + 3 * y <= 20
* var constraint = engine.addConstraint(0, 20);
* constraint.setCoefficient('x', 10);
* constraint.setCoefficient('y', 3);
*
*
* // Set the objective to be x + y
* engine.setObjectiveCoefficient('x', 1);
* engine.setObjectiveCoefficient('y', 1);
*
*
* // Engine should maximize the objective
* engine.setMaximization();
*
*
* // Solve the linear program
* var solution = engine.solve();
* if (!solution.isValid()) {
@@ -96,46 +96,46 @@ declare module GoogleAppsScript {
/**
* The linear optimization service, used to model and solve linear and mixed-integer linear
* programs. The example below solves the following linear program:
*
*
* Two variables, x and y:
*
*
* 0 ≤ x ≤ 10
*
*
* 0 ≤ y ≤ 5
*
*
* Constraints:
*
*
* 0 ≤ 2 * x + 5 * y ≤ 10
*
*
* 0 ≤ 10 * x + 3 * y ≤ 20
*
*
* Objective:
* Maximize x + y
*
*
* var engine = LinearOptimizationService.createEngine();
*
*
* // Add variables, constraints and define the objective using addVariable(), addConstraint(), etc.
* // Add two variables, 0 <= x <= 10 and 0 <= y <= 5
* engine.addVariable('x', 0, 10);
* engine.addVariable('y', 0, 5);
*
*
* // Create the constraint: 0 <= 2 * x + 5 * y <= 10
* var constraint = engine.addConstraint(0, 10);
* constraint.setCoefficient('x', 2);
* constraint.setCoefficient('y', 5);
*
*
* // Create the constraint: 0 <= 10 * x + 3 * y <= 20
* var constraint = engine.addConstraint(0, 20);
* constraint.setCoefficient('x', 10);
* constraint.setCoefficient('y', 3);
*
*
* // Set the objective to be x + y
* engine.setObjectiveCoefficient('x', 1);
* engine.setObjectiveCoefficient('y', 1);
*
*
* // Engine should maximize the objective.
* engine.setMaximization();
*
*
* // Solve the linear program
* var solution = engine.solve();
* if (!solution.isValid()) {
@@ -153,46 +153,46 @@ declare module GoogleAppsScript {
/**
* The solution of a linear program. The example below solves the following linear program:
*
*
* Two variables, x and y:
*
*
* 0 ≤ x ≤ 10
*
*
* 0 ≤ y ≤ 5
*
*
* Constraints:
*
*
* 0 ≤ 2 * x + 5 * y ≤ 10
*
*
* 0 ≤ 10 * x + 3 * y ≤ 20
*
*
* Objective:
* Maximize x + y
*
*
* var engine = LinearOptimizationService.createEngine();
*
*
* // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc.
* // Add two variables, 0 <= x <= 10 and 0 <= y <= 5
* engine.addVariable('x', 0, 10);
* engine.addVariable('y', 0, 5);
*
*
* // Create the constraint: 0 <= 2 * x + 5 * y <= 10
* var constraint = engine.addConstraint(0, 10);
* constraint.setCoefficient('x', 2);
* constraint.setCoefficient('y', 5);
*
*
* // Create the constraint: 0 <= 10 * x + 3 * y <= 20
* var constraint = engine.addConstraint(0, 20);
* constraint.setCoefficient('x', 10);
* constraint.setCoefficient('y', 3);
*
*
* // Set the objective to be x + y
* engine.setObjectiveCoefficient('x', 1);
* engine.setObjectiveCoefficient('y', 1);
*
*
* // Engine should maximize the objective
* engine.setMaximization();
*
*
* // Solve the linear program
* var solution = engine.solve();
* if (!solution.isValid()) {
@@ -225,4 +225,4 @@ declare module GoogleAppsScript {
}
}
declare var LinearOptimizationService: GoogleAppsScript.Optimization.LinearOptimizationService;
declare var LinearOptimizationService: GoogleAppsScript.Optimization.LinearOptimizationService;
+7 -7
View File
@@ -5,7 +5,7 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Properties {
/**
* The properties object acts as the interface to access user, document, or script properties.
@@ -31,14 +31,14 @@ declare module GoogleAppsScript {
/**
* Allows scripts to store simple data in key-value pairs scoped to one script, one user of a
* script, or one document in which an add-on is used. Properties cannot be shared between scripts.
* For more information about when to use each type of property, see the
* For more information about when to use each type of property, see the
* guide to the Properties service.
*
*
* // Sets three properties of different types.
* var documentProperties = PropertiesService.getDocumentProperties();
* var scriptProperties = PropertiesService.getScriptProperties();
* var userProperties = PropertiesService.getUserProperties();
*
*
* documentProperties.setProperty('DAYS_TO_FETCH', '5');
* scriptProperties.setProperty('SERVER_URL', 'http://www.example.com/MyWeatherService/');
* userProperties.setProperty('DISPLAY_UNITS', 'metric');
@@ -50,7 +50,7 @@ declare module GoogleAppsScript {
}
/**
*
*
* Deprecated. This class is deprecated and should not be used in new scripts.
* Script Properties are key-value pairs stored by a script in a persistent store. Script Properties
* are scoped per script, regardless of which user runs the script.
@@ -67,7 +67,7 @@ declare module GoogleAppsScript {
}
/**
*
*
* Deprecated. This class is deprecated and should not be used in new scripts.
* User Properties are key-value pairs unique to a user. User Properties are scoped per user; any
* script running under the identity of a user can access User Properties for that user only.
@@ -88,4 +88,4 @@ declare module GoogleAppsScript {
declare var PropertiesService: GoogleAppsScript.Properties.PropertiesService;
declare var ScriptProperties: GoogleAppsScript.Properties.ScriptProperties;
declare var UserProperties: GoogleAppsScript.Properties.UserProperties;
declare var UserProperties: GoogleAppsScript.Properties.UserProperties;
+6 -6
View File
@@ -9,7 +9,7 @@
/// <reference path="google-apps-script.forms.d.ts" />
/// <reference path="google-apps-script.spreadsheet.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Script {
/**
* An enumeration that identifies which categories of authorized services Apps Script
@@ -18,7 +18,7 @@ declare module GoogleAppsScript {
* property of the event parameter, e. For
* more information, see the
* guide to the authorization lifecycle for add-ons.
*
*
* function onOpen(e) {
* var menu = SpreadsheetApp.getUi().createAddonMenu();
* if (e && e.authMode == ScriptApp.AuthMode.NONE) {
@@ -49,7 +49,7 @@ declare module GoogleAppsScript {
* can be used to control access to sections of code for which the user lacks the necessary
* authorization. Alternately, the add-on can ask the user to open the URL for the
* authorization dialog to resolve the problem.
*
*
* This object is returned by
* ScriptApp.getAuthorizationInfo(authMode). In almost all cases,
* scripts should call
@@ -141,7 +141,7 @@ declare module GoogleAppsScript {
}
/**
*
*
*/
export enum Service { MYSELF, DOMAIN, ALL }
@@ -158,7 +158,7 @@ declare module GoogleAppsScript {
/**
* Allows scripts to create state tokens that can be used in callback APIs (like OAuth flows).
*
*
* // Reusable function to generate a callback URL, assuming the script has been published as a
* // web app (necessary to obtain the URL programmatically). If the script has not been published
* // as a web app, set `var url` in the first line to the URL of your script project (which
@@ -212,4 +212,4 @@ declare module GoogleAppsScript {
}
}
declare var ScriptApp: GoogleAppsScript.Script.ScriptApp;
declare var ScriptApp: GoogleAppsScript.Script.ScriptApp;
+5 -5
View File
@@ -6,16 +6,16 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Sites {
/**
* A Sites Attachment such as a file attached to a page.
*
*
* Note that an Attachment is a Blob and can be used anywhere Blob input is expected.
*
*
* var filesPage = SitesApp.getSite('example.com', 'mysite').getChildByName("files");
* var attachments = filesPage.getAttachments();
*
*
* // DocsList.createFile accepts a blob input. Since an Attachment is just a blob, we can
* // just pass it directly to that method
* var file = DocsList.createFile(attachments[0]);
@@ -238,4 +238,4 @@ declare module GoogleAppsScript {
}
}
declare var SitesApp: GoogleAppsScript.Sites.SitesApp;
declare var SitesApp: GoogleAppsScript.Sites.SitesApp;
+30 -30
View File
@@ -8,12 +8,12 @@
/// <reference path="google-apps-script.base.d.ts" />
/// <reference path="google-apps-script.drive.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Spreadsheet {
/**
* The chart's position within a sheet. Can be updated using the EmbeddedChart.modify()
* function.
*
*
* chart = chart.modify().setPosition(5, 5, 0, 0).build();
* sheet.updateChart(chart);
*/
@@ -28,7 +28,7 @@ declare module GoogleAppsScript {
* This class allows users to access existing data-validation rules. To create a new rule, see
* SpreadsheetApp.newDataValidation(), DataValidationBuilder, and
* Range.setDataValidation(rule).
*
*
* // Log information about the data-validation rule for cell A1.
* var cell = SpreadsheetApp.getActive().getRange('A1');
* var rule = cell.getDataValidation();
@@ -50,7 +50,7 @@ declare module GoogleAppsScript {
/**
* Builder for data-validation rules.
*
*
* // Set the data validation for cell A1 to require a value from B1:B10.
* var cell = SpreadsheetApp.getActive().getRange('A1');
* var range = SpreadsheetApp.getActive().getRange('B1:B10');
@@ -97,22 +97,22 @@ declare module GoogleAppsScript {
/**
* An enumeration representing the data-validation criteria that can be set on a range.
*
*
* // Change existing data-validation rules that require a date in 2013 to require a date in 2014.
* var oldDates = [new Date('1/1/2013'), new Date('12/31/2013')];
* var newDates = [new Date('1/1/2014'), new Date('12/31/2014')];
* var sheet = SpreadsheetApp.getActiveSheet();
* var range = sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns());
* var rules = range.getDataValidations();
*
*
* for (var i = 0; i < rules.length; i++) {
* for (var j = 0; j < rules[i].length; j++) {
* var rule = rules[i][j];
*
*
* if (rule != null) {
* var criteria = rule.getCriteriaType();
* var args = rule.getCriteriaValues();
*
*
* if (criteria == SpreadsheetApp.DataValidationCriteria.DATE_BETWEEN
* && args[0].getTime() == oldDates[0].getTime()
* && args[1].getTime() == oldDates[1].getTime()) {
@@ -127,7 +127,7 @@ declare module GoogleAppsScript {
export enum DataValidationCriteria { DATE_AFTER, DATE_BEFORE, DATE_BETWEEN, DATE_EQUAL_TO, DATE_IS_VALID_DATE, DATE_NOT_BETWEEN, DATE_ON_OR_AFTER, DATE_ON_OR_BEFORE, NUMBER_BETWEEN, NUMBER_EQUAL_TO, NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN, NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_NOT_BETWEEN, NUMBER_NOT_EQUAL_TO, TEXT_CONTAINS, TEXT_DOES_NOT_CONTAIN, TEXT_EQUAL_TO, TEXT_IS_VALID_EMAIL, TEXT_IS_VALID_URL, VALUE_IN_LIST, VALUE_IN_RANGE, CUSTOM_FORMULA }
/**
* Builder for area charts. For more details, see the Gviz
* Builder for area charts. For more details, see the Gviz
* documentation.
*/
export interface EmbeddedAreaChartBuilder {
@@ -167,7 +167,7 @@ declare module GoogleAppsScript {
}
/**
* Builder for bar charts. For more details, see the Gviz
* Builder for bar charts. For more details, see the Gviz
* documentation.
*/
export interface EmbeddedBarChartBuilder {
@@ -208,9 +208,9 @@ declare module GoogleAppsScript {
/**
* Represents a chart that has been embedded into a Spreadsheet.
*
*
* This example shows how to modify an existing chart:
*
*
* var sheet = SpreadsheetApp.getActiveSheet();
* var range = sheet.getRange("A2:B8")
* var chart = sheet.getCharts()[0];
@@ -221,9 +221,9 @@ declare module GoogleAppsScript {
* .setPosition(2,2,0,0)
* .build();
* sheet.updateChart(chart);
*
*
* This example shows how to create a new chart:
*
*
* function newChart(range, sheet) {
* var sheet = SpreadsheetApp.getActiveSheet();
* var chartBuilder = sheet.newChart();
@@ -248,7 +248,7 @@ declare module GoogleAppsScript {
/**
* This builder allows you to edit an EmbeddedChart. Make sure to call
* sheet.updateChart(builder.build()) to save your changes.
*
*
* var sheet = SpreadsheetApp.getActiveSheet();
* var range = sheet.getRange("A1:B8");
* var chart = sheet.getCharts()[0];
@@ -280,7 +280,7 @@ declare module GoogleAppsScript {
}
/**
* Builder for column charts. For more details, see the Gviz
* Builder for column charts. For more details, see the Gviz
* documentation.
*/
export interface EmbeddedColumnChartBuilder {
@@ -319,7 +319,7 @@ declare module GoogleAppsScript {
}
/**
* Builder for line charts. For more details, see the Gviz
* Builder for line charts. For more details, see the Gviz
* documentation.
*/
export interface EmbeddedLineChartBuilder {
@@ -359,7 +359,7 @@ declare module GoogleAppsScript {
}
/**
* Builder for pie charts. For more details, see the Gviz
* Builder for pie charts. For more details, see the Gviz
* documentation.
*/
export interface EmbeddedPieChartBuilder {
@@ -390,7 +390,7 @@ declare module GoogleAppsScript {
}
/**
* Builder for scatter charts. For more details, see the Gviz
* Builder for scatter charts. For more details, see the Gviz
* documentation.
*/
export interface EmbeddedScatterChartBuilder {
@@ -430,7 +430,7 @@ declare module GoogleAppsScript {
}
/**
* Builder for table charts. For more details, see the Gviz
* Builder for table charts. For more details, see the Gviz
* documentation.
*/
export interface EmbeddedTableChartBuilder {
@@ -463,7 +463,7 @@ declare module GoogleAppsScript {
}
/**
*
*
* Deprecated. For spreadsheets created in the newer version of Google Sheets, use the more powerful
* Protection class instead. Although this class is deprecated, it will remain
* available for compatibility with the older version of Sheets.
@@ -482,12 +482,12 @@ declare module GoogleAppsScript {
* range of cells or a named range. A protected sheet may include unprotected regions. For
* spreadsheets created with the older version of Google Sheets, use the PageProtection
* class instead.
*
*
* // Protect range A1:B10, then remove all other users from the list of editors.
* var ss = SpreadsheetApp.getActive();
* var range = ss.getRange('A1:B10');
* var protection = range.protect().setDescription('Sample protected range');
*
*
* // Ensure the current user is an editor before removing others. Otherwise, if the user's edit
* // permission comes from a group, the script will throw an exception upon removing the group.
* var me = Session.getEffectiveUser();
@@ -496,7 +496,7 @@ declare module GoogleAppsScript {
* if (protection.canDomainEdit()) {
* protection.setDomainEdit(false);
* }
*
*
* // Remove all range protections in the spreadsheet that the user has permission to edit.
* var ss = SpreadsheetApp.getActive();
* var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE);
@@ -506,11 +506,11 @@ declare module GoogleAppsScript {
* protection.remove();
* }
* }
*
*
* // Protect the active sheet, then remove all other users from the list of editors.
* var sheet = SpreadsheetApp.getActiveSheet();
* var protection = sheet.protect().setDescription('Sample protected sheet');
*
*
* // Ensure the current user is an editor before removing others. Otherwise, if the user's edit
* // permission comes from a group, the script will throw an exception upon removing the group.
* var me = Session.getEffectiveUser();
@@ -547,7 +547,7 @@ declare module GoogleAppsScript {
/**
* An enumeration representing the parts of a spreadsheet that can be protected from edits.
*
*
* // Remove all range protections in the spreadsheet that the user has permission to edit.
* var ss = SpreadsheetApp.getActive();
* var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE);
@@ -557,7 +557,7 @@ declare module GoogleAppsScript {
* protection.remove();
* }
* }
*
*
* // Removes sheet protection from the active sheet, if the user has permission to edit it.
* var sheet = SpreadsheetApp.getActiveSheet();
* var protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0];
@@ -569,7 +569,7 @@ declare module GoogleAppsScript {
/**
* Access and modify spreadsheet ranges.
*
*
* This class allows users to access and modify ranges in Google Sheets. A range can be
* a single cell in a sheet or a range of cells in a sheet.
*/
@@ -915,4 +915,4 @@ declare module GoogleAppsScript {
}
}
declare var SpreadsheetApp: GoogleAppsScript.Spreadsheet.SpreadsheetApp;
declare var SpreadsheetApp: GoogleAppsScript.Spreadsheet.SpreadsheetApp;
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: motemen <https://github.com/motemen/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
type BigNumber = any;
type Byte = number;
type Integer = number;
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -6,12 +6,12 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module URL_Fetch {
/**
* This class allows users to access specific information on HTTP responses.
* See also
*
*
* UrlFetchApp
*/
export interface HTTPResponse {
@@ -26,11 +26,11 @@ declare module GoogleAppsScript {
}
/**
*
*
* Deprecated. This class is deprecated and should not be used in new scripts.
* Represents configuration settings for an OAuth-enabled remote service.
* See also
*
*
* UrlFetchApp
*/
export interface OAuthConfig {
@@ -51,15 +51,15 @@ declare module GoogleAppsScript {
/**
* Fetch resources and communicate with other hosts over the Internet.
*
*
* This service allows scripts to communicate with other applications or access other resources on
* the web by fetching URLs. A script can use the URL Fetch service to issue HTTP and HTTPS requests
* and receive responses. The URL Fetch service uses Google's network infrastructure for efficiency
* and scaling purposes.
* See also
*
*
* OAuthConfig
*
*
* HTTPResponse
*/
export interface UrlFetchApp {
@@ -74,4 +74,4 @@ declare module GoogleAppsScript {
}
}
declare var UrlFetchApp: GoogleAppsScript.URL_Fetch.UrlFetchApp;
declare var UrlFetchApp: GoogleAppsScript.URL_Fetch.UrlFetchApp;
+2 -2
View File
@@ -6,7 +6,7 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module Utilities {
/**
* A typesafe enum for character sets.
@@ -73,4 +73,4 @@ declare module GoogleAppsScript {
declare var Charset: GoogleAppsScript.Utilities.Charset;
declare var DigestAlgorithm: GoogleAppsScript.Utilities.DigestAlgorithm;
declare var MacAlgorithm: GoogleAppsScript.Utilities.MacAlgorithm;
declare var Utilities: GoogleAppsScript.Utilities.Utilities;
declare var Utilities: GoogleAppsScript.Utilities.Utilities;
+18 -18
View File
@@ -5,11 +5,11 @@
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
declare namespace GoogleAppsScript {
export module XML_Service {
/**
* A representation of an XML attribute.
*
*
* // Reads the first and last name of each person and adds a new attribute with the full name.
* var xml = '<roster>'
* + '<person first="John" last="Doe"/>'
@@ -37,8 +37,8 @@ declare module GoogleAppsScript {
/**
* A representation of an XML CDATASection node.
*
* // Create and log an XML document that shows how special characters like '<', '>', and '&' are
*
* // Create and log an XML document that shows how special characters like '<', '>', and '&' are
* // stored in a CDATASection node as compared to in a Text node.
* var illegalCharacters = '<em>The Amazing Adventures of Kavalier & Clay</em>';
* var cdata = XmlService.createCdata(illegalCharacters);
@@ -71,21 +71,21 @@ declare module GoogleAppsScript {
/**
* A representation of a generic XML node.
* Implementing classes
*
*
* NameBrief description
*
*
* CdataA representation of an XML CDATASection node.
*
*
* CommentA representation of an XML Comment node.
*
*
* DocTypeA representation of an XML DocumentType node.
*
*
* ElementA representation of an XML Element node.
*
*
* EntityRefA representation of an XML EntityReference node.
*
*
* ProcessingInstructionA representation of an XML ProcessingInstruction node.
*
*
* TextA representation of an XML Text node.
*/
export interface Content {
@@ -148,7 +148,7 @@ declare module GoogleAppsScript {
/**
* A representation of an XML Element node.
*
*
* // Adds up the values listed in a sample XML document and adds a new element with the total.
* var xml = '<things>'
* + '<plates>12</plates>'
@@ -228,7 +228,7 @@ declare module GoogleAppsScript {
/**
* A formatter for outputting an XML document, with three pre-defined formats that can be further
* customized.
*
*
* // Log an XML document with specified formatting options.
* var xml = '<root><a><b>Text!</b><b>More text!</b></a></root>';
* var document = XmlService.parse(xml);
@@ -282,7 +282,7 @@ declare module GoogleAppsScript {
/**
* This service allows scripts to parse, navigate, and programmatically create XML documents.
*
*
* // Log the title and labels for the first page of blog posts on the Google Apps Developer blog.
* function parseXml() {
* var url = 'http://googleappsdeveloper.blogspot.com/atom.xml';
@@ -290,7 +290,7 @@ declare module GoogleAppsScript {
* var document = XmlService.parse(xml);
* var root = document.getRootElement();
* var atom = XmlService.getNamespace('http://www.w3.org/2005/Atom');
*
*
* var entries = document.getRootElement().getChildren('entry', atom);
* for (var i = 0; i < entries.length; i++) {
* var title = entries[i].getChild('title', atom).getText();
@@ -302,7 +302,7 @@ declare module GoogleAppsScript {
* Logger.log('%s (%s)', title, labels.join(', '));
* }
* }
*
*
* // Create and log an XML representation of the threads in your Gmail inbox.
* function createXml() {
* var root = XmlService.createElement('threads');
@@ -344,4 +344,4 @@ declare module GoogleAppsScript {
}
}
declare var XmlService: GoogleAppsScript.XML_Service.XmlService;
declare var XmlService: GoogleAppsScript.XML_Service.XmlService;