class AutoSaver { public _saverHandler ! : ( ( ) => void ) | undefined ; public saverTimer ! : NodeJS . Timer ; public Saver : ProxyHandler < any > = { } ; public Save ( ) { clearTimeout ( this . saverTimer ) ; this . saverTimer = setTimeout ( ( ) => { if ( this . _saverHandler !== undefined ) { try { this . _saverHandler ( ) ; } catch ( e ) { console . error ( e ) ; } } } , 100 ) ; } public constructor ( ) { const Save = ( ) => this . Save ( ) ; this . Saver = { get ( target , propName ) { const val = target [ propName ] ; return val ; } , set ( target , propName , value ) { target [ propName ] = value ; Save ( ) ; return true ; } , } ; } } export { AutoSaver } ;