/** * Microsoft Graph communication layer for the SharePoint Framework * * @remarks * This package defines the base communication layer between Microsoft Graph and * the SharePoint Framework. * * @packagedocumentation */ import type { Client } from '@microsoft/microsoft-graph-client'; import type { ClientOptions } from '@microsoft/microsoft-graph-client'; import type { GraphRequest as GraphRequest_2 } from '@microsoft/microsoft-graph-client'; import type { GraphRequestCallback } from '@microsoft/microsoft-graph-clientv1'; import type { Options } from '@microsoft/microsoft-graph-clientv1'; import type { Options as Options_2 } from '@microsoft/microsoft-graph-client'; import { ServiceKey } from '@microsoft/sp-core-library'; import { ServiceScope } from '@microsoft/sp-core-library'; import type { URLComponents } from '@microsoft/microsoft-graph-clientv1'; /** * 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 declare interface GraphRequest { config: Options; urlComponents: URLComponents; _headers: { [key: string]: string | number; }; _responseType: string; constructor(config: Options, path: string): GraphRequest; header(headerKey: string, headerValue: string): this; headers(headers: { [key: string]: string | number; }): this; parsePath(rawPath: string): void; buildFullUrl(): string; version(v: string): GraphRequest; select(properties: string | string[]): GraphRequest; expand(properties: string | string[]): GraphRequest; orderby(properties: string | string[]): GraphRequest; filter(filterStr: string): GraphRequest; top(n: number): GraphRequest; skip(n: number): GraphRequest; skipToken(token: string): GraphRequest; count(count: boolean): GraphRequest; responseType(responseType: string): GraphRequest; 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; }): GraphRequest; } /** * 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 declare class MSGraphClient { private static _instance; private static _window; private static _originalConfig; private static _graphBaseUrl; /* Excluded from this release type: __constructor */ /** * 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): GraphRequest; private _createGraphClientInstance; private _getOAuthToken; } /** * Returns a preinitialized version of the MSGraphClient. * For more information: {@link https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-msgraph} * * @public */ export declare class MSGraphClientFactory { /** * The service key for MSGraphClientFactory. */ static readonly serviceKey: ServiceKey; private _serviceScope; /* Excluded from this release type: __constructor */ /* Excluded from this release type: getClient */ /** * Returns an instance of version 3 the MSGraphClient V3 that communicates with the current tenant's configurable * Service Principal. * */ getClient(version: '3'): Promise; /** * Returns an instance of the MSGraphClient that communicates with the current tenant's configurable Service Pricipal. * Allows to specify custom middleware options. * * @param version - The version of the Graph API to use. 3. * @param options - Client options for the Graph API. */ getClientWithMiddleware(version: '3', options: ClientOptions): Promise; /* Excluded from this release type: getClientInternal */ } /** * 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 declare class MSGraphClientV3 { private static _instance; private static _internalInstance; private static _graphBaseUrl; private _isInternal; private _consumerComponentManifest; private _requestRateMonitor; /* Excluded from this release type: __constructor */ /** * 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. */ api(path: string): GraphRequest_2; /** * Gets the instance of the instantiated Client object from Microsoft Graph SDK. */ get client(): Client; private _createGraphClientInstance; private _createGraphClientInstanceWithMiddleware; private _createInternalGraphClientInstance; private _createClientInstance; } export { }