Reputation: 1327
I have this type
{timeStamp: number, rectangle:number[]}
and I want to use it multiple times(within the same file), is there any way to do it like:
type detectionParams = {timeStamp: number, rectangle:number[]};
private detection: detectionParams[];
Upvotes: 0
Views: 54
Reputation: 848
Since you have a plain object type, rather than using the type alias its more common to use an interface instead.
interface DetectionParams {
timeStamp: number;
rectangle: number[];
};
If any other files are to use this Object structure, just export it.
Upvotes: 1