Skip to content

Commit 4c254ba

Browse files
committed
chore(exo): Narrow the empty-state typing for makeExo
1 parent b341bd7 commit 4c254ba

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/exo/src/exo-makers.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const makeSelf = (proto, instanceCount) => {
3232
return harden(self);
3333
};
3434

35+
/** @type {Record<PropertyKey, never>} */
3536
const emptyRecord = harden({});
3637

3738
/**
@@ -40,8 +41,6 @@ const emptyRecord = harden({});
4041
* state record of the (virtual/durable) instances of the kind/exoClass
4142
* should be empty, and that the returned maker function should have zero
4243
* parameters.
43-
*
44-
* @returns {{}}
4544
*/
4645
export const initEmpty = () => emptyRecord;
4746

@@ -218,12 +217,14 @@ export const defineExoClassKit = (
218217
harden(defineExoClassKit);
219218

220219
/**
220+
* Return a singleton instance of an internal ExoClass with no state fields.
221+
*
221222
* @template {Methods} M
222223
* @param {string} tag
223224
* @param {import('@endo/patterns').InterfaceGuard<{
224225
* [K in keyof M]: import('@endo/patterns').MethodGuard
225226
* }> | undefined} interfaceGuard CAVEAT: static typing does not yet support `callWhen` transformation
226-
* @param {ExoClassMethods<M, () => Record<PropertyKey, never>>} methods
227+
* @param {ExoClassMethods<M, typeof initEmpty>} methods
227228
* @param {FarClassOptions<import('./types.js').ClassContext<{}, M>>} [options]
228229
* @returns {Guarded<M>}
229230
*/

0 commit comments

Comments
 (0)