internal export interface IDictionary { [ className ] : boolean ; } internal export interface ISerializableObject { toString ? : ( ) => string ; } internal export type ICssInput = string | ISerializableObject | IDictionary | null | undefined | boolean ; public export function css ( ... args ) { let classes = [ ] ; for ( let arg of args ) { if ( arg ) { if ( typeof arg === 'string' ) { classes . push ( arg ) ; } else if ( arg . hasOwnProperty ( 'toString' ) && typeof arg . toString === 'function' ) { classes . push ( arg . toString ( ) ) ; } else { for ( let key in arg as any ) { if ( ( arg as any ) [ key ] ) { classes . push ( key ) ; } } } } } return classes . join ( ' ' ) ; }