From 6f94b6f0fdfffae77f9b403b1d72de250ac5a9db Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 30 Apr 2024 10:07:33 -0700 Subject: [PATCH] refactor: consistent types-ambient --- packages/zoe/exported.js | 6 +++--- packages/zoe/src/contractSupport/ratio.js | 2 +- .../zoe/src/contractSupport/{types.js => types-ambient.js} | 0 packages/zoe/src/{types.js => types-ambient.js} | 0 packages/zoe/src/zoeService/originalZoeSeat.js | 2 +- packages/zoe/src/zoeService/{types.js => types-ambient.js} | 0 packages/zoe/src/zoeService/utils.d.ts | 7 +++---- packages/zoe/src/zoeService/zoeSeat.js | 2 +- packages/zoe/test/unitTests/contractSupport/test-ratio.js | 2 +- packages/zoe/typedoc.json | 4 ++-- 10 files changed, 12 insertions(+), 13 deletions(-) rename packages/zoe/src/contractSupport/{types.js => types-ambient.js} (100%) rename packages/zoe/src/{types.js => types-ambient.js} (100%) rename packages/zoe/src/zoeService/{types.js => types-ambient.js} (100%) diff --git a/packages/zoe/exported.js b/packages/zoe/exported.js index 03fb20ed65f0..e3828978f722 100644 --- a/packages/zoe/exported.js +++ b/packages/zoe/exported.js @@ -1,10 +1,10 @@ // @jessie-check import './src/contractFacet/types-ambient.js'; -import './src/zoeService/types.js'; -import './src/contractSupport/types.js'; +import './src/zoeService/types-ambient.js'; +import './src/contractSupport/types-ambient.js'; import './src/contracts/exported.js'; -import './src/types.js'; +import './src/types-ambient.js'; import './tools/types-ambient.js'; import '@agoric/notifier/exported.js'; import '@agoric/ertp/exported.js'; diff --git a/packages/zoe/src/contractSupport/ratio.js b/packages/zoe/src/contractSupport/ratio.js index f01f259941bb..c4659aa968b2 100644 --- a/packages/zoe/src/contractSupport/ratio.js +++ b/packages/zoe/src/contractSupport/ratio.js @@ -1,4 +1,4 @@ -/// +/// import { q, Fail } from '@agoric/assert'; import { AmountMath } from '@agoric/ertp'; import { assertRecord } from '@endo/marshal'; diff --git a/packages/zoe/src/contractSupport/types.js b/packages/zoe/src/contractSupport/types-ambient.js similarity index 100% rename from packages/zoe/src/contractSupport/types.js rename to packages/zoe/src/contractSupport/types-ambient.js diff --git a/packages/zoe/src/types.js b/packages/zoe/src/types-ambient.js similarity index 100% rename from packages/zoe/src/types.js rename to packages/zoe/src/types-ambient.js diff --git a/packages/zoe/src/zoeService/originalZoeSeat.js b/packages/zoe/src/zoeService/originalZoeSeat.js index 0187d07dcd33..97e4660851d7 100644 --- a/packages/zoe/src/zoeService/originalZoeSeat.js +++ b/packages/zoe/src/zoeService/originalZoeSeat.js @@ -6,7 +6,7 @@ import { deeplyFulfilled } from '@endo/marshal'; import { makePromiseKit } from '@endo/promise-kit'; import { satisfiesWant } from '../contractFacet/offerSafety.js'; -import '../types.js'; +import '../types-ambient.js'; import '../internal-types.js'; import { AmountKeywordRecordShape, diff --git a/packages/zoe/src/zoeService/types.js b/packages/zoe/src/zoeService/types-ambient.js similarity index 100% rename from packages/zoe/src/zoeService/types.js rename to packages/zoe/src/zoeService/types-ambient.js diff --git a/packages/zoe/src/zoeService/utils.d.ts b/packages/zoe/src/zoeService/utils.d.ts index e10f2ad53088..a94b16b491b9 100644 --- a/packages/zoe/src/zoeService/utils.d.ts +++ b/packages/zoe/src/zoeService/utils.d.ts @@ -1,8 +1,7 @@ import type { Callable } from '@agoric/internal/src/utils.js'; import type { VatUpgradeResults } from '@agoric/swingset-vat'; import type { Baggage } from '@agoric/swingset-liveslots'; - -import type { IssuerKeywordRecord, Payment } from './types.js'; +import type { Issuer } from '@agoric/ertp/exported.js'; // XXX https://github.com/Agoric/agoric-sdk/issues/4565 type SourceBundle = Record; @@ -71,7 +70,7 @@ export type ContractOf = StartParams & StartResult; type StartContractInstance = ( installation: Installation, - issuerKeywordRecord?: IssuerKeywordRecord, + issuerKeywordRecord?: Record>, terms?: object, privateArgs?: object, ) => Promise<{ @@ -113,7 +112,7 @@ export type StartedInstanceKit = { */ export type StartInstance = ( installation: Installation | PromiseLike>, - issuerKeywordRecord?: IssuerKeywordRecord, + issuerKeywordRecord?: Record>, // 'brands' and 'issuers' need not be passed in; Zoe provides them as StandardTerms terms?: Omit['terms'], 'brands' | 'issuers'>, privateArgs?: Parameters[1], diff --git a/packages/zoe/src/zoeService/zoeSeat.js b/packages/zoe/src/zoeService/zoeSeat.js index 363932fb89b7..688dcbb6a52d 100644 --- a/packages/zoe/src/zoeService/zoeSeat.js +++ b/packages/zoe/src/zoeService/zoeSeat.js @@ -6,7 +6,7 @@ import { deeplyFulfilled } from '@endo/marshal'; import { makePromiseKit } from '@endo/promise-kit'; import { satisfiesWant } from '../contractFacet/offerSafety.js'; -import '../types.js'; +import '../types-ambient.js'; import '../internal-types.js'; import { declareOldZoeSeatAdminKind, diff --git a/packages/zoe/test/unitTests/contractSupport/test-ratio.js b/packages/zoe/test/unitTests/contractSupport/test-ratio.js index f229f19e2a22..69a3febe1b6a 100644 --- a/packages/zoe/test/unitTests/contractSupport/test-ratio.js +++ b/packages/zoe/test/unitTests/contractSupport/test-ratio.js @@ -1,6 +1,6 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; -import '../../../src/contractSupport/types.js'; +import '../../../src/contractSupport/types-ambient.js'; import { makeIssuerKit, AmountMath } from '@agoric/ertp'; import { diff --git a/packages/zoe/typedoc.json b/packages/zoe/typedoc.json index e5a2997cfc2d..bdab322c101c 100644 --- a/packages/zoe/typedoc.json +++ b/packages/zoe/typedoc.json @@ -6,9 +6,9 @@ "src/contractFacet/internal-types.js", "src/contractFacet/types-ambient.d.ts", "src/contractSupport/index.js", - "src/contractSupport/types.js", + "src/contractSupport/types-ambient.js", "src/types.js", - "src/zoeService/types.js", + "src/zoeService/types-ambient.js", "src/zoeService/utils.d.ts", "src/zoeService/zoe.js", "tools/internal-types.js",