import { ComponentDefaultProps } from '@justeattakeaway/pie-webc-core'; import { CSSResult } from 'lit'; import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElement'; import * as React_2 from 'react'; import { TemplateResult } from 'lit-html'; export declare const aspectRatios: readonly ["1by1", "4by3", "16by9"]; export declare const backgroundColorClassNames: Record; export declare const backgroundColors: readonly ["default", "subtle", "strong", "dark", "inverse", "inverse-alternative"]; export declare type DefaultProps = ComponentDefaultProps; export declare const defaultProps: DefaultProps; export declare const PieThumbnail: React_2.ForwardRefExoticComponent, "children">> & React_2.RefAttributes & ReactBaseType>; /** * @tagname pie-thumbnail */ declare class PieThumbnail_2 extends PieElement implements ThumbnailProps { variant: "default" | "outline"; size: number; aspectRatio: "1by1" | "4by3" | "16by9"; src: string; alt: string; disabled: boolean; hasPadding: boolean; hideDefaultPlaceholder: boolean; backgroundColor: "default" | "subtle" | "strong" | "dark" | "inverse" | "inverse-alternative"; placeholder: ThumbnailProps['placeholder']; private _parentDisabled; private img; private _hasError; /** * Determines if the default placeholder should be displayed. */ private get _isDefaultPlaceholderVisible(); /** * Returns the appropriate image props based on the following order: * 1. If there is no error, return the provided image props. * 2. If there is an error and a custom placeholder is provided, return the placeholder props. * 3. If there is an error and no custom placeholder is provided, return the component default placeholder. * 4. Otherwise, fall back to the provided src (resulting in a broken image). */ private get _controlledSrc(); private get _controlledAlt(); /** * Assigns CSS variables based on the size prop. */ private _generateSizeStyles; /** * Handles the image error event. */ private _handleImageError; /** * Checks the image load status and triggers error handling if needed. * This is needed as the `onerror` event is not triggered in SSR. */ private _checkImageError; protected firstUpdated(): void; render(): TemplateResult<1>; static styles: CSSResult; } declare type PlaceholderProps = { src?: string; alt?: string; }; declare type ReactBaseType = React_2.HTMLAttributes; export declare const sizes: readonly number[]; export declare interface ThumbnailProps { /** * What style variant the thumbnail should be such as default or outline. */ variant?: typeof variants[number]; /** * Specify the size as a number between 24 and 128 (inclusive) and a multiple of 8. */ size?: typeof sizes[number]; /** * The src attribute for the underlying image tag. */ src?: string; /** * The alt attribute for the underlying image tag. */ alt?: string; /** * When true, the disabled styles are applied. Also applied automatically when the thumbnail is * inside a disabled `pie-radio-group` or `pie-checkbox-group`. */ disabled?: boolean; /** * When true, extra spacing around the thumbnail container is applied. */ hasPadding?: boolean; /** * What background color the thumbnail should be. */ backgroundColor?: typeof backgroundColors[number]; /** * When true, hides the component default placeholder on image load failure. */ hideDefaultPlaceholder?: boolean; /** * Overrides the component default placeholder with a custom one on image load failure. */ placeholder?: PlaceholderProps; /** * Sets the aspect-ratio of the thumbnail image. */ aspectRatio?: typeof aspectRatios[number]; } export declare const variants: readonly ["default", "outline"]; export { }