UNPKG

1.77 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { ElementRef } from '@angular/core';
9import { MediaMarshaller, BaseDirective2, StyleBuilder, StyleDefinition, StyleUtils } from '@angular/flex-layout/core';
10export declare class ImgSrcStyleBuilder extends StyleBuilder {
11 buildStyles(url: string): {
12 content: string;
13 };
14}
15export declare class ImgSrcDirective extends BaseDirective2 {
16 protected platformId: Object;
17 protected serverModuleLoaded: boolean;
18 protected DIRECTIVE_KEY: string;
19 protected defaultSrc: string;
20 set src(val: string);
21 constructor(elementRef: ElementRef, styleBuilder: ImgSrcStyleBuilder, styler: StyleUtils, marshal: MediaMarshaller, platformId: Object, serverModuleLoaded: boolean);
22 /**
23 * Use the [responsively] activated input value to update
24 * the host img src attribute or assign a default `img.src=''`
25 * if the src has not been defined.
26 *
27 * Do nothing to standard `<img src="">` usages, only when responsive
28 * keys are present do we actually call `setAttribute()`
29 */
30 protected updateWithValue(value?: string): void;
31 protected styleCache: Map<string, StyleDefinition>;
32}
33/**
34 * This directive provides a responsive API for the HTML <img> 'src' attribute
35 * and will update the img.src property upon each responsive activation.
36 *
37 * e.g.
38 * <img src="defaultScene.jpg" src.xs="mobileScene.jpg"></img>
39 *
40 * @see https://css-tricks.com/responsive-images-youre-just-changing-resolutions-use-src/
41 */
42export declare class DefaultImgSrcDirective extends ImgSrcDirective {
43 protected inputs: string[];
44}