-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
131 lines (131 loc) · 4.58 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/// <reference types="node" resolution-mode="require"/>
declare module "lib/unhandledrejection" {
export = UnhandledRejection;
class UnhandledRejection {
init(): void;
exitFunction: (() => void) | ((code?: number) => never);
rejectionHandler(err: any): Promise<void>;
getClient(): import("@sentry/types").Client<import("@sentry/types").ClientOptions<import("@sentry/types").BaseTransportOptions>>;
}
}
declare module "lib/helpers" {
export function getEnvironment(): string;
export const tracingFilterRegex: RegExp[];
}
declare module "lib/sentry" {
export function init(testingConfigOverwrites?: {}): void;
import Sentry = require("@sentry/node");
export { Sentry };
}
declare module "lib/metrics" {
export = metrics;
import metrics = require("prom-client");
}
declare module "lib/domain-fix" {
export const strongReferences: Map<any, any>;
}
declare module "lib/monitoring" {
export = MonitorServer;
class MonitorServer {
static convertListToPromises(checks: any): Promise<any[]>;
constructor(tracing: any);
config: {
enabled: boolean;
port: string | number;
domainFixEnabled: boolean;
};
initialized: boolean;
livenessChecks: any[];
readinessChecks: any[];
signalHooks: any[];
observedServers: any[];
terminus: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
tracing: any;
createServer(): http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
init(): http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
observeServer(server: any): void;
/**
* Add pre-controllers middlewares
*
* This function has to be called before adding the controllers
* to the Express application
*
* @param {Object} app The Express application object
*/
addPreControllersMiddlewares(app: any): void;
domainFix: typeof import("lib/domain-fix");
/**
* Add post-controllers middlewares
*
* This function has to be called right after adding the controllers
* to the Express application
*
* @param {Object} app The Express application object
*/
addPostControllersMiddlewares(app: any): void;
sentryTracingIdMiddleware(req: any, res: any, next: any): any;
close(): void;
addLivenessCheck(check: any): void;
addReadinessCheck(check: any): void;
addOnSignalHook(hook: any): void;
}
import http = require("http");
}
declare module "lib/tracing" {
export = Tracing;
class Tracing {
constructor(config?: {});
config: {
enabled: boolean;
debug: boolean;
mongoTracingEnabled: boolean;
captureMongoQueries: boolean;
uri: string;
tracingExpressEnabled: boolean;
};
start(): Promise<void>;
sdk: opentelemetry.NodeSDK;
tracer: opentelemetry.api.Tracer;
isEnabled(): boolean;
currentTraceId(): string;
currentRootSpan(): opentelemetry.api.Span;
currentSpan(): opentelemetry.api.Span;
addAttribute(key: any, value: any): any;
recordException(exception: any): any;
addRootSpanAttribute(key: any, value: any): any;
}
import opentelemetry = require("@opentelemetry/sdk-node");
}
declare module "lib/feature-flags" {
export class FeatureFlags {
disabled: boolean;
init(): void;
unleash: unleash.Unleash;
isEnabled(feature: any, context: any): boolean;
}
import unleash = require("unleash-client");
export { unleash };
}
declare module "lib/observability" {
export = Observability;
class Observability {
initialized: boolean;
init(testingConfigOverwrites?: {}): this;
tracing: Tracing;
monitoring: MonitorServer;
unhandledRejection: UnhandledRejection;
Sentry: typeof import("@sentry/node");
metrics: typeof import("prom-client");
featureFlags: FeatureFlags;
}
import Tracing = require("lib/tracing");
import MonitorServer = require("lib/monitoring");
import UnhandledRejection = require("lib/unhandledrejection");
import { FeatureFlags } from "lib/feature-flags";
}
declare module "@unu/observability" {
export = instance;
const instance: Observability;
import Observability = require("lib/observability");
}