Skip to content

Commit 5662163

Browse files
authored
Typescript Bug Fixes (#375)
1 parent d20e812 commit 5662163

File tree

7 files changed

+17
-25
lines changed

7 files changed

+17
-25
lines changed

packages/js-sdk/src/ConstantFlowAgreementV1Helper.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ export type ListFlowsType = Promise<{
1313
outFlows: Array<Flow>;
1414
}>;
1515

16-
export = ConstantFlowAgreementV1Helper;
17-
declare class ConstantFlowAgreementV1Helper {
16+
export declare class ConstantFlowAgreementV1Helper {
1817
static _sanitizeflowInfo({
1918
timestamp,
2019
flowRate,

packages/js-sdk/src/Framework.d.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import type Web3 from "web3";
2-
import { ethers, Contract as EthersContract, utils } from "ethers";
3-
import type { Contract as Web3Contract } from "web3-eth-contract";
4-
import TruffleContract from "@truffle/contract";
5-
62
import ConstantFlowAgreementV1Helper from "./ConstantFlowAgreementV1Helper";
73
import InstantDistributionAgreementV1Helper from "./InstantDistributionAgreementV1Helper";
84
import GasMeter from "./utils/gasMetering/gasMetering";
@@ -13,7 +9,7 @@ import Utils from "./Utils";
139

1410
declare type GasReportTypeOptions = 'JSON' | 'HTML' | 'TENDERLY';
1511

16-
export declare interface Agreements {
12+
export interface Agreements {
1713
cfa?: ConstantFlowAgreementV1Helper,
1814
ida?: InstantDistributionAgreementV1Helper
1915
}
@@ -30,7 +26,7 @@ export interface FrameworkOptions {
3026
contractLoader?: LoadContracts.ContractLoader,
3127
resolverAddress?: string,
3228
}
33-
declare class Framework {
29+
export declare class Framework {
3430

3531
constructor(options: FrameworkOptions);
3632

@@ -54,7 +50,14 @@ declare class Framework {
5450
initialize(): Promise<any>;
5551
isSuperTokenListed(superTokenKey: string): Promise<boolean>;
5652
loadToken(tokenKey: string): Promise<void>;
57-
createERC20Wrapper(tokenInfo: any, { superTokenSymbol, superTokenName, from, upgradability }?: string): Promise<any>;
53+
createERC20Wrapper(tokenInfo: any,
54+
{ superTokenSymbol, superTokenName, from, upgradability }: {
55+
superTokenSymbol?: string,
56+
superTokenName?: string,
57+
from?: string,
58+
upgradability?: string
59+
}
60+
): Promise<any>;
5861
user({ address, token, options }: {
5962
address: string;
6063
token: string;
@@ -64,5 +67,3 @@ declare class Framework {
6467
_pushTxForGasReport(tx: GasMeter.Record, actionName: string): void;
6568
generateGasReport(name: string): void;
6669
}
67-
68-
export = Framework;

packages/js-sdk/src/InstantDistributionAgreementV1Helper.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ export interface Subscription {
1010
pendingDistribution: BN;
1111
}
1212

13-
export = InstantDistributionAgreementV1Helper;
14-
declare class InstantDistributionAgreementV1Helper {
13+
export declare class InstantDistributionAgreementV1Helper {
1514
static _sanitizeIndexData({ exist, indexValue, totalUnitsApproved, totalUnitsPending, }: {
1615
exist: boolean;
1716
indexValue: any;

packages/js-sdk/src/User.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ export type DetailsType = {
1616
};
1717
};
1818

19-
export = User;
20-
declare class User {
19+
export declare class User {
2120
constructor({ sf, address, token, options }: {
2221
sf: Framework;
2322
address: string;

packages/js-sdk/src/Utils.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import Framework from "./Framework";
22
import type BN from 'bn.js'
3-
declare class Utils {
3+
export declare class Utils {
44
constructor(sf: Framework);
55
_sf: Framework;
66
normalizeTokenParam(param: string): string;
77
normalizeAddressParam(param: string): string;
88
normalizeFlowRateParam(param: BN|string): string;
99
}
10-
11-
export = Utils;

packages/js-sdk/src/getConfig.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
export declare interface NetworkConfig {
1+
export interface NetworkConfig {
22
nativeTokenSymbol?: string,
33
resolverAddress?: string
44
}
55

6-
declare function getConfig(chainId: number): NetworkConfig;
7-
8-
export = getConfig;
6+
export function getConfig(chainId: number): NetworkConfig;

packages/js-sdk/src/loadContracts.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface AdaptedContractOpts {
2222
}
2323
declare function getAdaptedContract({address, abi, ethers}: AdaptedContractOpts): EthersContract;
2424

25-
declare function loadContracts({ isTruffle, ethers, web3, from, additionalContracts, contractLoader, networkId, }: {
25+
export declare function loadContracts({ isTruffle, ethers, web3, from, additionalContracts, contractLoader, networkId, }: {
2626
isTruffle: boolean;
2727
ethers?: EthersWithSigner;
2828
web3?: Web3;
@@ -31,5 +31,3 @@ declare function loadContracts({ isTruffle, ethers, web3, from, additionalContra
3131
contractLoader: ContractLoader;
3232
networkId: number;
3333
}): Promise<LoadedContract[]>;
34-
35-
export = loadContracts;

0 commit comments

Comments
 (0)