UNPKG

2.94 kBTypeScriptView Raw
1import { ModuleWithProviders, ElementRef, OnChanges, OnDestroy, OnInit, SimpleChange } from '@angular/core';
2export declare class MdRipple implements OnInit, OnDestroy, OnChanges {
3 /**
4 * The element that triggers the ripple when click events are received. Defaults to the
5 * directive's host element.
6 */
7 trigger: HTMLElement | HTMLElement;
8 /**
9 * Whether the ripple always originates from the center of the host element's bounds, rather
10 * than originating from the location of the click event.
11 */
12 centered: boolean;
13 /**
14 * Whether click events will not trigger the ripple. It can still be triggered by manually
15 * calling start() and end().
16 */
17 disabled: boolean;
18 /**
19 * If set, the radius in pixels of foreground ripples when fully expanded. If unset, the radius
20 * will be the distance from the center of the ripple to the furthest corner of the host element's
21 * bounding rectangle.
22 */
23 maxRadius: number;
24 /**
25 * If set, the normal duration of ripple animations is divided by this value. For example,
26 * setting it to 0.5 will cause the animations to take twice as long.
27 */
28 speedFactor: number;
29 /** Custom color for ripples. */
30 color: string;
31 /** Custom color for the ripple background. */
32 backgroundColor: string;
33 /** Whether the ripple background will be highlighted to indicated a focused state. */
34 focused: boolean;
35 /** Whether foreground ripples should be visible outside the component's bounds. */
36 unbounded: boolean;
37 private _rippleRenderer;
38 constructor(_elementRef: ElementRef);
39 /** TODO: internal */
40 ngOnInit(): void;
41 /** TODO: internal */
42 ngOnDestroy(): void;
43 /** TODO: internal */
44 ngOnChanges(changes: {
45 [propertyName: string]: SimpleChange;
46 }): void;
47 /**
48 * Responds to the start of a ripple animation trigger by fading the background in.
49 */
50 start(): void;
51 /**
52 * Responds to the end of a ripple animation trigger by fading the background out, and creating a
53 * foreground ripple that expands from the event location (or from the center of the element if
54 * the "centered" property is set or forceCenter is true).
55 */
56 end(left: number, top: number, forceCenter?: boolean): void;
57 private _rippleTransitionEnded(ripple, event);
58 /**
59 * Called when the trigger element receives a mousedown event. Starts the ripple animation by
60 * fading in the background.
61 */
62 private _mouseDown(event);
63 /**
64 * Called when the trigger element receives a click event. Creates a foreground ripple and
65 * runs its animation.
66 */
67 private _click(event);
68 /**
69 * Called when the trigger element receives a mouseleave event. Fades out the background.
70 */
71 private _mouseLeave(event);
72}
73export declare class MdRippleModule {
74 static forRoot(): ModuleWithProviders;
75}