gradient-utils
Version:
css and svg gradient utils
43 lines (42 loc) • 2.07 kB
TypeScript
import { AngleUnit, LinearGradient, LinearGradientWithAngle, LinearGradientWithInterpolation, LinearGradientWithSideOrCorner } from './types';
export declare const NUMBER_REGEX: RegExp;
export declare const START_WITH_NUMBER_REGEX: RegExp;
export declare const DELIMITER_REGEX: RegExp;
export declare const UNIT_REGEX: RegExp;
export declare const START_WITH_SIDE_OR_CORNER_REGEX: RegExp;
export declare const START_WITH_INTERPOLATION: RegExp;
export declare const START_WITH_FUNCTION_REGEX: RegExp;
export declare const START_NAMED_COLOR_REGEX: RegExp;
export declare const START_HEX_REGEX: RegExp;
export declare const ANGLE_UNITS: AngleUnit[];
export declare const isAngleUnit: (unit: string) => unit is AngleUnit;
export declare const extractStartValueWithUnit: (source: string, zeroUnit?: string) => {
value: number;
sourceValue: string;
source: string;
unit: string;
} | null;
export declare const extractStartComma: (source: string) => string | null;
export declare const extractStartWithFunction: (source: string) => {
function: string;
source: string;
} | null;
export declare const extractStartWithHex: (source: string) => {
color: string;
alpha?: number | undefined;
source: string;
} | null;
export declare const extractStartNamedColor: (source: string) => {
color: string;
source: string;
} | null;
export declare const extractColor: (source: string) => {
color: string;
alpha?: number | undefined;
source: string;
} | null;
export declare const angleToDeg: (angle: number, unit: AngleUnit) => number;
export declare const removeCSSComments: (source: string) => string;
export declare const isLinearGradientWithAngle: (gradient: LinearGradient | null | undefined) => gradient is LinearGradientWithAngle;
export declare const isLinearGradientWithSideOrCorner: (gradient: LinearGradient | null | undefined) => gradient is LinearGradientWithSideOrCorner;
export declare const isLinearGradientWithInterpolation: (gradient: LinearGradient | null | undefined) => gradient is LinearGradientWithInterpolation;