Added requirement set info (#40225)

* adding requirement set info

* whitespace fix

* fix whitespace

* fix whitespace

* fixed storage req set tags
This commit is contained in:
David Chesnut
2019-11-11 10:53:30 -08:00
committed by Pranav Senthilnathan
parent 76ca97f1ce
commit 42bf170d42
+51 -1
View File
@@ -13,6 +13,9 @@ Copyright (c) Microsoft Corporation
declare namespace OfficeRuntime {
/**
* Method that enables a pop up web dialog box.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
* @param url Must be a string.
* @param options Optional parameter. Must be of type DisplayWebDialogOptions.
*/
@@ -23,6 +26,9 @@ declare namespace OfficeRuntime {
const storage: Storage;
/**
* Asynchronous, global, and persistent key-value storage.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
* @remarks
* Storage limit is 10 MB per domain, which may be shared by multiple add-ins.
*/
@@ -30,12 +36,18 @@ declare namespace OfficeRuntime {
/**
* Retrieves an item from storage based on its key.
* Returns a Promise. In the event the Promise does not resolve, returns null.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
* @param key Key of item to be retrieved. Must be a string.
*/
getItem(key: string): Promise<string | null>;
/**
* Sets a key-value pair into storage or updates an existing key-value pair.
* Returns a Promise.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
* @param key Key of item to be set. Must be a string.
* @param value Must be a string.
*/
@@ -43,36 +55,56 @@ declare namespace OfficeRuntime {
/**
* Removes an item from storage based on its key.
* Returns a Promise.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
* @param key Key of item to be removed. Must be a string.
*/
removeItem(key: string): Promise<void>;
/**
* Retrieves multiple items from storage based on their key.
* Returns a Promise. In the event the Promise does not resolve, returns null.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
* @param keys Keys of items to be removed. Must be an array of strings.
*/
getItems(keys: string[]): Promise<{ [key: string]: string | null }>;
/**
* Sets multiple items into storage or updates multiple items within storage.
* Returns a Promise.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
* @param keyValues Key-value pairs to be set. Must be strings.
*/
setItems(keyValues: { [key: string]: string }): Promise<void>;
/**
* Removes multiple items from storage.
* Returns a Promise.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
* @param keys Keys of items to be removed. Must be an array of strings.
*/
removeItems(keys: string[]): Promise<void>;
/**
* Retrieves an array of all keys from storage.
* Returns a Promise.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
*/
getKeys(): Promise<string[]>;
}
/** Object representing the dialog box. */
interface Dialog {
/** Method to close a dialog box. Returns a Promise. */
/**
* Method to close a dialog box. Returns a Promise.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
*/
close(): Promise<void>;
}
/** Provides display options and actions a dialog box may take. */
@@ -80,28 +112,46 @@ declare namespace OfficeRuntime {
/**
* Optional parameter that determines whether the dialog box displays as a popup (false) or within an IFrame (true).
* This setting is only applicable to custom functions running on Excel Online.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
*/
displayInIFrame?: boolean;
/**
* Optional parameter that defines the height of the dialog box as a percentage of the current display.
* For example, accepts strings such as: '50%', '50'.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
*/
height?: string;
/**
* Optional parameter that defines the width of dialog as a percentage of window.
* For example, accepts strings such as: '50%', '50'.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
*/
width?: string;
/**
* Optional callback that runs when the dialog box sends a message to its parent.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
*/
onMessage?: (message: string, dialog?: Dialog) => void;
/**
* Optional callback that runs when the dialog box is closed.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
*/
onClose?: () => void;
/**
* Optional callback that runs when the dialog box sends an error.
*
* [Api set: CustomFunctionsRuntime 1.1]
*
*/
onRuntimeError?: (error: Error, dialog?: Dialog) => void;
}