ri-flex-layout
Version:
An alternative library to Angular's deprecated [angular-flex-layout](https://github.com/angular/flex-layout) library. `ri-flex-layout` helps you achieve responsive layouts in Angular applications with minimal code changes.
30 lines (29 loc) • 1.34 kB
TypeScript
export type NgStyleRawList = string[];
export type NgStyleMap = {
[klass: string]: string;
};
export type NgStyleType = string | Set<string> | NgStyleRawList | NgStyleMap;
/**
* Callback function for SecurityContext.STYLE sanitization
*/
export type NgStyleSanitizer = (val: any) => string;
/** NgStyle allowed inputs */
export declare class NgStyleKeyValue {
key: string;
value: string;
constructor(key: string, value: string, noQuotes?: boolean);
}
export declare function getType(target: any): string;
/**
* Split string of key:value pairs into Array of k-v pairs
* e.g. 'key:value; key:value; key:value;' -> ['key:value',...]
*/
export declare function buildRawList(source: any, delimiter?: string): NgStyleRawList;
/** Convert array of key:value strings to a iterable map object */
export declare function buildMapFromList(styles: NgStyleRawList, sanitize?: NgStyleSanitizer): NgStyleMap;
/** Convert Set<string> or raw Object to an iterable NgStyleMap */
export declare function buildMapFromSet(source: NgStyleType, sanitize?: NgStyleSanitizer): NgStyleMap;
/** Convert 'key:value' -> [key, value] */
export declare function stringToKeyValue(it: string): NgStyleKeyValue;
/** Convert [ [key,value] ] -> { key : value } */
export declare function keyValuesToMap(map: NgStyleMap, entry: NgStyleKeyValue): NgStyleMap;