| 8 | * - For any `$debugName` directive return the debug name |
| 9 | */ |
| 10 | export function convertToStyles(object: types.NestedCSSProperties): Styles { |
| 11 | /** The final result we will return */ |
| 12 | const styles: Styles = {}; |
| 13 | for (const key in object) { |
| 14 | |
| 15 | /** Grab the value upfront */ |
| 16 | const val = (object as any)[key as any]; |
| 17 | |
| 18 | /** TypeStyle configuration options */ |
| 19 | if (key === '$nest') { |
| 20 | const nested = val!; |
| 21 | for (let selector in nested) { |
| 22 | const subproperties = nested[selector]!; |
| 23 | styles[selector] = convertToStyles(subproperties); |
| 24 | } |
| 25 | } |
| 26 | else if (key === '$debugName') { |
| 27 | styles.$displayName = val; |
| 28 | } |
| 29 | else { |
| 30 | styles[key] = val |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | return styles; |
| 35 | } |
| 36 | |
| 37 | // todo: better name here |
| 38 | export function convertToKeyframes(frames: types.KeyFrames): Styles { |