UNPKG

@wix/css-property-parser

Version:

A comprehensive TypeScript library for parsing and serializing CSS property values with full MDN specification compliance

55 lines (54 loc) 2.14 kB
import { FontValue, CSSVariableValue } from '../types'; export type { FontValue } from '../types'; /** * Parse a CSS font property string */ export declare function parse(value: string): FontValue | null; /** * Convert FontValue back to CSS string */ export declare function toCSSValue(parsed: FontValue | null): string | null; interface LegacyParsedType { type: string; value: string | string[] | number; originalString: string; families?: string[]; [key: string]: string | string[] | number | undefined; } type LegacyParsedTypeWithVariables = LegacyParsedType | CSSVariableValue; export declare const Family: { parse(value: string): LegacyParsedTypeWithVariables | null; isOfType(value: string): boolean; evaluate(parsed: LegacyParsedType | null): boolean; toCSSValue(parsed: LegacyParsedType | null): string | null; }; export declare const Style: { parse(value: string): LegacyParsedTypeWithVariables | null; isOfType(value: string): boolean; evaluate(parsed: LegacyParsedType | null): boolean; toCSSValue(parsed: LegacyParsedType | null): string | null; }; export declare const Variant: { parse(value: string): LegacyParsedTypeWithVariables | null; isOfType(value: string): boolean; evaluate(parsed: LegacyParsedType | null): boolean; toCSSValue(parsed: LegacyParsedType | null): string | null; }; export declare const Stretch: { parse(value: string): LegacyParsedTypeWithVariables | null; isOfType(value: string): boolean; evaluate(parsed: LegacyParsedType | null): boolean; toCSSValue(parsed: LegacyParsedType | null): string | null; }; export declare const Weight: { parse(value: string): LegacyParsedTypeWithVariables | null; isOfType(value: string): boolean; evaluate(parsed: LegacyParsedType | null): boolean; toCSSValue(parsed: LegacyParsedType | null): string | null; }; export declare const Size: { parse(value: string): LegacyParsedTypeWithVariables | null; isOfType(value: string): boolean; evaluate(parsed: LegacyParsedType | null): boolean; toCSSValue(parsed: LegacyParsedType | null): string | null; };