-
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.
incidental ## Description Migrated from Agoric/agoric-sdk#9011 Define an `EReturn` type for the `Awaited<ReturnType<` pattern. ### Security Considerations none ### Scaling Considerations none ### Documentation Considerations This will appear in TSdoc ### Testing Considerations has tests ### Compatibility Considerations none ### Upgrade Considerations none
- Loading branch information
Showing
8 changed files
with
48 additions
and
35 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
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ export type { | |
ERef, | ||
EProxy, | ||
EOnly, | ||
EReturn, | ||
RemoteFunctions, | ||
LocalRecord, | ||
FilteredKeys, | ||
|
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'; |