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 16, 2024
1 parent 6d5d1ba commit a925bba
Show file tree
Hide file tree
Showing 61 changed files with 15 additions and 140 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import '@agoric/zoe/exported.js';
import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
import { makeRatio } from '@agoric/zoe/src/contractSupport/index.js';

Expand Down
1 change: 0 additions & 1 deletion packages/governance/test/unitTests/paramGovernance.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { makeMockChainStorageRoot } from '@agoric/internal/src/storage-test-utils.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
1 change: 0 additions & 1 deletion packages/inter-protocol/src/auction/auctioneer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '@agoric/governance/exported.js';
import '@agoric/zoe/exported.js';
import '@agoric/zoe/src/contracts/exported.js';

import { AmountMath, AmountShape, BrandShape } from '@agoric/ertp';
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/src/econCommitteeCharter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import '@agoric/governance/exported.js';
import { M, mustMatch } from '@agoric/store';
import { TimestampShape } from '@agoric/time';
import { prepareExo, provideDurableMapStore } from '@agoric/vat-data';
import '@agoric/zoe/exported.js';
import '@agoric/zoe/src/contracts/exported.js';
import {
InstallationShape,
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
4 changes: 0 additions & 4 deletions packages/inter-protocol/src/vaultFactory/type-imports.js

This file was deleted.

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
1 change: 0 additions & 1 deletion packages/inter-protocol/src/vaultFactory/vaultDirector.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import '@agoric/zoe/src/contracts/exported.js';

import '@agoric/governance/exported.js';
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: 0 additions & 2 deletions packages/inter-protocol/src/vaultFactory/vaultKit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// @jessie-check

import '@agoric/zoe/exported.js';

import { makeTracer } from '@agoric/internal';
import { prepareVaultHolder } from './vaultHolder.js';

Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/src/vaultFactory/vaultManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* liquidated. If the auction is unsuccessful, the liquidation may be
* reverted.
*/
import '@agoric/zoe/exported.js';

import {
AmountMath,
Expand Down
2 changes: 0 additions & 2 deletions packages/inter-protocol/test/auction/auctionContract.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import '@agoric/zoe/exported.js';

import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import { documentStorageSchema } from '@agoric/governance/tools/storageDoc.js';
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
Expand Down
2 changes: 0 additions & 2 deletions packages/inter-protocol/test/auction/proportionalDist.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import '@agoric/zoe/exported.js';

import { makeIssuerKit } from '@agoric/ertp';
import { makeTracer } from '@agoric/internal';

Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/test/auction/scheduleMath.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { TimeMath } from '@agoric/time';
import { Far } from '@endo/marshal';
import '@agoric/zoe/exported.js';

import { NonNullish } from '@agoric/assert';
import {
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/test/interest-labeled.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import '@agoric/zoe/exported.js';

import { makeIssuerKit } from '@agoric/ertp';
import { makeRatio } from '@agoric/zoe/src/contractSupport/ratio.js';
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/test/interest.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import '@agoric/zoe/exported.js';

import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
import {
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/test/psm/psm.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import '@agoric/zoe/exported.js';
import '../../src/vaultFactory/types-ambient.js';

import { AmountMath, makeIssuerKit } from '@agoric/ertp';
Expand Down
2 changes: 0 additions & 2 deletions packages/inter-protocol/test/vaultFactory/driver.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '@agoric/zoe/exported.js';

import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
import { allValues, makeTracer, objectMap } from '@agoric/internal';
import { makeNotifierFromSubscriber } from '@agoric/notifier';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { AmountMath, makeIssuerKit } from '@agoric/ertp';
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/test/vaultFactory/proceeds.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { makeIssuerKit } from '@agoric/ertp';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { AmountMath, makeIssuerKit } from '@agoric/ertp';
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/test/vaultFactory/storage.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { makeTracer } from '@agoric/internal';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import '@agoric/zoe/exported.js';

import { E } from '@endo/eventual-send';
import { setUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/test/vaultFactory/vault.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { setUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '@agoric/zoe/exported.js';

import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
import { makeNotifierFromSubscriber } from '@agoric/notifier';
import { makeRatio } from '@agoric/zoe/src/contractSupport/index.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@agoric/zoe/exported.js';
import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { AmountMath, makeIssuerKit } from '@agoric/ertp';
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
Loading

0 comments on commit a925bba

Please sign in to comment.