packageDocumentation module import { PropertyDescription , PropertyEditorInfo } from "../properties/Description" ; import { CustomFormattedNumberParams , IconEditorParams , ParseResults , PropertyEditorParamTypes } from "../properties/EditorParams" ; import { StandardTypeNames } from "../properties/StandardTypeNames" ; import { StandardEditorNames } from "../properties/StandardEditorNames" ; beta export abstract class BaseQuantityDescription implements PropertyDescription { public name : string ; public displayLabel : string ; public typename : string ; public editor : PropertyEditorInfo ; constructor ( name , displayLabel , iconSpec ? ) { this . name = name ; this . displayLabel = displayLabel ; this . typename = StandardTypeNames . Number ; this . editor = { name : StandardEditorNames . NumberCustom , params : [ { type : PropertyEditorParamTypes . CustomFormattedNumber , formatFunction : this . format , parseFunction : this . parse } as CustomFormattedNumberParams , ] } ; if ( iconSpec ) { const params = { type : PropertyEditorParamTypes . Icon , definition : { iconSpec } } ; this . editor . params ! . push ( params ) ; } } protected abstract formatValue ( numberValue ) ; public format = ( numberValue ) : string => { return this . formatValue ( numberValue ) ; } ; protected abstract parseString ( userInput ) ; public parse = ( userInput ) : ParseResults => { return this . parseString ( userInput ) ; } ; public abstract get quantityType ( ) : string ; public abstract get parseError ( ) : string ; }