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

Commit 26c232c

Browse files
crdgonzalezcamayurkale22
authored andcommitted
Change CLS import to do stats type more general. (#528)
1 parent 800520f commit 26c232c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/opencensus-core/src/stats/types.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
*/
1616

1717
import {StatsEventListener} from '../exporters/types';
18-
import * as cls from '../internal/cls';
1918
import {Metric} from '../metrics/export/types';
2019
import {TagMap} from '../tags/tag-map';
2120
import {TagKey, TagValue} from '../tags/types';
2221

22+
/** Default type for functions */
23+
// tslint:disable:no-any
24+
type Func<T> = (...args: any[]) => T;
25+
2326
/** Main interface for stats. */
2427
export interface Stats {
2528
/**
@@ -107,7 +110,7 @@ export interface Stats {
107110
* @param fn Callback function.
108111
* @returns The callback return.
109112
*/
110-
withTagContext<T>(tags: TagMap, fn: cls.Func<T>): T;
113+
withTagContext<T>(tags: TagMap, fn: Func<T>): T;
111114

112115
/** Gets the current tag context. */
113116
getCurrentTagContext(): TagMap;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export type PluginNames = {
5555
};
5656

5757
export type PluginInternalFilesVersion = {
58-
[pluginName: string]: string
58+
[pluginName: string]: string;
5959
};
6060

6161
/**

0 commit comments

Comments
 (0)