Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 81081e6

Browse files
committed
chord: merge commit
2 parents e0b9be1 + 86ae976 commit 81081e6

1 file changed

Lines changed: 27 additions & 19 deletions

File tree

  • packages/opencensus-core/src/trace/instrumentation

packages/opencensus-core/src/trace/instrumentation/types.ts

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,33 @@
1414
* limitations under the License.
1515
*/
1616

17-
export interface Plugin <T> {
18-
applyPatch(module: any, tracer: T, version: string): void;
17+
/**
18+
* Interface Plugin to apply patch.
19+
*/
20+
export interface Plugin<T> {
21+
applyPatch(module: {}, tracer: T, version: string): void;
1922
}
23+
/**
24+
* This class represent the base to patch plugin
25+
*/
26+
export abstract class BasePlugin<T> {
27+
module: {};
28+
moduleName: string;
29+
tracer: T;
30+
version: string;
2031

21-
export abstract class BasePlugin <T> {
22-
23-
public module: any;
24-
public moduleName: string;
25-
public tracer: T;
26-
public version: string;
27-
28-
constructor (moduleName: string) {
29-
this.moduleName = moduleName;
30-
}
31-
32-
setPluginContext(http: any, tracer: T, version: string) {
33-
this.module = http;
34-
this.tracer = tracer;
35-
this.version = version;
36-
}
37-
32+
constructor(moduleName: string) {
33+
this.moduleName = moduleName;
34+
}
35+
/**
36+
* Set modified plugin to the context.
37+
* @param http object module to set on context
38+
* @param tracer tracer relating to context
39+
* @param version module version description
40+
*/
41+
setPluginContext(http: {}, tracer: T, version: string) {
42+
this.module = http;
43+
this.tracer = tracer;
44+
this.version = version;
45+
}
3846
}

0 commit comments

Comments
 (0)