UNPKG

1.75 kBTypeScriptView Raw
1/**
2 * -------------------------------------------------------------------------------------------
3 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4 * See License in the project root for license information.
5 * -------------------------------------------------------------------------------------------
6 */
7import { Context } from "../IContext";
8import { Middleware } from "./IMiddleware";
9/**
10 * @class
11 * @implements Middleware
12 * Class for TelemetryHandler
13 */
14export declare class TelemetryHandler implements Middleware {
15 /**
16 * @private
17 * @static
18 * A member holding the name of the client request id header
19 */
20 private static CLIENT_REQUEST_ID_HEADER;
21 /**
22 * @private
23 * @static
24 * A member holding the name of the sdk version header
25 */
26 private static SDK_VERSION_HEADER;
27 /**
28 * @private
29 * @static
30 * A member holding the language prefix for the sdk version header value
31 */
32 private static PRODUCT_NAME;
33 /**
34 * @private
35 * @static
36 * A member holding the key for the feature usage metrics
37 */
38 private static FEATURE_USAGE_STRING;
39 /**
40 * @private
41 * A member to hold next middleware in the middleware chain
42 */
43 private nextMiddleware;
44 /**
45 * @public
46 * @async
47 * To execute the current middleware
48 * @param {Context} context - The context object of the request
49 * @returns A Promise that resolves to nothing
50 */
51 execute(context: Context): Promise<void>;
52 /**
53 * @public
54 * To set the next middleware in the chain
55 * @param {Middleware} next - The middleware instance
56 * @returns Nothing
57 */
58 setNext(next: Middleware): void;
59}