import { EventSource, Events, PropertyChange } from '../coreUtils/events';
import { LinkTypeIri } from '../data/model';
import { Vector } from './geometry';
/**
 * Represents a diagram content object that can be interacted with.
 *
 * @category Core
 */
export type Cell = Element | Link | LinkVertex;
/**
 * Event data for{@link Element} events.
 */
export interface ElementEvents {
    /**
     * Triggered on {@link Element.position} property change.
     */
    changePosition: PropertyChange<Element, Vector>;
    /**
     * Triggered on {@link Element.isExpanded} property change.
     */
    changeExpanded: PropertyChange<Element, boolean>;
    /**
     * Triggered on {@link Element.elementState} property change.
     */
    changeElementState: PropertyChange<Element, ElementTemplateState | undefined>;
    /**
     * Triggered on a request to set DOM focus on the element.
     */
    requestedFocus: {
        /**
         * Event source (element).
         */
        readonly source: Element;
    };
    /**
     * Triggered on a request to re-render element on a canvas.
     *
     * @see {@link Element.redraw}
     */
    requestedRedraw: {
        /**
         * Event source (element).
         */
        readonly source: Element;
        /**
         * Element re-render level: which cached state should be invalidated
         * when redrawing it on a canvas.
         *
         * @default "render"
         */
        readonly level?: ElementRedrawLevel;
    };
}
/**
 * Specifies which cached state should be invalidated
 * when redrawing an element on a canvas:
 *   - `render` - force render only on a wrapping component,
 *     skipping element template render if template type has not changed;
 *   - `template` - full element render including its template component.
 *
 * @see {@link Element.redraw}
 */
export type ElementRedrawLevel = 'render' | 'template';
/**
 * Properties for {@link Element}.
 */
export interface ElementProps {
    id?: string;
    position?: Vector;
    expanded?: boolean;
    elementState?: ElementTemplateState;
}
/**
 * Abstract base class for diagram elements (graph nodes).
 *
 * @category Core
 */
export declare abstract class Element {
    protected readonly source: EventSource<ElementEvents>;
    readonly events: Events<ElementEvents>;
    readonly id: string;
    private _position;
    private _expanded;
    private _elementState;
    constructor(props: ElementProps);
    /**
     * Generates a new unique ID for an element.
     */
    static generateId(): string;
    get position(): Vector;
    setPosition(value: Vector): void;
    get isExpanded(): boolean;
    setExpanded(value: boolean): void;
    get elementState(): ElementTemplateState | undefined;
    setElementState(value: ElementTemplateState | undefined): void;
    focus(): void;
    redraw(level?: ElementRedrawLevel): void;
}
/**
 * Contains a template-specific state for an element.
 *
 * Each property value should be JSON-serializable to be able
 * to export and import it as part of the serialized diagram layout.
 */
export interface ElementTemplateState {
    [propertyIri: string]: unknown;
}
/**
 * Diagram element represented by an invisible single point.
 *
 * @category Core
 */
export declare class VoidElement extends Element {
    constructor(props: Pick<ElementProps, 'id' | 'position'>);
}
/**
 * Event data for {@link Link} events.
 */
export interface LinkEvents {
    /**
     * Triggered on {@link Link.vertices} property change.
     */
    changeVertices: PropertyChange<Link, ReadonlyArray<Vector>>;
    /**
     * Triggered on {@link Link.linkState} property change.
     */
    changeLinkState: PropertyChange<Link, LinkTemplateState | undefined>;
    /**
     * Triggered on a request to re-render link on a canvas.
     *
     * @see {@link Link.redraw}
     */
    requestedRedraw: {
        /**
         * Event source (link).
         */
        readonly source: Link;
    };
}
/**
 * Properties for {@link Link}.
 */
export interface LinkProps {
    id?: string;
    sourceId: string;
    targetId: string;
    vertices?: ReadonlyArray<Vector>;
    linkState?: LinkTemplateState;
}
/**
 * Abstract base class for diagram links (graph edges)
 *
 * @category Core
 */
export declare abstract class Link {
    protected readonly source: EventSource<LinkEvents>;
    readonly events: Events<LinkEvents>;
    readonly id: string;
    private _sourceId;
    private _targetId;
    private _vertices;
    private _linkState;
    constructor(props: LinkProps);
    /**
     * Generates a new unique ID for an link.
     */
    static generateId(): string;
    get sourceId(): string;
    get targetId(): string;
    get typeId(): LinkTypeIri;
    protected abstract getTypeId(): LinkTypeIri;
    get vertices(): ReadonlyArray<Vector>;
    setVertices(value: ReadonlyArray<Vector>): void;
    get linkState(): LinkTemplateState | undefined;
    setLinkState(value: LinkTemplateState | undefined): void;
    redraw(): void;
}
/**
 * Contains a template-specific state for a link.
 *
 * Each property value should be JSON-serializable to be able
 * to export and import it as part of the serialized diagram layout.
 */
export interface LinkTemplateState {
    [propertyIri: string]: unknown;
}
/**
 * Visibility mode for all links of a type:
 *   - `hidden` - completely skip rendering the links;
 *   - `visible` - display the links normally;
 *   - `withoutLabel` - display only the link path without any labels.
 */
export type LinkTypeVisibility = 'hidden' | 'visible' | 'withoutLabel';
/**
 * Represents a convenient way to refer to a particular vertex of a diagram link.
 *
 * @category Core
 */
export declare class LinkVertex {
    readonly link: Link;
    readonly vertexIndex: number;
    constructor(link: Link, vertexIndex: number);
    createAt(location: Vector): void;
    moveTo(location: Vector): void;
    remove(): void;
}
//# sourceMappingURL=elements.d.ts.map