Skip to content

Commit

Permalink
[FABN-1127] Corrected typescript definitions
Browse files Browse the repository at this point in the history
- Updated ChannelEventHub.connect() definition
- Exported ChaincodeChannelEventHandle
- Upgrade typescript dependency

Upgrade the version of the typescript devDependency since the
previous version seemed to contain a duplicate definition for
the standard JavaScript SharedArrayBuffer type and was failing
to compile typescript. (Mark S. Lewis <mark_lewis@uk.ibm.com>)

Change-Id: I10d27d87bf83b1a94e7c5327e27efc108e0a3a4d
Signed-off-by: Liam Grace <liamgrace.896@gmail.com>
  • Loading branch information
liam-grace authored and andrew-coleman committed Feb 13, 2019
1 parent 4b6b3b1 commit 433b5af
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fabric-client/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ interface ProtoBufObject {
toBuffer(): Buffer;
}

// Dummy interface for opaque handles for registerChaincodeEvent's
interface ChaincodeChannelEventHandle { // tslint:disable-line:no-empty-interface
}

declare class Remote {
constructor(url: string, opts?: Client.ConnectionOpts);
public getName(): string;
Expand Down Expand Up @@ -67,6 +63,7 @@ declare class Client extends BaseClient {
public getTargetOrderer(requestOrderer?: string | Client.Orderer, channelOrderers?: Client.Orderer[], channelName?: string): Client.Orderer;
public getClientCertHash(create: boolean): Buffer;
}

export = Client;

declare namespace Client { // tslint:disable-line:no-namespace
Expand Down Expand Up @@ -362,7 +359,7 @@ declare namespace Client { // tslint:disable-line:no-namespace
public getPeerAddr(): string;
public lastBlockNumber(): number;
public isconnected(): boolean;
public connect(options?: ConnectOptions | boolean): void;
public connect(options?: ConnectOptions | boolean, connectCallback?: (err: Error, channelEventHub: ChannelEventHub) => void): void;
public disconnect(): void;
public close(): void;

Expand All @@ -377,6 +374,10 @@ declare namespace Client { // tslint:disable-line:no-namespace
public unregisterTxEvent(txId: string, throwError?: boolean): void;
}

// Dummy interface for opaque handles for registerChaincodeEvent's
export interface ChaincodeChannelEventHandle { // tslint:disable-line:no-empty-interface
}

export interface SignedRequest {
payload: Buffer;
signature: Buffer;
Expand All @@ -401,7 +402,7 @@ declare namespace Client { // tslint:disable-line:no-namespace
public sendDeliver(envelope: Buffer): Promise<any>;
}

interface MSPConstructorConfig {
export interface MSPConstructorConfig {
rootCerts: IIdentity[];
intermediateCerts: IIdentity[];
admins: IIdentity[];
Expand Down

0 comments on commit 433b5af

Please sign in to comment.