@fe6/icon-cube-vue
Version:
Water Icon 的支持自定义图标
71 lines (70 loc) • 2.65 kB
TypeScript
import type { ComponentOptions, DefineComponent } from 'vue';
export declare type StrokeLinejoin = 'miter' | 'round' | 'bevel';
export declare type StrokeLinecap = 'butt' | 'round' | 'square';
export declare type TCubeTheme = 'outline' | 'filled' | 'twoTone' | 'multiColor';
export interface ICubeBaseColors {
outStrokeColor: string;
outFillColor: string;
}
export interface ICubeMoreColors extends ICubeBaseColors {
innerStrokeColor: string;
innerFillColor: string;
}
export interface IColors {
outline: ICubeBaseColors;
filled: ICubeBaseColors;
twoTone: ICubeBaseColors;
multiColor: ICubeMoreColors;
}
export interface ISvgIconProps {
id?: string;
size?: number | string;
strokeWidth?: number;
strokeLinecap?: StrokeLinecap;
strokeLinejoin?: StrokeLinejoin;
colors: string[];
spin?: boolean;
}
export interface IIconConfig {
size: number | string;
strokeWidth: number;
strokeLinecap: StrokeLinecap;
strokeLinejoin: StrokeLinejoin;
prefix: string;
spin: boolean;
rtl: boolean;
theme: TCubeTheme;
colors: IColors;
}
export interface IIconBase {
size?: number | string;
strokeWidth?: number;
strokeLinecap?: StrokeLinecap;
strokeLinejoin?: StrokeLinejoin;
theme?: TCubeTheme;
colors?: string[];
}
export interface IIconProps extends IIconBase {
spin?: boolean;
id?: string | number;
}
export declare type IconOptions = ComponentOptions<IIconProps>;
export declare type IconRender = (props: ISvgIconProps) => JSX.Element | string;
export declare type Icon = DefineComponent<ISvgIconProps>;
export interface IIconCubeItemData extends IIconProps {
content: string;
viewBox: string;
canSet?: boolean;
}
export interface IIconCubeData {
[key: number | string]: IIconCubeItemData;
}
export declare const DEFAULT_ICON_CONFIGS: IIconConfig;
export declare const getSvgItem: (svgId: string) => IIconCubeItemData | null;
declare type TSvgAttr = 'canSet' | 'theme' | 'size' | 'strokeWidth' | 'strokeLinecap' | 'strokeLinejoin' | 'colors' | 'spin' | 'content' | 'viewBox';
export declare const getSvgProp: (svgItem: IIconCubeItemData | null, attr: TSvgAttr, type: string, canSet: boolean, defValue: any) => any;
export declare const IconConverter: (id: string, icon: IIconProps, config: IIconConfig) => ISvgIconProps;
export declare const IconProvider: (config: IIconConfig) => void;
export declare const IconWrapper: (name: string, rtl: boolean, render: IconRender) => DefineComponent<IconOptions>;
export declare const IconWrapperCustomer: (name: string, rtl: boolean, render: IconRender) => IconOptions;
export {};