import {CompileFn, FormatFn} from './default' export type StructuredJson = Record< string, { translation: string notes?: string context?: string limit?: string } > export const format: FormatFn = msgs => { const results: StructuredJson = {} for (const [id, msg] of Object.entries(msgs)) { results[id] = { translation: msg.defaultMessage!, notes: msg.description, } } return results } export const compile: CompileFn = msgs => { const results: Record = {} for (const [id, msg] of Object.entries(msgs)) { results[id] = msg.translation } return results }