A FooList is both an array of Foo objects, as well as an object that contains a string-valued bar property.
If you're willing to use type assertions, it's easy enough to create one since you can just tell the compiler you know what you're doing:
var foos: any; // turn off type checking
foos = [{ baz: 'baz1' }, { baz: 'baz2' }];
foos.bar = 'bar';
var fooList: FooList = foos as FooList; // assert type of fooList
Creating one of these things safely, where the compiler guarantees that you've made something of the right type is a little tricky, but you can do it with Object.assign(), which returns an intersection of its parameter types:
const fooList: FooList = Object.assign([{ baz: 'baz' }, { baz: 'baz' }], { bar: 'bar' });
Hope that helps. Good luck!
Please ignore the stuff below; I'm not sure what came over me, but spreading an array into an object is unlikely to work the way anyone wants, since Array prototype methods will not be copied. Just use the above Object.assign() solution.
Update 1
@CésarAlberca said:
Thanks! Yours was my preferred solution. What is the equivalent of object assign using the spread operator?
Oh, sure, you could do that:
const fooList2: FooList = { ...[{ baz: 'baz' }, { baz: 'baz' }], ...{ bar: 'bar' } };
or
const fooList3: FooList = { ...[{ baz: 'baz' }, { baz: 'baz' }], bar: 'bar' };
Cheers.