import { IProductDefinition } from "./ObjectModel/ObjectModel";
import { IConfiguration } from "./Configuration/ConfigurationInterfaces";
import { Editor } from "./Editor";
/**
* Using this class you can load {@link (Editor:class)} instances to a specified iframe element and initialize them with a specified product and configuration.
* @public
*/
export declare class EditorBuilder {
private backendUrl;
/**
* Creates a new instance of the builder. Note, you may prefer to use a static method {@link EditorBuilder.for} instead.
*
* @param backendUrl - a URL to your Design Editor instance (can be installed either on your server or hosted on Aurigma's servers). If you don't have it, contact Aurigma team at info\@aurigma.com.
*/
constructor(backendUrl: string);
/**
* The same as a constructor, but implemented as a static method.
*
* @param backendUrl - a URL to your Design Editor instance (can be installed either on your server or hosted on Aurigma's servers). If you don't have it, contact Aurigma team at info\@aurigma.com.
*
* @example You may think of this methods as a "syntax sugar" to make it possible creating the editor with a single line, like this:
* ``` ts
* const editor = EditorLoader.for('').build(...);
* ```
*/
static for(backendUrl: string): EditorBuilder;
/**
* Creates an invisible iframe and preloads all Design Editor scripts inside it to cache them in a browser.
*
* @remarks Use this method in scenarios when instead of calling the {@link EditorBuilder.build} method in the beginning of a page lifecycle,
* you do it later (e.g. when the user clicks a sort of a "Personalize" button). In this case, you should call the {@link EditorBuilder.preload}
* as early as possible. By the moment when you call {@link EditorBuilder.build}, all Design Editor scripts will be loaded to the browser cache and
* the editor will be opened very quickly.
*
* If you call the {@link EditorBuilder.build} during the page initialization, there is no need to preload scripts.
*
* Hint: Although this method is async, most likely you don't want to call it with `await`. You should just call it and let it work in
* the background.
*/
preload(): Promise;
/**
* Builds an instance of {@link (Editor:class)} and loads it in a specified iframe element.
*
* @param target - the IFrame element where you want to load the editor. If another instance of an editor is already loaded, it will be automatically disposed.
* @param productDefinition - it can be either a {@link IProductDefinition} structure describing the template you want to load or a string (array of strings) containing the ID of state files. When multiple state files specified, they are merged to a single product.
* @param config - the editor configuration described with the {@link IConfiguration} structure.
* @returns The {@link (Editor:class)} class instance which allows manipulating the editor and its content.
*/
build(target: HTMLIFrameElement, productDefinition: string | string[] | IProductDefinition, config: IConfiguration): Promise;
}