import * as React from 'react';
import { Link } from './elements';
import { Rect, Size, Vector } from './geometry';
import { DiagramModel } from './model';
import { MutableRenderingState } from './renderingState';
export interface LinkLayerProps {
    model: DiagramModel;
    renderingState: MutableRenderingState;
    links: ReadonlyArray<Link>;
}
type ScheduleLabelMeasure = (label: MeasurableLabel, clear: boolean) => void;
/** @hidden */
interface MeasurableLabel {
    readonly owner: Link | undefined;
    measureSize(): Size | undefined;
    applySize({ width, height }: Size): void;
    computeBounds({ width, height }: Size): Rect;
}
export declare class LinkLayer extends React.Component<LinkLayerProps, {
    version: number;
}> {
    private readonly listener;
    private readonly delayedUpdate;
    private providedContext;
    private updateState;
    /** List of link IDs to update at the next flush event */
    private scheduledToUpdate;
    private labelMeasureRequests;
    private delayedMeasureLabels;
    private readonly memoizedLinks;
    constructor(props: LinkLayerProps);
    componentDidMount(): void;
    shouldComponentUpdate(): boolean;
    componentWillUnmount(): void;
    private scheduleUpdateAll;
    private scheduleUpdateLink;
    private popShouldUpdatePredicate;
    private scheduleLabelMeasure;
    private measureLabels;
    private performUpdate;
    render(): import("react/jsx-runtime").JSX.Element;
}
interface LinkLayerContext {
    scheduleLabelMeasure: ScheduleLabelMeasure;
}
declare const LinkLayerContext: React.Context<LinkLayerContext | null>;
/**
 * Props for {@link LinkPath} component.
 *
 * @see {@link LinkPath}
 */
export interface LinkPathProps {
    /**
     * Link geometry represented as an SVG path string.
     */
    path: string;
    /**
     * Additional attributes for the SVG path.
     */
    pathProps?: React.SVGAttributes<SVGPathElement>;
    /**
     * SVG path marker for the source endpoint of the link.
     */
    markerSource?: string;
    /**
     * SVG path marker for the target endpoint of the link.
     */
    markerTarget?: string;
}
/**
 * Component to render link geometry as an SVG path.
 *
 * @category Components
 */
export declare function LinkPath(props: LinkPathProps): import("react/jsx-runtime").JSX.Element;
/**
 * Props for {@link LinkLabel} component.
 *
 * @see {@link LinkLabel}
 */
export interface LinkLabelProps {
    /**
     * Owner link to display label over.
     */
    link: Link;
    /**
     * Whether the label should be considered as primary one for the link.
     *
     * Primary label bounds are available via {@link RenderingState.getLinkLabelBounds}.
     */
    primary?: boolean;
    /**
     * Label position in paper coordinates.
     */
    position: Vector;
    /**
     * Vertical row shift for the label
     * (e.g. `-1` for one row above, `1` for one row below).
     *
     * @default 0
     */
    line?: number;
    /**
     * Additional CSS class for the component.
     */
    className?: string;
    /**
     * Label text alignment relative to its position.
     *
     * @default "middle"
     */
    textAnchor?: 'start' | 'middle' | 'end';
    /**
     * Additional CSS class for the SVG rect used as underlying text background.
     */
    rectClass?: string;
    /**
     * Additional CSS styles for the SVG rect used as underlying text background.
     */
    rectStyle?: React.CSSProperties;
    /**
     * Additional CSS class for the SVG text used to display the label text.
     */
    textClass?: string;
    /**
     * Additional CSS styles for the SVG text used to display the label text.
     */
    textStyle?: React.CSSProperties;
    /**
     * Title for the label.
     */
    title?: string;
    /**
     * Label text content.
     *
     * This content is nested in SVG `<text>` element, so only plain text children
     * or elements like `<tspan>` should be specified.
     */
    content?: React.ReactNode;
    /**
     * Additional content rendered with the label.
     *
     * This content is rendered in the SVG context.
     */
    children?: React.ReactNode;
}
interface LinkLabelState {
    readonly width: number;
    readonly height: number;
}
/**
 * Component to display a text label over a diagram link.
 *
 * @category Components
 */
export declare class LinkLabel extends React.Component<LinkLabelProps, LinkLabelState> implements MeasurableLabel {
    /** @hidden */
    static contextType: React.Context<LinkLayerContext | null>;
    /** @hidden */
    readonly context: LinkLayerContext;
    private text;
    private shouldUpdateBounds;
    constructor(props: LinkLabelProps);
    /** @hidden */
    get owner(): Link | undefined;
    /** @hidden */
    render(): import("react/jsx-runtime").JSX.Element;
    /** @hidden */
    measureSize(): Size | undefined;
    /** @hidden */
    applySize({ width, height }: Size): void;
    /** @hidden */
    computeBounds({ width, height }: Size): Rect;
    private onTextMount;
    /** @hidden */
    componentDidMount(): void;
    /** @hidden */
    componentWillUnmount(): void;
    /** @hidden */
    UNSAFE_componentWillReceiveProps(nextProps: LinkLabelProps): void;
    /** @hidden */
    componentDidUpdate(props: LinkLabelProps): void;
    private tryRecomputeBounds;
}
/**
 * Props for {@link LinkVertices} component.
 *
 * @see {@link LinkVertices}
 */
export interface LinkVerticesProps {
    /**
     * Target link to manipulate vertices of.
     */
    linkId: string;
    /**
     * Vertices to display and interact with.
     */
    vertices: ReadonlyArray<Vector>;
    /**
     * Additional CSS class for the component.
     */
    className?: string;
    /**
     * Radius for each vertex in px.
     *
     * @default 10
     */
    vertexRadius?: number;
    /**
     * Fill color for each vertex.
     */
    fill?: string;
}
/**
 * Component to render interactive vertices of the link geometry.
 *
 * Each displayed vertex can be moved or deleted which
 * adds a command to the command history.
 *
 * @category Components
 */
export declare function LinkVertices(props: LinkVerticesProps): import("react/jsx-runtime").JSX.Element | null;
export interface LinkMarkersProps {
    renderingState: MutableRenderingState;
}
export declare class LinkMarkers extends React.Component<LinkMarkersProps> {
    private readonly listener;
    private readonly delayedUpdate;
    render(): import("react/jsx-runtime").JSX.Element;
    componentDidMount(): void;
    shouldComponentUpdate(): boolean;
    componentWillUnmount(): void;
}
export {};
//# sourceMappingURL=linkLayer.d.ts.map