Skip to content

Commit

Permalink
chore(types): remotables
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed May 6, 2024
1 parent d43ecbc commit e5df4b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
15 changes: 12 additions & 3 deletions packages/network/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
// Ensure this is a module.
export {};

/** @import {PromiseVow, Remote} from '@agoric/vow' */
/**
* @import {Passable, RemotableObject} from '@endo/pass-style';
* @import {PromiseVow, Remote} from '@agoric/vow';
*/

/**
* @template {import('@endo/exo').Methods} M
Expand All @@ -22,9 +25,12 @@ export {};
*/

/**
* @typedef {object} Closable A closable object
* @typedef {object} ClosableI A closable object
* @property {() => PromiseVow<void>} close Terminate the object
*/
/**
* @typedef {RemotableObject & ClosableI} Closable
*/

/**
* @typedef {object} Protocol The network Protocol
Expand Down Expand Up @@ -73,7 +79,7 @@ export {};
*/

/**
* @typedef {object} Connection
* @typedef {object} ConnectionI
* @property {(
* packetBytes: Bytes,
* opts?: Record<string, any>,
Expand All @@ -84,6 +90,9 @@ export {};
* connection
* @property {() => Endpoint} getRemoteAddress Get the name of the counterparty
*/
/**
* @typedef {RemotableObject & ConnectionI} Connection
*/

/**
* @typedef {object} ConnectionHandler A handler for a given Connection
Expand Down
7 changes: 6 additions & 1 deletion packages/vow/src/types.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// @ts-check
export {};

/**
* @import {Passable, RemotableObject} from '@endo/pass-style';
* @import {PromiseVow, Remote} from '@agoric/vow';
*/

/** @typedef {(...args: any[]) => any} Callable */

/**
Expand Down Expand Up @@ -77,7 +82,7 @@ export {};
/**
* @template [T=any]
* @typedef {object} VowPayload
* @property {Remote<VowV0<T>>} vowV0
* @property {RemotableObject & Remote<VowV0<T>>} vowV0
*/

/**
Expand Down

0 comments on commit e5df4b5

Please sign in to comment.