mirror of
https://github.com/BreizhHardware/express-prom-bundle.git
synced 2026-03-18 21:30:38 +01:00
Fix line ending
This commit is contained in:
118
types/index.d.ts
vendored
118
types/index.d.ts
vendored
@@ -1,59 +1,59 @@
|
|||||||
// TypeScript Version: 2.8
|
// TypeScript Version: 2.8
|
||||||
|
|
||||||
import { Request, RequestHandler, Response } from 'express';
|
import { Request, RequestHandler, Response } from 'express';
|
||||||
import { DefaultMetricsCollectorConfiguration } from 'prom-client';
|
import { DefaultMetricsCollectorConfiguration } from 'prom-client';
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
|
||||||
export = express_prom_bundle;
|
export = express_prom_bundle;
|
||||||
|
|
||||||
declare namespace express_prom_bundle {
|
declare namespace express_prom_bundle {
|
||||||
interface Labels {
|
interface Labels {
|
||||||
[key: string]: string | number;
|
[key: string]: string | number;
|
||||||
}
|
}
|
||||||
|
|
||||||
type NormalizePathEntry = [string | RegExp, string];
|
type NormalizePathEntry = [string | RegExp, string];
|
||||||
type NormalizePathRegexs = NormalizePathEntry[];
|
type NormalizePathRegexs = NormalizePathEntry[];
|
||||||
type NormalizePathFn = (req: Request, opts: Opts) => string;
|
type NormalizePathFn = (req: Request, opts: Opts) => string;
|
||||||
type NormalizeStatusCodeFn = (res: Response) => number | string;
|
type NormalizeStatusCodeFn = (res: Response) => number | string;
|
||||||
type TransformLabelsFn = (labels: Labels, req: Request, res: Response) => Labels;
|
type TransformLabelsFn = (labels: Labels, req: Request, res: Response) => Labels;
|
||||||
|
|
||||||
interface Opts {
|
interface Opts {
|
||||||
autoregister?: boolean;
|
autoregister?: boolean;
|
||||||
buckets?: number[];
|
buckets?: number[];
|
||||||
|
|
||||||
customLabels?: { [key: string]: any };
|
customLabels?: { [key: string]: any };
|
||||||
|
|
||||||
includeStatusCode?: boolean;
|
includeStatusCode?: boolean;
|
||||||
includeMethod?: boolean;
|
includeMethod?: boolean;
|
||||||
includePath?: boolean;
|
includePath?: boolean;
|
||||||
includeUp?: boolean;
|
includeUp?: boolean;
|
||||||
|
|
||||||
metricType?: 'summary' | 'histogram';
|
metricType?: 'summary' | 'histogram';
|
||||||
metricsPath?: string;
|
metricsPath?: string;
|
||||||
promClient?: { collectDefaultMetrics?: DefaultMetricsCollectorConfiguration };
|
promClient?: { collectDefaultMetrics?: DefaultMetricsCollectorConfiguration };
|
||||||
normalizePath?: NormalizePathRegexs | NormalizePathFn;
|
normalizePath?: NormalizePathRegexs | NormalizePathFn;
|
||||||
formatStatusCode?: NormalizeStatusCodeFn;
|
formatStatusCode?: NormalizeStatusCodeFn;
|
||||||
transformLabels?: TransformLabelsFn;
|
transformLabels?: TransformLabelsFn;
|
||||||
|
|
||||||
// https://github.com/disjunction/url-value-parser#options
|
// https://github.com/disjunction/url-value-parser#options
|
||||||
urlValueParser?: {
|
urlValueParser?: {
|
||||||
minHexLength?: number;
|
minHexLength?: number;
|
||||||
minBase64Length?: number;
|
minBase64Length?: number;
|
||||||
replaceMasks?: string[];
|
replaceMasks?: string[];
|
||||||
extraMasks?: string[];
|
extraMasks?: string[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const normalizePath: NormalizePathFn;
|
const normalizePath: NormalizePathFn;
|
||||||
const normalizeStatusCode: NormalizeStatusCodeFn;
|
const normalizeStatusCode: NormalizeStatusCodeFn;
|
||||||
|
|
||||||
function clusterMetrics(): RequestHandler;
|
function clusterMetrics(): RequestHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface express_prom_bundle {
|
interface express_prom_bundle {
|
||||||
normalizePath: express_prom_bundle.NormalizePathFn;
|
normalizePath: express_prom_bundle.NormalizePathFn;
|
||||||
normalizeStatusCode: express_prom_bundle.NormalizeStatusCodeFn;
|
normalizeStatusCode: express_prom_bundle.NormalizeStatusCodeFn;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare function express_prom_bundle(opts: express_prom_bundle.Opts): RequestHandler;
|
declare function express_prom_bundle(opts: express_prom_bundle.Opts): RequestHandler;
|
||||||
|
|||||||
Reference in New Issue
Block a user