index.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. import { Task, RuntimeContext } from 'mol-task'
  7. import { RenderObject } from 'mol-gl/render-object'
  8. import { PickingId } from '../geometry/picking';
  9. import { Loci } from 'mol-model/loci';
  10. import { MarkerAction } from '../geometry/marker-data';
  11. import { Params } from 'mol-util/parameter';
  12. export interface RepresentationProps {}
  13. export interface Representation<D, P extends RepresentationProps = {}> {
  14. readonly label: string
  15. readonly params: Params
  16. readonly renderObjects: ReadonlyArray<RenderObject>
  17. readonly props: Readonly<P>
  18. createOrUpdate: (props?: Partial<P>, data?: D) => Task<void>
  19. getLoci: (pickingId: PickingId) => Loci
  20. mark: (loci: Loci, action: MarkerAction) => boolean
  21. destroy: () => void
  22. }
  23. export interface Visual<D, P extends RepresentationProps = {}> {
  24. readonly renderObject: RenderObject | undefined
  25. createOrUpdate: (ctx: RuntimeContext, props?: Partial<P>, data?: D) => Promise<void>
  26. getLoci: (pickingId: PickingId) => Loci
  27. mark: (loci: Loci, action: MarkerAction) => boolean
  28. destroy: () => void
  29. }