Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-docs FR-001
What a lens is (commons 0011-documentation FR-013, FR-026): a value a configuration passes, which knows one library. Its read is given the build, the areas and their API once every API page is registered; it recognises the library's exports by the type the checker gives each, imports their module, registers the page each entity is shown on (so that an API page can link to it), and returns what makes its pages once every other page is made. The package ships no lens and depends on no library it shows.
Source: commons/docs/src/lens.ts
1 of 3 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.
interface Lens
A lens: its name, and what reads its library's values and makes their pages.
| Member | Type | What it is |
|---|
name | string | Its name, as data. |
read | (b: Build, areas: readonly Area[], apis: readonly AreaApi[]) => Promise<LensPages> | Reads the values of the areas whose exports are its library's, and returns what makes their pages. |
files? | ((b: Build) => readonly SiteFile[]) | The files it adds to the site once its pages are made (commons 0011-documentation FR-028). |
Imported by 2 tests of the run (2 passed, 0 failed): the library's results
LensPagestypeno test imports ittype LensPages = (b: Build, after: number) => number;
What makes a lens's pages: given the order its first group of pages takes in the Models section, it returns the order after its last.
SiteFileinterfaceno test imports itinterface SiteFile
A file a lens adds to the site beside its pages: the JSON of a model.
| Member | Type | What it is |
|---|
path | string | Where it is, from the site's root. |
text | string | |
what | string | What it is, in a few words, for the index of the site that a program reads (llms.txt). |