export class OjpImage { /** * 1. Own Properties * Note that because these properties * do not have the @Prop() decorator, they will not be exposed * publicly on the host element, but only used internally. */ _observer: any; _image: any; _prevCurrentSrc: any; _loadListener: any; _loadFailedListener: any; /** * 2. Reference to host HTML element. * Inlined decorator */ el: any; /** * 3. State() variables * Inlined decorator, alphabetical order. */ /** * 4. Public Property API * Inlined decorator, alphabetical order. These are * different from "own properties" in that public props * are exposed as properties and attributes on the host element. * Requires JSDocs for public API documentation. */ /** * Mobile image src */ mSrc: any; /** * Tablet image src */ tSrc: any; /** * Desktop image src * Type: string */ dSrc: any; /** * Widescreen image src */ wSrc: any; /** * Image src * Type: string * Required: true * Default: null */ src: string; /** * Image alt text * Type: string * Default: "" */ alt: string; /** * Loading type (true = lazy, false = eager) * Type: boolean * Default: false */ lazy: boolean; /** * Image aspect ratio * Type: see CSS aspect-ratio https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio * Default: null */ ratio: any; /** * Image focus/object position * Type: see CSS object-position https://developer.mozilla.org/en-US/docs/Web/CSS/object-position * Default: null */ imageFocus: any; /** * Width of the image * Type: string * Default: null * Note: this is not the width of the image container, but the width of the image itself * */ width: any; /** * Height of the image * Type: string * Default: null * Note: this is not the height of the image container, but the height of the image itself * */ height: any; /** * Optional placeholder image path * Type: string * Default: null */ placeholder: any; /** * 5. Events section * Inlined decorator, alphabetical order. * Requires JSDocs for public API documentation. */ /** * Triggered when the element has entered in the viewport */ elementIsVisible: any; /** * Triggered when the element has left the viewport */ elementIsInvisible: any; /** * Triggered when the image loaded */ imageLoaded: any; /** * Triggered when the image failed to load */ imageFailedToLoad: any; /** * Triggered when the current image source changes * Note: this event is not emitted when the image is loaded for the first time * Emits the previous source and the new source */ imageSourceChanged: any; /** * 6. Component lifecycle events * Ordered by their natural call order, for example * WillLoad should go before DidLoad. */ componentWillLoad(): void; componentDidUpdate(): void; componentDidLoad(): void; componentDidRender(): void; disconnectedCallback(): void; /** * 7. Listeners * It is ok to place them in a different location * if it makes more sense in the context. Recommend * starting a listener method with "on". * Always use two lines. */ /** * 8. Public methods API * These methods are exposed on the host element. * Always use two lines. * Public Methods must be async. * Requires JSDocs for public API documentation. */ /** * 9. Local methods * Internal business logic. These methods cannot be * called from the host element. */ handleIntersection: (entries: any) => Promise; handleImageLoaded(): void; /** * 10. render() function * Always the last public method in the class. * If private methods present, they are below public methods. */ render(): any; }