IF Commons GitHub

extract/api

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-docs FR-001

The API of each area, read through the TypeScript 7.1 programmatic API (commons 0011-documentation FR-010): every export of the area's entry points, an alias followed to what it names, a namespace (export * as fs) walked into, with its kinds, the source file it is declared in, its signature as the checker prints it (or, for a type or an interface, as its source writes it), the members of an interface, and its TSDoc. It uses typescript/async, whose channel to the compiler runs under Bun and under Node; the compiler is the one the package's package.json pins. The program is the repository's: its modules resolve from its own node_modules, and Node's types are the first @types/node found in the repository's root, in a package's folder, or beside the generator.

Source: commons/docs/src/extract/api.ts

0 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

ApiExportinterfaceno test imports it
interface ApiExport

An export of an area.

MemberTypeWhat it is
namestringIts name, with its namespace before a dot where it is a namespace's (fs.readTextFile).
kindsreadonly ExportKind[]What it is: more than one where a type and a value share the name.
filestringThe file it is declared in, from the checkout's root.
signaturestringIts signature.
docDocCommentIts TSDoc.
documentedbooleanWhether it has any TSDoc at all.
membersreadonly ApiMember[]The members of an interface or a class.
declared?stringThe name it is declared with, where it is exported under another (export { a as b }).
ApiMemberinterfaceno test imports it
interface ApiMember

A member of an interface or a class: its name, its type and its TSDoc.

MemberTypeWhat it is
namestringIts name.
typestringIts type, as the checker prints it.
docstringWhat its TSDoc says.
optionalbooleanWhether it may be left out.
AreaApiinterfaceno test imports it
interface AreaApi

The API of an area: its exports, in the order its entry points export them.

MemberTypeWhat it is
slugstringThe area.
exportsreadonly ApiExport[]Its exports.
ExportKindtypeno test imports it
type ExportKind = "function" | "const" | "class" | "interface" | "type" | "namespace" | "enum";

What an export is.

Titles, headings, exports, tables, columns and requirements. Esc closes.