import type { GraphRequestCallback, Options, URLComponents } from '@microsoft/microsoft-graph-clientv1'; import { type ServiceScope } from '@microsoft/sp-core-library'; /** * Represents the global singleton object on the window after loading the MS Graph SDK * @internal */ export interface IMSGraphClientModule { init(options: Options): IMSGraphClient; } /** * Interface for the MSGraphClient. * @privateRemarks * The original typings cause a build error with webpack. * * @internal */ export interface IMSGraphClient { config: Options; api(path: string): IGraphRequest; } /** * Interface for working with MSGraphClient * @internal */ export interface IWindowWithMSGraphSDK extends Window { MicrosoftGraph: { Client: IMSGraphClientModule; } | undefined; } /** * Typings for the GraphRequest Object * For more information: {@link https://github.com/microsoftgraph/msgraph-sdk-javascript} * * @privateRemarks * The original typings include references to polyfills. * Exporting the microsoft-graph-client defined class may add unnecessary code to the build. * Thefore, we export this interface as `GraphRequest` with the desired API described. * * @public */ export interface IGraphRequest { config: Options; urlComponents: URLComponents; _headers: { [key: string]: string | number; }; _responseType: string; constructor(config: Options, path: string): IGraphRequest; header(headerKey: string, headerValue: string): this; headers(headers: { [key: string]: string | number; }): this; parsePath(rawPath: string): void; buildFullUrl(): string; version(v: string): IGraphRequest; select(properties: string | string[]): IGraphRequest; expand(properties: string | string[]): IGraphRequest; orderby(properties: string | string[]): IGraphRequest; filter(filterStr: string): IGraphRequest; top(n: number): IGraphRequest; skip(n: number): IGraphRequest; skipToken(token: string): IGraphRequest; count(count: boolean): IGraphRequest; responseType(responseType: string): IGraphRequest; delete(callback?: GraphRequestCallback): Promise; patch(content: any, callback?: GraphRequestCallback): Promise; post(content: any, callback?: GraphRequestCallback): Promise; put(content: any, callback?: GraphRequestCallback): Promise; create(content: any, callback?: GraphRequestCallback): Promise; update(content: any, callback?: GraphRequestCallback): Promise; del(callback?: GraphRequestCallback): Promise; get(callback?: GraphRequestCallback): Promise; getStream(callback: GraphRequestCallback): void; putStream(stream: any, callback: GraphRequestCallback): void; query(queryDictionaryOrString: string | { [key: string]: string | number; }): IGraphRequest; } /** * MSGraphClient is used to perform REST calls against Microsoft Graph. * * @remarks The Microsoft Graph JavaScript client library is a lightweight wrapper around the * Microsoft Graph API. This class allows developers to start making REST calls to MSGraph without * needing to initialize the the MSGraph client library. If a custom configuration is desired, * the MSGraphClient api function needs to be provided with that custom configuration for * every request. * * For more information: {@link https://github.com/microsoftgraph/msgraph-sdk-javascript} * * @public */ export default class MSGraphClient { private static _instance; private static _window; private static _originalConfig; private static _graphBaseUrl; /** * @param serviceScope - Provides services for the MSGraphClient to consume. * * @internal */ constructor(serviceScope: ServiceScope); /** * All calls to Microsoft Graph are chained together starting with the api function. * * @remarks Path supports the following formats: * * me * * /me * * https://graph.microsoft.com/v1.0/me * * https://graph.microsoft.com/beta/me * * me/events?$filter=startswith(subject, 'ship') * * The authProvider and baseUrl option should not be used, as they have already been * provided by the framework. See the official documentation here: * https://github.com/microsoftgraph/msgraph-sdk-javascript * * @param path - The path for the request to MSGraph. * @param config - Sets the configuration for this request. */ api(path: string, config?: Options): IGraphRequest; private _createGraphClientInstance; private _getOAuthToken; } //# sourceMappingURL=MSGraphClient.d.ts.map