UNPKG

1.82 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 { DoCheck, ElementRef, KeyValueDiffers, Renderer2 } from '@angular/core';
9import { NgStyle } from '@angular/common';
10import { DomSanitizer } from '@angular/platform-browser';
11import { BaseDirective2, StyleUtils, MediaMarshaller } from '@angular/flex-layout/core';
12import { NgStyleType, NgStyleMap } from './style-transforms';
13export declare class StyleDirective extends BaseDirective2 implements DoCheck {
14 protected sanitizer: DomSanitizer;
15 private readonly ngStyleInstance;
16 protected DIRECTIVE_KEY: string;
17 protected fallbackStyles: NgStyleMap;
18 protected isServer: boolean;
19 constructor(elementRef: ElementRef, styler: StyleUtils, marshal: MediaMarshaller, sanitizer: DomSanitizer, differs: KeyValueDiffers, renderer2: Renderer2, ngStyleInstance: NgStyle, serverLoaded: boolean, platformId: Object);
20 /** Add generated styles */
21 protected updateWithValue(value: any): void;
22 /** Remove generated styles */
23 protected clearStyles(): void;
24 /**
25 * Convert raw strings to ngStyleMap; which is required by ngStyle
26 * NOTE: Raw string key-value pairs MUST be delimited by `;`
27 * Comma-delimiters are not supported due to complexities of
28 * possible style values such as `rgba(x,x,x,x)` and others
29 */
30 protected buildStyleMap(styles: NgStyleType): NgStyleMap;
31 /** For ChangeDetectionStrategy.onPush and ngOnChanges() updates */
32 ngDoCheck(): void;
33}
34/**
35 * Directive to add responsive support for ngStyle.
36 *
37 */
38export declare class DefaultStyleDirective extends StyleDirective implements DoCheck {
39 protected inputs: string[];
40}