Expose closed module types and define stable presentation occurrences

This commit is contained in:
Timothy J. Aveni
2026-09-25 11:37:27 -07:00
parent a83239892c
commit e0e8563224
5 changed files with 54 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
import type { InterfaceRevision } from "../capability-model/types.js";
/** Public, checked type information for artifact consumers. It describes the
* nominal role, without exposing implementations or synthesizing any storage. */
export function moduleTypeContext(iface: InterfaceRevision): {
typeArguments?: readonly unknown[];
requiredInterfaces?: readonly string[];
} {
return {
...(iface.application?.arguments.length
? {
typeArguments: structuredClone(iface.application.arguments),
}
: {}),
...(iface.requiredInterfaces?.length ? { requiredInterfaces: [...iface.requiredInterfaces].sort() } : {}),
};
}