@inventage-web-components/avatar-image
Version:
An avatar image based on user initials.
20 lines • 963 B
TypeScript
/**
* Simple hash function that generates an integer from a string. It uses bitwise operations and a prime number
* to ensure a relatively even distribution of hash values and to minimize collisions.
*
* @param string the string to generate the hash from
* @param tableSize the size of the hash table and is used to limit the range of output values
*/
export declare const stringHash: (string: string, tableSize?: number) => number;
export declare const getInitialsFromString: (string: string) => string | undefined;
export type SvgImageOptions = {
backgroundColor: string;
textColor: string;
fontSize: number;
round: boolean;
className: string;
partName: string;
};
export declare const svgImageDefaultOptions: Pick<SvgImageOptions, 'backgroundColor' | 'textColor' | 'fontSize' | 'round'>;
export declare const svgImage: (text: string, size: number, options?: Partial<SvgImageOptions>) => string;
//# sourceMappingURL=utils.d.ts.map