Skip to content

Commit

Permalink
chore(types): clean up ambients/references
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed May 15, 2024
1 parent afe6bd7 commit 981a46c
Show file tree
Hide file tree
Showing 37 changed files with 15 additions and 108 deletions.
4 changes: 1 addition & 3 deletions packages/ERTP/src/paymentLedger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @jessie-check
/// <reference types="@agoric/store/exported.js" />

/* eslint-disable no-use-before-define */
import { isPromise } from '@endo/promise-kit';
Expand All @@ -7,9 +8,6 @@ import { AmountMath } from './amountMath.js';
import { preparePaymentKind } from './payment.js';
import { preparePurseKind } from './purse.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/store/exported.js';

import { BrandI, makeIssuerInterfaces } from './typeGuards.js';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
insistVatDeliveryResult,
} from '../../lib/message.js';

/// <reference path="../../types-ambient.js" />

/**
* @import {VatDeliveryObject} from '@agoric/swingset-liveslots'
* @import {VatDeliveryResult} from '@agoric/swingset-liveslots'
Expand Down
4 changes: 0 additions & 4 deletions packages/agoric-cli/src/init.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import chalk from 'chalk';
import { makePspawn } from './helpers.js';

/// <reference types="@endo/captp/src/types.js" />
/// <reference types="@agoric/swingset-vat/exported.js" />
/// <reference types="@agoric/network/exported.js" />

// Use either an absolute template URL, or find it relative to DAPP_URL_BASE.
const gitURL = (relativeOrAbsoluteURL, base) => {
const url = new URL(relativeOrAbsoluteURL, base);
Expand Down
4 changes: 1 addition & 3 deletions packages/base-zone/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// @jessie-check

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/store/exported.js';
/// <reference types="@agoric/store/exported.js" />

// eslint-disable-next-line import/export
export * from './exports.js';
Expand Down
6 changes: 0 additions & 6 deletions packages/benchmark/src/benchmarkerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import fs from 'node:fs';
import '@endo/init/pre-bundle-source.js';
import '@endo/init';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/vats/exported.js';
import '@agoric/inter-protocol/exported.js';
import '@agoric/zoe/exported.js';
import '@agoric/cosmic-swingset/src/launch-chain.js';

import { Fail } from '@agoric/assert';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import { makeAgoricNamesRemotesFromFakeStorage } from '@agoric/vats/tools/board-utils.js';
Expand Down
3 changes: 0 additions & 3 deletions packages/boot/test/bootstrapTests/zcfProbe.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/zoe/exported.js';

import { makeTracer } from '@agoric/internal';
import { E } from '@endo/far';
import {
Expand Down
3 changes: 0 additions & 3 deletions packages/boot/tools/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import { loadSwingsetConfigFile } from '@agoric/swingset-vat';
import { makeSlogSender } from '@agoric/telemetry';
import { TimeMath, Timestamp } from '@agoric/time';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/vats/exported.js';

import {
boardSlottingMarshaller,
slotToBoardRemote,
Expand Down
4 changes: 1 addition & 3 deletions packages/cache/src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// @jessie-check

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/internal/exported.js';
/// <reference types="@agoric/internal/exported" />

// eslint-disable-next-line import/export
export * from './types.js';
Expand Down
2 changes: 0 additions & 2 deletions packages/deploy-script-support/src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// @ts-check

/// <reference path="../../zoe/exported.js" />

import { E } from '@endo/far';
import bundleSource from '@endo/bundle-source';

Expand Down
7 changes: 3 additions & 4 deletions packages/governance/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/// <reference types="@agoric/internal/exported.js" />
/// <reference types="@agoric/ERTP/exported.js" />

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/internal/exported.js';
import '@agoric/ertp/exported.js';
import '@agoric/zoe/exported.js';

/// <reference path="./types-ambient.js" />

export {
ChoiceMethod,
ElectionType,
Expand Down
3 changes: 0 additions & 3 deletions packages/governance/test/unitTests/binaryballotCount.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/zoe/exported.js';

import { E } from '@endo/eventual-send';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { makeHandle } from '@agoric/zoe/src/makeHandle.js';
Expand Down
3 changes: 0 additions & 3 deletions packages/governance/test/unitTests/committee.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/zoe/exported.js';

import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.js';
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
Expand Down
6 changes: 0 additions & 6 deletions packages/inter-protocol/src/auction/auctionBook.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/internal/exported.js';
import '@agoric/governance/exported.js';
import '@agoric/zoe/exported.js';
import '@agoric/zoe/src/contracts/exported.js';

import { AmountMath, RatioShape } from '@agoric/ertp';
import { mustMatch } from '@agoric/store';
import { M, prepareExoClassKit } from '@agoric/vat-data';
Expand Down
5 changes: 0 additions & 5 deletions packages/inter-protocol/src/psm/psm.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// @jessie-check

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/governance/exported.js';
import '@agoric/zoe/exported.js';
import '@agoric/zoe/src/contracts/exported.js';

import { AmountMath, AmountShape, BrandShape, RatioShape } from '@agoric/ertp';
import {
CONTRACT_ELECTORATE,
Expand Down
3 changes: 0 additions & 3 deletions packages/inter-protocol/src/vaultFactory/burn.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// @jessie-check

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/zoe/exported.js';

import { E } from '@endo/eventual-send';

/**
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/src/vaultFactory/type-imports.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @jessie-check

import '@agoric/zoe/exported.js';
/// <reference path="./types.js" />
3 changes: 0 additions & 3 deletions packages/inter-protocol/src/vaultFactory/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import { calculateCurrentDebt, reverseInterest } from '../interest-math.js';
import { calculateDebtCosts } from './math.js';
import { prepareVaultKit } from './vaultKit.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/zoe/exported.js';

const { quote: q, Fail } = assert;

const trace = makeTracer('Vault', true);
Expand Down
5 changes: 0 additions & 5 deletions packages/inter-protocol/src/vaultFactory/vaultFactory.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// @jessie-check

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/governance/exported.js';
import '@agoric/zoe/exported.js';
import '@agoric/zoe/src/contracts/exported.js';

// The vaultFactory owns a number of VaultManagers and a mint for Minted.
//
// addVaultType is a closely held method that adds a brand new collateral type.
Expand Down
2 changes: 1 addition & 1 deletion packages/network/src/network.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
/// <reference path="./types.js" />

import { E } from '@endo/far';
import { M } from '@endo/patterns';
Expand All @@ -7,7 +8,6 @@ import { toBytes } from './bytes.js';
import { Shape } from './shapes.js';

import '@agoric/store/exported.js';
/// <reference path="./types.js" />
/**
* @import {AttemptDescription, Bytes, Closable, CloseReason, Connection, ConnectionHandler, Endpoint, ListenHandler, Port, Protocol, ProtocolHandler, ProtocolImpl} from './types.js';
*/
Expand Down
6 changes: 3 additions & 3 deletions packages/network/src/router.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// @ts-check
/// <reference path="./types.js" />
/// <reference types="@agoric/store/exported.js" />

import { E as defaultE } from '@endo/far';
import { M } from '@endo/patterns';
import { Fail } from '@agoric/assert';
import { ENDPOINT_SEPARATOR, prepareNetworkProtocol } from './network.js';
import { Shape } from './shapes.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/store/exported.js';
/// <reference path="./types.js" />
/**
* @import {AttemptDescription, Bytes, Closable, CloseReason, Connection, ConnectionHandler, Endpoint, ListenHandler, Port, Protocol, ProtocolHandler, ProtocolImpl} from './types.js';
* @import {PromiseVow, Remote, VowKit, VowResolver, VowTools} from '@agoric/vow';
Expand Down
3 changes: 1 addition & 2 deletions packages/notifier/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @jessie-check

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/internal/exported.js';
/// <reference types="@agoric/internal/exported.js" />

export {
makePublishKit,
Expand Down
3 changes: 0 additions & 3 deletions packages/orchestration/src/exos/chainAccountKit.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/** @file ChainAccount exo */

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/network/exported.js';

import { NonNullish } from '@agoric/assert';
import { makeTracer } from '@agoric/internal';
import { V as E } from '@agoric/vow/vat.js';
Expand Down
3 changes: 0 additions & 3 deletions packages/orchestration/src/service.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/** @file Orchestration service */

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/network/exported.js';

import { V as E } from '@agoric/vow/vat.js';
import { M } from '@endo/patterns';
import { Shape as NetworkShape } from '@agoric/network';
Expand Down
3 changes: 0 additions & 3 deletions packages/smart-wallet/src/invitations.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { InvitationHandleShape } from '@agoric/zoe/src/typeGuards.js';
import { E } from '@endo/far';
import { shape } from './typeGuards.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/zoe/exported.js';

const { Fail } = assert;

// A safety limit
Expand Down
3 changes: 0 additions & 3 deletions packages/smart-wallet/src/offers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/zoe/src/zoeService/types-ambient.js';

/**
* @typedef {number | string} OfferId
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import { E } from '@endo/far';
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/vats/src/core/types-ambient.js';

/**
* @param {BootstrapPowers & ChainBootstrapSpace} powers
* @param {object} options
Expand Down
3 changes: 0 additions & 3 deletions packages/smart-wallet/src/smartWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ import { shape } from './typeGuards.js';
import { objectMapStoragePath } from './utils.js';
import { prepareOfferWatcher, watchOfferOutcomes } from './offerWatcher.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/zoe/exported.js';

const { Fail, quote: q } = assert;

const trace = makeTracer('SmrtWlt');
Expand Down
4 changes: 0 additions & 4 deletions packages/smart-wallet/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import { deeplyFulfilledObject, objectMap, makeTracer } from '@agoric/internal';
import { observeIteration, subscribeEach } from '@agoric/notifier';
import { E } from '@endo/far';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/internal/exported.js';
import '@agoric/notifier/exported.js';

export const NO_SMART_WALLET_ERROR = 'no smart wallet';

const trace = makeTracer('WUTIL', false);
Expand Down
3 changes: 1 addition & 2 deletions packages/swingset-liveslots/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/store/exported.js';
/// <reference types="@agoric/store/exported.js" />

/* eslint-disable import/export -- types files have no named runtime exports */
export { makeLiveSlots, makeMarshaller } from './liveslots.js';
Expand Down
2 changes: 0 additions & 2 deletions packages/time/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import type { ERef, RemotableBrand } from '@endo/eventual-send';

import type { RankComparison, RemotableObject } from '@endo/marshal';

/// <reference types="@agoric/notifier/src/types.js"/>

// These aren't in the global runtime environment. They are just types that are
// meant to be globally accessible as a side-effect of importing this module.
/**
Expand Down
1 change: 0 additions & 1 deletion packages/vats/src/nameHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { E } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { M, getInterfaceGuardPayload } from '@endo/patterns';

/// <reference path="./types.js" />
import {
makeSyncMethodCallback,
prepareGuardedAttenuator,
Expand Down
1 change: 0 additions & 1 deletion packages/wallet/api/src/lib-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import '@agoric/store/exported.js';
import '@agoric/zoe/exported.js';

import './internal-types.js';
/// <reference path="./types.js" />

// does nothing
const noActionStateChangeHandler = _newState => {};
Expand Down
3 changes: 0 additions & 3 deletions packages/zoe/src/contractFacet/zcfZygote.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ import { createSeatManager } from './zcfSeat.js';
import { HandleOfferI, InvitationHandleShape } from '../typeGuards.js';
import { prepareZcMint } from './zcfMint.js';

/// <reference path="../internal-types.js" />
/// <reference path="./internal-types.js" />

/** @import {IssuerOptionsRecord} from '@agoric/ertp' */

const { Fail } = assert;
Expand Down
1 change: 1 addition & 0 deletions packages/zoe/src/internal-types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @jessie-check
/// <reference types="@agoric/notifier/exported.js" />

/**
* @typedef {object} SeatData
Expand Down
1 change: 0 additions & 1 deletion packages/zoe/src/zoeService/escrowStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { q, Fail } from '@agoric/assert';
import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
import { provideDurableWeakMapStore } from '@agoric/vat-data';

/// <reference path="./types.js" />
import './internal-types.js';

import { cleanKeywords } from '../cleanProposal.js';
Expand Down
6 changes: 0 additions & 6 deletions packages/zoe/src/zoeService/zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
* validate that.
*/

/// <reference path="../internal-types.js" />

import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { makeScalarBigMapStore, prepareExo } from '@agoric/vat-data';
Expand All @@ -26,10 +24,6 @@ import { getZcfBundleCap } from './createZCFVat.js';
import { defaultFeeIssuerConfig, prepareFeeMint } from './feeMint.js';
import { ZoeServiceI } from '../typeGuards.js';

// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
import '@agoric/internal/exported.js';
import '@agoric/notifier/exported.js';

/** @import {Baggage} from '@agoric/vat-data' */

const { Fail } = assert;
Expand Down
4 changes: 2 additions & 2 deletions packages/zoe/src/zoeService/zoeStorageManager.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference path="./internal-types.js" />

import { E } from '@endo/far';
import {
AssetKind,
Expand All @@ -21,8 +23,6 @@ import { prepareInvitationKit } from './makeInvitation.js';
import { makeInstanceAdminStorage } from './instanceAdminStorage.js';
import { makeInstallationStorage } from './installationStorage.js';

/// <reference path="./types.js" />
import './internal-types.js';
import {
InstanceStorageManagerIKit,
ZoeMintI,
Expand Down

0 comments on commit 981a46c

Please sign in to comment.