tapuscrit itérer les propriétés de l'interface

J'ai besoin de la carte d'interface des propriétés aux objets:

    interface Activity {
        id: string,
        title: string,
        body: string,
        json: Object
    }

Je fais:

   headers: Array<Object> = [
            { text: 'id', value: 'id' },
            { text: 'title', value: 'title' },
            { text: 'body', value: 'body' },
            { text: 'json', value: 'json' }
        ]

Cela devient très répétitif. Ce que je voudrais, c'est quelque chose comme ceci:

   headers: Array<Object> = Activity.keys.map(key => {
       return { text: key, value: key }
   })

OriginalL'auteur Chris | 2017-08-14