IF Commons GitHub

engine/point

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-engine FR-001, 0002-engine FR-002

A contribution point: a named, typed place that a layer lets extensions fill (commons data 0002-engine FR-002). The layer that offers a point declares it with point; an extension's manifest names it and says what it contributes, typed by T. The engine declares no point of a layer.

import { point } from "@intellectual-frontiers/data/engine";
export const vocabulary = point<{ readonly term: string }>("governance.vocabulary");

Source: commons/data/engine/point.ts

2 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.

ContributionPointinterface
interface ContributionPoint<T>

A contribution point: what an extension may contribute to it is T, which the point's value carries for the compiler and never holds.

MemberTypeWhat it is
name`${string}.${string}`The point's name.
__contributes?TNever set: carries what may be contributed, for the compiler.

Imported by 1 test of the run (1 passed, 0 failed): the library's results

pointfunction
function point<T>(name: `${string}.${string}`): ContributionPoint<T>

Declares a contribution point.

ParameterWhat it is
nameits namespace and name, such as governance.vocabulary

Returns: the point, frozen

Imported by 17 tests of the run (17 passed, 0 failed): the library's results

PointNametypeno test imports it
type PointName = `${string}.${string}`;

The name of a contribution point: a namespace, a dot and a name (governance.vocabulary); a name with no namespace does not compile.

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