import type { Map as MbMap } from '@kbn/mapbox-gl' ; import { StaticStyleProperty } from './static_style_property' ; import { LabelStaticOptions } from '../../../../../common/descriptor_types' ; export class StaticTextProperty extends StaticStyleProperty < LabelStaticOptions > { isComplete ( ) { return this . getOptions ( ) . value . length > 0 ; } syncTextFieldWithMb ( mbLayerId , mbMap ) { if ( this . getOptions ( ) . value . length ) { mbMap . setLayoutProperty ( mbLayerId , 'text-field' , this . getOptions ( ) . value ) ; } else { if ( typeof mbMap . getLayoutProperty ( mbLayerId , 'text-field' ) !== 'undefined' ) { mbMap . setLayoutProperty ( mbLayerId , 'text-field' , undefined ) ; } } } }