@@ -18,16 +18,8 @@ import { wrapInescapableCompartment } from './compartment-wrapper.js';
18
18
* @typedef {import('@endo/bundle-source').BundleSourceResult<any> | {moduleFormat: 'test'} } ImportableBundle
19
19
*/
20
20
21
- /**
22
- * importBundle takes the output of `bundleSource` or `bundleTestExports`, and returns a namespace
23
- * object (with .default, and maybe other properties for named exports)
24
- *
25
- * @template [T=any]
26
- * @param {ImportableBundle } bundle
27
- * @param {object } [options]
28
- * @param {object } [powers]
29
- * @returns {Promise<T> }
30
- */
21
+ // Adding a type signature in-place proved difficult to migrate in-place.
22
+ // See typedImportBundle below.
31
23
export async function importBundle ( bundle , options = { } , powers = { } ) {
32
24
await null ;
33
25
const {
@@ -194,6 +186,22 @@ export async function importBundle(bundle, options = {}, powers = {}) {
194
186
}
195
187
}
196
188
189
+ /**
190
+ * typedImportBundle<Expected> takes the output of `bundleSource` or
191
+ * `bundleTestExports`, and returns a namespace object, with .default, and
192
+ * maybe other properties for named exports.
193
+ *
194
+ * This is the intended signature but produces a type that is not suitable
195
+ * in integration with legacy code of Agoric SDK.
196
+ *
197
+ * @template [T=any]
198
+ * @param {ImportableBundle } bundle
199
+ * @param {object } [options]
200
+ * @param {object } [powers]
201
+ * @returns {Promise<T> }
202
+ */
203
+ export const typedImportBundle = importBundle ;
204
+
197
205
/**
198
206
* A utility function for producing test bundles, which are not serializable
199
207
* as JSON or passable.
0 commit comments