fui-fancyui
Version:
FancyUI Libary
32 lines (31 loc) • 1.1 kB
TypeScript
import { default as React } from 'react';
export type LinearOrientation = 'linear' | 'repeatLinear';
export type NonLinearOrientation = 'radial' | 'elliptical' | 'repeatRadial' | 'repeatElliptical';
export type GradientOrientation = LinearOrientation | NonLinearOrientation;
export type GradientPosition = 'left' | 'right' | 'top' | 'bottom' | 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
export type TGradientColor = {
color: string;
stop?: string;
};
type BaseGradientProps = {
children: React.ReactNode;
colors: string[] | TGradientColor[];
orientation?: GradientOrientation;
};
type avalableAlignment = {
degree?: number;
position?: never;
} | {
degree?: never;
position?: GradientPosition;
};
type LinearGradientProps = BaseGradientProps & {
orientation: LinearOrientation;
} & avalableAlignment;
type NonLinearGradientProps = BaseGradientProps & {
orientation?: NonLinearOrientation;
degree?: never;
position?: GradientPosition;
};
export type TTextGradientProps = LinearGradientProps | NonLinearGradientProps;
export {};