const allowedCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ; const allowedCharactersLength = allowedCharacters . length ; export type ClassNameGenerator = { /**
     * Generates a unique class name
     */ nextClassName ( ) : string ; /**
     * Returns the state of the ClassNameGenerator.
     */ getCurrCSSKey ( ) : number ; } ; param currCSSKey export function createClassNameGenerator ( currCSSKey = 0 ) { return { nextClassName ( ) { const key1unit = allowedCharactersLength * allowedCharactersLength ; const key1pos = Math . floor ( currCSSKey / key1unit ) ; const key1 = allowedCharacters [ key1pos - 1 ] ; const key2pos = Math . floor ( ( currCSSKey - ( key1 ? key1pos * key1unit : 0 ) ) / allowedCharactersLength ) ; const key2 = allowedCharacters [ key2pos - 1 ] ; const key3 = allowedCharacters [ ( currCSSKey - ( key1 ? ( key1pos * key1unit ) : 0 ) - ( key2 ? key2pos * allowedCharactersLength : 0 ) ) ] ; let key = '' ; if ( key1 ) { key += key1 ; } if ( key2 ) { key += key2 ; } if ( key3 ) { key += key3 ; } currCSSKey ++ ; return key ; } , getCurrCSSKey : ( ) => currCSSKey , } ; }