function from
from(
input?: UserRunOptions | string | string[],
options?: UserRunOptions
): ConfigOptions & { reporters: Reporter[]; }

Public options in, runner input out — this is the API's Args.parse, and the only reason UserRunOptions and ConfigOptions are separate types.

Takes the same shorthands every verb does: a single path, a list of paths, or the options object, so run('test/') and run({ inputs: ['test/'] }) reach here identically.

ConfigOptions extends the CLI's parsed flags, so its shape is the flag grammar's: htmlPaths, coverageFormats, portExplicit. Publishing that would make every flag rename a breaking API change and would expose portExplicit, which only exists to record whether the user typed --port. This is where the two vocabularies meet, and it is the only place that knows both.

The returned reporters is a fresh array, and typed as always present, so a caller with a reporter of its own can push onto it before handing the whole thing to Config.setup.

import * as Options from './options.ts';

Options.from('test/cart-test.ts').inputs; // ['test/cart-test.ts'] — the bare-path shorthand
Options.from({ coverage: { formats: ['lcov'] } }).coverageFormats; // ['lcov']
Options.from({ html: ['test/index.html'] }).htmlPaths; // ['test/index.html']

Parameters

optional
input: UserRunOptions | string | string[]
optional
options: UserRunOptions

Return Type

ConfigOptions & { reporters: Reporter[]; }

Usage

import { from } from "lib/api/options.ts";