Merge pull request #3 from mscharlock/michelle-officeruntime

Michelle officeruntime
This commit is contained in:
Michelle Scharlock
2018-09-18 10:18:02 -07:00
committed by GitHub
+26 -31
View File
@@ -12,19 +12,19 @@ Copyright (c) Microsoft Corporation
declare namespace OfficeRuntime {
function displayWebDialog(url: string, options: DisplayWebDialogOptions): Promise<Dialog>;
const AsyncStorage: AsyncStorage;
// tslint:disable-next-line:interface-name
/*
* Asynchronous, global, and persistent key-value storage that can be used by Excel Custom Functions.
* @beta
*
* @remarks
* Each add-in instance has its own storage partition, unique to a user and their device.
*
* The default amount of total storage allowed per add-in is 5MB.
*
* Each method listed below returns a Promise object.
*
* @remarks
* Each add-in instance has its own storage partition, unique to a user and their device.
*
* The default amount of total storage allowed per add-in is 5MB.
*
* Each method listed below returns a Promise object.
*
*/
interface AsyncStorage {
/*
@@ -34,27 +34,27 @@ declare namespace OfficeRuntime {
getItem(key: string, callback?: (error?: Error, result?: string) => void): Promise<string>;
/*
* @beta
* Assigns the value for a key-value pair and invokes a callback when finished. Returns a Promise.
* Assigns the value for a key-value pair and invokes a callback when finished. Returns a Promise.
*/
setItem(key: string, value: string, callback?: (error?: Error) => void): Promise<void>;
/*
* @beta
* Removes an item for specified key and invokes a callback when finished. Returns a Promise.
* Removes an item for specified key and invokes a callback when finished. Returns a Promise.
*/
removeItem(key: string, callback?: (error?: Error) => void): Promise<void>;
/*
* @beta
* Erases all AsyncStorage. Returns a Promise.
* Erases all AsyncStorage. Returns a Promise.
*/
clear(callback?: (error?: Error) => void): Promise<void>;
/*
* @beta
* Returns a Promise with all keys.
* Returns a Promise with all keys.
*/
getAllKeys(callback?: (error?: Error, keys?: string[]) => void): Promise<string[]>;
/*
* @beta
* Stores multiple key-value pairs in one batch. Returns a Promise. When a key doesn't exist, returns null.
* Stores multiple key-value pairs in one batch. Returns a Promise. When a key doesn't exist, returns null.
*/
multiSet(keyValuePairs: string[][], callback?: (errors?: Error[]) => void): Promise<void>;
/*
@@ -64,30 +64,29 @@ declare namespace OfficeRuntime {
multiRemove(keys: string[], callback?: (errors?: Error[]) => void): Promise<void>;
/*
* @beta
* Fetches a batch of keys, specified in the `keys` array. When a key doesn't exist, returns null.
* Fetches a batch of keys, specified in the `keys` array. When a key doesn't exist, returns null.
*/
multiGet(keys: string[], callback?: (errors?: Error[], result?: string[][]) => void): Promise<string[][]>;
}
/*
* @beta
* Object representing the dialog box.
* Object representing the dialog box.
*/
interface Dialog {
/*
* @beta
* Method that closes a dialog box.
* Method that closes a dialog box.
*/
close(): Promise<void>;
}
/*
* Provides options for how a dialog is displayed.
* Provides options for how a dialog is displayed.
*/
interface DisplayWebDialogOptions {
/*
* @beta
* 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.
* 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.
*/
displayInIFrame?: boolean;
/*
@@ -95,29 +94,25 @@ declare namespace OfficeRuntime {
* Defines the height of the dialog box as a percentage of the current display.
*/
height?: string;
/**
* @beta
* Defines the width of the dialog box as a percentage of the current display.
*/
width?: string;
/*
* @beta
* True if title is hidden from the dialog box.
* Defines the width of the dialog box as a percentage of the current display.
*/
width?: string;
/*
* @beta
* True if title is hidden from the dialog box.
*/
hideTitle?: boolean;
/*
* @beta
* Callback that is run when the dialog box is closed.
*/
onClose?: () => void;
/*
* @beta
* Callback that is run when the dialog box sends an error.
*/
onMessage?(message: string, dialog?: Dialog): void
onMessage?(message: string, dialog?: Dialog): void;
}
}