ReplSession.imported(): Promise<Array<{ file: string; exports: Array<{ name: string; capture: string; }>; }>>
What each preloaded file put in scope, and what kind of thing each one is.
exports rather than names, because a list of { name, capture } is not a list of names —
and names: Array<{ name }> made every reader stop on the stutter. Not values either:
nothing here is a value, and going to the page for thirty of them to print a heading would
cost a round trip per file for something nobody asked to see.
The kind is a theme capture rather than a JavaScript type, because it exists to be COLOURED: a list of names says nothing about what they are, and painting a function the colour this REPL paints functions says it without printing a value.
import type { ReplSession } from './session.ts'; // Defined, not invoked: a real session owns a browser and a bound port. async function listing(session: ReplSession) { return await session.imported(); // [{ file: 'test/fixtures/repl-helpers.ts', // exports: [{ name: 'double', capture: '@function' }] }] }