-
Notifications
You must be signed in to change notification settings - Fork 82
/
types.ts
54 lines (46 loc) · 1.57 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import * as React from 'react';
type Style = {
[key: string]: string | number | boolean
}
export type Sex = 'man' | 'woman'
export type EarSize = 'small' | 'big'
export type HairStyle = 'normal' | 'thick' | 'mohawk' | 'womanLong' | 'womanShort'
export type HairStyleMan = 'normal' | 'thick' | 'mohawk'
export type HairStyleWoman = 'normal' | 'womanLong' | 'womanShort'
export type HatStyle = 'beanie' |'turban' | 'none'
export type EyeStyle = 'circle' | 'oval' | 'smile'
export type GlassesStyle = 'round' | 'square' | 'none'
export type NoseStyle = 'short' | 'long' | 'round'
export type MouthStyle = 'laugh' | 'smile' | 'peace'
export type ShirtStyle = 'hoody' | 'short' | 'polo'
export type EyeBrowStyle = 'up' | 'upWoman'
export interface AvatarConfig {
sex?: Sex,
faceColor?: string,
earSize?: EarSize,
hairColor?: string,
hairStyle?: HairStyle,
hairColorRandom?: boolean,
hatColor?: string,
hatStyle?: HatStyle,
eyeStyle?: EyeStyle,
glassesStyle?: GlassesStyle,
noseStyle?: NoseStyle,
mouthStyle?: MouthStyle,
shirtStyle?: ShirtStyle,
shirtColor?: string,
bgColor?: string,
isGradient?: boolean
}
export interface AvatarFullConfig extends AvatarConfig {
eyeBrowStyle?: EyeBrowStyle
}
export interface NiceAvatarProps extends AvatarConfig {
id?: string,
className?: string,
style?: Style,
shape?: "circle" | "rounded" | "square"
}
export type GenConfigFunc = (config?: AvatarFullConfig | string) => Required<AvatarFullConfig>
export declare const genConfig: GenConfigFunc
export default class ReactNiceAvatar extends React.Component<NiceAvatarProps> {}