Every export The complete public surface of truecopy, by entry point. Each module is also its own import, so a project that wants one pays for one.
Every module is its own entry point (truecopy/signature loads signature and nothing else), and the package is side-effect free, so a bundler drops what you do not import. The barrel (truecopy) re-exports all of it.
truecopy/table
readTable(file, options?)
rows, warnings, boundaries, document (the two-line path )
Table
the shape it returns
truecopy/open
openDocument(file, options?)
the door : caps, deadline, engine released
UnreadableDocument
carries reason so your application writes the sentence
Unreadable
'empty' | 'too-big' | 'no-text' | 'too-slow' | 'binary' | 'no-engine' | 'not-opened'
DEFAULT_LIMITS, Limits
20 MB, 40 pages, 30 s
OpenOptions
the limits, plus workerSrc and pdfjs
PdfEngine
what this library needs of an engine, structurally
withDeadline(promise, ms?)
bound any read in time
positionedItems(items)
the pure step between an engine and this library’s data
truecopy/layout
cellsOf(page, boundaries?)
a page as a table of cells
placesOf(page, boundaries?)
where each cell is, laid out identically
placeOf(items, page)
where any group of items sits
boundariesFromRecurrence(rows, support?)
keep only the x that come back row after row
boundariesFromAnchors(anchors)
cut halfway between anchors you trust
columnBoundaries(items)
the raw spread of x
columnAt(x, boundaries)
which column an x falls into
rowToCells(row, boundaries)
one row, cut
rowsFrom(items, boundaries)
items into rows, by proximity of baseline
pageFrom(n, w, h, items)
items into a page
documentFrom(pages, origin, name)
pages into a document
documentFromText(text, name)
a paste, a CSV, an export
truecopy/notation
readNumber(raw)
how a page writes a figure , null rather than a guess
findNumbers(text, decimals?)
every figure on a line, in order
isOnlyNumber(text, decimals?)
a cell of figures, not prose quoting one
numberToken(decimals?)
the pattern, to compose with
readDate(text, notation)
a delimited date, in the stated order
readLeadingDate(text, notation, yearWhenMissing?)
the date a line starts with, and its length
decimalMarkOf(text)
which mark the document uses, null when nothing settled it
wellGrouped(written, mark)
is this number grouped the way its document groups thousands
accentFree(text)
lower-cased and stripped of accents, to compare a label
Notation, FoundNumber, LeadingDate, DecimalMark
truecopy/records
recordsFrom(rows, options?)
which rows belong to the same record
spineWidthOf(rows)
how many filled cells a complete row carries, measured
Records
records, loose and findings - no row is ever grouped away
RecordBlock
the spine row, and every row index it carries
RecordFinding, RecordDoubt
'spine-not-sharp' | 'no-spine', with its numbers
RecordsOptions
spineWidth, reach
truecopy/labels
labelledValues(rows, isLabel, isValue, options?)
the cells that could be a label’s value
columnOfHeader(rows, isHeader)
the column a header sits in, null when several match
Labelled, Candidate, Cell
the label, its candidates closest first, and raw
LabelOptions, Look
reach, and 'row' | 'column' | 'both'
truecopy/signature
truecopy/columns
profileColumns(rows, options)
what each column holds, counted once
dominantKind(profile, thresholds)
the kind a column is made of
columnCount(rows), cellAt(row, column)
ColumnProfile, ProfileOptions
truecopy/roles
truecopy/schema
schemaOf(schema)
one declaration, two outputs
RecordOf<typeof schema>
the record type, read back off it
validate(schema, records)
the first rule that broke, or null
validateWith(standardSchema, records, rule)
bring your own Zod, Valibot or ArkType
conforms(schema, record)
one record
Schema, Field, FieldFormat, SchemaViolation, StandardSchema
truecopy/classify
truecopy/pattern
compilePattern(raw, options?)
domain knowledge as data , behind a guard
toRawPattern(pattern)
back to JSON
countMatches(text, pattern)
NEVER_MATCHES
what a rejected pattern compiles to
RawPattern, CompileOptions
truecopy/explain
explainDocument(document, options?)
what the reading decided , as text
explainRows(rows, options?)
the same, for rows that never came from a page
describeAnomaly(anomaly)
one anomaly, in words
ExplainOptions
truecopy/contract
readDocument(document, reader)
drive a reading , and enforce the one rule
Reader
read, selfCheck, rowsToReview, and two optional
ReadResult, Reading, SelfCheck, Discrepancy, Refusal, ReviewableRow, Verdict
truecopy/kit
checkContract(reader, corpus, options)
six rules, in your own suite
contractReport(results)
the run as a file you commit
failures(results)
what went red, in sentences
pdfWithText(words), pdfWithPages(pages)
a real PDF, xref table included
docxWithText(blocks), docxWithBody(bodyXml)
a real .docx, real CRC, both methods
documentWithoutSubstance()
for rule 5
CorpusCase, CheckResult, ContractOptions, PlacedWord
truecopy (types)
Document, TextPage, Row, PositionedItem, Place.
Previous pattern - domain knowledge as data