gas-types-detailed
Version:
Enhanced Google Apps Script Type Definitions with detailed documentation. Includes type definitions plus code snippets, return values, required authorization scopes, and other details not found in @types/google-apps-script.
1,193 lines (1,121 loc) • 1.5 MB
TypeScript
// Type definitions for Google Apps Script 2025-11-10
// Project: https://developers.google.com/apps-script/
// Definitions by: motemen <https://github.com/motemen/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
/// <reference path="google-apps-script.charts.d.ts" />
/// <reference path="google-apps-script.drive.d.ts" />
declare namespace GoogleAppsScript {
namespace Spreadsheet {
/**
* An enumeration of the types of series used to calculate auto-filled values. The manner in which
* these series affect calculated values differs depending on the type and amount of source data.
*
* To call an enum, you call its parent class, name, and property. For example,
* SpreadsheetApp.AutoFillSeries.DEFAULT_SERIES.
*/
enum AutoFillSeries { DEFAULT_SERIES, ALTERNATE_SERIES }
/**
* Access and modify bandings, the color patterns applied to rows or columns of a range. Each
* banding consists of a range and a set of colors for rows, columns, headers, and footers.
*/
interface Banding {
/**
* Copies this banding to another range.
*
* Return:
* - Banding — The new banding.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#copyTo(Range)
* @param range The range to copy this banding to.
*/
copyTo(range: Range): Banding;
/**
* Returns the first alternating column color in the banding, or null if no color is set.
*
* Return:
* - Color — The first alternating column color in the banding, or null if no color is set.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getFirstColumnColorObject()
*/
getFirstColumnColorObject(): Color;
/**
* Returns the first alternating row color, or null if no color is set.
*
* Return:
* - Color — The first alternating row color in the banding, or null if no color is set.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getFirstRowColorObject()
*/
getFirstRowColorObject(): Color;
/**
* Returns the color of the last column in the banding, or null if no color is set.
*
* Return:
* - Color — The last column color in the banding, or null if no color is set.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getFooterColumnColorObject()
*/
getFooterColumnColorObject(): Color;
/**
* Returns the last row color in the banding, or null if no color is set.
*
* Return:
* - Color — The footer row color in the banding, or null if no color is set.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getFooterRowColorObject()
*/
getFooterRowColorObject(): Color;
/**
* Returns the color of the first column in the banding, or null if no color is set.
*
* Return:
* - Color — The first column color in the banding, or null if no color is set.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getHeaderColumnColorObject()
*/
getHeaderColumnColorObject(): Color;
/**
* Returns the color of the header row or null if no color is set.
*
* Return:
* - Color — The color of the header row; returns null if no color is set.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getHeaderRowColorObject()
*/
getHeaderRowColorObject(): Color;
/**
* Returns the range for this banding.
*
* Return:
* - Range — The range for this banding.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getRange()
*/
getRange(): Range;
/**
* Returns the second alternating column color in the banding, or null if no color is set.
*
* Return:
* - Color — The second alternating column color in the banding, or null if no color is set.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getSecondColumnColorObject()
*/
getSecondColumnColorObject(): Color;
/**
* Returns the second alternating row color, or null if no color is set.
*
* Return:
* - Color — The second alternating row color in the banding, or null if no color is set.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#getSecondRowColorObject()
*/
getSecondRowColorObject(): Color;
/**
* Removes this banding.
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#remove()
*/
remove(): void;
/**
* Sets the first column color that is alternating.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setFirstColumnColor(String)
* @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.
*/
setFirstColumnColor(color: string): Banding;
/**
* Sets the first alternating column color in the banding.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setFirstColumnColorObject(Color)
* @param color The new first alternating column color in the banding; setting to null clears the color.
*/
setFirstColumnColorObject(color: Color): Banding;
/**
* Sets the first row color that is alternating.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setFirstRowColor(String)
* @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.
*/
setFirstRowColor(color: string): Banding;
/**
* Sets the first alternating row color in the banding.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setFirstRowColorObject(Color)
* @param color The new first alternating color in the banding; setting to null clears the color.
*/
setFirstRowColorObject(color: Color): Banding;
/**
* Sets the color of the last column.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setFooterColumnColor(String)
* @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.
*/
setFooterColumnColor(color: string): Banding;
/**
* Sets the color of the last column in the banding.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setFooterColumnColorObject(Color)
* @param color The new color of the last column in the banding; setting to null clears the color.
*/
setFooterColumnColorObject(color: Color): Banding;
/**
* Sets the color of the last row.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setFooterRowColor(String)
* @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.
*/
setFooterRowColor(color: string): Banding;
/**
* Sets the color of the footer row in the banding.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setFooterRowColorObject(Color)
* @param color The new footer row color; setting to null clears the color.
*/
setFooterRowColorObject(color: Color): Banding;
/**
* Sets the color of the header column.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setHeaderColumnColor(String)
* @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.
*/
setHeaderColumnColor(color: string): Banding;
/**
* Sets the color of the header column.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setHeaderColumnColorObject(Color)
* @param color The new header column color; setting to null clears the color.
*/
setHeaderColumnColorObject(color: Color): Banding;
/**
* Sets the color of the header row.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setHeaderRowColor(String)
* @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.
*/
setHeaderRowColor(color: string): Banding;
/**
* Sets the color of the header row.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setHeaderRowColorObject(Color)
* @param color The new header row color; setting to null clears the color.
*/
setHeaderRowColorObject(color: Color): Banding;
/**
* Sets the range for this banding.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setRange(Range)
* @param range The new range for this banding.
*/
setRange(range: Range): Banding;
/**
* Sets the second column color that is alternating.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setSecondColumnColor(String)
* @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.
*/
setSecondColumnColor(color: string): Banding;
/**
* Sets the second alternating column color in the banding.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setSecondColumnColorObject(Color)
* @param color The new second alternating column color in the banding; setting to null clears the color.
*/
setSecondColumnColorObject(color: Color): Banding;
/**
* Sets the second row color that is alternating.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setSecondRowColor(String)
* @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.
*/
setSecondRowColor(color: string): Banding;
/**
* Sets the second alternating color in the banding.
*
* Return:
* - Banding — This banding, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/banding#setSecondRowColorObject(Color)
* @param color The new second alternating color in the banding; setting to null clears the color.
*/
setSecondRowColorObject(color: Color): Banding;
/** @deprecated DO NOT USE */ getFirstColumnColor(): string;
/** @deprecated DO NOT USE */ getFirstRowColor(): string;
/** @deprecated DO NOT USE */ getFooterColumnColor(): string;
/** @deprecated DO NOT USE */ getFooterRowColor(): string;
/** @deprecated DO NOT USE */ getHeaderColumnColor(): string;
/** @deprecated DO NOT USE */ getHeaderRowColor(): string;
/** @deprecated DO NOT USE */ getSecondColumnColor(): string;
/** @deprecated DO NOT USE */ getSecondRowColor(): string;
}
/**
* An enumeration of banding themes. Each theme consists of several complementary colors that are
* applied to different cells based on the banding settings.
*
* To call an enum, you call its parent class, name, and property. For example,
* SpreadsheetApp.BandingTheme.LIGHT_GREY.
*/
enum BandingTheme { LIGHT_GREY, CYAN, GREEN, YELLOW, ORANGE, BLUE, TEAL, GREY, BROWN, LIGHT_GREEN, INDIGO, PINK }
/**
* Access the existing BigQuery data source specification. To create a new data source
* specification, use SpreadsheetApp.newDataSourceSpec().
*/
interface BigQueryDataSourceSpec {
/**
* Creates a DataSourceSpecBuilder based on this data source's settings.
*
* // TODO(developer): Replace the URL with your own.
* const ss = SpreadsheetApp.openByUrl(
* 'https://docs.google.com/spreadsheets/d/abc123456/edit',
* );
* const spec = ss.getDataSources()[0].getSpec();
*
* const newSpec = spec.copy();
*
* Return:
* - DataSourceSpecBuilder — The builder.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#copy()
*/
copy(): DataSourceSpecBuilder;
/**
* Gets the BigQuery dataset ID.
*
* Return:
* - String — The dataset ID, or an empty string if the data source spec is defined by a raw query.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getDatasetId()
*/
getDatasetId(): string;
/**
* Gets the parameters of the data source.
*
* // TODO(developer): Replace the URL with your own.
* const ss = SpreadsheetApp.openByUrl(
* 'https://docs.google.com/spreadsheets/d/abc123456/edit',
* );
* const spec = ss.getDataSources()[0].getSpec();
* const parameters = spec.getParameters();
*
* This method is only available for BigQuery data sources.
*
* Return:
* - DataSourceParameter[] — The parameter list.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getParameters()
*/
getParameters(): DataSourceParameter[];
/**
* Gets the billing project ID.
*
* Return:
* - String — The project ID.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getProjectId()
*/
getProjectId(): string;
/**
* Gets the raw query string.
*
* Return:
* - String — The raw query string.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getRawQuery()
*/
getRawQuery(): string;
/**
* Gets the BigQuery table ID.
*
* Return:
* - String — The table ID, or an empty string if the data source spec is defined by a raw query.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getTableId()
*/
getTableId(): string;
/**
* Gets the BigQuery project ID for the table.
*
* Return:
* - String — The table project ID, or an empty string if the data source spec is defined by a raw query.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getTableProjectId()
*/
getTableProjectId(): string;
/**
* Gets the type of the data source.
*
* // TODO(developer): Replace the URL with your own.
* const ss = SpreadsheetApp.openByUrl(
* 'https://docs.google.com/spreadsheets/d/abc123456/edit',
* );
* const spec = ss.getDataSources()[0].getSpec();
* const type = spec.getType();
*
* Return:
* - DataSourceType — The data source type.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getType()
*/
getType(): DataSourceType;
}
/**
* The builder for BigQueryDataSourceSpecBuilder.
*/
interface BigQueryDataSourceSpecBuilder {
/**
* Builds a data source specification from the settings in this builder. Must use as...() to specify a data source type before building.
* The following code sample builds a BigQuery DataSource Spec.
*
* const bigQueryDataSourceSpec = SpreadsheetApp.newDataSourceSpec().asBigQuery();
* // TODO(developer): Replace with the required dataset, project and table IDs.
* bigQueryDataSourceSpec.setDatasetId('my data set id');
* bigQueryDataSourceSpec.setProjectId('my project id');
* bigQueryDataSourceSpec.setTableId('my table id');
*
* bigQueryDataSourceSpec.build();
*
* The following code sample builds a Looker DataSource Spec.
*
* const lookerDataSourceSpecBuilder =
* SpreadsheetApp.newDataSourceSpec().asLooker();
* const lookerSpec = lookerDataSourceSpecBuilder.setExploreName('my explore name')
* .setInstanceUrl('my instance url')
* .setModelName('my model name')
* .build();
*
* Return:
* - DataSourceSpec — The data source specification.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#build()
*/
build(): DataSourceSpec;
/**
* Creates a DataSourceSpecBuilder based on this data source's settings.
*
* // TODO(developer): Replace the URL with your own.
* const ss = SpreadsheetApp.openByUrl(
* 'https://docs.google.com/spreadsheets/d/abc123456/edit',
* );
* const spec = ss.getDataSources()[0].getSpec();
*
* const newSpec = spec.copy();
*
* Return:
* - DataSourceSpecBuilder — The builder.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#copy()
*/
copy(): DataSourceSpecBuilder;
/**
* Gets the BigQuery dataset ID.
*
* Return:
* - String — The dataset ID, or an empty string if the data source spec is defined by a raw query.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getDatasetId()
*/
getDatasetId(): string;
/**
* Gets the parameters of the data source.
*
* // TODO(developer): Replace the URL with your own.
* const ss = SpreadsheetApp.openByUrl(
* 'https://docs.google.com/spreadsheets/d/abc123456/edit',
* );
* const spec = ss.getDataSources()[0].getSpec();
* const parameters = spec.getParameters();
*
* This method is only available for BigQuery data sources.
*
* Return:
* - DataSourceParameter[] — The parameter list.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getParameters()
*/
getParameters(): DataSourceParameter[];
/**
* Gets the billing project ID.
*
* Return:
* - String — The project ID.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getProjectId()
*/
getProjectId(): string;
/**
* Gets the raw query string.
*
* Return:
* - String — The raw query string.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getRawQuery()
*/
getRawQuery(): string;
/**
* Gets the BigQuery table ID.
*
* Return:
* - String — The table ID, or an empty string if the data source spec is defined by a raw query.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getTableId()
*/
getTableId(): string;
/**
* Gets the BigQuery project ID for the table.
*
* Return:
* - String — The table project ID, or an empty string if the data source spec is defined by a raw query.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getTableProjectId()
*/
getTableProjectId(): string;
/**
* Gets the type of the data source.
*
* // TODO(developer): Replace the URL with your own.
* const ss = SpreadsheetApp.openByUrl(
* 'https://docs.google.com/spreadsheets/d/abc123456/edit',
* );
* const spec = ss.getDataSources()[0].getSpec();
* const type = spec.getType();
*
* Return:
* - DataSourceType — The data source type.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getType()
*/
getType(): DataSourceType;
/**
* Removes all the parameters.
*
* const specBuilder = SpreadsheetApp.newDataSourceSpec();
* specBuilder.removeAllParameters();
*
* Return:
* - BigQueryDataSourceSpecBuilder — The builder, for chaining.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#removeAllParameters()
*/
removeAllParameters(): BigQueryDataSourceSpecBuilder;
/**
* Removes the specified parameter.
*
* const specBuilder = SpreadsheetApp.newDataSourceSpec();
* specBuilder.removeParameter('x');
*
* Return:
* - BigQueryDataSourceSpecBuilder — The builder, for chaining.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#removeParameter(String)
* @param parameterName The name of the parameter to remove.
*/
removeParameter(parameterName: string): BigQueryDataSourceSpecBuilder;
/**
* Sets the BigQuery dataset ID.
*
* Return:
* - BigQueryDataSourceSpecBuilder — This builder, for chaining.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#setDatasetId(String)
* @param datasetId The ID of the dataset.
*/
setDatasetId(datasetId: string): BigQueryDataSourceSpecBuilder;
/**
* Adds a parameter, or if the parameter with the name exists, updates its source cell for data source spec builders of type DataSourceType.BIGQUERY.
* This method is only available for BigQuery data sources.
*
* const specBuilder = SpreadsheetApp.newDataSourceSpec().asBigQuery();
* specBuilder.setParameterFromCell('x', 'A1');
* const bigQuerySpec = specBuilder.build();
*
* Return:
* - BigQueryDataSourceSpecBuilder — The builder, for chaining.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#setParameterFromCell(String,String)
* @param parameterName The parameter name.
* @param sourceCell The source cell, as specified in A1 notation.
*/
setParameterFromCell(parameterName: string, sourceCell: string): BigQueryDataSourceSpecBuilder;
/**
* Sets the billing BigQuery project ID.
*
* Return:
* - BigQueryDataSourceSpecBuilder — The builder, for chaining.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#setProjectId(String)
* @param projectId The ID of the billing project.
*/
setProjectId(projectId: string): BigQueryDataSourceSpecBuilder;
/**
* Sets the raw query string.
*
* Return:
* - BigQueryDataSourceSpecBuilder — The builder, for chaining.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#setRawQuery(String)
* @param rawQuery The raw query string.
*/
setRawQuery(rawQuery: string): BigQueryDataSourceSpecBuilder;
/**
* Sets the BigQuery table ID.
*
* Return:
* - BigQueryDataSourceSpecBuilder — This builder, for chaining.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#setTableId(String)
* @param tableId The ID of the table.
*/
setTableId(tableId: string): BigQueryDataSourceSpecBuilder;
/**
* Sets the BigQuery project ID for the table.
*
* Return:
* - BigQueryDataSourceSpecBuilder — The builder, for chaining.
*
* https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#setTableProjectId(String)
* @param projectId The project ID of the BigQuery table.
*/
setTableProjectId(projectId: string): BigQueryDataSourceSpecBuilder;
}
/**
* Access boolean conditions in ConditionalFormatRules. Each
* conditional format rule may contain a single boolean condition. The boolean condition itself
* contains a boolean criteria (with values) and formatting settings. The criteria is evaluated
* against the content of a cell resulting in either a true or false value. If the
* criteria evaluates to true, the condition's formatting settings are applied to the cell.
*/
interface BooleanCondition {
/**
* Gets the background color for this boolean condition. Returns null if not set.
*
* // Logs the boolean condition background color for each conditional format rule
* // on a sheet.
* const sheet = SpreadsheetApp.getActiveSheet();
* const rules = sheet.getConditionalFormatRules();
* for (const rule of rules) {
* const color = rule.getBooleanCondition().getBackgroundObject();
* Logger.log(`Background color: ${color.asRgbColor().asHexString()}`);
* }
*
* Return:
* - Color — The background color, or null if not set for this condition.
*
* https://developers.google.com/apps-script/reference/spreadsheet/boolean-condition#getBackgroundObject()
*/
getBackgroundObject(): Color;
/**
* Returns true if this boolean condition bolds the text and returns false if this boolean condition removes bolding from the text. Returns null if bolding is unaffected.
*
* // Logs the boolean condition font weight for each conditional format rule on a
* // sheet.
* const sheet = SpreadsheetApp.getActiveSheet();
* const rules = sheet.getConditionalFormatRules();
* for (const rule of rules) {
* const bold = rule.getBooleanCondition().getBold();
* Logger.log(`Bold: ${bold}`);
* }
*
* Return:
* - Boolean — whether or not the boolean condition bolds the text, or null if bolding is unaffected
*
* https://developers.google.com/apps-script/reference/spreadsheet/boolean-condition#getBold()
*/
getBold(): boolean;
/**
* Gets the rule's criteria type as defined in the BooleanCriteria enum. To get the arguments for the criteria, use getCriteriaValues(). To use these values to create or modify a conditional formatting rule, see ConditionalFormatRuleBuilder.withCriteria(criteria, args).
*
* // Log information about the conditional formats on the active sheet that use
* // boolean conditions.
*
* const formats = SpreadsheetApp.getActiveSheet.getConditionalFormats();
* SpreadsheetApp.getActiveSheet.getConditionalFormats().forEach((format) => {
* const booleanCondition = format.getBooleanCondition();
* if (booleanCondition) {
* const criteria = booleanCondition.getCriteriaType();
* const args = booleanCondition.getCriteriaValues();
* Logger.log(`The conditional format rule is ${criteria} ${args}`);
* }
* });
*
* Return:
* - BooleanCriteria — The type of conditional formatting criteria.
*
* https://developers.google.com/apps-script/reference/spreadsheet/boolean-condition#getCriteriaType()
*/
getCriteriaType(): BooleanCriteria;
/**
* Gets an array of arguments for the rule's criteria. To get the criteria type, use getCriteriaType(). To use these values to create or modify a conditional formatting rule, see ConditionalFormatRuleBuilder.withCriteria(criteria, args).
*
* // Log information about the conditional formats on the active sheet that use
* // boolean conditions.
*
* const formats = SpreadsheetApp.getActiveSheet.getConditionalFormats();
* SpreadsheetApp.getActiveSheet.getConditionalFormats().forEach((format) => {
* const booleanCondition = format.getBooleanCondition();
* if (booleanCondition) {
* const criteria = booleanCondition.getCriteriaType();
* const args = booleanCondition.getCriteriaValues();
* Logger.log(`The conditional format rule is ${criteria} ${args}`);
* }
* });
*
* Return:
* - Object[] — An array of arguments appropriate to the rule's criteria type; the number of arguments and their type match the corresponding when...() method of the ConditionalFormatRuleBuilder class.
*
* https://developers.google.com/apps-script/reference/spreadsheet/boolean-condition#getCriteriaValues()
*/
getCriteriaValues(): any[];
/**
* Gets the font color for this boolean condition. Returns null if not set.
*
* // Logs the boolean condition font color for each conditional format rule on a
* // sheet.
* const sheet = SpreadsheetApp.getActiveSheet();
* const rules = sheet.getConditionalFormatRules();
* for (const rule of rules) {
* const color = rule.getBooleanCondition().getFontColorObject();
* Logger.log(`Font color: ${color.asRgbColor().asHexString()}`);
* }
*
* Return:
* - Color — The font color, or null if not set for this condition.
*
* https://developers.google.com/apps-script/reference/spreadsheet/boolean-condition#getFontColorObject()
*/
getFontColorObject(): Color;
/**
* Returns true if this boolean condition italicises the text and returns false if this boolean condition removes italics from the text. Returns null if italics are unaffected.
*
* // Logs the boolean condition font style for each conditional format rule on a
* // sheet.
* const sheet = SpreadsheetApp.getActiveSheet();
* const rules = sheet.getConditionalFormatRules();
* for (const rule of rules) {
* const italic = rule.getBooleanCondition().getItalic();
* Logger.log(`Italic: ${italic}`);
* }
*
* Return:
* - Boolean — whether or not the boolean condition italicises the text, or null if italicising is unaffected
*
* https://developers.google.com/apps-script/reference/spreadsheet/boolean-condition#getItalic()
*/
getItalic(): boolean;
/**
* Returns true if this boolean condition strikes through the text and returns false if this boolean condition removes strikethrough from the text. Returns null if strikethrough is unaffected.
*
* // Logs the boolean condition strikethrough setting for each conditional format
* // rule on a sheet.
* const sheet = SpreadsheetApp.getActiveSheet();
* const rules = sheet.getConditionalFormatRules();
* for (const rule of rules) {
* const strikethrough = rule.getBooleanCondition().getStrikethrough();
* Logger.log(`Strikethrough: ${strikethrough}`);
* }
*
* Return:
* - Boolean — whether or not the boolean condition strikes through the text, or null if strikethrough is unaffected
*
* https://developers.google.com/apps-script/reference/spreadsheet/boolean-condition#getStrikethrough()
*/
getStrikethrough(): boolean;
/**
* Returns true if this boolean condition underlines the text and returns false if this boolean condition removes underlining from the text. Returns null if underlining is unaffected.
*
* // Logs the boolean condition underline setting for each conditional format rule
* // on a sheet.
* const sheet = SpreadsheetApp.getActiveSheet();
* const rules = sheet.getConditionalFormatRules();
* for (const rule of rules) {
* const underline = rule.getBooleanCondition().getUnderline();
* Logger.log(`Underline: ${underline}`);
* }
*
* Return:
* - Boolean — whether or not the boolean condition underlines the text, or null if underlining is unaffected
*
* https://developers.google.com/apps-script/reference/spreadsheet/boolean-condition#getUnderline()
*/
getUnderline(): boolean;
/** @deprecated DO NOT USE */ getBackground(): string;
/** @deprecated DO NOT USE */ getFontColor(): string;
}
/**
* An enumeration representing the boolean criteria that can be used in conditional format or
* filter.
*
* To call an enum, you call its parent class, name, and property. For example,
* SpreadsheetApp.BooleanCriteria.CELL_EMPTY.
*/
enum BooleanCriteria { CELL_EMPTY, CELL_NOT_EMPTY, DATE_AFTER, DATE_BEFORE, DATE_EQUAL_TO, DATE_NOT_EQUAL_TO, DATE_AFTER_RELATIVE, DATE_BEFORE_RELATIVE, DATE_EQUAL_TO_RELATIVE, 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_NOT_EQUAL_TO, TEXT_STARTS_WITH, TEXT_ENDS_WITH, CUSTOM_FORMULA }
/**
* Styles that can be set on a range using Range.setBorder(top, left, bottom, right, vertical, horizontal, color, style).
*
* To call an enum, you call its parent class, name, and property. For example,
* SpreadsheetApp.BorderStyle.DOTTED.
*/
enum BorderStyle { DOTTED, DASHED, SOLID, SOLID_MEDIUM, SOLID_THICK, DOUBLE }
/**
* Represents an image value in a cell. To add an image to a cell, you must create a new image value
* for the image using SpreadsheetApp.newCellImage() and CellImageBuilder. Then you can use Range.setValue(value) or Range.setValues(values) to
* add the image value to the cell.
*/
interface CellImage {
valueType: typeof ValueType;
/**
* Returns the alt text description for this image.
*
* Return:
* - String — The alt text description.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/cell-image#getAltTextDescription()
*/
getAltTextDescription(): string;
/**
* Returns the alt text title for this image.
*
* Return:
* - String — The alt text title.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/cell-image#getAltTextTitle()
*/
getAltTextTitle(): string;
/**
* Returns a Google-hosted URL to the image. This URL is tagged with the account of the requester, so anyone with the URL effectively accesses the image as the original requester. Access to the image might be lost if the spreadsheet's sharing settings change. The returned URL expires after a short period of time.
*
* const range = SpreadsheetApp.getActiveSpreadsheet().getRange("Sheet1!A1");
* const value = range.getValue();
* if (value.valueType == SpreadsheetApp.ValueType.IMAGE) {
* console.log(value.getContentUrl());
* }
*
* Return:
* - String — The Google-hosted URL of the image.
*
* https://developers.google.com/apps-script/reference/spreadsheet/cell-image#getContentUrl()
*/
getContentUrl(): string;
/**
* Creates a cell image builder based on the current image properties. Use CellImageBuilder.setSourceUrl(url) to set the source URL of the new image. Then you can add it to a cell using Range.setValue(value) or Range.setValues(values).
*
* const ss = SpreadsheetApp.getActiveSpreadsheet();
* const range = ss.getRange("Sheet1!A1");
* const value = range.getValue();
* if (value.valueType == SpreadsheetApp.ValueType.IMAGE) {
* const newImage =
* value.toBuilder()
* .setSourceUrl(
* 'https://www.gstatic.com/images/branding/productlogos/apps_script/v10/web-64dp/logo_apps_script_color_1x_web_64dp.png',
* )
* .build();
* const newRange = ss.getRange("Sheet1!A2");
* newRange.setValue(newImage);
* }
*
* Return:
* - CellImageBuilder — A builder that creates an image value type based on the given image properties.
*
* https://developers.google.com/apps-script/reference/spreadsheet/cell-image#toBuilder()
*/
toBuilder(): CellImageBuilder;
/** @deprecated DO NOT USE */ getUrl(): string;
}
/**
* Builder for CellImage. This builder creates the image value needed to add an
* image to a cell.
*/
interface CellImageBuilder {
valueType: typeof ValueType;
/**
* Creates the image value type needed to add an image to a cell. The image value is built from the image properties added to the builder, such as the source URL.
*
* Return:
* - CellImage — A representation of the image to add to a cell.
*
* https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#build()
*/
build(): CellImage;
/**
* Returns the alt text description for this image.
*
* Return:
* - String — The alt text description.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#getAltTextDescription()
*/
getAltTextDescription(): string;
/**
* Returns the alt text title for this image.
*
* Return:
* - String — The alt text title.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spreadsheets
*
* https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#getAltTextTitle()
*/
getAltTextTitle(): string;
/**
* Returns a Google-hosted URL to the image. This URL is tagged with the account of the requester, so anyone with the URL effectively accesses the image as the original requester. Access to the image might be lost if the spreadsheet's sharing settings change. The returned URL expires after a short period of time.
*
* const range = SpreadsheetApp.getActiveSpreadsheet().getRange("Sheet1!A1");
* const value = range.getValue();
* if (value.valueType == SpreadsheetApp.ValueType.IMAGE) {
* console.log(value.getContentUrl());
* }
*
* Return:
* - String — The Google-hosted URL of the image.
*
* https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#getContentUrl()
*/
getContentUrl(): string;
/**
* Sets the alt-text description for this image.
*
* Return:
* - CellImage — This image, for chaining.
*
* Authorization:
*
* Scripts that use this method require authorization with one or more of the following scopes:
* - https://www.googleapis.com/auth/spreadsheets.currentonly
* - https://www.googleapis.com/auth/spread