import { ElementIri, ElementModel, LinkTypeIri } from '../data/model';
import { Element, ElementTemplateState, Link, LinkTemplateState, LinkTypeVisibility } from '../diagram/elements';
import { Vector } from '../diagram/geometry';
/**
 * Serialized diagram state in [JSON-LD](https://json-ld.org/) compatible format.
 *
 * @see {@link serializeDiagram}
 */
export interface SerializedDiagram {
    '@context': any;
    '@type': 'Diagram';
    layoutData: SerializedLayout;
    linkTypeOptions?: ReadonlyArray<SerializedLinkOptions>;
}
/**
 * Serialized state for a single link type on a diagram.
 */
export interface SerializedLinkOptions {
    '@type': 'LinkTypeOptions';
    property: LinkTypeIri;
    visible: boolean;
    showLabel?: boolean;
}
/**
 * Serialized diagram layout, composed of elements and links.
 */
export interface SerializedLayout {
    '@type': 'Layout';
    elements: ReadonlyArray<SerializedLayoutElement | SerializedLayoutElementGroup>;
    links: ReadonlyArray<SerializedLayoutLink | SerializedLayoutLinkGroup>;
}
/**
 * Serialized entity element state.
 */
export interface SerializedLayoutElement {
    '@type': 'Element';
    '@id': string;
    iri?: ElementIri;
    position: Vector;
    isExpanded?: boolean;
    elementState?: ElementTemplateState;
}
/**
 * Serialized entity group state.
 */
export interface SerializedLayoutElementGroup {
    '@type': 'ElementGroup';
    '@id': string;
    items: ReadonlyArray<SerializedLayoutElementItem>;
    position: Vector;
    elementState?: ElementTemplateState;
}
/**
 * Serialized entity group item state.
 */
export interface SerializedLayoutElementItem {
    '@type': 'ElementItem';
    iri: ElementIri;
    elementState?: ElementTemplateState;
}
/**
 * Serialized relation link state.
 */
export interface SerializedLayoutLink {
    '@type': 'Link';
    '@id': string;
    property: LinkTypeIri;
    source: {
        '@id': string;
    };
    target: {
        '@id': string;
    };
    targetIri?: ElementIri;
    sourceIri?: ElementIri;
    vertices?: ReadonlyArray<Vector>;
    linkState?: LinkTemplateState;
}
/**
 * Serialized relation group state.
 */
export interface SerializedLayoutLinkGroup {
    '@type': 'LinkGroup';
    '@id': string;
    property: LinkTypeIri;
    source: {
        '@id': string;
    };
    target: {
        '@id': string;
    };
    items: ReadonlyArray<SerializedLayoutLinkItem>;
    vertices?: ReadonlyArray<Vector>;
    linkState?: LinkTemplateState;
}
/**
 * Serialized relation group item state.
 */
export interface SerializedLayoutLinkItem {
    '@type': 'LinkItem';
    targetIri: ElementIri;
    sourceIri: ElementIri;
    linkState?: LinkTemplateState;
}
/**
 * Makes an empty serialized diagram state.
 */
export declare function emptyDiagram(): SerializedDiagram;
/**
 * Raw diagram state to serialize.
 *
 * @see {@link deserializeDiagram}
 */
export interface DeserializedDiagram {
    elements: ReadonlyArray<Element>;
    links: ReadonlyArray<Link>;
    linkTypeVisibility: ReadonlyMap<LinkTypeIri, LinkTypeVisibility>;
}
/**
 * Exports diagram model state for [JSON-LD](https://json-ld.org/) compatible serialization.
 *
 * @see {@link deserializeDiagram}
 */
export declare function serializeDiagram(diagram: DeserializedDiagram): SerializedDiagram;
/**
 * Options for diagram deserialization.
 */
export interface DeserializeDiagramOptions {
    readonly preloadedElements?: ReadonlyMap<ElementIri, ElementModel>;
    readonly markLinksAsLayoutOnly?: boolean;
}
/**
 * Imports diagram model state from the serialized form.
 *
 * @see {@link serializeDiagram}
 */
export declare function deserializeDiagram(diagram: SerializedDiagram, options?: DeserializeDiagramOptions): DeserializedDiagram;
export declare function markLayoutOnly(linkState: LinkTemplateState | undefined, value: boolean): LinkTemplateState | undefined;
//# sourceMappingURL=serializedDiagram.d.ts.map