JSON.parse returns any. The compiler cannot know what shape you expect. You can assert the parsed value to the interface you need.
Create a small Point shape and read it from JSON. Then compute a simple metric from the point.
interface P {
x: number;
y: number;
}
const p = JSON.parse('{"x":1,"y":2}') as P;Parse a point from JSON and compute its Manhattan distance.
interface Point { x: number; y: number }.pointFromJson(json: string): Point using an assertion on JSON.parse.manhattan(p: Point): number that returns Math.abs(p.x) + Math.abs(p.y).