Your IP : 3.144.18.59


Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/imageeditor/src/
Upload File :
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/imageeditor/src/imageeditor.js

import 'main.imageeditor';
import buildOptions from './internal/build.options';
import getFilename from './internal/get.filename';

/**
 * @memberOf BX.Landing
 */
export class ImageEditor
{
	static edit(options: {image: string, dimensions: {width: number, height: number}})
	{
		const imageEditor = BX.Main.ImageEditor.getInstance();
		const preparedOptions = buildOptions(options);

		return imageEditor
			.edit(preparedOptions)
			.then((file) => {
				file.name = decodeURIComponent(getFilename(options.image));
				return file;
			});
	}
}