positioning.service.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { ElementRef, RendererFactory2, NgZone } from '@angular/core';
  2. import { Observable } from 'rxjs';
  3. import { Options } from './models';
  4. export interface PositioningOptions {
  5. /** The DOM element, ElementRef, or a selector string of an element which will be moved */
  6. element?: HTMLElement | ElementRef | string;
  7. /** The DOM element, ElementRef, or a selector string of an element which the element will be attached to */
  8. target?: HTMLElement | ElementRef | string;
  9. /**
  10. * A string of the form 'vert-attachment horiz-attachment' or 'placement'
  11. * - placement can be "top", "bottom", "left", "right"
  12. * not yet supported:
  13. * - vert-attachment can be any of 'top', 'middle', 'bottom'
  14. * - horiz-attachment can be any of 'left', 'center', 'right'
  15. */
  16. attachment?: string;
  17. /** A string similar to `attachment`. The one difference is that, if it's not provided,
  18. * `targetAttachment` will assume the mirror image of `attachment`.
  19. */
  20. targetAttachment?: string;
  21. /** A string of the form 'vert-offset horiz-offset'
  22. * - vert-offset and horiz-offset can be of the form "20px" or "55%"
  23. */
  24. offset?: string;
  25. /** A string similar to `offset`, but referring to the offset of the target */
  26. targetOffset?: string;
  27. /** If true component will be attached to body */
  28. appendToBody?: boolean;
  29. }
  30. export declare class PositioningService {
  31. private options;
  32. private update$$;
  33. private positionElements;
  34. private triggerEvent$;
  35. private isDisabled;
  36. constructor(ngZone: NgZone, rendererFactory: RendererFactory2, platformId: number);
  37. position(options: PositioningOptions): void;
  38. readonly event$: Observable<number | Event>;
  39. disable(): void;
  40. enable(): void;
  41. addPositionElement(options: PositioningOptions): void;
  42. calcPosition(): void;
  43. deletePositionElement(elRef: ElementRef): void;
  44. setOptions(options: Options): void;
  45. }