The literal DocumentTypeCode of the document being parsed.
Document type to parse.
Raw user input.
A discriminated union ParseResult<C>: { ok: true, value } on
success, or { ok: false, error } describing why the input was rejected.
result.code is narrowed to the literal C.
Detailed parse with a discriminated
ParseResult. Never throws on input errors; instead returns{ ok: false, error: { kind, ... } }so callers can branch on the failure mode (use this when you need to show a user-facing error message vianationid/i18n.getErrorMessage).Generic over the document type code: passing a literal narrows the returned
ParseResult<C>soresult.codekeeps its literal type. Aswitch (r.code)after the call sees onlyCas a reachable value, not the whole 124-memberDocumentTypeCodeunion.