Logo Xantham

Harvest Module

Tier 1 - Harvest: the Wire-driven inventory of what the author exported. No mapping decisions live here; the tier's invariant is that every export of the entry module appears exactly once, aliases followed to their origin.

Functions and values

Function or value Description

harvestDocs

Full Usage: harvestDocs

Returns: Pass<HarvestModel>

Documentation for every harvested export, from the checker rather than the syntax tree so merged declarations already read as one.

Returns: Pass<HarvestModel>

harvestExports

Full Usage: harvestExports

Returns: Pass<HarvestModel>

The entry module's exports, each followed through `getAliasedSymbol` to its origin so that re-exports and default-export aliases land on the declaring symbol. A global type library (`@cloudflare/workers-types`, `@types/*` that declare no module) has no module symbol at all. That is not an error and not an escape: the pass advances with nothing, and `harvest-globals` picks the file's ambient declarations up instead.

Returns: Pass<HarvestModel>

harvestGlobals

Full Usage: harvestGlobals

Returns: Pass<HarvestModel>

The entry package's ambient global declarations, for a package that declares no module at all. Asking the checker for the symbols in scope at the top of the entry file returns the whole global environment - three thousand names for `@cloudflare/workers-types`, two thirds of them `lib.dom.d.ts` - so the result is filtered to the symbols the package itself declares, by the same O7 placement the resolve tier groups types with. An ambient module declaration (`declare module "cloudflare:email"`) arrives here too, under a symbol name that is its quoted specifier. Its exports are harvested under `FromAmbientModule`: the types are declared beside the package's globals, and the values carry the specifier's own import. Runs only when `harvest-exports` found nothing: a package with a module symbol may also augment the global scope, and folding those globals into its exports would emit names the package does not export.

Returns: Pass<HarvestModel>

orderExports

Full Usage: orderExports

Returns: Pass<HarvestModel>

Fixes the output order: source order of the first declaration, then export name as the tiebreak. Exports with no declaration handle sort last.

Returns: Pass<HarvestModel>

passes

Full Usage: passes

Returns: Pass<HarvestModel> list

The tier's pass list, in execution order.

Returns: Pass<HarvestModel> list

Type something to start searching.