The file `source.ts` contains a TypeScript program that models geometric shapes
as a discriminated union and computes their area and perimeter.

Convert it to idiomatic Flow in `main.js`, preserving the runtime behavior. The
result must pass `flow check` with zero errors.
