From 92a2a9507da4c34a01a1d9d59ce642f442244616 Mon Sep 17 00:00:00 2001 From: Taku Shimosawa Date: Mon, 15 Jun 2020 01:12:12 -0700 Subject: [PATCH] [FABCN-414] Update TypeScript definition (#165) 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 b11dee63c..647490793 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 {