calculateExtentInternal(size) {
    size = size || this.getViewportSizeMinusPadding_();
    const center = /** @type {!import("./coordinate.js").Coordinate} */ (
      this.getCenterInternal()
    );
    assert(center, 'The view center is not defined');
    const resolution = /** @type {!number} */ (this.getResolution());
    assert(resolution !== undefined, 'The view resolution is not defined');
    const rotation = /** @type {!number} */ (this.getRotation());
    assert(rotation !== undefined, 'The view rotation is not defined');

    return getForViewAndSize(center, resolution, rotation, size);
  }
@param {import("./size.js").Size} [size] Box pixel size. If not provided,
the map's last known viewport size will be used.
@return {import("./extent.js").Extent} Extent.