Merge pull request #29271 from mscharlock/michelle-officefixes

Making some updates to comments in office-runtime and custom-functions-runtime
This commit is contained in:
Andrew Casey
2018-10-02 14:32:36 -07:00
committed by GitHub
3 changed files with 17 additions and 19 deletions

View File

@@ -1,11 +1,10 @@
/* Note that this is a sample function for the purpose of running the below CustomFunctionsMappings test */
function ADD10(n: number) {
/* Note that this is a sample function for the purpose of running the below CustomFunctionsMappings test. */
function addTen(n: number) {
return n + 10;
}
CustomFunctionMappings = {
addTen: ADD10
};
/*Assume that the function id for addTen in the function's JSON metadata is specified as ADDTEN. */
CustomFunctionMappings.ADDTEN = addTen;
async function getStockValues(ticker: string): Promise<number> {
const response = await fetch(`myService.com/prices/${ticker}`);

View File

@@ -9,16 +9,17 @@ office-js
Copyright (c) Microsoft Corporation
*/
////////////////////////////////////////////////////////////////
//////////////////// Begin custom-functions-runtime ////////////
////////////////////////////////////////////////////////////////
/**
* Enables you to map your own name that uses lowercase letters to a function.
* Specific to Excel Custom Functions. Enables you to set key-value pairs (a function's JSON id : JavaScript name).
*/
declare let CustomFunctionMappings: { [key: string]: Function };
/**
* CustomFunctions namespace, used by Excel Custom Functions
*/
declare namespace CustomFunctions {
/**
* StreamingHandler interface
*/
interface StreamingHandler<T> extends CancelableHandler {
/**
* Sets the returned result for a streaming custom function.
@@ -26,7 +27,9 @@ declare namespace CustomFunctions {
*/
setResult: (value: T | Error) => void;
}
/**
* CancelableHandler interface
*/
interface CancelableHandler {
/**
* Handles what should occur when a custom function is canceled.
@@ -35,7 +38,3 @@ declare namespace CustomFunctions {
onCanceled: () => void;
}
}
////////////////////////////////////////////////////////////////
//////////////////// End custom-functions-runtime ////////////
////////////////////////////////////////////////////////////////

View File

@@ -75,7 +75,7 @@ declare namespace OfficeRuntime {
*/
multiGet(keys: string[], callback?: (errors?: Error[], result?: string[][]) => void): Promise<string[][]>;
}
/*
/**
* @beta
* Object representing the dialog box.
*/
@@ -111,12 +111,12 @@ declare namespace OfficeRuntime {
* 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 sends a message to its parent.
*/