Class: ModifyShapeHelper
Defined in: src/helper/modify-shape-helper.ts:69
Helper class for modifying PowerPoint shapes in XML structure Provides various methods for manipulating shape appearance, position, and content
Constructors
Constructor
new ModifyShapeHelper():
ModifyShapeHelper
Returns
ModifyShapeHelper
Methods
elementHasBackground()
staticelementHasBackground(element):ShapeBackgroundInfo
Defined in: src/helper/modify-shape-helper.ts:416
Check if the given element has a background which is non-transparent
Parameters
element
Element
The XML element to check
Returns
ShapeBackgroundInfo
ShapeBackgroundInfo
ensureTransformElements()
staticensureTransformElements(element):Element
Defined in: src/helper/modify-shape-helper.ts:175
Creates missing transformation elements (a:off and a:ext) with default values Ensures that a shape has the required XML structure for positioning and sizing
Parameters
element
Element
The XML element to check and modify
Returns
Element
The xfrm element that contains or will contain the transformation data
getElementPlaceholderInfo()
staticgetElementPlaceholderInfo(element):PlaceholderInfo
Defined in: src/helper/modify-shape-helper.ts:407
Forward placeholder info function
Parameters
element
Element
The XML element to check
Returns
PlaceholderInfo
The PlaceholderInfo object
getElementVisualType()
staticgetElementVisualType(element):ElementVisualType
Defined in: src/helper/modify-shape-helper.ts:398
Determines the type of visual element in PowerPoint
Parameters
element
Element
The XML element to check
Returns
ElementVisualType
A string identifying the element type
replaceText()
staticreplaceText(replaceText,options?): (element) =>void
Defined in: src/helper/modify-shape-helper.ts:159
Replace tagged text content within modified shape
Parameters
replaceText
Single replacement or array of replacements
options?
ReplaceTextOptions
Optional configuration for text replacement
Returns
Function that accepts an XML element to modify
(element) => void
rotate()
staticrotate(degrees): (element) =>void
Defined in: src/helper/modify-shape-helper.ts:300
Rotate a shape by a given angle in degrees
Parameters
degrees
number
Rotation angle in degrees (positive = clockwise, negative = counterclockwise)
Returns
Function that accepts an XML element to modify
(element) => void
roundedCorners()
staticroundedCorners(degree): (element) =>void
Defined in: src/helper/modify-shape-helper.ts:320
Apply rounded corners to a shape with a specified corner radius
Parameters
degree
number
Corner radius in EMU units (1 cm = 360000 EMU)
Returns
Function that accepts an XML element to modify
(element) => void
setBulletList()
staticsetBulletList(list): (element) =>void
Defined in: src/helper/modify-shape-helper.ts:146
Set content to bulleted list within a shape
Parameters
list
BulletListContent
Array or string content for the bullet list
Returns
Function that accepts an XML element to modify
(element) => void
setOutline()
staticsetOutline(outline): (element) =>void
Defined in: src/helper/modify-shape-helper.ts:98
Set outline (line) properties of an existing shape, picture or placeholder: width, dash style and color.
Creates an <a:ln> element if the shape has none, which is the case whenever the outline was never overridden in PowerPoint and is inherited from the theme or the shape style.
Note: if the shape's outline was explicitly switched off in PowerPoint (<a:ln><a:noFill/></a:ln>), a weight alone stays invisible - pass a color as well. Use ModifyCleanupHelper.removeBorder to drop an outline.
Parameters
outline
Width (EMU, 1pt = 12700), dash type and/or color
Returns
Function that accepts an XML element to modify
(element) => void
setPosition()
staticsetPosition(pos): (element) =>void
Defined in: src/helper/modify-shape-helper.ts:233
Set absolute position and size of a shape
Parameters
pos
Object containing position and size coordinates
Returns
Function that accepts an XML element to modify
(element) => void
setSolidFill()
staticsetSolidFill(element):void
Defined in: src/helper/modify-shape-helper.ts:75
Set solid fill of modified shape to accent6 color
Parameters
element
Element
XML element representing the shape
Returns
void
setText()
staticsetText(text): (element) =>void
Defined in: src/helper/modify-shape-helper.ts:134
Set text content of a shape
Parameters
text
string
Text string to set as shape content
Returns
Function that accepts an XML element to modify
(element) => void
updatePosition()
staticupdatePosition(pos): (element) =>void
Defined in: src/helper/modify-shape-helper.ts:264
Incrementally update position and size of a shape by adding delta values
Parameters
pos
Object containing delta values for position and size
Returns
Function that accepts an XML element to modify
(element) => void