Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript 3.7 support #122

Merged
merged 1 commit into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"@babel/preset-typescript": "^7.6.0",
"@babel/preset-typescript": "^7.7.4",
"@types/jest": "^24.0.18",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
Expand All @@ -38,7 +38,7 @@
"lerna": "^3.16.4",
"prettier": "^1.18.2",
"puppeteer": "^1.20.0",
"ts-jest": "^24.1.0",
"typescript": "3.6.3"
"ts-jest": "^24.2.0",
"typescript": "^3.7.2"
}
}
4 changes: 2 additions & 2 deletions packages/api-bzz-browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class Bzz extends BaseBzz<Response, Readable> {
return super.uploadBody(body, options, raw)
}

return new Promise<hexValue>(resolve => {
return new Promise(resolve => {
const buffers: Array<Uint8Array> = []

body.on('data', function(d) {
Expand All @@ -42,7 +42,7 @@ export class Bzz extends BaseBzz<Response, Readable> {
// @ts-ignore
resolve(Buffer.concat(buffers))
})
}).then((data: Buffer) => super.uploadBody(data, options, raw))
}).then(data => super.uploadBody(data as Buffer, options, raw))
}

public async uploadDirectory(
Expand Down
1 change: 0 additions & 1 deletion packages/api-bzz-node/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export declare class Bzz extends BaseBzz<Response, Readable> {
downloadDirectoryTo(hash: string, toPath: string, options?: DownloadOptions): Promise<number>;
downloadTo(hash: string, toPath: string, options?: DownloadOptions): Promise<void>;
uploadDirectory(directory: DirectoryData, options?: UploadOptions): Promise<hexValue>;
uploadFileStream(stream: Readable, options?: UploadOptions): Promise<hexValue>;
uploadFileFrom(path: string, options?: UploadOptions): Promise<hexValue>;
private uploadTarStream;
uploadTar(path: string, options?: UploadOptions): Promise<hexValue>;
Expand Down
2 changes: 1 addition & 1 deletion packages/api-pss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Hex, createHex, hexInput, hexValue } from '@erebos/hex'
import { StreamRPC } from '@erebos/rpc-stream'
import { Observable, Observer } from 'rxjs'

export const EMPTY_ADDRESS = '0x' as hexValue
export const EMPTY_ADDRESS: hexValue = '0x' as hexValue

export interface PssEvent {
key?: hexValue
Expand Down
2 changes: 1 addition & 1 deletion packages/api-pss/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Hex, hexInput, hexValue } from '@erebos/hex';
import { StreamRPC } from '@erebos/rpc-stream';
import { Observable } from 'rxjs';
export declare const EMPTY_ADDRESS: never;
export declare const EMPTY_ADDRESS: hexValue;
export interface PssEvent {
key?: hexValue;
msg: Hex;
Expand Down
2 changes: 1 addition & 1 deletion packages/client-base/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export declare function createInstantiateAPI<R extends BaseRPC>(createRPC: Creat
export declare abstract class BaseClient {
protected rpcInstance: StreamRPC | void;
constructor(config?: ClientConfig);
readonly rpc: StreamRPC;
get rpc(): StreamRPC;
disconnect(): void;
}
export {};
4 changes: 3 additions & 1 deletion packages/hex/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
enum HexValue {}
enum HexValue {
_ = '',
}

export type hexValue = HexValue & string

Expand Down
3 changes: 2 additions & 1 deletion packages/hex/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="node" />
declare enum HexValue {
_ = ""
}
export declare type hexValue = HexValue & string;
export declare type hexInput = hexValue | string | Record<string, any> | Buffer | Array<number>;
Expand All @@ -26,7 +27,7 @@ export declare class Hex {
protected input: HexInput;
protected hexValue: hexValue;
constructor(inputValue: hexInput | Hex);
readonly value: hexValue;
get value(): hexValue;
equals(other: hexInput | Hex): boolean;
toBuffer(): Buffer;
toBytesArray(): Array<number>;
Expand Down
2 changes: 1 addition & 1 deletion packages/rpc-stream/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export declare class StreamRPC extends BaseRPC {
private _subscription;
private _transport;
constructor(transport: Subject<any>);
readonly connected: boolean;
get connected(): boolean;
connect(): void;
disconnect(): void;
observe<P = any, R = any>(method: string, params?: P): Observable<R>;
Expand Down
4 changes: 2 additions & 2 deletions packages/swarm-browser/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export declare class SwarmClient extends BaseClient {
protected bzzInstance: Bzz | void;
protected pssInstance: Pss | void;
constructor(config: SwarmConfig);
readonly bzz: Bzz;
readonly pss: Pss;
get bzz(): Bzz;
get pss(): Pss;
}
4 changes: 2 additions & 2 deletions packages/swarm-node/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export declare class SwarmClient extends BaseClient {
protected bzzInstance: Bzz | void;
protected pssInstance: Pss | void;
constructor(config: SwarmConfig);
readonly bzz: Bzz;
readonly pss: Pss;
get bzz(): Bzz;
get pss(): Pss;
}
2 changes: 1 addition & 1 deletion packages/wallet-hd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"dependencies": {
"@babel/runtime": "^7.6.2",
"@erebos/secp256k1": "^0.10.0",
"ethers": "^4.0.37"
"ethers": "^4.0.40"
}
}
6 changes: 3 additions & 3 deletions packages/wallet-hd/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export declare class HDWallet {
protected walletsRecord: Record<string, Wallet>;
static createRandom(): HDWallet;
constructor(mnemonic: string, activeIndexes?: Array<number>);
readonly mnemonic: string;
readonly wallets: Array<Wallet>;
readonly accounts: Array<string>;
get mnemonic(): string;
get wallets(): Array<Wallet>;
get accounts(): Array<string>;
getAccountWallet(address: string): Wallet | void;
addAccount(index: number | string): Wallet;
discardAccount(index: number | string): void;
Expand Down
Loading