import { DefaultTextStyle , hAlignFromPlacement , HorizontalAlignment , hPlacementFromAlignment , TextLayoutStyle , TextPlacement , vAlignFromPlacement , VerticalAlignment , vPlacementFromAlignment } from "@here/harp-text-canvas" ; hidden export class LayoutState { private m_hAlign = DefaultTextStyle . DEFAULT_HORIZONTAL_ALIGNMENT ; private m_vAlign = DefaultTextStyle . DEFAULT_VERTICAL_ALIGNMENT ; constructor ( placement ) { this . textPlacement = placement ; } param placement set textPlacement ( placement ) { this . m_hAlign = hAlignFromPlacement ( placement . h ) ; this . m_vAlign = vAlignFromPlacement ( placement . v ) ; } returns get textPlacement ( ) : TextPlacement { return { h : hPlacementFromAlignment ( this . m_hAlign ) , v : vPlacementFromAlignment ( this . m_vAlign ) } ; } /**
     * Reset existing `LayoutState` to contain values from style/theme layout.
     */ reset ( layoutStyle ) { this . m_hAlign = layoutStyle . horizontalAlignment ; this . m_vAlign = layoutStyle . verticalAlignment ; } get horizontalAlignment ( ) : HorizontalAlignment { return this . m_hAlign ; } get verticalAlignment ( ) : VerticalAlignment { return this . m_vAlign ; } }