UNPKG

@rxap/directives

Version:

This package provides a set of Angular directives to simplify common tasks such as setting background images, confirming clicks, making elements contenteditable, and more. It includes directives for handling UI interactions, applying styles, and managing

42 lines (41 loc) 1.94 kB
import { ElementRef, OnChanges, OnInit, Renderer2, SimpleChanges } from '@angular/core'; import { ImageLoaderService } from '@rxap/services'; import * as i0 from "@angular/core"; export declare enum GlobalStyleOptions { INITIAL = "initial", INHERIT = "inherit" } export declare enum BackgroundSizeOptions { AUTO = "auto", COVER = "cover", CONTAIN = "contain" } export type BackgroundSize = GlobalStyleOptions | BackgroundSizeOptions | string; export declare enum BackgroundRepeatOptions { NO_REPEAT = "no-repeat" } export type BackgroundRepeat = GlobalStyleOptions | BackgroundRepeatOptions; export declare enum BackgroundPositionOptions { CENTER = "center", CENTER_CENTER = "center center" } export type BackgroundPosition = GlobalStyleOptions | BackgroundPositionOptions | string; export declare class BackgroundImageDirective implements OnChanges, OnInit { private readonly host; private readonly renderer; private readonly imageLoader; imageUrl: string | null | undefined; placeholderImageUrl: string; size?: BackgroundSize; repeat?: BackgroundRepeat; position?: BackgroundPosition; constructor(host: ElementRef, renderer: Renderer2, imageLoader: ImageLoaderService); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; private repeatChange; private positionChange; private sizeChange; private imageUrlChange; static ɵfac: i0.ɵɵFactoryDeclaration<BackgroundImageDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<BackgroundImageDirective, "[rxapBackgroundImage]", never, { "imageUrl": { "alias": "rxapBackgroundImage"; "required": false; }; "placeholderImageUrl": { "alias": "placeholderImageUrl"; "required": false; }; "size": { "alias": "size"; "required": false; }; "repeat": { "alias": "repeat"; "required": false; }; "position": { "alias": "position"; "required": false; }; }, {}, never, never, true, never>; }