import { SerializedFieldFormat } from '../../../../src/plugins/field_formats/common' ; import { FieldFormatsSetup , FieldFormatsStart } from '../../../../src/plugins/field_formats/public' ; import { ExampleCurrencyFormat } from '../../common' ; export function registerExampleFormat ( fieldFormats ) { fieldFormats . register ( [ ExampleCurrencyFormat ] ) ; } export function getSample ( fieldFormats ) { const exampleSerializedFieldFormat = { id : 'example-currency' , params : { currency : 'USD' , } , } ; const fieldFormat = fieldFormats . deserialize ( exampleSerializedFieldFormat ) ; const pairs = [ 1000 , 100000 , 100000000 ] . map ( ( value ) => ( { raw : value , formatted : fieldFormat . convert ( value ) , } ) ) ; return pairs ; }