UNPKG

gas-types-detailed

Version:

Detailed Google Apps Script Type Definitions. Forked from Definitely Typed @types/google-apps-script. Adds full documentation and urls.

1,082 lines (979 loc) 1.06 MB
// Type definitions for Google Apps Script 2023-10-28 // 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. * 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. * 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. * 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. * 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. * 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. * 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. * https://developers.google.com/apps-script/reference/spreadsheet/banding#getHeaderRowColorObject() */ getHeaderRowColorObject(): Color; /** * Returns the range for this banding. * 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. * 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. * https://developers.google.com/apps-script/reference/spreadsheet/banding#getSecondRowColorObject() */ getSecondRowColorObject(): Color; /** * Removes this banding. * https://developers.google.com/apps-script/reference/spreadsheet/banding#remove() */ remove(): void; /** * Sets the first column color that is alternating. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#copy() */ copy(): DataSourceSpecBuilder; /** * Gets the BigQuery dataset ID. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getDatasetId() */ getDatasetId(): string; /** * Gets the parameters of the data source. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getParameters() */ getParameters(): DataSourceParameter[]; /** * Gets the billing project ID. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getProjectId() */ getProjectId(): string; /** * Gets 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. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getTableId() */ getTableId(): string; /** * Gets the BigQuery project ID for the table. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getTableProjectId() */ getTableProjectId(): string; /** * Gets the type of the data source. * 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. * 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. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#copy() */ copy(): DataSourceSpecBuilder; /** * Gets the BigQuery dataset ID. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getDatasetId() */ getDatasetId(): string; /** * Gets the parameters of the data source. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getParameters() */ getParameters(): DataSourceParameter[]; /** * Gets the billing project ID. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getProjectId() */ getProjectId(): string; /** * Gets 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. * 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. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getTableProjectId() */ getTableProjectId(): string; /** * Gets the type of the data source. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#getType() */ getType(): DataSourceType; /** * Removes all the parameters. * https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec-builder#removeAllParameters() */ removeAllParameters(): BigQueryDataSourceSpecBuilder; /** * Removes the specified parameter. * 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. * 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. * 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. * 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. * 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. * 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. * 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. * var sheet = SpreadsheetApp.getActiveSheet(); * var rules = sheet.getConditionalFormatRules(); * for (int i = 0; i < rules.length; i++) { * var color = rules[i].getBooleanCondition().getBackgroundObject(); * Logger.log("The background color for rule %s is %s", i, color.asRgbColor().asHexString()); * } * 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. * var sheet = SpreadsheetApp.getActiveSheet(); * var rules = sheet.getConditionalFormatRules(); * for (int i = 0; i < rules.length; i++) { * var bold = rules[i].getBooleanCondition().getBold(); * Logger.log("The font bold setting for rule %s is %b", i, weight); * } * 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. * var sheet = SpreadsheetApp.getActiveSheet; * var formats = sheet.getConditionalFormats(); * sheet.getConditionalFormats().forEach(function(format) { * var booleanCondition = format.getBooleanCondition(); * if (booleanCondition) { * var criteria = booleanCondition.getCriteriaType(); * var args = booleanCondition.getCriteriaValues(); * Logger.log('The conditional format rule is %s %s', criteria, args); * } * }); * 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. * var sheet = SpreadsheetApp.getActiveSheet; * var formats = sheet.getConditionalFormats(); * sheet.getConditionalFormats().forEach(function(format) { * var booleanCondition = format.getBooleanCondition(); * if (booleanCondition) { * var criteria = booleanCondition.getCriteriaType(); * var args = booleanCondition.getCriteriaValues(); * Logger.log('The conditional format rule is %s %s', criteria, args); * } * }); * 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. * var sheet = SpreadsheetApp.getActiveSheet(); * var rules = sheet.getConditionalFormatRules(); * for (int i = 0; i < rules.length; i++) { * var color = rules[i].getBooleanCondition().getFontColorObject(); * Logger.log("The font color for rule %s is %s", i, color.asRgbColor().asHexString()); * } * 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. * var sheet = SpreadsheetApp.getActiveSheet(); * var rules = sheet.getConditionalFormatRules(); * for (int i = 0; i < rules.length; i++) { * var italic = rules[i].getBooleanCondition().getItalic(); * Logger.log("The font italic setting for rule %s is %b", i, italic); * } * 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. * var sheet = SpreadsheetApp.getActiveSheet(); * var rules = sheet.getConditionalFormatRules(); * for (int i = 0; i < rules.length; i++) { * var strikethrough = rules[i].getBooleanCondition().getStrikethrough(); * Logger.log("The font strikethrough setting for rule %s is %b", i, strikethrough); * } * 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. * var sheet = SpreadsheetApp.getActiveSheet(); * var rules = sheet.getConditionalFormatRules(); * for (int i = 0; i < rules.length; i++) { * var underline = rules[i].getBooleanCondition().getUnderline(); * Logger.log("The font underline setting for rule %s is %b", i, underline); * } * 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 to add to 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. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image#getAltTextDescription() */ getAltTextDescription(): string; /** * Returns the alt text title for this image. * 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. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image#getContentUrl() */ getContentUrl(): string; /** * Gets the image's source URL; returns null if the URL is unavailable. If the image was * inserted by URL using an API, this method returns the URL provided during image insertion. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image#getUrl() */ getUrl(): string; /** * Creates a builder that turns an image into an image value type so that you can place it into a * cell. Before an image is placed into a cell, it needs to be created as an image value type. * Then you can add it to a cell using Range.setValue(value) or Range.setValues(values). * https://developers.google.com/apps-script/reference/spreadsheet/cell-image#toBuilder() */ toBuilder(): CellImageBuilder; } /** * 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. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#build() */ build(): CellImage; /** * Returns the alt text description for this image. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#getAltTextDescription() */ getAltTextDescription(): string; /** * Returns the alt text title for this image. * 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. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#getContentUrl() */ getContentUrl(): string; /** * Gets the image's source URL; returns null if the URL is unavailable. If the image was * inserted by URL using an API, this method returns the URL provided during image insertion. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#getUrl() */ getUrl(): string; /** * Sets the alt-text description for this image. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#setAltTextDescription(String) * @param description The new alt text description for the image. */ setAltTextDescription(description: string): CellImage; /** * Sets the alt text title for this image. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#setAltTextTitle(String) * @param title The new alt text title for the image. */ setAltTextTitle(title: string): CellImage; /** * Sets the image source URL. * https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#setSourceUrl(String) * @param url The URL for the image. */ setSourceUrl(url: string): CellImageBuilder; /** * Creates a builder that turns an image into an image value type so that you can place it into a * cell. Before an image is placed into a cell, it needs to be created as an image value type. * Then you can add it to a cell using Range.setValue(value) or Range.setValues(values). * https://developers.google.com/apps-script/reference/spreadsheet/cell-image-builder#toBuilder() */ toBuilder(): CellImageBuilder; } /** * A representation for a color. */ interface Color { /** * Converts this color to an RgbColor. * https://developers.google.com/apps-script/reference/spreadsheet/color#asRgbColor() */ asRgbColor(): Base.RgbColor; /** * Converts this color to a ThemeColor. * https://developers.google.com/apps-script/reference/spreadsheet/color#asThemeColor() */ asThemeColor(): ThemeColor; /** * Get the type of this color. * https://developers.google.com/apps-script/reference/spreadsheet/color#getColorType() */ getColorType(): Base.ColorType; } /** * The builder for ColorBuilder. To create a new builder, use SpreadsheetApp.newColor(). */ interface ColorBuilder { /** * Converts this color to an RgbColor. * https://developers.google.com/apps-script/reference/spreadsheet/color-builder#asRgbColor() */ asRgbColor(): Base.RgbColor; /** * Converts this color to a ThemeColor. * https://developers.google.com/apps-script/reference/spreadsheet/color-builder#asThemeColor() */ asThemeColor(): ThemeColor; /** * Creates a color object from the settings supplied to the builder. * https://developers.google.com/apps-script/reference/spreadsheet/color-builder#build() */ build(): Color; /** * Get the type of this color. * https://developers.google.com/apps-script/reference/spreadsheet/color-builder#getColorType() */ getColorType(): Base.ColorType; /** * Sets as RGB color. * https://developers.google.com/apps-script/reference/spreadsheet/color-builder#setRgbColor(String) * @param cssString The RGB color in CSS notation (such as '#ffffff'). */ setRgbColor(cssString: string): ColorBuilder; /** * Sets as theme color. * https://developers.google.com/apps-script/reference/spreadsheet/color-builder#setThemeColor(ThemeColorType) * @param themeColorType The theme color type. */ setThemeColor(themeColorType: ThemeColorType): ColorBuilder; } /** * Access conditional formatting rules. To create a new rule, use SpreadsheetApp.newConditionalFormatRule() and ConditionalFormatRuleBuilder. * You can use Sheet.setConditionalFormatRules(rules) to set the * rules for a given sheet. */ interface ConditionalFormatRule { /** * Returns a rule builder preset with this rule's settings. * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule#copy() */ copy(): ConditionalFormatRuleBuilder; /** * Retrieves the rule's BooleanCondition information if this rule uses * boolean condition criteria. Otherwise returns null. * * * // Log the boolean criteria type of the first conditional format rules of a sheet. * var rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; * var booleanCondition = rule.getBooleanCondition(); * if (booleanCondition != null) { * Logger.log(booleanCondition.getCriteriaType()); * } * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule#getBooleanCondition() */ getBooleanCondition(): BooleanCondition; /** * Retrieves the rule's GradientCondition information, if this rule * uses gradient condition criteria. Otherwise returns null. * * * // Log the gradient minimum color of the first conditional format rule of a sheet. * var rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; * var gradientCondition = rule.getGradientCondition(); * if (gradientCondition != null) { * // Assume the color has ColorType.RGB. * Logger.log(gradientCondition.getMinColorObject().asRgbColor().asHexString()); * } * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule#getGradientCondition() */ getGradientCondition(): GradientCondition; /** * Retrieves the ranges to which this conditional format rule is applied. * * * // Log each range of the first conditional format rule of a sheet. * var rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; * var ranges = rule.getRanges(); * for (var i = 0; i < ranges.length; i++) { * Logger.log(ranges[i].getA1Notation()); * } * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule#getRanges() */ getRanges(): Range[]; } /** * Builder for conditional format rules. * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to turn red if * // they contain a number between 1 and 10. * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var rule = SpreadsheetApp.newConditionalFormatRule() * .whenNumberBetween(1, 10) * .setBackground("#FF0000") * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule); * sheet.setConditionalFormatRules(rules); */ interface ConditionalFormatRuleBuilder { /** * Constructs a conditional format rule from the settings applied to the builder. * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#build() */ build(): ConditionalFormatRule; /** * Returns a rule builder preset with this rule's settings. * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#copy() */ copy(): ConditionalFormatRuleBuilder; /** * Retrieves the rule's BooleanCondition information if this rule uses * boolean condition criteria. Otherwise returns null. * * * // Log the boolean criteria type of the first conditional format rules of a sheet. * var rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; * var booleanCondition = rule.getBooleanCondition(); * if (booleanCondition != null) { * Logger.log(booleanCondition.getCriteriaType()); * } * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#getBooleanCondition() */ getBooleanCondition(): BooleanCondition; /** * Retrieves the rule's GradientCondition information, if this rule * uses gradient condition criteria. Otherwise returns null. * * * // Log the gradient minimum color of the first conditional format rule of a sheet. * var rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; * var gradientCondition = rule.getGradientCondition(); * if (gradientCondition != null) { * // Assume the color has ColorType.RGB. * Logger.log(gradientCondition.getMinColorObject().asRgbColor().asHexString()); * } * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#getGradientCondition() */ getGradientCondition(): GradientCondition; /** * Retrieves the ranges to which this conditional format rule is applied. * * * // Log each range of the first conditional format rule of a sheet. * var rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; * var ranges = rule.getRanges(); * for (var i = 0; i < ranges.length; i++) { * Logger.log(ranges[i].getA1Notation()); * } * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#getRanges() */ getRanges(): Range[]; /** * Sets the background color for the conditional format rule's format. Passing in null * removes the background color format setting from the rule. * * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to set their * // background color to red if the cell has text equal to "hello". * * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var rule = SpreadsheetApp.newConditionalFormatRule() * .whenTextEqualTo("hello") * .setBackground("#FF0000") * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule); * sheet.setConditionalFormatRules(rules); * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#setBackground(String) * @param color The desired color or null to clear. */ setBackground(color: string): ConditionalFormatRuleBuilder; /** * Sets the background color for the conditional format rule's format. Passing in null * removes the background color format setting from the rule. * * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to set their * // background color to theme background color if the cell has text equal to "hello". * * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var color = SpreadsheetApp.newColor() * .setThemeColor(SpreadsheetApp.ThemeColorType.BACKGROUND) * .build(); * var rule = SpreadsheetApp.newConditionalFormatRule() * .whenTextEqualTo("hello") * .setBackground(color) * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule); * sheet.setConditionalFormatRules(rules); * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#setBackgroundObject(Color) * @param color The desired color object or null to clear. */ setBackgroundObject(color: Color): ConditionalFormatRuleBuilder; /** * Sets text bolding for the conditional format rule's format. If bold is true, * the rule bolds text if the condition is met; if false, the rule removes any existing * bolding if the condition is met. Passing in null removes the bold format setting from * the rule. * * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to turn their * // text bold if the cell has text equal to "hello". * * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var rule = SpreadsheetApp.newConditionalFormatRule() * .whenTextEqualTo("hello") * .setBold(true) * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule); * sheet.setConditionalFormatRules(rules); * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#setBold(Boolean) * @param bold Whether or not the text should be bolded if the format condition is met; null removes this setting. */ setBold(bold: boolean): ConditionalFormatRuleBuilder; /** * Sets the font color for the conditional format rule's format. Passing in null removes * the font color format setting from the rule. * * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to set their font * // color to red if the cell has text equal to "hello". * * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var rule = SpreadsheetApp.newConditionalFormatRule() * .whenTextEqualTo("hello") * .setFontColor("#FF0000") * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule); * sheet.setConditionalFormatRules(rules); * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#setFontColor(String) * @param color The desired color or null to clear. */ setFontColor(color: string): ConditionalFormatRuleBuilder; /** * Sets the font color for the conditional format rule's format. Passing in null removes * the font color format setting from the rule. * * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to set their font * // color to theme text color if the cell has text equal to "hello". * * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var color = SpreadsheetApp.newColor() * .setThemeColor(SpreadsheetApp.ThemeColorType.TEXT) * .build(); * var rule = SpreadsheetApp.newConditionalFormatRule() * .whenTextEqualTo("hello") * .setFontColor(color) * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule); * sheet.setConditionalFormatRules(rules); * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#setFontColorObject(Color) * @param color The desired color object or null to clear. */ setFontColorObject(color: Color): ConditionalFormatRuleBuilder; /** * Clears the conditional format rule's gradient maxpoint value, and instead uses the maximum * value in the rule's ranges. Also sets the gradient's maxpoint color to the input color. * * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to set their * // background color somewhere between white and red, based on their values in comparison to * // the ranges minimum and maximum values. * * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var rule = SpreadsheetApp.newConditionalFormatRule() * .setGradientMaxpoint("#FF0000") * .setGradientMinpoint("#FFFFFF") * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule); * sheet.setConditionalFormatRules(rules); * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#setGradientMaxpoint(String) * @param color The maxpoint color to set. */ setGradientMaxpoint(color: string): ConditionalFormatRuleBuilder; /** * Clears the conditional format rule's gradient maxpoint value, and instead uses the maximum * value in the rule's ranges. Also sets the gradient's maxpoint color to the input color. * * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to set their * // background color somewhere between theme text and background colors, based on their values * // in comparison to the ranges minimum and maximum values. * * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var textColor = SpreadsheetApp.newColor() * .setThemeColor(SpreadsheetApp.ThemeColorType.TEXT) * .build(); * var backgroundColor = SpreadsheetApp.newColor() * .setThemeColor(SpreadsheetApp.ThemeColorType.BACKGROUND) * .build(); * var rule = SpreadsheetApp.newConditionalFormatRule() * .setGradientMaxpoint(textColor) * .setGradientMinpoint(backgroundColor) * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule); * sheet.setConditionalFormatRules(rules); * https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder#setGradientMaxpointObject(Color) * @param color The maxpoint color object to set. */ setGradientMaxpointObject(color: Color): ConditionalFormatRuleBuilder; /** * Sets the conditional format rule's gradient maxpoint fields. * * * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to set their * // background color somewhere from theme accent 1, accent 2 to accent 3 colors, based on their * // values in comparison to the values 0, 50, and 100. * * var sheet = SpreadsheetApp.getActiveSheet(); * var range = sheet.getRange("A1:B3"); * var color1 = SpreadsheetApp.newColor() * .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1) * .build(); * var color2 = SpreadsheetApp.newColor() * .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT2) * .build(); * var color3 = SpreadsheetApp.newColor() * .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT3) * .build(); * var rule = SpreadsheetApp.newConditionalFormatRule() * .setGradientMaxpointWithValue(color1, SpreadsheetApp.InterpolationType.NUMBER, "100") * .setGradientMidpointWithValue(color2, SpreadsheetApp.InterpolationType.NUMBER, "50") * .setGradientMinpointWithValue(color3, SpreadsheetApp.InterpolationType.NUMBER, "0") * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); * rules.push(rule);