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