Optionaloptions: FarClassOptions<ClassContext<{}, M>>Create a singleton exo object whose methods are type-checked against the InterfaceGuard at compile time.
When a typed InterfaceGuard is provided (built with M.call(...).returns(...)),
the methods parameter is constrained to match the guard's inferred method
signatures at compile time. The return type is derived from the concrete
methods argument (not the guard), so narrower implementations are preserved.
const FooI = M.interface('Foo', {
bar: M.call(M.string()).returns(M.nat()),
});
const foo = makeExo('Foo', FooI, {
bar(name) { // name: string — inferred from guard
return 0n; // must return bigint — enforced by guard
},
});
Optionaloptions: FarClassOptions<ClassContext<{}, M>>
Create a singleton exo object whose methods are type-checked against the InterfaceGuard at compile time.
When a typed InterfaceGuard is provided (built with
M.call(...).returns(...)), themethodsparameter is constrained to match the guard's inferred method signatures at compile time. The return type is derived from the concretemethodsargument (not the guard), so narrower implementations are preserved.