refactor(SwingSet): Define SwingSet types as module exported #4729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add "re-exporting" ambient file for backwards compatibility
refs: #4560
Description
types.js
) definitions as being declared in a module file (types-external.js
), requiring them to be explicitly imported for usage, and combine into it the previoustypes-exported.js
(fixing a typo for the type ofDynamicVatOptionsWithoutMeter.vatParameters
)@agoric/swingset-vat/exported.js
file, by being ambient they effectively were made transitively external when someone imported from@agoric/swingset-vat
.types-ambient.js
file which "typedef re-exports" types fromtypes-external.js
type.js
->types-ambient.js
with the following modifications@property
liness/@typedef +\{(?:[^@]|\n)*\} +(\w+)( +[0-9a-zA-Z ]+)?$/@typedef { import('./types-external.js').$1 } $1/
@
in the type definition)Security Considerations
None. Typing only change
Documentation Considerations
The type definitions in
types-external.js
should probably move to being defined closer to the internal API that use the types, and@typedef
ed intypes-external.js
so they can be used by external users throughimport('@agoric/swingset-vat').ExportedType
The
types-ambient.js
should over time shrink into oblivion, with ambient usages replaced by the correspondingimport().Type
Testing Considerations
yarn lint
passing successfully