Expose closed module types and define stable presentation occurrences
This commit is contained in:
@@ -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() } : {}),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user