progress-bar.d.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. import { ElementRef, EventEmitter, NgZone, AfterViewInit, OnDestroy, InjectionToken } from '@angular/core';
  9. import { CanColor, CanColorCtor } from '@angular/material/core';
  10. /** Last animation end data. */
  11. export interface ProgressAnimationEnd {
  12. value: number;
  13. }
  14. /** @docs-private */
  15. declare class MatProgressBarBase {
  16. _elementRef: ElementRef;
  17. constructor(_elementRef: ElementRef);
  18. }
  19. declare const _MatProgressBarMixinBase: CanColorCtor & typeof MatProgressBarBase;
  20. /**
  21. * Injection token used to provide the current location to `MatProgressBar`.
  22. * Used to handle server-side rendering and to stub out during unit tests.
  23. * @docs-private
  24. */
  25. export declare const MAT_PROGRESS_BAR_LOCATION: InjectionToken<MatProgressBarLocation>;
  26. /**
  27. * Stubbed out location for `MatProgressBar`.
  28. * @docs-private
  29. */
  30. export interface MatProgressBarLocation {
  31. getPathname: () => string;
  32. }
  33. /** @docs-private */
  34. export declare function MAT_PROGRESS_BAR_LOCATION_FACTORY(): MatProgressBarLocation;
  35. /**
  36. * `<mat-progress-bar>` component.
  37. */
  38. export declare class MatProgressBar extends _MatProgressBarMixinBase implements CanColor, AfterViewInit, OnDestroy {
  39. _elementRef: ElementRef;
  40. private _ngZone;
  41. _animationMode?: string | undefined;
  42. constructor(_elementRef: ElementRef, _ngZone: NgZone, _animationMode?: string | undefined,
  43. /**
  44. * @deprecated `location` parameter to be made required.
  45. * @breaking-change 8.0.0
  46. */
  47. location?: MatProgressBarLocation);
  48. /** Flag that indicates whether NoopAnimations mode is set to true. */
  49. _isNoopAnimation: boolean;
  50. /** Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow. */
  51. value: number;
  52. private _value;
  53. /** Buffer value of the progress bar. Defaults to zero. */
  54. bufferValue: number;
  55. private _bufferValue;
  56. _primaryValueBar: ElementRef;
  57. /**
  58. * Event emitted when animation of the primary progress bar completes. This event will not
  59. * be emitted when animations are disabled, nor will it be emitted for modes with continuous
  60. * animations (indeterminate and query).
  61. */
  62. animationEnd: EventEmitter<ProgressAnimationEnd>;
  63. /** Reference to animation end subscription to be unsubscribed on destroy. */
  64. private _animationEndSubscription;
  65. /**
  66. * Mode of the progress bar.
  67. *
  68. * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to
  69. * 'determinate'.
  70. * Mirrored to mode attribute.
  71. */
  72. mode: 'determinate' | 'indeterminate' | 'buffer' | 'query';
  73. /** ID of the progress bar. */
  74. progressbarId: string;
  75. /** Attribute to be used for the `fill` attribute on the internal `rect` element. */
  76. _rectangleFillValue: string;
  77. /** Gets the current transform value for the progress bar's primary indicator. */
  78. _primaryTransform(): {
  79. transform: string;
  80. };
  81. /**
  82. * Gets the current transform value for the progress bar's buffer indicator. Only used if the
  83. * progress mode is set to buffer, otherwise returns an undefined, causing no transformation.
  84. */
  85. _bufferTransform(): {
  86. transform: string;
  87. } | undefined;
  88. ngAfterViewInit(): void;
  89. ngOnDestroy(): void;
  90. /** Emit an animationEnd event if in determinate or buffer mode. */
  91. private _emitAnimationEnd;
  92. }
  93. export {};