-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(far): deduplicate types from
eventual-send
by aliasing
- Loading branch information
1 parent
b8c2107
commit 43e4d43
Showing
4 changed files
with
16 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { FarRef, ERef, EOnly, EReturn } from '@endo/eventual-send'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Just a dummy to use exports.d.ts and satisfy runtime imports. | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,5 @@ | ||
export { E } from '@endo/eventual-send'; | ||
export { Far, getInterfaceOf, passStyleOf } from '@endo/pass-style'; | ||
|
||
// TODO re-export from eventual-send, may require .d.ts | ||
/** | ||
* @template Primary | ||
* @template [Local=import('@endo/eventual-send').DataOnly<Primary>] | ||
* @typedef {import('@endo/eventual-send').FarRef<Primary, Local>} FarRef | ||
* Declare an object that is potentially a far reference of type Primary whose | ||
* auxilliary data has type Local. This should be used only for consumers of | ||
* Far objects in arguments and declarations; the only creators of Far objects | ||
* are distributed object creator components like the `Far` or `Remotable` | ||
* functions. | ||
*/ | ||
|
||
/** | ||
* @template T | ||
* @typedef {import('@endo/eventual-send').ERef<T>} ERef | ||
* Declare that `T` may or may not be a Promise. This should be used only for | ||
* consumers of arguments and declarations; return values should specifically be | ||
* `Promise<T>` or `T` itself. | ||
*/ | ||
|
||
/** | ||
* @template T | ||
* @typedef {import('@endo/eventual-send').EOnly<T>} EOnly | ||
* Declare a near object that must only be invoked with E, even locally. It | ||
* supports the `T` interface but additionally permits `T`'s methods to return | ||
* `PromiseLike`s even if `T` declares them as only synchronous. | ||
*/ | ||
// eslint-disable-next-line import/export | ||
export * from './exports.js'; |