I don't really know the terms to search on google for this, so it might be duplicated.
I have an interface that looks like
export interface SolidOptions<T> { position: Cartesian3; options?: T; } now, I want this T to be ONLY of 3 types : CylinderOptions | RectangleOptions | PolygoneOptions
I do NOT want this solution :
export interface SolidOptions<T> { position: Cesium.Cartesian3; options?: CylinderOptions | RectangleOptions | PolygoneOptions; } the reason why is I want to use this as follow :
static generateCylinder = (options: SolidOptions<CylinderOptions>)=> { } static generateRectangle = (options: SolidOptions<RectangleOptions >)=> { } static generatePolygon = (options: SolidOptions<PolygoneOptions>)=> { } and not having the abilities to pass the wrong type to the wrong function.