import { Drawing } from '@rnacanvas/draw';
import type { DrawingElement } from './DrawingElement';
import type { Nucleobase } from '@rnacanvas/draw';
import { DrawingView } from './DrawingView';
import { SchemaDrawer } from '@rnacanvas/draw';
import { EventfulSet } from '@rnacanvas/utilities';
import { SearchHighlighting } from '@rnacanvas/draw.svg.highlight';
import { SelectedBases } from '@rnacanvas/draw.interact';
import { OpenForm } from '@rnacanvas/forms.open';
import type { Form } from './Form';
import { NewForm } from '@rnacanvas/forms.new';
import { LayoutForm } from '@rnacanvas/forms.layout';
import { EditForm } from '@rnacanvas/forms.edit';
import { ExportForm } from '@rnacanvas/forms.export';
import { FindForm } from '@rnacanvas/forms.find';
import { AboutForm } from '@rnacanvas/forms.about';
/**
 * An RNAcanvas app object that can be included as a component of a web page / app.
 */
export declare class RNAcanvas {
    #private;
    /**
     * The actual DOM node of the RNAcanvas app object.
     *
     * Contains the entirety of the RNAcanvas app.
     */
    readonly domNode: HTMLElement;
    /**
     * Meant to fill up the space of the DOM node of the app object
     * and for other components of the app object to be positioned relative to it.
     *
     * The purpose of separating the bounding box from the outermost DOM node of the app object
     * is so that styles applied to the outermost DOM node do not affect the bounding box.
     */
    private boundingBox;
    /**
     * The 2D nucleic acid structure drawing of the app object.
     */
    readonly drawing: Drawing;
    private readonly invertedPrimaryBondsHider;
    private readonly drawingScrollContainer;
    private readonly stackedDrawingsContainer;
    /**
     * The user's view of the drawing.
     */
    readonly drawingView: DrawingView;
    /**
     * A pinch-to-scale feature for the drawing of the app.
     */
    private readonly pinchToScaleFeature;
    private dotBracketDrawer;
    /**
     * The set of SVG elements in the drawing of the app that are currently selected.
     */
    readonly selectedSVGElements: EventfulSet<SVGGraphicsElement>;
    /**
     * A drawing overlaid and sized to match the main drawing of the app.
     *
     * Can be used for highlightings of SVG elements (such as the currently selected SVG elements).
     */
    private readonly overlaidDrawing;
    /**
     * Highlightings of the currently selected SVG elements in the drawing of the app.
     */
    private readonly selectedSVGElementHighlightings;
    private readonly clickSelectTool;
    private readonly selectingRect;
    readonly selectedBases: SelectedBases<Nucleobase>;
    private readonly consecutiveBasesSelectingTool;
    /**
     * Forms are to go in here.
     */
    private readonly formsContainer;
    readonly layoutForm: LayoutForm;
    readonly exportForm: ExportForm;
    private readonly toolbar;
    private readonly toolbarContainer;
    constructor();
    /**
     * Appends the DOM node of the app object to the given container node.
     */
    appendTo(container: Node): void;
    /**
     * Removes the DOM node of the app object from its parent container node.
     *
     * (Has no effect if the DOM node of the app object had no parent container node to begin with.)
     */
    remove(): void;
    /**
     * The horizontal scrollbar for the drawing of the app.
     */
    get horizontalDrawingScrollbar(): import("@rnacanvas/scrollbars").HorizontalScrollbar;
    /**
     * The vertical scrollbar for the drawing of the app.
     */
    get verticalDrawingScrollbar(): import("@rnacanvas/scrollbars").VerticalScrollbar;
    /**
     * The scrollbars for the drawing of the app.
     */
    get drawingScrollbars(): import("@rnacanvas/scrollbars").Scrollbars;
    /**
     * The user's view of the drawing.
     */
    get view(): DrawingView;
    addSearchHighlighting(eles: Iterable<DrawingElement | SVGGraphicsElement>): SearchHighlighting;
    /**
     * Hides the overlaid drawing by setting its `visibility` CSS property to `hidden`.
     *
     * Can be used to hide element highlightings (e.g., when dragging elements).
     */
    private hideOverlaidDrawing;
    /**
     * Undoes the action(s) of the `hideOverlaidDrawing` method.
     */
    private unhideOverlaidDrawing;
    get peripheralUI(): {
        hide: () => void;
        showFull: () => void;
        showMinimal: () => void;
        show: () => void;
    };
    /**
     * Draws whatever is specified by the text
     * (e.g., a structure in dot-bracket notation,
     * a structure in CT format,
     * a saved RNAcanvas app state).
     *
     * May throw for invalid text inputs.
     */
    draw(text: string): {
        readonly bases: Iterable<ReturnType<InstanceType<typeof Drawing>["addBase"]>>;
    } | undefined;
    /**
     * Draws the specified structure (expressed in dot-bracket notation) on the drawing of the app.
     *
     * A nucleobase will be added to the drawing for each character in the sequence of the structure.
     *
     * A secondary bond will be added to the drawing for each base-pair expressed in the dot-bracket notation
     * for the structure.
     *
     * Currently, this method is only able to handle simple dot-bracket notation
     * (i.e., that only contains the characters ".", "(" and ")").
     *
     * A primary bond will also be added between each consecutive pair of bases in the sequence of bases.
     *
     * This method will also radialize the layout of the drawn bases.
     *
     * @param seq The sequence of the structure to draw.
     * @param dotBracket Dot-bracket notation expressing the base-pairs in the structure to draw.
     */
    drawDotBracket(seq: string, dotBracket: string): {
        readonly bases: Iterable<ReturnType<InstanceType<typeof Drawing>["addBase"]>>;
    };
    /**
     * Draws the structure specified by the provided CT string in the drawing of the app.
     *
     * A CT string could be the text contents of a CT file, for example.
     *
     * Throws if unable to parse the CT string.
     */
    drawCT(ctString: string): {
        readonly bases: Iterable<ReturnType<InstanceType<typeof Drawing>["addBase"]>>;
    };
    /**
     * Draws the provided schema (on top of whatever is currently already drawn).
     *
     * See the R2DT RNA 2D JSON schema format for more information on schemas.
     *
     * This method might throw for invalid schemas,
     * in which case the drawing of the app might get left in a partially drawn state
     * (e.g., with only part of the schema having been drawn).
     */
    drawSchema(schema: Parameters<SchemaDrawer['draw']>[0]): void | never;
    /**
     * The currently selected SVG element.
     *
     * This getter will throw if no SVG elements or more than one SVG element
     * are currently selected.
     */
    get selectedSVGElement(): SVGGraphicsElement | never;
    /**
     * Deselects any currently selected elements and then adds the specified elements to those selected.
     */
    select(eles: Iterable<SVGGraphicsElement | {
        readonly domNode: SVGGraphicsElement;
    }>): void;
    /**
     * Adds the specified elements to the set of selected elements
     * (without deselecting any elements).
     */
    addToSelected(eles: Iterable<SVGGraphicsElement | {
        readonly domNode: SVGGraphicsElement;
    }>): void;
    /**
     * Removes the specified elements from that which are currently selected.
     */
    removeFromSelected(eles: Iterable<SVGGraphicsElement | {
        readonly domNode: SVGGraphicsElement;
    }>): void;
    /**
     * Selects all SVG (graphics) elements in the drawing of the app.
     */
    selectAll(): void;
    /**
     * Deselect all currently selected elements.
     */
    deselect(): void;
    /**
     * Removes all selected elements from the drawing of the app.
     *
     * This method will push the undo stack prior to removing any elements.
     */
    removeSelected(): void;
    /**
     * The currently selected base.
     *
     * This getter will throw if no bases or more than one base are currently selected.
     */
    get selectedBase(): Nucleobase | never;
    get selectedNumberings(): {
        [Symbol.iterator](): ArrayIterator<import("@rnacanvas/draw/dist/Numbering").Numbering>;
        addEventListener: (name: "change", listener: () => void) => void;
    };
    get selectedNumberingLines(): {
        [Symbol.iterator](): ArrayIterator<import("@rnacanvas/draw/dist/Numbering").NumberingLine>;
        addEventListener: (name: "change", listener: () => void) => void;
    };
    /**
     * Represents the currently selected outlines.
     */
    get selectedOutlines(): {
        [Symbol.iterator](): ArrayIterator<import("@rnacanvas/draw/dist/BaseOutline").BaseOutline>;
        /**
         * Listeners are called whenever the set of currently selected outlines changes.
         *
         * Listeners might sometimes get called even when the set of currently selected outlines
         * doesn't actually change.
         */
        addEventListener: (name: "change", listener: () => void) => void;
    };
    get selectedPrimaryBonds(): {
        [Symbol.iterator](): ArrayIterator<import("@rnacanvas/draw/dist/PrimaryBondsDrawing").PrimaryBond>;
        /**
         * Listeners are called whenever the current selection of primary bonds changes.
         */
        addEventListener: (name: "change", listener: () => void) => void;
    };
    get selectedSecondaryBonds(): {
        [Symbol.iterator](): ArrayIterator<import("@rnacanvas/draw/dist/SecondaryBondsDrawing").SecondaryBond>;
        /**
         * Listeners are called whenever the current selection of secondary bonds changes.
         */
        addEventListener: (name: "change", listener: () => void) => void;
    };
    get selectedElementHighlightings(): {
        domNode: SVGGElement;
    };
    /**
     * The Start page interface.
     */
    get startPage(): {
        open: () => void;
        close: () => void;
        isOpen: () => boolean;
    };
    get forms(): {
        new: NewForm;
        open: OpenForm;
        layout: LayoutForm;
        edit: EditForm;
        find: FindForm;
        export: ExportForm;
        about: AboutForm;
    };
    openForm(form: Form | Node | string): void | never;
    /**
     * Closes the topmost form.
     *
     * Does nothing if no forms are open.
     */
    closeForm(): void;
    /**
     * Closes all forms.
     *
     * Does nothing if no forms are open.
     */
    closeAllForms(): void;
    /**
     * The CSS style declaration for the actual DOM node of the app object.
     */
    get style(): CSSStyleDeclaration;
    /**
     * Returns the serialized form of an app instance
     * (e.g., which can be saved in a file).
     *
     * Throws if unable to properly serialize the app instance.
     */
    serialized(): {
        drawing: {
            outerXML: string;
            bases: {
                id: string;
            }[];
            numberings: {
                id: string;
                ownerID: string;
            }[];
            numberingLines: {
                id: string;
                ownerID: string;
            }[];
            baseOutlines: {
                id: string;
                ownerID: string;
            }[];
            primaryBonds: {
                id: string;
                baseID1: string;
                baseID2: string;
            }[];
            secondaryBonds: {
                id: string;
                baseID1: string;
                baseID2: string;
            }[];
            tertiaryBonds: {
                id: string;
                baseID1: string;
                baseID2: string;
            }[];
        };
        selectedSVGElementIDs: string[];
        drawingView: {
            centerPoint: import("@rnacanvas/points").Point;
        };
    };
    /**
     * Offers for download an RNAcanvas file of the current state of the app.
     */
    save(): void;
    /**
     * Restores a previous state of the app.
     *
     * Throws if unable to do so.
     *
     * This method is atomic in that
     * if it is unable to restore a previous app state
     * then the current state of the app will be left unchanged.
     *
     * @param previousState The serialized form of an app instance.
     */
    restore(previousState: unknown): void | never;
    /**
     * Pushes the current state of the app onto the top of the undo stack
     * and clears the redo stack.
     *
     * Throws if unable to do so
     * (e.g., the app instance is unable to be properly serialized).
     */
    pushUndoStack(): void | never;
    canUndo(): boolean;
    /**
     * Throws if the undo stack is empty,
     * if the current state of the app cannot be properly serialized
     * (so that it can be pushed onto the redo stack),
     * or if the app state at the top of the undo stack cannot be restored.
     *
     * This method is atomic in that when it throws
     * the current state of the app will be left unchanged.
     */
    undo(): void | never;
    /**
     * The undo stack interface.
     */
    get undoStack(): {
        isEmpty: () => boolean;
        addEventListener: (name: "change", listener: () => void) => void;
        removeEventListener: (name: "change", listener: () => void) => void;
        /**
         * Throws if the undo stack is empty.
         *
         * The returned previous state should not be modified by outside code.
         */
        peek: () => PreviousState | never;
        /**
         * Push the undo stack with the current app state.
         */
        push: () => void;
    };
    canRedo(): boolean;
    /**
     * Throws if the redo stack is empty,
     * if the current state of the app cannot be properly serialized
     * (so that it can be pushed onto the undo stack),
     * or if the app state at the top of the redo stack cannot be restored.
     *
     * This method is atomic in that when it throws
     * the current state of the app will be left unchanged.
     */
    redo(): void | never;
    /**
     * The redo stack interface.
     */
    get redoStack(): {
        isEmpty: () => boolean;
        addEventListener: (name: "change", listener: () => void) => void;
        removeEventListener: (name: "change", listener: () => void) => void;
        /**
         * Throws if the redo stack is empty.
         *
         * The returned previous state should not be modified by outside code.
         */
        peek: () => PreviousState | never;
    };
    beforeEdit(): void;
    afterEdit(): void;
    beforeDragging(): void;
    afterDragging(): void;
    /**
     * Downloads the drawing in its current state as an SVG image.
     */
    exportSVG(): void;
    /**
     * Downloads the drawing for the user as a PNG image.
     */
    exportPNG(): Promise<void>;
    /**
     * Downloads the drawing for the user as a JPEG image.
     */
    exportJPEG(): Promise<void>;
    get keyBindings(): Iterable<{
        owner: Element | undefined;
    }>;
    /**
     * Opens a new tab of the RNAcanvas app.
     */
    newTab(): void;
    /**
     * Opens a duplicate tab of the RNAcanvas app.
     *
     * Does so by opening a new tab of the RNAcanvas app with the same URL parameters
     * - except the `peripheral_ui` URL parameter will be omitted from the new tab
     * so that the new tab is always opened with a full peripheral UI.
     *
     * (This is a useful property of this method when the RNAcanvas app currently exists within an `iframe` element
     * embedded in another website without the full peripheral UI being shown.)
     *
     * Known issue #1: This method will simply open a new blank tab of the RNAcanvas app
     * if the RNAcanvas URL interface was not used when creating the current tab.
     *
     * Known issue #2: This method cannot currently recreate edits that the user has made to the drawing
     * in the new duplicate tab.
     */
    duplicateTab(): void;
}
type PreviousState = NonNullObject;
type NonNullObject = {
    [name: string]: unknown;
};
export {};
//# sourceMappingURL=RNAcanvas.d.ts.map