SheetXL - v0.3.20
    Preparing search index...

    Interface IMovable

    Capabilities for working with graphical elements that can be arbitrarily placed (floated) within a virtual 'canvas'.

    Encompasses objects like images, charts, shapes, and custom widgets.

    Key features include:

    • Inserting, positioning, resizing, and scaling movables.
    • Grouping and layering multiple movables.
    • Loading, saving, and copy/pasting movables.
    interface IMovable {
        isIAnchored: true;
        isIMovable: true;
        isSelected: () => boolean;
        scrollIntoView: (
            options?: boolean | ScrollIntoViewOptions,
        ) => Promise<boolean>;
        unselect: () => boolean;
        addListeners(listeners: IListeners, options?: IListener.Options): Remove;
        close(): void;
        delete(): void;
        getAnchorCoords(): IRange.Coords;
        getAnchorType(): IAnchored.Type;
        getBounds(): Bounds;
        getContent<T extends IModel<IListeners>>(): T;
        getDescription(): string;
        getName(): string;
        getRotation(): number;
        getSnapshot(
            options?: ReferenceableClipboard.CopyOptions,
        ): IHistory.ISnapshot<IMovable.SnapshotDestination, IMovable, Bounds, any>;
        getUUID(): string;
        getZIndex(): number;
        isClosed(): boolean;
        isHidden(): boolean;
        isLockAspectRatio(): boolean;
        isProtected(): boolean;
        moveBackward(): this;
        moveForward(): this;
        moveToBack(): this;
        moveToFront(): this;
        select(options?: IMovable.SelectOptions): Promise<boolean>;
        setAnchorType(anchorType: IAnchored.Type): IMovable;
        setBounds(bounds: Partial<Bounds>, options?: OperationOptions): IMovable;
        setDescription(description: string): IMovable;
        setHidden(hidden: boolean): IMovable;
        setLockAspectRatio(locked: boolean): IMovable;
        setName(name: string): IMovable;
        setRotation(rotation: number): IMovable;
        toJSON(toResourceId?: (resource: IResource) => number): JSON;
    }

    Hierarchy (View Summary)

    Index

    Properties

    isIAnchored: true

    For runtime type checking.

    isIMovable: true

    For runtime type checking.

    isSelected: () => boolean

    Returns a flag indicating if the movable is selected.

    scrollIntoView: (options?: boolean | ScrollIntoViewOptions) => Promise<boolean>

    Scroll the movable into the viewport.

    Type declaration

      • (options?: boolean | ScrollIntoViewOptions): Promise<boolean>
      • Parameters

        • Optionaloptions: boolean | ScrollIntoViewOptions

        Returns Promise<boolean>

        A promise that resolve to a boolean when the scroll is complete.

    This will return when the scroll view is loaded but before any scroll animations have started or finished.

    unselect: () => boolean

    Remove the movable the current selection.

    Type declaration

      • (): boolean
      • Returns boolean

        A flag indicating if it was previously in the selection.

    Methods

    • Similar to delete but cleans resources and can't be undone.

      Returns void

    • Deletes the anchored item.

      Returns void

    • Returns the absolute bounds of the movable object in pixels.

      Returns Bounds

    • Returns the content of the movable.

      Type Parameters

      • T extends IModel<IListeners>

      Returns T

    • Returns string

    • Returns number

    • A specific uuid for use in memory.

      Returns string

      Useful for caches and react keys. This is not persisted.

    • The order in the z plane. To adjust this use the move methods.

      Returns number

    • Returns if the model has been closed

      Returns boolean

    • Returns boolean

    • If the anchor is unable to be modified.

      Returns boolean

    • Move movable backward one layer in the zIndex.

      Returns this

    • Move movable forward one layer in the zIndex.

      Returns this

    • Move movable to the back in the zIndex.

      Returns this

    • Move movable to the font in the zIndex.

      Returns this

    • Selects the current movable.

      Parameters

      Returns Promise<boolean>

      An async boolean indicating the movable was selected.

    • Set the absolution position of a movable in pixels.

      Parameters

      Returns IMovable

      If only some of the points are provided then only those will be moved.

    • This is the alternative text use for assistive technologies.

      Parameters

      • description: string

      Returns IMovable

    • If true then the movable object is hidden.

      Parameters

      • hidden: boolean

      Returns IMovable

    • If true then the aspect should be maintained during resize if using the corners or if the api only specifies one dimension.

      Parameters

      • locked: boolean

      Returns IMovable

      Lock aspect ratio will have different default values depending on the movable type.

    • Set the name for a movable object.

      Parameters

      • name: string

        The name of the IMovable.

      Returns IMovable

    • Set the rotation in degrees.

      Parameters

      • rotation: number

      Returns IMovable

    • If defined this will be called when the containing sheet is being serialized.

      Parameters

      • OptionaltoResourceId: (resource: IResource) => number

      Returns JSON