# sefaz_danfe v0.1.0 - API Reference

## Modules

- Public API
  - [SefazDanfe](SefazDanfe.md): The printed auxiliary documents of the Brazilian electronic fiscal documents, drawn from the
authorized XML: the DANFE of an NF-e (model 55), the DANFE NFC-e (model 65), the DACTE of a CT-e
(57) or CT-e OS (67) and the DAMDFE of an MDF-e (58).
  - [SefazDanfe.Contingency](SefazDanfe.Contingency.md): The contingency of a document, read from its `ide`: `tpEmis` (the emission type) and, when the
XML has them, `dhCont` (when the contingency began) and `xJust` (why).
  - [SefazDanfe.ContingencyCode](SefazDanfe.ContingencyCode.md): The additional barcode of the documents printed in contingency on the security form (FS-DA, and
FS-IA of the NF-e): "Dados da NF-e" (MOC 7.0, Anexo II, item 2.9.2) and "Dados do CT-e" (MOC
3.00a of the DACTE, item 2.18.2). It is a Code 128 subset C of 36 digits, and the same 36 digits
in nine blocks of four go printed in the box next to it.

- Data
  - [SefazDanfe.Cte.Data](SefazDanfe.Cte.Data.md): The data of a DACTE, read from the `cteProc` (or `cteOSProc`) SEFAZ authorized: what the PDF is
drawn from.
  - [SefazDanfe.Mdfe.Data](SefazDanfe.Mdfe.Data.md): The data of a DAMDFE, read from the `mdfeProc` SEFAZ authorized (with the closeout appended, once it
is registered): what the PDF is drawn from.
  - [SefazDanfe.Nfce.Data](SefazDanfe.Nfce.Data.md): The data of a DANFE NFC-e, read from the `nfeProc` SEFAZ authorized: what the 80 mm or 58 mm receipt is
drawn from.
  - [SefazDanfe.Nfe.Data](SefazDanfe.Nfe.Data.md): The data of a DANFE, read from the `nfeProc` SEFAZ authorized: what the PDF is drawn from.

- Internals
  - [SefazDanfe.Barcode](SefazDanfe.Barcode.md): Code 128 subset C (ISO/IEC 15417), the barcode the DANFE prints for the access key.
  - [SefazDanfe.Format](SefazDanfe.Format.md): The Brazilian presentation of the values of a DANFE: tax ids, CEP, dates, money, quantities and
the access key. Every function takes what the XML holds (text, `nil` when absent) and answers
text, or `nil` when there is nothing to show, so a missing field stays blank.

  - [SefazDanfe.QrCode](SefazDanfe.QrCode.md): A QR Code (ISO/IEC 18004, model 2) encoder for the DANFE NFC-e: byte mode, error correction level
M (the level the NFC-e manual asks for), versions 1 to 14, the best of the eight masks.
  - [SefazDanfe.Renderer](SefazDanfe.Renderer.md): Draws the PDF of a document from the data `SefazDanfe.data/2` reads: the one place that calls
Typst.

