From 21cc42ca418fff01cf51fdbc99bc181b0e65a1b1 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 25 Sep 2024 14:50:43 -0700 Subject: [PATCH] chore(types): types-index internal --- packages/boot/test/bootstrapTests/ibcClientMock.js | 3 ++- packages/internal/src/index.js | 2 +- packages/internal/src/types-index.d.ts | 1 + packages/internal/src/{types.js => types-index.js} | 0 packages/internal/src/{types.d.ts => types.ts} | 3 ++- packages/vow/src/index.js | 3 --- packages/vow/src/types-index.d.ts | 3 +++ 7 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 packages/internal/src/types-index.d.ts rename packages/internal/src/{types.js => types-index.js} (100%) rename packages/internal/src/{types.d.ts => types.ts} (96%) diff --git a/packages/boot/test/bootstrapTests/ibcClientMock.js b/packages/boot/test/bootstrapTests/ibcClientMock.js index d25e0d2017a..2966743698f 100644 --- a/packages/boot/test/bootstrapTests/ibcClientMock.js +++ b/packages/boot/test/bootstrapTests/ibcClientMock.js @@ -5,7 +5,8 @@ import { heapVowE as E } from '@agoric/vow/vat.js'; /** * @import {Connection, PortAllocator} from '@agoric/network'; - * @import {FarRef, ERef} from '@agoric/vow'; + * @import {FarRef} from '@agoric/internal'; + * @import {ERef} from '@agoric/vow'; */ /** diff --git a/packages/internal/src/index.js b/packages/internal/src/index.js index 536d8ffa125..457c35502e3 100644 --- a/packages/internal/src/index.js +++ b/packages/internal/src/index.js @@ -11,7 +11,7 @@ export * from './typeCheck.js'; export * from './typeGuards.js'; // eslint-disable-next-line import/export -- just types -export * from './types.js'; +export * from './types-index.js'; export { objectMap } from '@endo/common/object-map.js'; export { objectMetaMap } from '@endo/common/object-meta-map.js'; diff --git a/packages/internal/src/types-index.d.ts b/packages/internal/src/types-index.d.ts new file mode 100644 index 00000000000..d4702960d54 --- /dev/null +++ b/packages/internal/src/types-index.d.ts @@ -0,0 +1 @@ +export * from './types.js'; diff --git a/packages/internal/src/types.js b/packages/internal/src/types-index.js similarity index 100% rename from packages/internal/src/types.js rename to packages/internal/src/types-index.js diff --git a/packages/internal/src/types.d.ts b/packages/internal/src/types.ts similarity index 96% rename from packages/internal/src/types.d.ts rename to packages/internal/src/types.ts index a91602bf1f4..54d13d2d509 100644 --- a/packages/internal/src/types.d.ts +++ b/packages/internal/src/types.ts @@ -1,6 +1,7 @@ /* eslint-disable max-classes-per-file */ import type { ERef, RemotableBrand } from '@endo/eventual-send'; import type { Primitive } from '@endo/pass-style'; +import type { Pattern } from '@endo/patterns'; import type { Callable } from './utils.js'; /** @@ -11,7 +12,7 @@ export type TotalMap = Omit, 'get'> & { /** Returns the element associated with the specified key in the TotalMap. */ get: (key: K) => V; }; -export type TotalMapFrom = +export type TotalMapFrom> = M extends Map ? TotalMap : never; export declare class Callback any> { diff --git a/packages/vow/src/index.js b/packages/vow/src/index.js index ebbe635f3e9..2c5348e2a12 100644 --- a/packages/vow/src/index.js +++ b/packages/vow/src/index.js @@ -8,6 +8,3 @@ export { VowShape, toPassableCap } from './vow-utils.js'; // eslint-disable-next-line import/export export * from './types-index.js'; - -// XXX re-exporting the Remote type for back-compat -export * from '@agoric/internal/src/types.js'; diff --git a/packages/vow/src/types-index.d.ts b/packages/vow/src/types-index.d.ts index 0e98a59385a..7c8123e0792 100644 --- a/packages/vow/src/types-index.d.ts +++ b/packages/vow/src/types-index.d.ts @@ -1,2 +1,5 @@ // Export all the types this package provides export * from './types.js'; + +// XXX re-exporting the Remote type for back-compat +export { Remote } from '@agoric/internal/src/types.js';