I am attempting to return an object, with a property of type string[]
However, coda.ValueType.StringArray
is not available for schema properties (only parameters)
And typing the items
property of Arrays as coda.ValueType.String
is not allowed either
pack.addFormula({
resultType: coda.ValueType.Object,
schema: coda.makeObjectSchema({
properties: {
property1: { type: coda.ValueType.String },
arrayOfStrings: { type: coda.ValueType.Array, items: coda.ValueType.String }, // ".ValueType' is not assignable to type 'Schema'"
},
})
})
Instead, typing the example property arrayOfStrings
as an array of objects (where the object has property of type string) works – but then there is an extra nested property myString
pack.addFormula({
resultType: coda.ValueType.Object,
schema: coda.makeObjectSchema({
properties: {
property1: { type: coda.ValueType.String },
arrayOfStrings: {
type: coda.ValueType.Array, items: coda.makeObjectSchema({
properties: {
myString: { type: coda.ValueType.String }, // works, but not ideal
},
})
},
},
}),
})
Is there a way to type a resultType object’s property as an array of strings?
Thank you