export class Point { public X : number ; public Y : number ; } export class Size { public Height : number ; public Width : number ; constructor ( height , width ) { this . Height = height ; this . Width = width ; } } export function AddSetterToObject ( object , callback ) { for ( const key in object ) { if ( object . hasOwnProperty ( key ) ) { let newKey = key ; if ( newKey [ 0 ] . toLowerCase ( ) === newKey [ 0 ] ) { continue ; } newKey = newKey [ 0 ] . toLowerCase ( ) + newKey . substring ( 1 ) ; object [ newKey ] = object [ key ] ; Object . defineProperty ( object , key , { set : function ( v ) { this [ newKey ] = v ; callback ( v ) ; } , get : function ( ) { return this [ newKey ] ; } } ) ; } } } export function getArgs ( func ) { const args = func . toString ( ) . match ( /\(([^)]*)\)/ ) [ 1 ] ; return args . split ( ',' ) . map ( function ( arg ) { return arg . replace ( /\/\*.*\*\// , '' ) . trim ( ) ; } ) . filter ( function ( arg ) { return arg ; } ) ; }