import { ElementModel , ElementTypeIri , LinkTypeIri , PropertyTypeIri , LinkModel , ElementIri , } from './model' ; import { LinkDirection } from '../diagram/elements' ; import { CancellationToken } from '../viewUtils/async' ; export interface MetadataApi { /**
     * Can user create element and link from this element?
     */ canDropOnCanvas ( source , ct ) : Promise < boolean > ; /**
     * Can we create link between two elements? Maybe it's unnesesary.
     */ canDropOnElement ( source , target , ct ) : Promise < boolean > ; /**
     * Links of which types can we create between elements?
     */ possibleLinkTypes ( source , target , ct ) : Promise < DirectedLinkType [ ] > ; /**
     * If new element is created by dragging link from existing element, this should return available element types.
     */ typesOfElementsDraggedFrom ( source , ct ) : Promise < ElementTypeIri [ ] > ; /**
     * List properties for type meant to be edited in-place.
     */ propertiesForType ( type , ct ) : Promise < PropertyTypeIri [ ] > ; filterConstructibleTypes ( types , ct ) : Promise < ReadonlySet < ElementTypeIri > > ; canDeleteElement ( element , ct ) : Promise < boolean > ; canEditElement ( element , ct ) : Promise < boolean > ; canLinkElement ( element , ct ) : Promise < boolean > ; canDeleteLink ( link , source , target , ct ) : Promise < boolean > ; canEditLink ( link , source , target , ct ) : Promise < boolean > ; generateNewElement ( types , ct ) : Promise < ElementModel > ; } export interface DirectedLinkType { readonly linkTypeIri : LinkTypeIri ; readonly direction : LinkDirection ; }