Hi, how would I deel with TS code where there is a...
# javascript
a
Hi, how would I deel with TS code where there is a getter that returns a type but the setter accepts another type ?
Copy code
interface IPointData {
        public x: number;
        public y: number;
}

declare class ObservablePoint<T extends any = any> extends IPointData {}

declare class DisplayObject {
        public get position(): ObservablePoint;
        public set position(pos: IPointData);
}
How do I type this in Kotlin ?
b
Interface hierarchy? Or just dynamic
a
Found a clever way with
Copy code
open var position: ObservablePoint<Any?>
	@Suppress("WRONG_SETTER_PARAMETER_TYPE")
	set(value: IPointData) = definedExternally
It's not the cleaner way but the most precise way I could find
👍 1
b
Clever indeed!