import { HttpHeaders } from '@angular/common/http' ; import { Injectable } from '@angular/core' ; @ Injectable ( ) export class ImageLoaderConfig { debugMode = false ; spinnerEnabled = true ; fallbackAsPlaceholder = false ; backgroundSize = 'contain' ; backgroundRepeat = 'no-repeat' ; display = 'block' ; width = '100%' ; height = '100%' ; useImg = false ; fallbackUrl ; concurrency = 5 ; maxCacheSize = - 1 ; maxCacheAge = - 1 ; imageReturnType : 'base64' | 'uri' = 'uri' ; spinnerName ; spinnerColor ; httpHeaders : HttpHeaders ; fileNameCachedWithExtension = false ; fallbackFileNameCachedExtension = '.jpg' ; cacheDirectoryType : 'cache' | 'data' = 'cache' ; private _cacheDirectoryName : string = 'image-loader-cache' ; get cacheDirectoryName ( ) { return this . _cacheDirectoryName ; } set cacheDirectoryName ( name ) { name . replace ( /\W/g , '' ) ; this . _cacheDirectoryName = name ; } /**
     * Enables debug mode to receive console logs, errors, warnings
     */ enableDebugMode ( ) { this . debugMode = true ; } param { boolean } enable enableSpinner ( enable ) { this . spinnerEnabled = enable ; } param { boolean } enable enableFallbackAsPlaceholder ( enable ) { this . fallbackAsPlaceholder = enable ; } param { string } name setCacheDirectoryName ( name ) { this . cacheDirectoryName = name ; } param { string } height setHeight ( height ) { this . height = height ; } param { string } width setWidth ( width ) { this . width = width ; } param { string } display setDisplay ( display ) { this . display = display ; } param { boolean } use useImageTag ( use ) { this . useImg = use ; } param { string } backgroundSize setBackgroundSize ( backgroundSize ) { this . backgroundSize = backgroundSize ; } param { string } backgroundRepeat setBackgroundRepeat ( backgroundRepeat ) { this . backgroundRepeat = backgroundRepeat ; } param { string } fallbackUrl setFallbackUrl ( fallbackUrl ) { this . fallbackUrl = fallbackUrl ; } param { number } concurrency setConcurrency ( concurrency ) { this . concurrency = concurrency ; } param { number } cacheSize setMaximumCacheSize ( cacheSize ) { this . maxCacheSize = cacheSize ; } param { number } cacheAge setMaximumCacheAge ( cacheAge ) { this . maxCacheAge = cacheAge ; } param imageReturnType { string } setImageReturnType ( imageReturnType ) { this . imageReturnType = imageReturnType ; } param { string } name setSpinnerName ( name ) { this . spinnerName = name ; } param { string } color setSpinnerColor ( color ) { this . spinnerColor = color ; } param { HttpHeaders } headers setHttpHeaders ( headers ) { this . httpHeaders = headers ; } param options deprecated setFileTransferOptions ( options ) { } param { boolean } enable setFileNameCachedWithExtension ( enable ) { this . fileNameCachedWithExtension = enable ; } param { string } extension setFallbackFileNameCachedExtension ( extension ) { this . fallbackFileNameCachedExtension = extension ; } }