Suppose I have a JavaScript array that has a certain type of different types of elements at the beginning, but then (pattern) of repeating type (s) at the end for an arbitrary number of repetitions.
How can I declare a TypeScript type that will be compatible with this JavaScript array?
interface A {
foo: Foo,
bar: Bar,
}
interface B {
baz: Baz
}
interface Bat {
}
Edit:
To clarify, I am experimenting with using TypeScript external declarations with vanilla JavaScript code to identify problems in existing JavaScript code. I understand that submission may be unreasonable; if more wisdom were used in creating the JavaScript source code, I would not mention this adventure.