Adding Office.onReady() (#25518)

Added declaration for Office.onReady() API.
This commit is contained in:
shreedhart
2018-05-04 13:51:02 -07:00
committed by Andy
parent ad30dc660f
commit 3d1bed2f48

View File

@@ -20,6 +20,13 @@ declare namespace Office {
* @param reason Indicates how the app was initialized
*/
export function initialize(reason: InitializationReason): void;
/**
* Ensures that the Office JavaScript APIs are ready to be called by the add-in. If the framework hasn't initialized yet, the callback or promise will wait until the Office host is ready to accept API calls.
* Note that though this API is intended to be used inside an Office add-in, it can also be used outside the add-in. In that case, once Office.js determines that it is running outside of an Office host application, it will call the callback and resolve the promise with "null" for both the host and platform.
* @param callback - An optional callback method, that will receive the host and platform info. Alternatively, rather than use a callback, an add-in may simply wait for the Promise returned by the function to resolve.
* @returns A Promise that contains the host and platform info, once initialization is completed.
*/
export function onReady(callback?: (info: { host: HostType, platform: PlatformType} ) => any): Promise<{ host: HostType, platform: PlatformType }>;
/**
* Indicates if the large namespace for objects will be used or not.
* @param useShortNamespace Indicates if 'true' that the short namespace will be used