base-strategy.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { Platform } from '@angular/cdk/platform';
  6. import { ChangeDetectorRef, QueryList, Renderer2 } from '@angular/core';
  7. import { Observable } from 'rxjs';
  8. import { NzSafeAny } from 'ng-zorro-antd/core/types';
  9. import { NzCarouselContentDirective } from '../carousel-content.directive';
  10. import { FromToInterface, NzCarouselComponentAsSource, PointerVector } from '../typings';
  11. export declare abstract class NzCarouselBaseStrategy<T = NzSafeAny> {
  12. protected cdr: ChangeDetectorRef;
  13. protected renderer: Renderer2;
  14. protected platform: Platform;
  15. protected options?: T | undefined;
  16. protected carouselComponent: NzCarouselComponentAsSource | null;
  17. protected contents: NzCarouselContentDirective[];
  18. protected slickListEl: HTMLElement;
  19. protected slickTrackEl: HTMLElement;
  20. protected length: number;
  21. protected unitWidth: number;
  22. protected unitHeight: number;
  23. protected get maxIndex(): number;
  24. protected get firstEl(): HTMLElement;
  25. protected get lastEl(): HTMLElement;
  26. constructor(carouselComponent: NzCarouselComponentAsSource, cdr: ChangeDetectorRef, renderer: Renderer2, platform: Platform, options?: T | undefined);
  27. /**
  28. * Initialize dragging sequences.
  29. *
  30. * @param contents
  31. */
  32. withCarouselContents(contents: QueryList<NzCarouselContentDirective> | null): void;
  33. /**
  34. * Trigger transition.
  35. */
  36. abstract switch(_f: number, _t: number): Observable<void>;
  37. /**
  38. * When user drag the carousel component.
  39. *
  40. * @optional
  41. */
  42. dragging(_vector: PointerVector): void;
  43. /**
  44. * Destroy a scroll strategy.
  45. */
  46. dispose(): void;
  47. protected getFromToInBoundary(f: number, t: number): FromToInterface;
  48. }