Contextinterfaceno test imports itinterface ContextWhat activate is given.
| Member | Type | What it is |
|---|---|---|
use | <T>(h: Handle<T>) => Result<T, HandleError> | The value of a handle the manifest declared and the project provided. |
A handle: what an extension is given to act with, and nothing more (commons data 0002-engine FR-009). A layer defines the handles it offers (the trace graph, the statements to emit, the files to write) with handle; a project provides a value for each with provide; an extension says in its manifest which it uses, and its activate can use only those. This is a discipline, not a sandbox: code that runs in the same process can import what it likes, and the layers check keeps it to public surfaces.
Contextinterfaceno test imports itinterface ContextWhat activate is given.
| Member | Type | What it is |
|---|---|---|
use | <T>(h: Handle<T>) => Result<T, HandleError> | The value of a handle the manifest declared and the project provided. |
Handleinterfaceno test imports itinterface Handle<T>A handle: a named place for a value of type T, which the project provides.
| Member | Type | What it is |
|---|---|---|
name | `${string}.${string}` | The handle's name, a namespace and a name like a contribution point's. |
__gives? | T | Never set: carries what the handle gives, for the compiler. |
handlefunctionfunction handle<T>(name: `${string}.${string}`): Handle<T>Declares a handle.
| Parameter | What it is |
|---|---|
name | its namespace and name, such as physical.statements |
Returns: the handle, frozen
HandleErrortypeno test imports ittype HandleError =
{ readonly kind: "undeclared"; readonly handle: PointName } | { readonly kind: "unprovided"; readonly handle: PointName };Why use gave nothing: the extension did not declare the handle, or the project did not provide it.
Providedinterfaceno test imports itinterface ProvidedA value the project provides for a handle, made by provide.
| Member | Type | What it is |
|---|---|---|
name | `${string}.${string}` | |
value | unknown |
providefunctionfunction provide<T>(h: Handle<T>, value: T): ProvidedProvides a value for a handle, typed by it.
| Parameter | What it is |
|---|---|
h | the handle |
value | what it gives |
Returns: the provision, frozen