UNPKG

2.44 kBTypeScriptView Raw
1import { ElementRef } from '@angular/core';
2/** TODO: internal */
3export declare enum ForegroundRippleState {
4 NEW = 0,
5 EXPANDING = 1,
6 FADING_OUT = 2,
7}
8/**
9 * Wrapper for a foreground ripple DOM element and its animation state.
10 * TODO: internal
11 */
12export declare class ForegroundRipple {
13 rippleElement: Element;
14 state: ForegroundRippleState;
15 constructor(rippleElement: Element);
16}
17/**
18 * Helper service that performs DOM manipulations. Not intended to be used outside this module.
19 * The constructor takes a reference to the ripple directive's host element and a map of DOM
20 * event handlers to be installed on the element that triggers ripple animations.
21 * This will eventually become a custom renderer once Angular support exists.
22 * TODO: internal
23 */
24export declare class RippleRenderer {
25 private _eventHandlers;
26 private _backgroundDiv;
27 private _rippleElement;
28 private _triggerElement;
29 constructor(_elementRef: ElementRef, _eventHandlers: Map<string, (e: Event) => void>);
30 /**
31 * Installs event handlers on the given trigger element, and removes event handlers from the
32 * previous trigger if needed.
33 */
34 setTriggerElement(newTrigger: HTMLElement): void;
35 /**
36 * Installs event handlers on the host element of the md-ripple directive.
37 */
38 setTriggerElementToHost(): void;
39 /**
40 * Removes event handlers from the current trigger element if needed.
41 */
42 clearTriggerElement(): void;
43 /**
44 * Creates a foreground ripple and sets its animation to expand and fade in from the position
45 * given by rippleOriginLeft and rippleOriginTop (or from the center of the <md-ripple>
46 * bounding rect if centered is true).
47 */
48 createForegroundRipple(rippleOriginLeft: number, rippleOriginTop: number, color: string, centered: boolean, radius: number, speedFactor: number, transitionEndCallback: (r: ForegroundRipple, e: TransitionEvent) => void): void;
49 /**
50 * Fades out a foreground ripple after it has fully expanded and faded in.
51 */
52 fadeOutForegroundRipple(ripple: Element): void;
53 /**
54 * Removes a foreground ripple from the DOM after it has faded out.
55 */
56 removeRippleFromDom(ripple: Element): void;
57 /**
58 * Fades in the ripple background.
59 */
60 fadeInRippleBackground(color: string): void;
61 /**
62 * Fades out the ripple background.
63 */
64 fadeOutRippleBackground(): void;
65}