basic.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * Adapted from LiteMol
  5. * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info.
  6. */
  7. import { Event } from './event'
  8. import { Logger } from '../service/logger';
  9. import { Dispatcher } from '../service/dispatcher'
  10. import { LayoutState } from '../controller/layout';
  11. import { ViewportOptions } from '../controller/visualization/viewport';
  12. import { Job } from '../service/job';
  13. import { Element } from 'mol-model/structure'
  14. const Lane = Dispatcher.Lane;
  15. export const LogEvent = Event.create<Logger.Entry>('bs.Log', Lane.Log);
  16. export namespace CommonEvents {
  17. export const LayoutChanged = Event.create('bs.Common.LayoutChanged', Lane.Slow);
  18. export const ComponentsChanged = Event.create('bs.Common.ComponentsChanged', Lane.Slow);
  19. }
  20. export namespace JobEvents {
  21. export const Started = Event.create<Job.Info>('bs.Jobs.Started', Lane.Job);
  22. export const Completed = Event.create<number>('bs.Jobs.Completed', Lane.Job);
  23. export const StateUpdated = Event.create<Job.State>('bs.Jobs.StateUpdated', Lane.Busy);
  24. }
  25. export namespace LayoutEvents {
  26. export const SetState = Event.create<Partial<LayoutState>>('lm.cmd.Layout.SetState', Lane.Slow);
  27. export const SetViewportOptions = Event.create<ViewportOptions>('bs.cmd.Layout.SetViewportOptions', Lane.Slow);
  28. }
  29. export namespace InteractivityEvents {
  30. export const HighlightElementLoci = Event.create<Element.Loci | undefined>('bs.Interactivity.HighlightElementLoci', Lane.Slow);
  31. }