UNPKG

2.32 kBTypeScriptView Raw
1import { StylesheetMap } from '../stylesheet-map/stylesheet-map';
2import { LayoutConfigOptions } from '../tokens/library-config';
3import * as i0 from "@angular/core";
4export declare class StyleUtils {
5 private _serverStylesheet;
6 private _serverModuleLoaded;
7 private _platformId;
8 private layoutConfig;
9 constructor(_serverStylesheet: StylesheetMap, _serverModuleLoaded: boolean, _platformId: Object, layoutConfig: LayoutConfigOptions);
10 /**
11 * Applies styles given via string pair or object map to the directive element
12 */
13 applyStyleToElement(element: HTMLElement, style: StyleDefinition | string, value?: string | number | null): void;
14 /**
15 * Applies styles given via string pair or object map to the directive's element
16 */
17 applyStyleToElements(style: StyleDefinition, elements?: HTMLElement[]): void;
18 /**
19 * Determine the DOM element's Flexbox flow (flex-direction)
20 *
21 * Check inline style first then check computed (stylesheet) style
22 */
23 getFlowDirection(target: HTMLElement): [string, string];
24 hasWrap(target: HTMLElement): boolean;
25 /**
26 * Find the DOM element's raw attribute value (if any)
27 */
28 lookupAttributeValue(element: HTMLElement, attribute: string): string;
29 /**
30 * Find the DOM element's inline style value (if any)
31 */
32 lookupInlineStyle(element: HTMLElement, styleName: string): string;
33 /**
34 * Determine the inline or inherited CSS style
35 * NOTE: platform-server has no implementation for getComputedStyle
36 */
37 lookupStyle(element: HTMLElement, styleName: string, inlineOnly?: boolean): string;
38 /**
39 * Applies the styles to the element. The styles object map may contain an array of values
40 * Each value will be added as element style
41 * Keys are sorted to add prefixed styles (like -webkit-x) first, before the standard ones
42 */
43 private _applyMultiValueStyleToElement;
44 static ɵfac: i0.ɵɵFactoryDeclaration<StyleUtils, never>;
45 static ɵprov: i0.ɵɵInjectableDeclaration<StyleUtils>;
46}
47/**
48 * Definition of a css style. Either a property name (e.g. "flex-basis") or an object
49 * map of property name and value (e.g. {display: 'none', flex-order: 5})
50 */
51export declare type StyleDefinition = {
52 [property: string]: string | number | null;
53};