UNPKG

1.65 kBPlain TextView 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 */
7
8import { AuthenticationProvider } from "./IAuthenticationProvider";
9import { FetchOptions } from "./IFetchOptions";
10import { Middleware } from "./middleware/IMiddleware";
11
12/**
13 * @interface
14 * Options for initializing the Graph Client
15 * @property {Function} [authProvider] - The authentication provider instance
16 * @property {string} [baseUrl] - Base url that needs to be appended to every request
17 * @property {boolean} [debugLogging] - The boolean to enable/disable debug logging
18 * @property {string} [defaultVersion] - The default version that needs to be used while making graph api request
19 * @property {FetchOptions} [fetchOptions] - The options for fetch request
20 * @property {Middleware| Middleware[]} [middleware] - The first middleware of the middleware chain or an array of the Middleware handlers
21 * @property {Set<string>}[customHosts] - A set of custom host names. Should contain hostnames only.
22 */
23
24export interface ClientOptions {
25 authProvider?: AuthenticationProvider;
26 baseUrl?: string;
27 debugLogging?: boolean;
28 defaultVersion?: string;
29 fetchOptions?: FetchOptions;
30 middleware?: Middleware | Middleware[];
31 /**
32 * Example - If URL is "https://test_host/v1.0", then set property "customHosts" as "customHosts: Set<string>(["test_host"])"
33 */
34 customHosts?: Set<string>;
35}