-
Notifications
You must be signed in to change notification settings - Fork 96
export Metrics classes and types #265
export Metrics classes and types #265
Conversation
c542988
to
0cd2b8d
Compare
export * from './metrics/gauges/types'; | ||
import {Metric, MetricDescriptor, TimeSeries, MetricDescriptorType, LabelKey, LabelValue, Point as TimeSeriesPoint, DistributionValue, BucketOptions, Bucket as DistributionBucket, SummaryValue, Explicit, Exemplar, Timestamp, Snapshot, ValueAtPercentile, MetricProducerManager, MetricProducer} from './metrics/export/types'; | ||
|
||
export { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be equivalent to use export {Metric, ...} from './metrics/export/types'
rather than importing them and then exporting them? If so, that feels a little more compact to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason I did this way is to resolve ambiguity. The Bucket
and Point
are already exported under stats module. Both the members are there for metrics module also, I have added alias for Point -> TimeSeriesPoint
and Bucket -> DistributionBucket
before exporting it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, makes sense. Would it work to use export .. from ...
for the things that aren't renamed and then a separate import and export for the things that get renamed?
Really a nit though so feel free to leave as is.
export * from './metrics/gauges/types'; | ||
import {Metric, MetricDescriptor, TimeSeries, MetricDescriptorType, LabelKey, LabelValue, Point as TimeSeriesPoint, DistributionValue, BucketOptions, Bucket as DistributionBucket, SummaryValue, Explicit, Exemplar, Timestamp, Snapshot, ValueAtPercentile, MetricProducerManager, MetricProducer} from './metrics/export/types'; | ||
|
||
export { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, makes sense. Would it work to use export .. from ...
for the things that aren't renamed and then a separate import and export for the things that get renamed?
Really a nit though so feel free to leave as is.
No description provided.