UNPKG

pptx-automizer

Version:

A template based pptx generator

70 lines (69 loc) 3.1 kB
import { XmlElement } from '../types/xml-types'; import { Color } from '../index'; /** * Helper class for cleaning and clearing PowerPoint effects in XML structure */ export default class ModifyCleanupHelper { /** * Removes background color and fill elements from a shape * This removes both visible and hidden fill properties and sets explicit noFill * * @param element - The XML element representing the shape */ static removeBackground: (element: XmlElement) => void; /** * Removes shape style but preserves fill color information by moving it to a standard fill element * This converts the p:style reference colors to direct solidFill colors on the shape * * @param element - The XML element representing the shape */ static removeShapeStyle: (element: XmlElement) => void; /** * Removes border/outline from a shape * This function removes the a:ln (line) element which defines the border properties * * @param element - The XML element representing the shape */ static removeBorder: (element: XmlElement) => void; /** * Removes unwanted visual effects from PowerPoint elements based on their type * Preserves certain effects for drawings but removes distracting effects from photos * * @param element - The XML element to clean up */ static removeEffects(element: XmlElement): void; /** * Removes text formatting effects * * @param element - The XML element containing text runs to clean up */ static removeTextEffects(element: XmlElement): void; /** * Removes extension list (extLst) elements from PowerPoint shapes * * The extLst (Extension List) element in OOXML contains application-specific extensions * and future compatibility features that may not be supported across all Office versions. * These extensions can include: * - Custom drawing effects and transformations * - Third-party add-in specific properties * - Version-specific features that may cause rendering inconsistencies * - Experimental or preview features * * Removing extLst helps ensure cross-version compatibility and prevents rendering * issues when the presentation is opened in different versions of PowerPoint or * other OOXML-compatible applications. * * @param element - The XML element containing extension lists to remove */ static removeExtLst(element: XmlElement): void; static clearTextUnderlineToBold(element: XmlElement): void; static clearTextItalicsToBold(element: XmlElement): void; static clearTextUnderline(element: XmlElement): void; static clearTextBold(element: XmlElement): void; static clearTextSize(element: XmlElement): void; static clearTextColor(element: XmlElement, color?: Color): void; static removeFillEffects(element: XmlElement): void; static remove3dEffects(element: XmlElement): void; static removeShadowEffects(element: XmlElement): void; static removeColorAdjustment(element: XmlElement): void; }