import { LitElement, TemplateResult } from "lit-element"; import { AriaRole } from "../util/aria"; /** * Base properties of the ripple. Used when showing a ripple. */ export interface IRippleBaseProperties { autoRelease: boolean; initialDuration: number; releaseDuration: number; } /** * Properties of the ripple. */ export interface IRippleProperties extends IRippleBaseProperties { target: EventTarget; overlay: boolean; disabled: boolean; unbounded: boolean; centered: boolean; focusable: boolean; role: AriaRole; } /** * Configuration when showing a ripple. */ export interface IRippleConfig extends IRippleBaseProperties { } /** * Callback type used to release a ripple. */ export declare type RippleReleaseFunction = () => void; /** * Base configuration for the ripple animation. */ export declare const RIPPLE_ANIMATION_CONFIG: KeyframeAnimationOptions; /** * Initial animation duration. */ export declare const RIPPLE_INITIAL_DURATION = 350; /** * Release animation duration. */ export declare const RIPPLE_RELEASE_DURATION = 500; /** * Indicate touch actions. * @cssprop --ripple-color - Color. * @cssprop --ripple-opacity - Opacity. */ export declare class Ripple extends LitElement implements IRippleProperties { static styles: import("lit-element").CSSResult[]; /** * Makes the ripple visible outside the bounds. * @attr */ unbounded: boolean; /** * Makes ripple appear from the center. * @attr */ centered: boolean; /** * Overlays the ripple. * @attr */ overlay: boolean; /** * Disables the ripple. * @attr */ disabled: boolean; /** * Allows focusin to spawn a ripple. * @attr */ focusable: boolean; /** * Releases the ripple after it has been spawned. * @attr */ autoRelease: boolean; /** * Initial animation duration. * @attr */ initialDuration: number; /** * Fade out animation duration. * @attr */ releaseDuration: number; /** * Role of the ripple. * @attr */ role: AriaRole; /** * Target for the spawn ripple events. * @attr */ target: EventTarget; /** * Event subscribers on the target. */ private listeners; /** * Event subscribers present during the ripple animation. */ private rippleAnimationListeners; /** * Hooks up the element. */ connectedCallback(): void; /** * Tears down the element. */ disconnectedCallback(): void; /** * Reacts on updated properties. * @param props */ updated(props: Map): void; /** * Adds event listeners to the target. */ protected addListeners(): void; /** * Removes listeners. */ protected removeListeners(): void; /** * Handles the mouse down events and spawns a ripple. * If no event is provided the ripple will spawn in the center. * @param {MouseEvent | TouchEvent} e * @param config */ spawnRipple(e?: MouseEvent | TouchEvent, config?: Partial): RippleReleaseFunction; /** * Handles the mouse up event and removes the ripple. */ releaseRipple(): void; /** * Shows a ripple at a specific coordinate. * @param number * @param config */ showRippleAtCoords({ x, y }: { x: number; y: number; }, config?: Partial): RippleReleaseFunction; /** * Add a persistent ripple when the taget gains focus. */ protected onFocusIn(): void; /** * Release the current ripple when the focus is lost from the target. */ protected onFocusOut(): void; /** * Returns the template for the element. */ protected render(): TemplateResult; } declare global { interface HTMLElementTagNameMap { "wl-ripple": Ripple; } }