Options
All
  • Public
  • Public/Protected
  • All
Menu

Module roosterjs-editor-plugins

Index

Type aliases

AnnounceFeatureKey

AnnounceFeatureKey: "announceNewListItem" | "announceWarningOnLastTableCell"

Announce feature keys

DNDDirectionX

DNDDirectionX: "w" | "" | "e"

Horizontal direction types for image edit

DnDDirectionY

DnDDirectionY: "n" | "" | "s"

Vertical direction types for image edit

Functions

canRegenerateImage

  • canRegenerateImage(img: HTMLImageElement): boolean

getAllFeatures

isResizedTo

  • isResizedTo(image: HTMLImageElement, percentage: number, maxError?: number): boolean
  • Check if the image is already resized to the given percentage

    Parameters

    • image: HTMLImageElement

      The image to check

    • percentage: number

      The percentage to check

    • maxError: number = 1

      Maximum difference of pixels to still be considered the same size

    Returns boolean

resetImage

  • resetImage(editor: IEditor, image: HTMLImageElement): void

resizeByPercentage

  • resizeByPercentage(editor: IEditor, image: HTMLImageElement, percentage: number, minWidth: number, minHeight: number): void
  • Resize the image by percentage of its natural size. If the image is cropped or rotated, the final size will also calculated with crop and rotate info.

    Parameters

    • editor: IEditor

      The editor that contains the image

    • image: HTMLImageElement

      The image to resize

    • percentage: number

      Percentage to resize to

    • minWidth: number

      Minimum width

    • minHeight: number

      Minimum height

    Returns void

Generated using TypeDoc