import type { ISlideDrawingTransform, ISlidePageElement, SlideModel } from '@univerjs-pro/slides'; import type { Injector } from '@univerjs/core'; /** * The facade class for a slide page element. * @template T The slide page element data type wrapped by this facade. * @hideconstructor */ export declare class FPageElement { /** @ignore */ readonly unitId: string; /** @ignore */ readonly subUnitId: string; /** @ignore */ readonly elementId: string; /** @ignore */ protected readonly _slideModel: SlideModel; /** @ignore */ protected readonly _injector: Injector; constructor( /** @ignore */ unitId: string, /** @ignore */ subUnitId: string, /** @ignore */ elementId: string, /** @ignore */ _slideModel: SlideModel, /** @ignore */ _injector: Injector); /** * Get the element id. * @returns {string} The element id. * * @example * ```ts * const fPresentation = univerAPI.getActivePresentation(); * const fSlide = fPresentation.getActiveSlide(); * const elements = fSlide.getElements(); * console.log(elements[0]?.getId()); * ``` */ getId(): string; /** * Get the element type. * @returns {ISlidePageElement['type']} The slide element type. * * @example * ```ts * const fPresentation = univerAPI.getActivePresentation(); * const fSlide = fPresentation.getActiveSlide(); * const elements = fSlide.getElements(); * console.log(elements[0]?.getType()); * ``` */ getType(): T['type']; /** * Get the raw slide element data. * @returns {ISlidePageElement} The slide element data. * * @example * ```ts * const fPresentation = univerAPI.getActivePresentation(); * const fSlide = fPresentation.getActiveSlide(); * const element = fSlide.getElements()[0]; * console.log(element.getData()); * ``` */ getData(): T; /** * Get the transform of this element. * @returns {ISlideDrawingTransform} The transform data, including position, size, rotation, and flip state. * * @example * ```ts * const fPresentation = univerAPI.getActivePresentation(); * const fSlide = fPresentation.getActiveSlide(); * const element = fSlide.getElements()[0]; * console.log(element.getTransform()); * ``` */ getTransform(): ISlideDrawingTransform; /** * Update the transform of this element. * @param {Partial} transform The transform fields to update. * @param {number} [transform.left] The x-coordinate of the element's top-left corner. * @param {number} [transform.top] The y-coordinate of the element's top-left corner. * @param {number} [transform.width] The element width. * @param {number} [transform.height] The element height. * @param {number} [transform.rotation] The element rotation in degrees. * @param {boolean} [transform.flipX] Whether the element is flipped horizontally. * @param {boolean} [transform.flipY] Whether the element is flipped vertically. * @returns {FPageElement} This element, for chaining. * * @example * ```ts * const fPresentation = univerAPI.getActivePresentation(); * const fSlide = fPresentation.getActiveSlide(); * const element = fSlide.getElements()[0]; * element.setTransform({ left: 80, top: 120, width: 320, height: 180 }); * ``` */ setTransform(transform: Partial): this; /** * Set the element position by absolute slide coordinates. * @param {number} left The x-coordinate of the element's top-left corner. * @param {number} top The y-coordinate of the element's top-left corner. * @returns {FPageElement} This element, for chaining. * * @example * ```ts * const element = fSlide.getElements()[0]; * element.setPosition(80, 120); * ``` */ setPosition(left: number, top: number): this; /** * Set the element size. * @param {number} width The element width. * @param {number} height The element height. * @returns {FPageElement} This element, for chaining. * * @example * ```ts * const element = fSlide.getElements()[0]; * element.setSize(320, 180); * ``` */ setSize(width: number, height: number): this; /** * Set the element name. * @param {string} name The element name. * @returns {FPageElement} This element, for chaining. * * @example * ```ts * const element = fSlide.getElements()[0]; * element.setName('Title shape'); * ``` */ setName(name: string): this; /** * Set the element description. * @param {string} description The element description, usually used as accessibility text. * @returns {FPageElement} This element, for chaining. * * @example * ```ts * const element = fSlide.getElements()[0]; * element.setDescription('Company logo'); * ``` */ setDescription(description: string): this; /** * Set whether the element is visible. * @param {boolean} visible Whether the element is visible. * @returns {FPageElement} This element, for chaining. * * @example * ```ts * const element = fSlide.getElements()[0]; * element.setVisible(false); * ``` */ setVisible(visible: boolean): this; /** * Set whether the element is locked. * @param {boolean} locked Whether the element is locked. * @returns {FPageElement} This element, for chaining. * * @example * ```ts * const element = fSlide.getElements()[0]; * element.setLocked(true); * ``` */ setLocked(locked: boolean): this; /** * Set whether the element can be selected. * @param {boolean} selectable Whether the element can be selected. * @returns {FPageElement} This element, for chaining. * * @example * ```ts * const element = fSlide.getElements()[0]; * element.setSelectable(false); * ``` */ setSelectable(selectable: boolean): this; /** * @ignore */ protected _updateElement(element: T): this; }