gas-types-detailed
Version:
Detailed Google Apps Script Type Definitions. Forked from Definitely Typed @types/google-apps-script. Adds full documentation and urls.
1,271 lines (1,147 loc) • 478 kB
TypeScript
// 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.spreadsheet.d.ts" />
declare namespace GoogleAppsScript {
namespace Slides {
/**
* A 3x3 matrix used to transform source coordinates (x1, y1) into destination coordinates (x2, y2)
* according to matrix multiplication:
*
* [ x2 ] [ scaleX shearX translateX ] [ x1 ]
* [ y2 ] = [ shearY scaleY translateY ] [ y1 ]
* [ 1 ] [ 0 0 1 ] [ 1 ]
*
* After transformation,
*
* x2 = scaleX * x1 + shearX * y1 + translateX
* y2 = scaleY * y1 + shearY * x1 + translateY
*/
interface AffineTransform {
/**
* Gets the X coordinate scaling element.
* https://developers.google.com/apps-script/reference/slides/affine-transform#getScaleX()
*/
getScaleX(): number;
/**
* Gets the Y coordinate scaling element.
* https://developers.google.com/apps-script/reference/slides/affine-transform#getScaleY()
*/
getScaleY(): number;
/**
* Gets the X coordinate shearing element.
* https://developers.google.com/apps-script/reference/slides/affine-transform#getShearX()
*/
getShearX(): number;
/**
* Gets the Y coordinate shearing element.
* https://developers.google.com/apps-script/reference/slides/affine-transform#getShearY()
*/
getShearY(): number;
/**
* Gets the X coordinate translation element in points.
* https://developers.google.com/apps-script/reference/slides/affine-transform#getTranslateX()
*/
getTranslateX(): number;
/**
* Gets the Y coordinate translation element in points.
* https://developers.google.com/apps-script/reference/slides/affine-transform#getTranslateY()
*/
getTranslateY(): number;
/**
* Returns a new AffineTransformBuilder based on this transform.
* https://developers.google.com/apps-script/reference/slides/affine-transform#toBuilder()
*/
toBuilder(): AffineTransformBuilder;
}
/**
* A builder for AffineTransform objects. Defaults to the identity transform.
*
* Call AffineTransformBuilder#build() to get the AffineTransform object.
*
* var transform =
* SlidesApp.newAffineTransformBuilder().setScaleX(2.0).setShearY(1.1).build();
*
* The resulting transform matrix is
* [ 2.0 0.0 0.0 ]
* [ 1.1 1.0 0.0 ]
* [ 0 0 1 ]
*/
interface AffineTransformBuilder {
/**
* Creates an AffineTransform object initialized with the elements set in the builder.
* https://developers.google.com/apps-script/reference/slides/affine-transform-builder#build()
*/
build(): AffineTransform;
/**
* Sets the X coordinate scaling element and returns the builder.
* https://developers.google.com/apps-script/reference/slides/affine-transform-builder#setScaleX(Number)
* @param scaleX
*/
setScaleX(scaleX: number): AffineTransformBuilder;
/**
* Sets the Y coordinate scaling element and returns the builder.
* https://developers.google.com/apps-script/reference/slides/affine-transform-builder#setScaleY(Number)
* @param scaleY
*/
setScaleY(scaleY: number): AffineTransformBuilder;
/**
* Sets the X coordinate shearing element and returns the builder.
* https://developers.google.com/apps-script/reference/slides/affine-transform-builder#setShearX(Number)
* @param shearX
*/
setShearX(shearX: number): AffineTransformBuilder;
/**
* Sets the Y coordinate shearing element and returns the builder.
* https://developers.google.com/apps-script/reference/slides/affine-transform-builder#setShearY(Number)
* @param shearY
*/
setShearY(shearY: number): AffineTransformBuilder;
/**
* Sets the X coordinate translation element in points, and returns the builder.
* https://developers.google.com/apps-script/reference/slides/affine-transform-builder#setTranslateX(Number)
* @param translateX
*/
setTranslateX(translateX: number): AffineTransformBuilder;
/**
* Sets the Y coordinate translation element in points, and returns the builder.
* https://developers.google.com/apps-script/reference/slides/affine-transform-builder#setTranslateY(Number)
* @param translateY
*/
setTranslateY(translateY: number): AffineTransformBuilder;
}
/**
* The alignment position to apply.
*
* To call an enum, you call its parent class, name, and property. For example,
* SlidesApp.AlignmentPosition.CENTER.
*/
enum AlignmentPosition { CENTER, HORIZONTAL_CENTER, VERTICAL_CENTER }
/**
* The kinds of start and end forms with which linear geometry can be rendered.
*
* Some values are based on the "ST_LineEndType" simple type described in section 20.1.10.33 of
* of "Office Open XML File Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th
* edition.
*
* To call an enum, you call its parent class, name, and property. For example,
* SlidesApp.ArrowStyle.FILL_ARROW.
*/
enum ArrowStyle { UNSUPPORTED, NONE, STEALTH_ARROW, FILL_ARROW, FILL_CIRCLE, FILL_SQUARE, FILL_DIAMOND, OPEN_ARROW, OPEN_CIRCLE, OPEN_SQUARE, OPEN_DIAMOND }
/**
* An element of text that is dynamically replaced with content that can change over time, such as a
* slide number.
*/
interface AutoText {
/**
* Returns the type of auto text. Returns null if the auto text has been deleted.
* https://developers.google.com/apps-script/reference/slides/auto-text#getAutoTextType()
*/
getAutoTextType(): AutoTextType;
/**
* Returns the index of the auto text. Returns null if the auto text has been deleted.
* https://developers.google.com/apps-script/reference/slides/auto-text#getIndex()
*/
getIndex(): Integer;
/**
* Returns a TextRange spanning the auto text. Returns null if the auto text has
* been deleted.
* https://developers.google.com/apps-script/reference/slides/auto-text#getRange()
*/
getRange(): TextRange;
}
/**
* The types of auto text.
*
* To call an enum, you call its parent class, name, and property. For example,
* SlidesApp.AutoTextType.SLIDE_NUMBER.
*/
enum AutoTextType { UNSUPPORTED, SLIDE_NUMBER }
/**
* Describes the autofit settings of a shape. If a change is made that might affect text fitting
* within its bounding text box:
*
* Autofit is deactivated and set to AutofitType.NONE.
*
* The font scale is reset to the default value and applied to the font size.
*
* The line spacing reduction is reset to the default value and applied to the line spacing.
*/
interface Autofit {
/**
* Sets the AutofitType of a shape to AutofitType.NONE.
* https://developers.google.com/apps-script/reference/slides/autofit#disableAutofit()
*/
disableAutofit(): Autofit;
/**
* Gets the AutofitType of the shape.
* https://developers.google.com/apps-script/reference/slides/autofit#getAutofitType()
*/
getAutofitType(): AutofitType;
/**
* Gets the font scale applied to the shape. For shapes with AutofitType AutofitType.NONE or AutofitType.SHAPE_AUTOFIT, this value is the default value of 1.
* For AutofitType.TEXT_AUTOFIT, the value returned is what the original font size is
* multiplied by to fit within the shape.
* https://developers.google.com/apps-script/reference/slides/autofit#getFontScale()
*/
getFontScale(): number;
/**
* Gets the line spacing reduction applied to the shape. For shapes with AutofitType
* AutofitType.NONE or AutofitType.SHAPE_AUTOFIT, this value is the default value
* of 0. For AutofitType.TEXT_AUTOFIT, the returned value is the amount of spacing
* subtracted from the original spacing to make the text fit within the shape.
* https://developers.google.com/apps-script/reference/slides/autofit#getLineSpacingReduction()
*/
getLineSpacingReduction(): number;
}
/**
* The autofit types.
*
* To call an enum, you call its parent class, name, and property. For example,
* SlidesApp.AutofitType.TEXT_AUTOFIT.
*/
enum AutofitType { UNSUPPORTED, NONE, TEXT_AUTOFIT, SHAPE_AUTOFIT }
/**
* Describes the border around an element.
*/
interface Border {
/**
* Gets the DashStyle of the border.
* https://developers.google.com/apps-script/reference/slides/border#getDashStyle()
*/
getDashStyle(): DashStyle;
/**
* Gets the LineFill of the border.
* https://developers.google.com/apps-script/reference/slides/border#getLineFill()
*/
getLineFill(): LineFill;
/**
* Gets the thickness of the border in points. Returns null if the element does not have a
* border.
* https://developers.google.com/apps-script/reference/slides/border#getWeight()
*/
getWeight(): number;
/**
* Gets whether the border is visible or not.
* https://developers.google.com/apps-script/reference/slides/border#isVisible()
*/
isVisible(): boolean;
/**
* Sets the DashStyle of the border.
*
*
* Setting a DashStyle on a transparent border makes it visible.
* https://developers.google.com/apps-script/reference/slides/border#setDashStyle(DashStyle)
* @param style
*/
setDashStyle(style: DashStyle): Border;
/**
* Sets the border to be transparent.
* https://developers.google.com/apps-script/reference/slides/border#setTransparent()
*/
setTransparent(): Border;
/**
* Sets the thickness of the border in points.
*
*
* Setting a weight on a transparent border makes it visible.
* https://developers.google.com/apps-script/reference/slides/border#setWeight(Number)
* @param points
*/
setWeight(points: number): Border;
}
/**
* The table cell merge states.
*
* To call an enum, you call its parent class, name, and property. For example,
* SlidesApp.CellMergeState.NORMAL.
*/
enum CellMergeState { NORMAL, HEAD, MERGED }
/**
* An opaque color
*/
interface Color {
/**
* Converts this color to an RgbColor.
* https://developers.google.com/apps-script/reference/slides/color#asRgbColor()
*/
asRgbColor(): Base.RgbColor;
/**
* Converts this color to a ThemeColor.
* https://developers.google.com/apps-script/reference/slides/color#asThemeColor()
*/
asThemeColor(): ThemeColor;
/**
* Get the type of this color.
* https://developers.google.com/apps-script/reference/slides/color#getColorType()
*/
getColorType(): Base.ColorType;
}
/**
* A color scheme defines a mapping from members of ThemeColorType to the actual colors used
* to render them.
*/
interface ColorScheme {
/**
* Returns the concrete Color associated with the ThemeColorType in this color
* scheme.
*
*
* The returned color is guaranteed to not be an instance of ThemeColor.
* https://developers.google.com/apps-script/reference/slides/color-scheme#getConcreteColor(ThemeColorType)
* @param theme The theme color to derive the concrete color from.
*/
getConcreteColor(theme: ThemeColorType): Color;
/**
* Returns a list of all possible theme color types in a color scheme.
* https://developers.google.com/apps-script/reference/slides/color-scheme#getThemeColors()
*/
getThemeColors(): ThemeColorType[];
/**
* Sets the concrete color associated with the ThemeColorType in this color scheme to the
* given color.
* https://developers.google.com/apps-script/reference/slides/color-scheme#setConcreteColor(ThemeColorType,Color)
* @param type The theme color type.
* @param color The color to set the theme color type to.
*/
setConcreteColor(type: ThemeColorType, color: Color): ColorScheme;
/**
* Sets the concrete color associated with the ThemeColorType in this color scheme to the
* given color in RGB format.
* https://developers.google.com/apps-script/reference/slides/color-scheme#setConcreteColor(ThemeColorType,Integer,Integer,Integer)
* @param type The theme color type.
* @param red The red value of the color to set the theme color type to (between 0 and 255).
* @param green The green value of the color to set the theme color type to (between 0 and 255).
* @param blue The blue value of the color to set the theme color type to (between 0 and 255).
*/
setConcreteColor(type: ThemeColorType, red: Integer, green: Integer, blue: Integer): ColorScheme;
/**
* Sets the concrete color associated with the ThemeColorType in this color scheme to the
* given color in HEX format.
*
*
* The hex string must be in the format '#RRGGBB'.
* https://developers.google.com/apps-script/reference/slides/color-scheme#setConcreteColor(ThemeColorType,String)
* @param type The theme color type.
* @param hexColor The hex color to set the theme color type to, such as '#F304a7'.
*/
setConcreteColor(type: ThemeColorType, hexColor: string): ColorScheme;
}
/**
* The connection site on a PageElement that can connect to a connector.
*/
interface ConnectionSite {
/**
* Returns the index of the connection site. The index is unique among all the connection sites on
* the same page element.
*
*
* In most cases, it corresponds to the predefined connection site index from the ECMA-376
* standard. More information on those connection sites can be found in the description of the
* "cnx" attribute in section 20.1.9.9 and Annex H. "Predefined DrawingML Shape and Text
* Geometries" of "Office Open XML File Formats-Fundamentals and Markup Language Reference", part
* 1 of ECMA-376
* 5th edition.
* https://developers.google.com/apps-script/reference/slides/connection-site#getIndex()
*/
getIndex(): Integer;
/**
* Returns the PageElement that the connection site is on.
* https://developers.google.com/apps-script/reference/slides/connection-site#getPageElement()
*/
getPageElement(): PageElement;
}
/**
* The content alignments for a Shape or TableCell. The supported alignments
* correspond to predefined text anchoring types from the ECMA-376 standard.
*
* More information on those alignments can be found in the description of
* the ST_TextAnchoringType simple type in section 20.1.10.59 of "Office Open XML File
* Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th
* edition.
*
* To call an enum, you call its parent class, name, and property. For example,
* SlidesApp.ContentAlignment.TOP.
*/
enum ContentAlignment { UNSUPPORTED, TOP, MIDDLE, BOTTOM }
/**
* The kinds of dashes with which linear geometry can be rendered. These values are based on the
* "ST_PresetLineDashVal" simple type described in section 20.1.10.48 of "Office Open XML File
* Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th
* edition.
*
* To call an enum, you call its parent class, name, and property. For example,
* SlidesApp.DashStyle.DOT.
*/
enum DashStyle { UNSUPPORTED, SOLID, DOT, DASH, DASH_DOT, LONG_DASH, LONG_DASH_DOT }
/**
* Describes the page element's background
*/
interface Fill {
/**
* Get the solid fill of this background, or null if the fill type is not FillType.SOLID.
* https://developers.google.com/apps-script/reference/slides/fill#getSolidFill()
*/
getSolidFill(): SolidFill;
/**
* Get the type of this fill.
* https://developers.google.com/apps-script/reference/slides/fill#getType()
*/
getType(): FillType;
/**
* Whether the background is visible.
* https://developers.google.com/apps-script/reference/slides/fill#isVisible()
*/
isVisible(): boolean;
/**
* Sets the solid fill to the given Color.
* https://developers.google.com/apps-script/reference/slides/fill#setSolidFill(Color)
* @param color
*/
setSolidFill(color: Color): void;
/**
* Sets the solid fill to the given alpha and Color.
* https://developers.google.com/apps-script/reference/slides/fill#setSolidFill(Color,Number)
* @param color
* @param alpha
*/
setSolidFill(color: Color, alpha: number): void;
/**
* Sets the solid fill to the given RGB values.
* https://developers.google.com/apps-script/reference/slides/fill#setSolidFill(Integer,Integer,Integer)
* @param red
* @param green
* @param blue
*/
setSolidFill(red: Integer, green: Integer, blue: Integer): void;
/**
* Sets the solid fill to the given alpha and RGB values.
* https://developers.google.com/apps-script/reference/slides/fill#setSolidFill(Integer,Integer,Integer,Number)
* @param red
* @param green
* @param blue
* @param alpha
*/
setSolidFill(red: Integer, green: Integer, blue: Integer, alpha: number): void;
/**
* Sets the solid fill to the given hex color string.
*
*
* The hex string must be in the format '#RRGGBB'. For example, pink would be represented as
* '#FFC0CB'.
* https://developers.google.com/apps-script/reference/slides/fill#setSolidFill(String)
* @param hexString
*/
setSolidFill(hexString: string): void;
/**
* Sets the solid fill to the given alpha and hex color string.
*
*
* The hex string must be in the format '#RRGGBB'. For example, pink would be represented as
* '#FFC0CB'.
* https://developers.google.com/apps-script/reference/slides/fill#setSolidFill(String,Number)
* @param hexString
* @param alpha
*/
setSolidFill(hexString: string, alpha: number): void;
/**
* Sets the solid fill to the given ThemeColorType.
* https://developers.google.com/apps-script/reference/slides/fill#setSolidFill(ThemeColorType)
* @param color
*/
setSolidFill(color: ThemeColorType): void;
/**
* Sets the solid fill to the given alpha and ThemeColorType.
* https://developers.google.com/apps-script/reference/slides/fill#setSolidFill(ThemeColorType,Number)
* @param color
* @param alpha
*/
setSolidFill(color: ThemeColorType, alpha: number): void;
/**
* Sets the background to transparent.
* https://developers.google.com/apps-script/reference/slides/fill#setTransparent()
*/
setTransparent(): void;
}
/**
* The kinds of fill.
*
* To call an enum, you call its parent class, name, and property. For example,
* SlidesApp.FillType.SOLID.
*/
enum FillType { UNSUPPORTED, NONE, SOLID }
/**
* A collection of PageElements joined as a single unit.
*/
interface Group {
/**
* Aligns the element to the specified alignment position on the page.
* https://developers.google.com/apps-script/reference/slides/group#alignOnPage(AlignmentPosition)
* @param alignmentPosition The position to align this page element to on the page.
*/
alignOnPage(alignmentPosition: AlignmentPosition): Group;
/**
* Brings the page element forward on the page by one element.
*
*
* The page element must not be in a group.
* https://developers.google.com/apps-script/reference/slides/group#bringForward()
*/
bringForward(): Group;
/**
* Brings the page element to the front of the page.
*
*
* The page element must not be in a group.
* https://developers.google.com/apps-script/reference/slides/group#bringToFront()
*/
bringToFront(): Group;
/**
* Duplicates the page element.
*
*
* The duplicate page element is placed on the same page at the same position as the original.
* https://developers.google.com/apps-script/reference/slides/group#duplicate()
*/
duplicate(): PageElement;
/**
* Gets the collection of page elements in the group. The minimum size of a group is 2.
* https://developers.google.com/apps-script/reference/slides/group#getChildren()
*/
getChildren(): PageElement[];
/**
* Returns the list of ConnectionSites on the page element, or an empty list if the page
* element does not have any connection sites.
* https://developers.google.com/apps-script/reference/slides/group#getConnectionSites()
*/
getConnectionSites(): ConnectionSite[];
/**
* Returns the page element's alt text description. The description is combined with the title to
* display and read alt text.
* https://developers.google.com/apps-script/reference/slides/group#getDescription()
*/
getDescription(): string;
/**
* Gets the element's height in points, which is the height of the element's bounding box when the
* element has no rotation.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/group#getHeight()
*/
getHeight(): number;
/**
* Returns the element's inherent height in points.
*
*
* The page element's transform is relative to its inherent size. Use the inherent size in
* conjunction with the element's transform to determine the element's final visual appearance.
* https://developers.google.com/apps-script/reference/slides/group#getInherentHeight()
*/
getInherentHeight(): number;
/**
* Returns the element's inherent width in points.
*
*
* The page element's transform is relative to its inherent size. Use the inherent size in
* conjunction with the element's transform to determine the element's final visual appearance.
* https://developers.google.com/apps-script/reference/slides/group#getInherentWidth()
*/
getInherentWidth(): number;
/**
* Returns the element's horizontal position in points, measured from the upper-left corner of the
* page when the element has no rotation.
* https://developers.google.com/apps-script/reference/slides/group#getLeft()
*/
getLeft(): number;
/**
* Returns the unique ID for this object. Object IDs used by pages and page elements share the
* same namespace.
* https://developers.google.com/apps-script/reference/slides/group#getObjectId()
*/
getObjectId(): string;
/**
* Returns the page element's type, represented as a PageElementType enum.
* https://developers.google.com/apps-script/reference/slides/group#getPageElementType()
*/
getPageElementType(): PageElementType;
/**
* Returns the group this page element belongs to, or null if the element is not in a
* group.
* https://developers.google.com/apps-script/reference/slides/group#getParentGroup()
*/
getParentGroup(): Group;
/**
* Returns the page this page element is on.
* https://developers.google.com/apps-script/reference/slides/group#getParentPage()
*/
getParentPage(): Page;
/**
* Returns the element's clockwise rotation angle around its center in degrees, where zero degrees
* means no rotation.
* https://developers.google.com/apps-script/reference/slides/group#getRotation()
*/
getRotation(): number;
/**
* Returns the page element's alt text title. The title is combined with the description to
* display and read alt text.
* https://developers.google.com/apps-script/reference/slides/group#getTitle()
*/
getTitle(): string;
/**
* Gets the element's vertical position in points, measured from the upper-left corner of the page
* when the element has no rotation.
* https://developers.google.com/apps-script/reference/slides/group#getTop()
*/
getTop(): number;
/**
* Gets the page element's transform.
*
*
* The initial transform for a newly created Group is always the identity transform:
* 1.0 scale parameters, and 0.0 shear and translate parameters.
* https://developers.google.com/apps-script/reference/slides/group#getTransform()
*/
getTransform(): AffineTransform;
/**
* Returns the element's width in points, which is the width of the element's bounding box when
* the element has no rotation.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/group#getWidth()
*/
getWidth(): number;
/**
* Preconcatenates the provided transform to the existing transform of the page element.
*
*
* newTransform = argument * existingTransform
* For example, to move a page elements 36 points to the left:
*
*
* element.preconcatenateTransform(SlidesApp.newAffineTransformBuilder()
* .setTranslateX(-36.0)
* .build());
* You can also replace the page element's transform with setTransform(transform).
* https://developers.google.com/apps-script/reference/slides/group#preconcatenateTransform(AffineTransform)
* @param transform The transform to preconcatenate onto this page element's transform.
*/
preconcatenateTransform(transform: AffineTransform): Group;
/**
* Removes the page element.
*
*
* If after a remove operation, a Group contains only one or no page elements, the
* group itself is also removed.
*
*
* If a placeholder PageElement is removed on a master or layout, any empty inheriting
* placeholders are also removed.
* https://developers.google.com/apps-script/reference/slides/group#remove()
*/
remove(): void;
/**
* Scales the element's height by the specified ratio. The element's height is the height of its
* bounding box when the element has no rotation.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/group#scaleHeight(Number)
* @param ratio The ratio to scale this page element's height by.
*/
scaleHeight(ratio: number): Group;
/**
* Scales the element's width by the specified ratio. The element's width is the width of its
* bounding box when the element has no rotation.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/group#scaleWidth(Number)
* @param ratio The ratio to scale this page element's width by.
*/
scaleWidth(ratio: number): Group;
/**
* Selects only the PageElement in the active presentation and removes any previous
* selection. This is same as calling select(replace) with true.
*
*
* A script can only access the selection of the user who is running the script, and only if
* the script is bound to the presentation.
*
*
* This sets the parent Page of the PageElement as the current page selection.
*
*
* var slide = SlidesApp.getActivePresentation().getSlides()[0];
* var pageElement = slide.getPageElements()[0];
* // Only select this page element and replace any previous selection.
* pageElement.select();
* https://developers.google.com/apps-script/reference/slides/group#select()
*/
select(): void;
/**
* Selects the PageElement in the active presentation.
*
*
* A script can only access the selection of the user who is running the script, and only if
* the script is bound to the presentation.
*
*
* Pass true to this method to select only the PageElement and remove any
* previous selection. This also sets the parent Page of the PageElement as the
* current page selection.
*
*
* Pass false to select multiple PageElement objects. The PageElement
* objects must be in the same Page.
*
*
* The following conditions must be met while selecting a page element using a false
* parameter:
*
*
* https://developers.google.com/apps-script/reference/slides/group#select(Boolean)
* @param replace If true, the selection replaces any previous selection; otherwise the selection is added to any previous selection.
*/
select(replace: boolean): void;
/**
* Sends the page element backward on the page by one element.
*
*
* The page element must not be in a group.
* https://developers.google.com/apps-script/reference/slides/group#sendBackward()
*/
sendBackward(): Group;
/**
* Sends the page element to the back of the page.
*
*
* The page element must not be in a group.
* https://developers.google.com/apps-script/reference/slides/group#sendToBack()
*/
sendToBack(): Group;
/**
* Sets the page element's alt text description.
*
*
* The method is not supported for Group elements.
*
*
* // Set the first page element's alt text description to "new alt text description".
* var pageElement = SlidesApp.getActivePresentation().getSlides()[0].getPageElements()[0];
* pageElement.setDescription('new alt text description');
* Logger.log(pageElement.getDescription());
* https://developers.google.com/apps-script/reference/slides/group#setDescription(String)
* @param description The string to set the alt text description to.
*/
setDescription(description: string): Group;
/**
* Sets the element's height in points, which is the height of the element's bounding box when the
* element has no rotation.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/group#setHeight(Number)
* @param height The new height of this page element to set, in points.
*/
setHeight(height: number): Group;
/**
* Sets the element's horizontal position in points, measured from the upper-left corner of the
* page when the element has no rotation.
* https://developers.google.com/apps-script/reference/slides/group#setLeft(Number)
* @param left The new horizontal position to set, in points.
*/
setLeft(left: number): Group;
/**
* Sets the element's clockwise rotation angle around its center in degrees.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/group#setRotation(Number)
* @param angle The new clockwise rotation angle to set, in degrees.
*/
setRotation(angle: number): Group;
/**
* Sets the page element's alt text title.
*
*
* The method is not supported for Group elements.
*
*
* // Set the first page element's alt text title to "new alt text title".
* var pageElement = SlidesApp.getActivePresentation().getSlides()[0].getPageElements()[0];
* pageElement.setTitle('new alt text title');
* Logger.log(pageElement.getTitle());
* https://developers.google.com/apps-script/reference/slides/group#setTitle(String)
* @param title The string to set the alt text title to.
*/
setTitle(title: string): Group;
/**
* Sets the element's vertical position in points, measured from the upper-left corner of the page
* when the element has no rotation.
* https://developers.google.com/apps-script/reference/slides/group#setTop(Number)
* @param top The new vertical position to set, in points.
*/
setTop(top: number): Group;
/**
* Sets the transform of the page element with the provided transform.
*
*
* Updating the transform of a group changes the absolute transform of the page elements in
* that group, which can change their visual appearance.
*
*
* Updating the transform of a page element that is in a group only changes the transform of
* that page element; it doesn't affect the transforms of the group or other page elements in the
* group.
*
*
* For details on how transforms impact visual appearance of page elements, see getTransform().
* https://developers.google.com/apps-script/reference/slides/group#setTransform(AffineTransform)
* @param transform The transform that is set for this page element.
*/
setTransform(transform: AffineTransform): Group;
/**
* Sets the element's width in points, which is the width of the element's bounding box when the
* element has no rotation.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/group#setWidth(Number)
* @param width The new width of this page element to set, in points.
*/
setWidth(width: number): Group;
/**
* Ungroups the elements of the group.
*
*
* The group itself is removed.
*
*
* Groups inside other groups cannot be ungrouped.
* https://developers.google.com/apps-script/reference/slides/group#ungroup()
*/
ungroup(): void;
}
/**
* A PageElement representing an image.
*/
interface Image {
/**
* Aligns the element to the specified alignment position on the page.
* https://developers.google.com/apps-script/reference/slides/image#alignOnPage(AlignmentPosition)
* @param alignmentPosition The position to align this page element to on the page.
*/
alignOnPage(alignmentPosition: AlignmentPosition): Image;
/**
* Brings the page element forward on the page by one element.
*
*
* The page element must not be in a group.
* https://developers.google.com/apps-script/reference/slides/image#bringForward()
*/
bringForward(): Image;
/**
* Brings the page element to the front of the page.
*
*
* The page element must not be in a group.
* https://developers.google.com/apps-script/reference/slides/image#bringToFront()
*/
bringToFront(): Image;
/**
* Duplicates the page element.
*
*
* The duplicate page element is placed on the same page at the same position as the original.
* https://developers.google.com/apps-script/reference/slides/image#duplicate()
*/
duplicate(): PageElement;
/**
* Return the data inside this object as a blob converted to the specified content type. This
* method adds the appropriate extension to the filename—for example, "myfile.pdf". However, it
* assumes that the part of the filename that follows the last period (if any) is an existing
* extension that should be replaced. Consequently, "ShoppingList.12.25.2014" becomes
* "ShoppingList.12.25.pdf".
*
*
* To view the daily quotas for conversions, see Quotas for Google
* Services. Newly created Google Workspace domains might be temporarily subject to stricter
* quotas.
* https://developers.google.com/apps-script/reference/slides/image#getAs(String)
* @param contentType The MIME type to convert to. For most blobs, 'application/pdf' is the only valid option. For images in BMP, GIF, JPEG, or PNG format, any of 'image/bmp', 'image/gif', 'image/jpeg', or 'image/png' are also valid.
*/
getAs(contentType: string): Base.Blob;
/**
* Return the data inside this image as a blob.
* https://developers.google.com/apps-script/reference/slides/image#getBlob()
*/
getBlob(): Base.Blob;
/**
* Returns the Border of the image.
* https://developers.google.com/apps-script/reference/slides/image#getBorder()
*/
getBorder(): Border;
/**
* Returns the list of ConnectionSites on the page element, or an empty list if the page
* element does not have any connection sites.
* https://developers.google.com/apps-script/reference/slides/image#getConnectionSites()
*/
getConnectionSites(): ConnectionSite[];
/**
* Gets a 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 may be lost if the
* presentation's sharing settings change. The returned URL expires after a short period of time.
* https://developers.google.com/apps-script/reference/slides/image#getContentUrl()
*/
getContentUrl(): string;
/**
* Returns the page element's alt text description. The description is combined with the title to
* display and read alt text.
* https://developers.google.com/apps-script/reference/slides/image#getDescription()
*/
getDescription(): string;
/**
* Gets the element's height in points, which is the height of the element's bounding box when the
* element has no rotation.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/image#getHeight()
*/
getHeight(): number;
/**
* Returns the element's inherent height in points.
*
*
* The page element's transform is relative to its inherent size. Use the inherent size in
* conjunction with the element's transform to determine the element's final visual appearance.
* https://developers.google.com/apps-script/reference/slides/image#getInherentHeight()
*/
getInherentHeight(): number;
/**
* Returns the element's inherent width in points.
*
*
* The page element's transform is relative to its inherent size. Use the inherent size in
* conjunction with the element's transform to determine the element's final visual appearance.
* https://developers.google.com/apps-script/reference/slides/image#getInherentWidth()
*/
getInherentWidth(): number;
/**
* Returns the element's horizontal position in points, measured from the upper-left corner of the
* page when the element has no rotation.
* https://developers.google.com/apps-script/reference/slides/image#getLeft()
*/
getLeft(): number;
/**
* Returns the Link or null if there is no link.
*
*
* var link = shape.getLink();
* if (link != null) {
* Logger.log('Shape has a link of type: ' + link.getLinkType());
* }
* https://developers.google.com/apps-script/reference/slides/image#getLink()
*/
getLink(): Link;
/**
* Returns the unique ID for this object. Object IDs used by pages and page elements share the
* same namespace.
* https://developers.google.com/apps-script/reference/slides/image#getObjectId()
*/
getObjectId(): string;
/**
* Returns the page element's type, represented as a PageElementType enum.
* https://developers.google.com/apps-script/reference/slides/image#getPageElementType()
*/
getPageElementType(): PageElementType;
/**
* Returns the group this page element belongs to, or null if the element is not in a
* group.
* https://developers.google.com/apps-script/reference/slides/image#getParentGroup()
*/
getParentGroup(): Group;
/**
* Returns the page this page element is on.
* https://developers.google.com/apps-script/reference/slides/image#getParentPage()
*/
getParentPage(): Page;
/**
* Returns the parent page element of the placeholder. Returns null if the image is not a
* placeholder or has no parent.
* https://developers.google.com/apps-script/reference/slides/image#getParentPlaceholder()
*/
getParentPlaceholder(): PageElement;
/**
* Returns the index of the placeholder image. If two or more placeholder images on the same page
* are the same type, they each have a unique index value. Returns null if the image isn't
* a placeholder.
* https://developers.google.com/apps-script/reference/slides/image#getPlaceholderIndex()
*/
getPlaceholderIndex(): Integer;
/**
* Returns the placeholder type of the image, or PlaceholderType.NONE if the shape is not
* a placeholder.
* https://developers.google.com/apps-script/reference/slides/image#getPlaceholderType()
*/
getPlaceholderType(): PlaceholderType;
/**
* Returns the element's clockwise rotation angle around its center in degrees, where zero degrees
* means no rotation.
* https://developers.google.com/apps-script/reference/slides/image#getRotation()
*/
getRotation(): number;
/**
* Gets the image's source URL, if available.
*
*
* When an image is inserted by URL, returns the URL provided during image insertion.
* https://developers.google.com/apps-script/reference/slides/image#getSourceUrl()
*/
getSourceUrl(): string;
/**
* Returns the page element's alt text title. The title is combined with the description to
* display and read alt text.
* https://developers.google.com/apps-script/reference/slides/image#getTitle()
*/
getTitle(): string;
/**
* Gets the element's vertical position in points, measured from the upper-left corner of the page
* when the element has no rotation.
* https://developers.google.com/apps-script/reference/slides/image#getTop()
*/
getTop(): number;
/**
* Returns the page element's transform.
*
*
* The visual appearance of the page element is determined by its absolute transform. To
* compute the absolute transform, preconcatenate a page element's transform with the transforms
* of all of its parent groups. If the page element is not in a group, its absolute transform is
* the same as the value in this field.
* https://developers.google.com/apps-script/reference/slides/image#getTransform()
*/
getTransform(): AffineTransform;
/**
* Returns the element's width in points, which is the width of the element's bounding box when
* the element has no rotation.
*
*
* This method isn't compatible with all page elements. To learn which page elements aren't
* compatible with this method, refer to the
* sizing and positioning limitations.
* https://developers.google.com/apps-script/reference/slides/image#getWidth()
*/
getWidth(): number;
/**
* Preconcatenates the provided transform to the existing transform of the page element.
*
*
* newTransform = argument * existingTransform
* For example, to move a page elements 36 points to the left:
*
*
* element.preconcatenateTransform(SlidesApp.newAffineTransformBuilder()
* .setTranslateX(-36.0)
* .build());
* You can also replace the page element's transform with setTransform(transform).
* https://developers.google.com/apps-script/reference/slides/image#preconcatenateTransform(AffineTransform)
* @param transform The transform to preconcatenate onto this page element's transform.
*/
preconcatenateTransform(transform: AffineTransform): Image;
/**
* Removes the page element.
*
*
* If after a remove operation, a Group contains only one or no page elements, the
* group itself is also removed.
*
*
* If a placeholder PageElement is removed on a master or layout, any empty inheriting
* placeholders are also removed.
* https://developers.google.com/apps-script/reference/slides/image#remove()
*/
remove(): void;
/**
* Removes a Link.
*
*
* shape.removeLink();
* https://developers.google.com/apps-script/reference/slides/image#removeLink()
*/
removeLink(): void;
/**
* Replaces this image with an image described by a BlobSource object.
*
*
* Inserting the image fetches it from the
* BlobSource once and a copy is stored for display inside the presentation.
* Images must be less than 50MB in size, cannot exceed 25 megapixels, and must be in either in
* PNG, JPEG, or GIF format.
*
*
* In order to maintain the image's aspect ratio, the image is scaled and centered with respect
* to the size of the existing image.
*
*
* var image = SlidesApp.getActivePresentation().getSlides()[0].getImages()[0];
* // Get the Drive image file with the given ID.
* var driveImage = DriveApp.getFileById(fileId);
* image.replace(driveImage);
* https://developers.google.com/apps-script/reference/slides/image#replace(BlobSource)
* @param blobSource The image data.
*/
replace(blobSource: Base.BlobSource): Image;
/**
* Replaces this image with an image described by a Image object, optionally cropping
* the image to fit.
*
*
* Inserting the image fetches it from the
* BlobSource once and a copy is stored for display inside the presentation.
* Images must be less than 50MB in size, cannot exceed 25 megapixels, and must be in either in
* PNG, JPEG, or GIF format.
*
*
* var image = SlidesApp.getActivePresentation().getSlides()[0].getImages()[0];
* // Get the Drive image file with the given ID.
* var driveImage = DriveApp.getFileById(fileId);
* // Replace and crop the drive image.
* image.replace(driveImage, true);
* https://developers.google.com/apps-script/reference/slides/image#replace(BlobSource,Boolean)
* @param blobSource The image data.
* @param crop If true, crops the image to fit the existing image's size. Otherwise, the image is scaled and centered.
*/
replace(blobSource: Base.BlobSource, crop: boolean): Image;
/**
* Replaces this image with another image downloaded from the provided URL.
*
*
* Inserting the image fetches it from the URL once and a copy is stored for display inside the
* presentation. Images must be less than 50MB in size, cannot exceed 25 megapixels, and must be
* in either in PNG, JPEG, or GIF format.
*