moodie
Version:
Randomly generated avatars with a mood
47 lines (44 loc) • 1.33 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import React, { HTMLProps } from 'react';
declare const eyeTypes: {
normal: EyesRenderer;
happy: EyesRenderer;
sleepy: EyesRenderer;
mischief: EyesRenderer;
};
declare const mouthTypes: {
smile: (props: MouthProps) => react_jsx_runtime.JSX.Element;
open: (props: MouthProps) => react_jsx_runtime.JSX.Element;
surprise: (props: MouthProps) => react_jsx_runtime.JSX.Element;
unhappy: (props: MouthProps) => react_jsx_runtime.JSX.Element;
};
declare const Moodie: React.MemoExoticComponent<({ name, colors, size, title, square, expression, ...props }: MoodieProps & Omit<HTMLProps<SVGSVGElement>, keyof MoodieProps>) => react_jsx_runtime.JSX.Element>;
type ExpressionProps = {
eye?: keyof typeof eyeTypes;
mouth?: keyof typeof mouthTypes;
};
type MoodieProps = {
name?: string;
colors?: string[];
size?: string | number;
title?: string;
square?: boolean;
expression?: ExpressionProps;
};
type EyeProps = {
eyeSize: number;
eyeSpread: number;
eyeColor: string;
x: number;
y: number;
};
type MouthProps = {
mouthSpread: number;
mouthSize: number;
mouthColor: string;
};
type EyesRenderer = {
rightEye: React.FC<EyeProps>;
leftEye: React.FC<EyeProps>;
};
export { Moodie };