storage.getFileStats()
Builds reusable record or worksheet indexes and returns file statistics.
Notes:
- mode: “lines” builds a separate physical-line index with lineCount, map, batches, encoding and separator.
- CSV stats include physicalLineCount, blankLineCount and endsWithRecordDelimiter independently of logical rowCount.
- CSV dialect options include encoding, delimiter, recordDelimiter, headerRow, quote and escape. quote: false disables quoting and ignores escape.
- maxRecordBytes defaults to 64 MiB per logical record, independently of batch size. Invalid syntax or oversized records reject indexing with STORAGE_CSV_INVALID. Wrong source field counts reject by default; onError: “skipRow” skips them with csvReport diagnostics.
- The error contains errorCount, at most 100 location diagnostics and diagnosticsTruncated, never raw rows/cells; RecordTooLarge may report only the inspected prefix.
- physicalLineCount counts actual lines including headers, blank lines and multiline fields. Legacy lineCount retains the synthetic terminal empty line when present.
- Derived stats are cached on the storage entry metadata for later batch reads.

