const someArray = ['foo', 'bar']
const someOtherArray = ['foobar', 'barfoos']
const config = [
...someArray,
...someOtherArray,
{
name: 'someName',
type: 'someType'
}
]
config.push({
name: 'someNewName',
type: 'someNewType',
newProperty: { someThing: 'value' }
})
const config = [ ...someArray, ...someOtherArray, { name: 'someName', type: 'someType' } ]
config.push({
name: 'someNewName',
type: 'someNewType',
newProperty: { someThing: 'value' }
})
const someArray = ['foo', 'bar']
const someOtherArray = ['foobar', 'barfoos']
export type ConfigType = (string | {
name: string;
type: string;
newProperty?: {
someThing: string;
}
})[]
const config: ConfigType = [
...someArray,
...someOtherArray,
{
name: 'someName',
type: 'someType'
}
]
config.push({
name: 'someNewName',
type: 'someNewType',
newProperty: { someThing: 'value' }
})
console.log(config)
export type ConfigType = (string | { name: string; type: string; newProperty?: { someThing: string; } })[]
const config: ConfigType = [ ...someArray, ...someOtherArray, { name: 'someName', type: 'someType' } ]
config.push({ name: 'someNewName', type: 'someNewType', newProperty: { someThing: 'value' } })
console.log(config)
const someArray = ['foo', 'bar']
const someOtherArray = ['foobar', 'barfoos']
export type TypeTypes = 'someString' | 'someOtherString';
export type ConfigType = (string | {
name: string;
type: TypeTypes;
newProperty?: {
someThing: string;
}
})[]
const config: ConfigType = [
...someArray,
...someOtherArray,
{
name: 'someName',
type: 'someString'
}
]
config.push({
name: 'someNewName',
type: 'someOtherString',
newProperty: { someThing: 'value' }
})
console.log(config)
export type TypeTypes = 'someString' | 'someOtherString';
export type ConfigType = (string | { name: string; type: TypeTypes; newProperty?: { someThing: string; } })[]
const config: ConfigType = [ ...someArray, ...someOtherArray, { name: 'someName', type: 'someString' } ]
config.push({ name: 'someNewName', type: 'someOtherString', newProperty: { someThing: 'value' } })
console.log(config)