diff --git a/packages/bundle-source/demo/comments/types.js b/packages/bundle-source/demo/comments/types.js
index 858ff01edf..febf1775b1 100644
--- a/packages/bundle-source/demo/comments/types.js
+++ b/packages/bundle-source/demo/comments/types.js
@@ -1 +1 @@
-/** @typedef {import('./types.js').Bogus} Bogus */
+/** @import {Bogus} from './types.js' */
diff --git a/packages/captp/src/captp.js b/packages/captp/src/captp.js
index db6033b0f8..fdf527a08e 100644
--- a/packages/captp/src/captp.js
+++ b/packages/captp/src/captp.js
@@ -1,8 +1,6 @@
///
-/** @template [R=unknown] @typedef {import('@endo/eventual-send').Settler} Settler */
-/** @template [R=unknown] @typedef {import('@endo/eventual-send').HandledExecutor} HandledExecutor */
-/** @template [R=unknown] @typedef {import('@endo/eventual-send').RemoteKit} RemoteKit */
+/** @import {RemoteKit, Settler} from '@endo/eventual-send' */
// Your app may need to `import '@endo/eventual-send/shim.js'` to get HandledPromise
@@ -804,7 +802,7 @@ export const makeCapTP = (
serialize,
unserialize,
makeTrapHandler,
- Trap: /** @type {import('./types.js').Trap | undefined} */ (undefined),
+ Trap: /** @type {import('./ts-types.js').Trap | undefined} */ (undefined),
};
if (trapGuest) {
diff --git a/packages/captp/src/loopback.js b/packages/captp/src/loopback.js
index c29c5a3561..7726fba055 100644
--- a/packages/captp/src/loopback.js
+++ b/packages/captp/src/loopback.js
@@ -5,10 +5,7 @@ import { makeFinalizingMap } from './finalize.js';
export { E };
-/**
- * @template T
- * @typedef {import('@endo/eventual-send').ERef} ERef
- */
+/** @import {ERef} from '@endo/eventual-send' */
/**
* Create an async-isolated channel to an object.
diff --git a/packages/captp/src/trap.js b/packages/captp/src/trap.js
index db789935d6..5b7c81afda 100644
--- a/packages/captp/src/trap.js
+++ b/packages/captp/src/trap.js
@@ -58,7 +58,7 @@ const TrapProxyHandler = (x, trapImpl) => {
/**
* @param {import('./types.js').TrapImpl} trapImpl
- * @returns {Trap}
+ * @returns {import('./ts-types.js').Trap}
*/
export const makeTrap = trapImpl => {
const Trap = x => {
diff --git a/packages/captp/src/types.js b/packages/captp/src/types.js
index aa68b83103..ff22ce4e18 100644
--- a/packages/captp/src/types.js
+++ b/packages/captp/src/types.js
@@ -47,10 +47,3 @@ export {};
* @returns {AsyncIterator | undefined} If an AsyncIterator is
* returned, it will satisfy a future guest IterationObserver.
*/
-
-/** @typedef {import('./ts-types.js').Trap} Trap */
-
-/**
- * @template T
- * @typedef {import('./ts-types').TrapHandler} TrapHandler
- */
diff --git a/packages/compartment-mapper/src/import-archive.js b/packages/compartment-mapper/src/import-archive.js
index 5eeffd8065..0b5644e7d2 100644
--- a/packages/compartment-mapper/src/import-archive.js
+++ b/packages/compartment-mapper/src/import-archive.js
@@ -15,6 +15,9 @@ import { assertCompartmentMap } from './compartment-map.js';
import { exitModuleImportHookMaker } from './import-hook.js';
import { attenuateModuleHook, enforceModulePolicy } from './policy.js';
+/** @import {StaticModuleType} from 'ses' */
+/** @import {Application, CompartmentDescriptor, ComputeSourceLocationHook, ComputeSourceMapLocationHook, ExecuteFn, ExecuteOptions, ExitModuleImportHook, HashFn, ImportHookMaker, LoadArchiveOptions, ParserImplementation, ReadPowers} from './types.js' */
+
const DefaultCompartment = Compartment;
const { Fail, quote: q } = assert;
@@ -23,7 +26,7 @@ const textDecoder = new TextDecoder();
const { freeze } = Object;
-/** @type {Record} */
+/** @type {Record} */
const parserForLanguage = {
'pre-cjs-json': parserPreCjs,
'pre-mjs-json': parserPreMjs,
@@ -34,7 +37,7 @@ const parserForLanguage = {
/**
* @param {string} errorMessage - error to throw on execute
- * @returns {import('./types.js').StaticModuleType}
+ * @returns {StaticModuleType}
*/
const postponeErrorToExecute = errorMessage => {
// Return a place-holder that'd throw an error if executed
@@ -55,13 +58,13 @@ const postponeErrorToExecute = errorMessage => {
/**
* @param {(path: string) => Uint8Array} get
- * @param {Record} compartments
+ * @param {Record} compartments
* @param {string} archiveLocation
- * @param {import('./types.js').HashFn} [computeSha512]
- * @param {import('./types.js').ComputeSourceLocationHook} [computeSourceLocation]
- * @param {import('./types.js').ExitModuleImportHook} [exitModuleImportHook]
- * @param {import('./types.js').ComputeSourceMapLocationHook} [computeSourceMapLocation]
- * @returns {import('./types.js').ImportHookMaker}
+ * @param {HashFn} [computeSha512]
+ * @param {ComputeSourceLocationHook} [computeSourceLocation]
+ * @param {ExitModuleImportHook} [exitModuleImportHook]
+ * @param {ComputeSourceMapLocationHook} [computeSourceMapLocation]
+ * @returns {ImportHookMaker}
*/
const makeArchiveImportHookMaker = (
get,
@@ -73,7 +76,7 @@ const makeArchiveImportHookMaker = (
computeSourceMapLocation = undefined,
) => {
// per-assembly:
- /** @type {import('./types.js').ImportHookMaker} */
+ /** @type {ImportHookMaker} */
const makeImportHook = ({
packageLocation,
packageName,
@@ -244,13 +247,13 @@ const makeFauxModuleExportsNamespace = Compartment => {
* @param {string} [archiveLocation]
* @param {object} [options]
* @param {string} [options.expectedSha512]
- * @param {import('./types.js').HashFn} [options.computeSha512]
+ * @param {HashFn} [options.computeSha512]
* @param {Record} [options.modules]
- * @param {import('./types.js').ExitModuleImportHook} [options.importHook]
+ * @param {ExitModuleImportHook} [options.importHook]
* @param {CompartmentConstructor} [options.Compartment]
- * @param {import('./types.js').ComputeSourceLocationHook} [options.computeSourceLocation]
- * @param {import('./types.js').ComputeSourceMapLocationHook} [options.computeSourceMapLocation]
- * @returns {Promise}
+ * @param {ComputeSourceLocationHook} [options.computeSourceLocation]
+ * @param {ComputeSourceMapLocationHook} [options.computeSourceMapLocation]
+ * @returns {Promise}
*/
export const parseArchive = async (
archiveBytes,
@@ -356,7 +359,7 @@ export const parseArchive = async (
)}`;
}
- /** @type {import('./types.js').ExecuteFn} */
+ /** @type {ExecuteFn} */
const execute = async options => {
const {
globals,
@@ -400,10 +403,10 @@ export const parseArchive = async (
};
/**
- * @param {import('./types.js').ReadFn | import('./types.js').ReadPowers} readPowers
+ * @param {import('@endo/zip').ReadFn | ReadPowers} readPowers
* @param {string} archiveLocation
- * @param {import('./types.js').LoadArchiveOptions} [options]
- * @returns {Promise}
+ * @param {LoadArchiveOptions} [options]
+ * @returns {Promise}
*/
export const loadArchive = async (
readPowers,
@@ -428,9 +431,9 @@ export const loadArchive = async (
};
/**
- * @param {import('./types.js').ReadFn | import('./types.js').ReadPowers} readPowers
+ * @param {import('@endo/zip').ReadFn | ReadPowers} readPowers
* @param {string} archiveLocation
- * @param {import('./types.js').ExecuteOptions & import('./types.js').LoadArchiveOptions} options
+ * @param {ExecuteOptions & LoadArchiveOptions} options
* @returns {Promise