import * as React from 'react';
import { ElementModel, LinkModel, LinkDirection, LinkTypeIri } from '../data/model';
import { EntityElement, RelationLink } from '../editor/dataElements';
import { WorkspaceContext } from '../workspace/workspaceContext';
export interface LinkTypeSelectorProps {
    link: ExtendedLink;
    onChange: (link: ExtendedLink) => void;
    disabled?: boolean;
    error?: React.ReactNode | null;
}
export interface ExtendedLink {
    base: Omit<LinkModel, 'sourceId' | 'targetId'>;
    source: ElementModel;
    target: ElementModel;
    direction: LinkDirection;
}
interface State {
    linkTypes?: ReadonlyArray<DirectedLinkType>;
}
interface DirectedLinkType {
    readonly iri: LinkTypeIri;
    readonly direction: LinkDirection;
}
export declare class LinkTypeSelector extends React.Component<LinkTypeSelectorProps, State> {
    static contextType: React.Context<WorkspaceContext | null>;
    readonly context: WorkspaceContext;
    private readonly listener;
    private readonly cancellation;
    constructor(props: LinkTypeSelectorProps, context: any);
    private updateAll;
    componentDidMount(): void;
    componentDidUpdate(prevProps: LinkTypeSelectorProps): void;
    componentWillUnmount(): void;
    private fetchPossibleLinkTypes;
    private listenToLinkLabels;
    private onChangeType;
    private renderPossibleLinkType;
    render(): import("react/jsx-runtime").JSX.Element;
}
export declare function dataFromExtendedLink(link: ExtendedLink): LinkModel;
export declare function relationFromExtendedLink(link: ExtendedLink, source: EntityElement, target: EntityElement): RelationLink;
export interface ValidatedLink {
    link: ExtendedLink;
    error?: string;
    validated: boolean;
    allowChange: boolean;
}
export declare function validateLinkType(currentLink: LinkModel, originalLink: LinkModel, workspace: WorkspaceContext, signal: AbortSignal | undefined): Promise<Pick<ValidatedLink, 'error' | 'allowChange'>>;
export {};
//# sourceMappingURL=linkTypeSelector.d.ts.map