import { NgZone , Injectable } from '@angular/core' ; declare const AmCharts ; export interface AmChart { [ key ] : any ; } export interface AmEvent { [ key ] : any ; } export interface Formatter { precision : number ; decimalSeparator : string ; thousandsSeparator : string ; } export declare class StockPanel { constructor ( ) ; [ key ] : any ; } export declare class StockGraph { constructor ( ) ; [ key ] : any ; } export declare class StockEvent { constructor ( ) ; [ key ] : any ; } export declare class StockLegend { constructor ( ) ; [ key ] : any ; } @ Injectable ( { providedIn : 'root' } ) export class AmChartsService { constructor ( private zone ) { } get StockPanel ( ) : typeof StockPanel { return AmCharts . StockPanel ; } get StockGraph ( ) : typeof StockGraph { return AmCharts . StockGraph ; } get StockEvent ( ) : typeof StockEvent { return AmCharts . StockEvent ; } get StockLegend ( ) : typeof StockLegend { return AmCharts . StockLegend ; } get baseHref ( ) : boolean { return AmCharts . baseHref ; } set baseHref ( v ) { AmCharts . baseHref = v ; } get useUTC ( ) : boolean { return AmCharts . useUTC ; } set useUTC ( v ) { AmCharts . useUTC = v ; } get dayNames ( ) : Array < string > { return AmCharts . dayNames ; } set dayNames ( v ) { AmCharts . dayNames = v ; } get monthNames ( ) : Array < string > { return AmCharts . monthNames ; } set monthNames ( v ) { AmCharts . monthNames = v ; } get shortDayNames ( ) : Array < string > { return AmCharts . shortDayNames ; } set shortDayNames ( v ) { AmCharts . shortDayNames = v ; } get shortMonthNames ( ) : Array < string > { return AmCharts . shortMonthNames ; } set shortMonthNames ( v ) { AmCharts . shortMonthNames = v ; } get theme ( ) : any { return AmCharts . theme ; } set theme ( v ) { AmCharts . theme = v ; } get processDelay ( ) : number { return AmCharts . processDelay ; } set processDelay ( v ) { AmCharts . processDelay = v ; } get charts ( ) : Array < AmChart > { return AmCharts . charts ; } addInitHandler ( handler , types ? ) { AmCharts . addInitHandler ( handler , types ) ; } addPrefix ( value , prefixesBig , prefixesSmall , numberFormatter ) { return AmCharts . addPrefix ( value , prefixesBig , prefixesSmall , numberFormatter ) ; } clear ( ) { AmCharts . clear ( ) ; } formatDate ( date , format ) { return AmCharts . formatDate ( date , format ) ; } formatNumber ( value , formatter , zeroCount ) { return AmCharts . formatNumber ( value , formatter , zeroCount ) ; } stringToDate ( value , format ) { return AmCharts . stringToDate ( value , format ) ; } makeChart ( id , config , delay ? ) { return this . zone . runOutsideAngular ( ( ) => AmCharts . makeChart ( id , config , delay ) ) ; } addListener ( chart , type , fn ) { const callback = ( e ) => { this . zone . run ( ( ) => { fn ( e ) ; } ) ; } ; this . zone . runOutsideAngular ( ( ) => { chart . addListener ( type , callback ) ; } ) ; return ( ) => { this . zone . runOutsideAngular ( ( ) => { chart . removeListener ( chart , type , callback ) ; } ) ; } ; } updateChart ( chart , fn ) { this . zone . runOutsideAngular ( ( ) => { fn ( ) ; chart . validateNow ( true ) ; } ) ; } destroyChart ( chart ) { this . zone . runOutsideAngular ( ( ) => { chart . clear ( ) ; } ) ; } }