From 96c2f5e1ef76a4c84dc68b8249a67bcfbee0a9ec Mon Sep 17 00:00:00 2001 From: Taku Shimosawa Date: Wed, 10 Jun 2020 14:16:43 -0700 Subject: [PATCH] [FABCN-414] Update TypeScript definition This patch updates the type defintion file for TypeScript to add classes and interfaces related to the chaincode server feature. Signed-off-by: Taku Shimosawa --- libraries/fabric-shim/types/index.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libraries/fabric-shim/types/index.d.ts b/libraries/fabric-shim/types/index.d.ts index b11dee63..64749079 100644 --- a/libraries/fabric-shim/types/index.d.ts +++ b/libraries/fabric-shim/types/index.d.ts @@ -45,6 +45,24 @@ declare module 'fabric-shim' { static newLogger(name: string): Logger; static start(chaincode: ChaincodeInterface): any; static success(payload?: Uint8Array): ChaincodeResponse; + static server(chaincode: ChaincodeInterface, serverOpts: ChaincodeServerOpts): ChaincodeServer; + } + + export class ChaincodeServer { + constructor(chaincode: ChaincodeInterface, serverOpts: ChaincodeServerOpts); + start(): Promise; + } + + export interface ChaincodeServerOpts { + ccid: string; + address: string; + tlsProps: ChaincodeServerTLSProperties; + } + + export interface ChaincodeServerTLSProperties { + key: Buffer; + cert: Buffer; + clientCACerts: Buffer; } export class ClientIdentity implements IClientIdentity {