Closed EdwardZZZ closed 3 years ago
// generic code class DynaicContext { constructor({ publicParasm, params, headerMap, }) { this.publicParasm = publicParasm; this.params = params; this.headerMap = headerMap; } publicParasm; params; headerMap; } function RPCProxy() {} class BaseService { invoke(...props: any[]) { return RPCProxy(); } } class HSF extends BaseService { getDynaicData(dynaicContext: DynaicContext) { return RPCProxy(); } } // code const hsf = new HSF(); hsf.getDynaicData(new DynaicContext({ publicParasm: {}, params: {}, headerMap: new Map(), })); hsf.invoke('getDynaicData', new DynaicContext({ publicParasm: {}, params: {}, headerMap: new Map(), }));