import type Axis from '../../Core/Axis/Axis' ; import U from '../../Core/Utilities.js' ; const { addEvent } = U ; declare module '../../Core/Axis/AxisComposition' { interface AxisComposition { vml ? : VMLAxis3D [ 'vml' ] ; } } declare module '../../Core/Axis/AxisType' { interface AxisTypeRegistry { VMLAxis3D : VMLAxis3D ; } } class VMLAxis3DAdditions { public constructor ( axis ) { this . axis = axis ; } axis : VMLAxis3D ; backFrame ? : Highcharts . VMLElement ; bottomFrame ? : Highcharts . VMLElement ; sideFrame ? : Highcharts . VMLElement ; } class VMLAxis3D { public static compose ( AxisClass ) { AxisClass . keepProps . push ( 'vml' ) ; addEvent ( AxisClass , 'destroy' , VMLAxis3D . onDestroy ) ; addEvent ( AxisClass , 'init' , VMLAxis3D . onInit ) ; addEvent ( AxisClass , 'render' , VMLAxis3D . onRender ) ; } private public static onDestroy ( this ) { const axis = this as VMLAxis3D , vml = axis . vml ; if ( vml ) { let el ; ( [ 'backFrame' , 'bottomFrame' , 'sideFrame' ] as Array < ( 'backFrame' | 'bottomFrame' | 'sideFrame' ) > ) . forEach ( function ( prop ) : void { el = vml [ prop ] ; if ( el ) { vml [ prop ] = el . destroy ( ) ; } } , this ) ; } } private public static onInit ( this ) { const axis = this ; if ( ! axis . vml ) { axis . vml = new VMLAxis3DAdditions ( axis as VMLAxis3D ) ; } } private public static onRender ( this ) { const axis = this as VMLAxis3D ; const vml = axis . vml ; if ( vml . sideFrame ) { vml . sideFrame . css ( { zIndex : 0 } ) ; ( vml . sideFrame . front as any ) . attr ( { fill : vml . sideFrame . color } ) ; } if ( vml . bottomFrame ) { vml . bottomFrame . css ( { zIndex : 1 } ) ; ( vml . bottomFrame . front as any ) . attr ( { fill : vml . bottomFrame . color } ) ; } if ( vml . backFrame ) { vml . backFrame . css ( { zIndex : 0 } ) ; ( vml . backFrame . front as any ) . attr ( { fill : vml . backFrame . color } ) ; } } } interface VMLAxis3D extends Axis { vml : VMLAxis3DAdditions ; } export default VMLAxis3D ;