import { BimCoreApi } from '../BimCoreApi';
import { Mesh, Nullable, Observable, Plane, Texture, TransformNode, Vector3, Matrix, Color4 } from '../loader/babylonjs-import';
import { Html2CanvasPoint, HtmlPointParent } from './Html2CanvasPoint';
import { CoordinateTracker, TrackCoordinate2D } from './CoordinateTracker';
export interface Html2CanvasPointFactoryHandler<Point extends Html2CanvasPoint> {
    (api: BimCoreApi, plane: Plane): Point;
}
/**
 * Renders HTML elements to a plane in 3D space.
 * WARNING: This class does NOT sanitize its contents. Make sure to sanitize your HTML in the htmlConversion parameter or before passing it
 * to this class.
 */
export declare class Html2CanvasPlane<Point extends Html2CanvasPoint = Html2CanvasPoint> implements HtmlPointParent<Html2CanvasPoint> {
    private readonly _api;
    readonly id: string;
    private readonly _htmlConversion;
    private readonly _position;
    private readonly _normal;
    private readonly _scale;
    rotationAroundNormal: number;
    private _backgroundColor;
    private readonly _pointFactory;
    private _parent;
    private _maxTextureSize;
    /**
     * @hidden
     */
    _pointTracker: CoordinateTracker<Html2CanvasPoint>;
    readonly onPointTrackableScreen: Observable<TrackCoordinate2D<Point>>;
    private _html;
    private _originalHtml;
    private _mesh;
    private _minScale;
    private readonly _texture;
    private readonly _cornerCoordinatesLocal;
    private readonly _cornerPoints;
    private readonly _centerPoint;
    readonly onHtmlChangeObservable: Observable<string>;
    readonly onBackgroundColorChangeObservable: Observable<Color4>;
    private _onParentWorldMatrixUpdateObserver;
    private readonly _containerDiv;
    private static readonly _parser;
    private readonly _tmpVecA;
    private readonly _tmpVecB;
    private readonly _tmpVecC;
    private readonly _tmpMatrix;
    /**
     * Creates a new Html2CanvasPlane and adds it to the scene.
     * @param api BimApi instance.
     * @param id unique id
     * @param html The original HTML
     * @param htmlConversion The method for modifying the HTML string. NOTE: This class does not sanitize HTML so this method is a good place to do so.
     * @param position The position of the plane.
     * @param normal The normal of the plane.
     * @param scale The scale of the plane. If a number is passed in the scale will automatically adjust for aspect ratio and parent scale. If a Vector3 is passed in it is the absolute scaling of the plane.
     * @param rotationAroundNormal How much the plane should be rotated around the normal in radians.
     * @param backgroundColor Background color for the resulting canvas which is then applied to the plane.
     * @param pointFactory Factory method for the points the user can drag to resize the plane etc.
     * @param parent Babylonjs parent node.
     * @returns The new a promise with the Html2CanvasPlane.
     */
    static create<Point extends Html2CanvasPoint = Html2CanvasPoint>(api: BimCoreApi, id: string, html: string, htmlConversion: (html: string) => string, position: Vector3, normal: Vector3, scale: Vector3 | number, rotationAroundNormal: number, backgroundColor: Color4, pointFactory: Html2CanvasPointFactoryHandler<Point>, parent: Nullable<TransformNode>): Promise<Html2CanvasPlane<Point>>;
    private constructor();
    private registerParentWorldMatrixCallback;
    /**
     * Sets the parent of the Html2CanvasPlane without keeping the position in world space.
     * @param node new parent for the Html2CanvasPlane.
     */
    set parent(node: Nullable<TransformNode>);
    /**
     * Gets the parent TransformNode.
     */
    get parent(): Nullable<TransformNode>;
    /**
     * Gets the position of the plane in world space.
     */
    get position(): Vector3;
    /**
     * Gets the scaling of the plane.
     */
    get scaling(): Vector3;
    /**
     * @returns The worldmatrix of the plane mesh.
     */
    worldMatrix(): Matrix;
    private parseHtml;
    /**
     * Renders the HTML to a plane in 3D space.
     * @returns The mesh on which the HTML is rendered.
     */
    private renderToPlane;
    /**
     * Updates the container div element with the current HTML.
     */
    private updateContainerDiv;
    /**
     * Renders the containerdiv to the plane.
     * @returns A promise that will resolve when the texture is rendered.
     */
    renderContainerDivToPlane(): Promise<Texture>;
    /**
     * Updates the container div and renders the container div to the plane.
     * @returns A promise which resolves when the texture is updated.
     */
    updateTexture(): Promise<Texture>;
    /**
     * @hidden
     */
    rotate(point: Html2CanvasPoint): void;
    /**
     * @hidden
     */
    scale(point: Html2CanvasPoint, retainAspectRatio?: boolean): void;
    private updatePointsFromLocalSpaceCoordinates;
    /**
     * @hidden
     */
    translate(): void;
    /**
     * Sets the HTML and applies it to the texture
     * @param html The new HTML to be rendered.
     * @param htmlConversion The conversion function for the HTML, note that it is recommended to santize the input first.
     */
    setHtmlAndUpdate(html: string, htmlConversion: (html: string) => string): Promise<void>;
    setHtml(html: string, htmlConversion: (html: string) => string): Promise<void>;
    /**
     * Sets the background color and updates the texture which is rendered on the plane mesh.
     * @param col New background color.
     */
    setBackgroundColorAndUpdateTexture(col: Color4): Promise<void>;
    /**
     * Returns the original HTML before it was put through the htmlConversion parameter method.
     */
    get originalHtml(): string;
    get containerDiv(): HTMLDivElement;
    /**
     * @returns the babylonjs mesh
     */
    get mesh(): Mesh;
    private clear;
    /**
     * Get the current minScale of the plane.
     */
    get minScale(): number;
    /**
     * Set the minimum scale of the plane. This value will be applied on all scaling axes.
     * @param scale New minimum scale to apply to the scaling axes.
     */
    set minScale(scale: number);
    /**
     * Disposes the Html2CanvasPlane.
     */
    dispose(): void;
    /**
     * Sets the max size of the texture used to render the html.
     * NOTE: Increasing the max texture size will have a negative performance impact
     * @param size new max texture size (width * height)
     */
    set maxTextureSize(size: number);
    /**
     * Gets the max texture size (width * height).
     */
    get maxTextureSize(): number;
    centerPoint(): Html2CanvasPoint;
    /**
     * Gets the style of the HTML element that will be rendered to the plane.
     * NOTE: Do not change background color here as the canvas renderer has its own background color property,
     * use {@link setBackgroundColorAndUpdateTexture} instead.
     */
    get style(): CSSStyleDeclaration;
}
//# sourceMappingURL=Html2CanvasPlane.d.ts.map