let shorcut = { 'w' : 'width' , 'h' : 'height' , 'm' : 'margin' , 'l' : 'left' , 't' : 'top' , 'o' : 'overflow' } ; export class _$ { currentClass : string ; styleObject : any ; key : any ; value : any ; measure : any ; constructor ( className ) { this . currentClass = className ; this . styleObject = { } ; this . key = '' ; this . value = 0 ; this . measure = '' ; } shiftKey = function ( keys , func ? ) { let prefixClass = this . currentClass . split ( /[0-9]/ ) [ 0 ] ; let keysExistinClass = keys . filter ( ( key ) => prefixClass . indexOf ( key ) > - 1 ) ; let strongest = this . returnStrongestMatch ( [ prefixClass ] ) ; this . key = shorcut [ strongest ] ; this . styleObject [ this . key ] = 0 ; this . currentClass = this . currentClass . replace ( strongest , '' ) ; func ? func ( this . styleObject ) : null ; return this ; } ; shiftValue = function ( allowedValues , func ? ) { let thenum = this . currentClass . replace ( /^\D+/g , '' ) ; let withNoDigits = this . currentClass . replace ( /[0-9]/g , '' ) ; this . currentClass = withNoDigits ; this . styleObject [ this . key ] = thenum ; func ? func ( this . styleObject ) : null ; return this ; } ; shiftMeasurement = function ( measurements ) { } ; returnStrongestMatch = function ( keysExistinClass , idx ? , currentStrongest ? ) { let strongest = currentStrongest || keysExistinClass [ 0 ] ; let currentIndex = idx || 0 ; let currentKey = keysExistinClass [ currentIndex ] ; if ( idx < keysExistinClass . length ) { if ( strongest . length < currentKey . length ) { strongest = currentKey ; } return this . returnStrongestMatch ( keysExistinClass , currentIndex + 1 , strongest ) ; } else { return strongest ; } } ; } ; export const stepThrough = function ( b ) { return new _$ ( b ) ; } ;