Skip to content

Commit

Permalink
fix: update @agoric/store types and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Oct 9, 2020
1 parent 20667ce commit 9e3493a
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 233 deletions.
5 changes: 0 additions & 5 deletions packages/SwingSet/src/vats/network/internal-types.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* @template K,V
* @typedef {import('@agoric/store').Store<K,V>} Store
*/

/**
* @template T
* @typedef {import('@agoric/promise-kit').PromiseRecord<T>} PromiseRecord
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/src/vats/network/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { E } from '@agoric/eventual-send';
import { makePromiseKit } from '@agoric/promise-kit';
import { toBytes } from './bytes';

import '@agoric/store/exported';
import './types';
import './internal-types';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/src/vats/network/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { E as defaultE } from '@agoric/eventual-send';
import makeStore from '@agoric/store';
import { makeNetworkProtocol, ENDPOINT_SEPARATOR } from './network';

import '@agoric/store/exported';
import './types';
import './internal-types';

Expand Down
4 changes: 3 additions & 1 deletion packages/SwingSet/src/vats/plugin-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { makeCapTP } from '@agoric/captp';
import { makePromiseKit } from '@agoric/promise-kit';
import { E, HandledPromise } from '@agoric/eventual-send';

import '@agoric/store/exported';

/**
* @template T
* @typedef {T | PromiseLike<T>} ERef
Expand Down Expand Up @@ -70,7 +72,7 @@ export function makePluginManager(pluginDevice, { D, ...vatPowers }) {
*/

/**
* @type {import('@agoric/store').Store<number, AbortDispatch>}
* @type {Store<number, AbortDispatch>}
*/
const modConnection = makeStore('moduleIndex');

Expand Down
203 changes: 0 additions & 203 deletions packages/SwingSet/test/test-external-store.js

This file was deleted.

3 changes: 2 additions & 1 deletion packages/cosmic-swingset/lib/ag-solo/vats/bridge.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check

import makeStore from '@agoric/store';
import '@agoric/store/exported';

/**
* @template T
Expand Down Expand Up @@ -36,7 +37,7 @@ import makeStore from '@agoric/store';
/* eslint-enable jsdoc/valid-types */
export function makeBridgeManager(E, D, bridgeDevice) {
/**
* @type {import('@agoric/store').Store<string, BridgeHandler>}
* @type {Store<string, BridgeHandler>}
*/
const srcHandlers = makeStore('srcID');

Expand Down
6 changes: 1 addition & 5 deletions packages/cosmic-swingset/lib/ag-solo/vats/ibc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import makeStore from '@agoric/store';
import { makePromiseKit } from '@agoric/promise-kit';
import { generateSparseInts } from '@agoric/sparse-ints';

import '@agoric/store/exported';
import '@agoric/swingset-vat/src/vats/network/types';

import { makeWithQueue } from './queue';
Expand All @@ -31,11 +32,6 @@ const FIXME_ALLOW_NAIVE_RELAYS = true;
* @typedef {import('@agoric/promise-kit').PromiseRecord<U>} PromiseRecord
*/

/**
* @template K,V
* @typedef {import('@agoric/store').Store<K, V>} Store
*/

/**
* @typedef {string} IBCPortID
* @typedef {string} IBCChannelID
Expand Down
1 change: 1 addition & 0 deletions packages/store/exported.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './src/types';
2 changes: 1 addition & 1 deletion packages/store/src/external/hydrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { makeStore } from '../store';
* the Closure interface that the rewriter targets.
*
* @template {Array<any>} A
* @template {Instance} T
* @template {ExternalInstance} T
* @param {MakeBackingStore} makeBackingStore
* @returns {MakeHydrateExternalStore<A, T>}
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/store/src/external/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../types';
* garbage-collected in the usual way, but it will not page out any objects to
* secondary storage.
*
* @template {(...args: any[]) => Instance} M
* @template {(...args: any[]) => ExternalInstance} M
* @param {string} instanceName
* @param {M} maker
* @returns {ExternalStore<M>}
Expand Down
12 changes: 6 additions & 6 deletions packages/store/src/types.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @typedef {Record<string, Function>} Instance
* @typedef {Record<string, Function>} ExternalInstance
*/

/**
Expand Down Expand Up @@ -42,7 +42,7 @@
/**
* An external store for a given constructor.
*
* @template {(...args: Array<any>) => Instance} C
* @template {(...args: Array<any>) => ExternalInstance} C
* @typedef {Object} ExternalStore
* @property {C} makeInstance
* @property {MakeWeakStore<ReturnType<C>, any>} makeWeakStore
Expand All @@ -64,7 +64,7 @@
* "representative" instance.
*
* @template {Array<any>} A
* @template {Instance} T
* @template {ExternalInstance} T
* @callback MakeHydrateExternalStore
* @param {string} instanceKind
* @param {(...args: A) => HydrateData} adaptArguments
Expand All @@ -73,11 +73,11 @@
*/

/**
* @typedef {Store<string, string> & { makeWeakStore: () => WeakStore<any, any> }}} InstanceStore
* @typedef {Store<string, string> & { makeWeakStore: () => WeakStore<any, any> }}} ExternalInstanceStore
*/

/**
* @typedef {Object} BackingStore
* @property {(storeId: string, instanceKind: string) => InstanceStore} makeStore
* @property {(storeId: string) => InstanceStore} findStore
* @property {(storeId: string, instanceKind: string) => ExternalInstanceStore} makeStore
* @property {(storeId: string) => ExternalInstanceStore} findStore
*/
1 change: 1 addition & 0 deletions packages/zoe/exported.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ import './src/zoeService/types';
import './src/contractSupport/types';
import './src/types';
import '@agoric/ertp/exported';
import '@agoric/store/exported';
10 changes: 0 additions & 10 deletions packages/zoe/src/internal-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
* @typedef {import('@agoric/promise-kit').ERef<T>} ERef
*/

/**
* @template K,V
* @typedef {import('@agoric/store').Store<K, V>} Store
*/

/**
* @template K,V
* @typedef {import('@agoric/weak-store').WeakStore<K, V>} WeakStore
*/

/**
* @template T
* @typedef {import('@agoric/promise-kit').PromiseRecord<T>} PromiseRecord
Expand Down
1 change: 1 addition & 0 deletions packages/zoe/src/zoeService/zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { makePromiseKit } from '@agoric/promise-kit';
* Zoe uses ERTP, the Electronic Rights Transfer Protocol
*/
import '@agoric/ertp/exported';
import '@agoric/store/exported';
import { makeIssuerKit, MathKind } from '@agoric/ertp';

import '../../exported';
Expand Down

0 comments on commit 9e3493a

Please sign in to comment.