Files
quixos-protocol/src/execution-world/module-contracts.ts
T

18 lines
656 B
TypeScript
Raw Normal View History

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() } : {}),
};
}