Simplify type definition

This commit is contained in:
KARASZI István
2019-04-30 22:54:46 +02:00
parent 2a5e25dd77
commit 02f3fe9008

3
types/index.d.ts vendored
View File

@@ -13,7 +13,6 @@ declare namespace express_prom_bundle {
}
type NormalizePathEntry = [string | RegExp, string];
type NormalizePathRegexs = NormalizePathEntry[];
type NormalizePathFn = (req: Request, opts: Opts) => string;
type NormalizeStatusCodeFn = (res: Response) => number | string;
type TransformLabelsFn = (labels: Labels, req: Request, res: Response) => Labels;
@@ -32,7 +31,7 @@ declare namespace express_prom_bundle {
metricType?: 'summary' | 'histogram';
metricsPath?: string;
promClient?: { collectDefaultMetrics?: DefaultMetricsCollectorConfiguration };
normalizePath?: NormalizePathRegexs | NormalizePathFn;
normalizePath?: NormalizePathEntry[] | NormalizePathFn;
formatStatusCode?: NormalizeStatusCodeFn;
transformLabels?: TransformLabelsFn;