eventManager.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { EventCallback, TemplateManager } from "./templateManager";
  2. /**
  3. * The EventManager is in charge of registering user interctions with the viewer.
  4. * It is used in the TemplateManager
  5. */
  6. export declare class EventManager {
  7. private _templateManager;
  8. private _callbacksContainer;
  9. constructor(_templateManager: TemplateManager);
  10. /**
  11. * Register a new callback to a specific template.
  12. * The best example for the usage can be found in the DefaultViewer
  13. *
  14. * @param templateName the templateName to register the event to
  15. * @param callback The callback to be executed
  16. * @param eventType the type of event to register
  17. * @param selector an optional selector. if not defined the parent object in the template will be selected
  18. */
  19. registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
  20. /**
  21. * This will remove a registered event from the defined template.
  22. * Each one of the variables apart from the template name are optional, but one must be provided.
  23. *
  24. * @param templateName the templateName
  25. * @param callback the callback to remove (optional)
  26. * @param eventType the event type to remove (optional)
  27. * @param selector the selector from which to remove the event (optional)
  28. */
  29. unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
  30. private _eventTriggered(data);
  31. /**
  32. * Dispose the event manager
  33. */
  34. dispose(): void;
  35. }