I am currently accepting interface for my component and it accept the array object "options" as one of its arguments. My question is how do you create an interface for array object. I believe you need to use index signature for the interface but I havent used it before and not sure how it need to be strcuture.
Currently I uses arrow function. And here is how I declare my interface of my function
interface IOption {
key: number;
text: string;
value: number
}
Interface DropDownInputInt {
name: string;
value: any;
label: string;
disabled: boolean;
onChange: Function;
extraClassName: string;
required: boolean;
options: IOption[] | string;
multiple: boolean;
clearable: boolean;
index?: number;
placeholder: string;
toolTipMessage: string;
addCollon: boolean;
}
const DropDownInput = ({
name,
value,
label,
disabled,
onChange,
extraClassName,
required,
options,
multiple,
clearable,
index,
placeholder,
toolTipMessage,
addCollon
}: DropDownInputInt) => {
//MY CODES HERE
})
My second question is how do you create in interface that accept both string and object.

Array<IOption>orIOption[]typescriptlang.org/docs/handbook/basic-types.html