Function calculateTextDimensions

  • Calculate the dimensions needed for an element's text. This is a relatively expensive operation, so it should not be called excessively.

    Parameters

    • parentElement: Element
    • text: string
    • OptionalcustomOptions: PartialWithUndefined<
          {
              debug: boolean;
              errorMessage: string;
              timeout: Partial<Record<DurationUnit, undefined | number>>;
          },
      >

    Returns Promise<Dimensions>