Skip to content

Commit

Permalink
chore(types): misc fix for TS 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Mar 11, 2024
1 parent 4a01c97 commit 37efb5a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/pegasus/src/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import '@agoric/zoe/exported.js';
import '../exported.js';

/**
* @type {ContractStartFn<Pegasus, never, {}, {
* @type {ContractStartFn<import('./pegasus.js').Pegasus, never, {}, {
* board: ERef<BoardDepositFacet>,
* namesByAddress: ERef<import('@agoric/vats').NameHub>
* }}
* }>}
*/
export const start = (zcf, privateArgs, baggage) => {
const zone = makeDurableZone(baggage);
Expand Down
2 changes: 1 addition & 1 deletion packages/vats/src/core/types-ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ type StartUpgradableOpts<
import('@agoric/zoe/src/zoeService/utils').StartParams<SF>['terms'],
'brands' | 'issuers'
>;
privateArgs?: import('@agoric/zoe/src/zoeService/utils').StartParams<SF>['privateArgs'];
privateArgs?: Parameters<SF>[1];
label: string;
};

Expand Down
2 changes: 2 additions & 0 deletions packages/wallet/api/src/lib-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1408,11 +1408,13 @@ export function makeWalletRoot({
boardId,
dappOrigin = undefined,
) {
/** @type {Petname} */
let petname;
if (dappOrigin === undefined) {
petname = suggestedPetname;
} else {
const edgename = edgeMapping.valToPetname.get(dappOrigin);
// @ts-expect-error if suggestedPetname is itself an array, this nests
petname = [edgename, suggestedPetname];
}

Expand Down
6 changes: 3 additions & 3 deletions packages/zoe/src/contractFacet/types-ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ type ContractStartFn<
> = (
zcf: ZCF<CT>,
privateArgs: PA,
baggage?: MapStore<any, any> | undefined,
baggage: import('@agoric/vat-data').Baggage,
) => ContractStartFnResult<PF, CF>;
type ContractStartFnResult<PF, CF> = {
publicFacet: PF;
creatorFacet: CF;
publicFacet?: PF;
creatorFacet?: CF;
creatorInvitation?: Promise<Invitation<R, A>> | undefined;
};
type ContractOf<S> = import('../zoeService/utils').ContractOf<S>;
Expand Down
1 change: 0 additions & 1 deletion packages/zoe/test/privateArgsUsageContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const start = (_zcf, privateArgs) => {
const creatorFacet = Far('creatorFacet', {
usePrivateArgs: () => E(privateArgs.myArg).doTest(),
});
// @ts-expect-error missing publicFacet for ContractStartFn
return harden({ creatorFacet });
};
harden(start);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const start = zcf => {

const creatorInvitation = makeSafeInvitation();

// @ts-expect-error missing creatorFacet of ContractStartFn
return harden({ creatorInvitation, publicFacet });
};

Expand Down

0 comments on commit 37efb5a

Please sign in to comment.