ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
32 lines (31 loc) • 1.26 kB
TypeScript
import { RanElement } from '@/utils/index';
export declare class ImageElement extends RanElement {
static get observedAttributes(): string[];
_image: HTMLImageElement | undefined;
_container: Element;
_shadowDom: ShadowRoot;
constructor();
get fallback(): string;
set fallback(value: string);
get sheet(): string;
set sheet(value: string);
/**
* Alternative text forwarded to the inner `<img>`. Defaults to `''` (empty),
* which marks the image decorative so screen readers skip it — better than a
* missing alt, where they announce the file name/URL. Set a description for
* meaningful images.
*/
get alt(): string;
set alt(value: string);
handlerExternalCss: () => void;
listenFallback(name: string, value: string | null): void;
/**
* Point the inner `<img>` at the current `src` attribute. The `error`/`load`
* listeners wired in `connectedCallback` stay attached, so this reuses the
* same fallback-on-error and append-on-load behavior for every src change.
*/
updateSrc: () => void;
connectedCallback(): void;
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
}
export default ImageElement;