// biome-ignore lint: suspicious/noUnsafeDeclarationMerging
class PrometheusMetric extends Schema.Class<PrometheusMetric>(
"PrometheusMetric"
)({
key: Schema.String,
type: Schema.Union(Schema.Literal("counter"), Schema.Literal("gauge")),
help: Schema.optional(Schema.String),
}) {
static gauge(key: string) {
return PrometheusMetric.make({ key, type: "gauge" });
}
static counter(key: string) {
return PrometheusMetric.make({ key, type: "counter" });
}
static withHelp: {
(help: string): <Self>(self: Self) => Self & { help: string };
<Self>(self: Self, help: string): Self & { help: string };
} = dual(2, (self, help) => {
return PrometheusMetric.make({ ...self, help });
});
}
PrometheusMetric.prototype.pipe = function () {
// biome-ignore lint/style/noArguments
return pipeArguments(this, arguments);
};
interface PrometheusMetric extends Pipeable.Pipeable {}
// biome-ignore lint: suspicious/noUnsafeDeclarationMerging
class PrometheusMetric extends Schema.Class<PrometheusMetric>(
"PrometheusMetric"
)({
key: Schema.String,
type: Schema.Union(Schema.Literal("counter"), Schema.Literal("gauge")),
help: Schema.optional(Schema.String),
}) {
static gauge(key: string) {
return PrometheusMetric.make({ key, type: "gauge" });
}
static counter(key: string) {
return PrometheusMetric.make({ key, type: "counter" });
}
static withHelp: {
(help: string): <Self>(self: Self) => Self & { help: string };
<Self>(self: Self, help: string): Self & { help: string };
} = dual(2, (self, help) => {
return PrometheusMetric.make({ ...self, help });
});
}
PrometheusMetric.prototype.pipe = function () {
// biome-ignore lint/style/noArguments
return pipeArguments(this, arguments);
};
interface PrometheusMetric extends Pipeable.Pipeable {}