The file `source.ts` contains a TypeScript program that defines a read-only
subset of a document record and a class that materializes documents matching
that subset from raw input.

Convert it to idiomatic Flow in `main.js`, preserving the runtime behavior.
