mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Added support for the Dialog API (#9574)
Added the ui property to the context object. Added UI interface and its 3 methods. Added DisplayOptions interface and is properties.
This commit is contained in:
37
office-js/office-js.d.ts
vendored
37
office-js/office-js.d.ts
vendored
@@ -53,6 +53,7 @@ declare namespace Office {
|
||||
displayLanguage: string;
|
||||
license: string;
|
||||
touchEnabled: boolean;
|
||||
ui: UI;
|
||||
requirements: {
|
||||
/**
|
||||
* Check if the specified requirement set is supported by the host Office application.
|
||||
@@ -66,6 +67,42 @@ declare namespace Office {
|
||||
message: string;
|
||||
name: string;
|
||||
}
|
||||
export interface UI {
|
||||
/**
|
||||
* Displays a dialog to show or collect information from the user or to facilitate Web navigation.
|
||||
* @param startAddress Accepts the initial HTTPS Url that opens in the dialog.
|
||||
* @param options Optional. Accepts a DialogOptions object to define dialog behaviors.
|
||||
* @param callback Optional. Accepts a callback method to handle the dialog creation attempt.
|
||||
*/
|
||||
displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* When called from an active add-in dialog, asynchronously closes the dialog.
|
||||
*/
|
||||
close(): void;
|
||||
/**
|
||||
* Synchronously delivers a message from the dialog to its parent add-in.
|
||||
* @param messageObject Accepts a message from the dialog to deliver to the add-in.
|
||||
*/
|
||||
messageParent(messageObject: any): void;
|
||||
}
|
||||
export interface DialogOptions {
|
||||
/**
|
||||
* Optional. Defines the width of the dialog as a percentage of the current display. Defaults to 99%. 250px minimum.
|
||||
*/
|
||||
height?: number,
|
||||
/**
|
||||
* Optional. Defines the height of the dialog as a percentage of the current display. Defaults to 99%. 150px minimum.
|
||||
*/
|
||||
width?: number,
|
||||
/**
|
||||
* Optional. Specifies whether the dialog can only display pages that have HTTPS URLs.
|
||||
*/
|
||||
requireHTTPS?: boolean,
|
||||
/**
|
||||
* Optional. Determines whether the dialog is safe to display within a Web frame.
|
||||
*/
|
||||
xFrameDenySafe?: boolean,
|
||||
}
|
||||
}
|
||||
declare namespace OfficeExtension {
|
||||
/** An abstract proxy object that represents an object in an Office document. You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the proxy object state with the document by calling "context.sync()". */
|
||||
|
||||
Reference in New Issue
Block a user