Last active
July 19, 2019 20:33
-
-
Save akrantz/623c60ec80829e5775a212fdb08b6e4c to your computer and use it in GitHub Desktop.
A custom function which returns a Promise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Custom Function returns a Promise | |
description: A custom function which returns a Promise | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
/** | |
* Async custom function | |
* @customfunction | |
*/ | |
async function doSomething(seconds: number): Promise<number> { | |
await delay(seconds); | |
return seconds; | |
} | |
async function delay(seconds: number): Promise<void> { | |
return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); | |
} | |
language: typescript | |
libraries: | | |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js | |
@types/office-js | |
[email protected]/dist/css/fabric.min.css | |
[email protected]/dist/css/fabric.components.min.css | |
[email protected]/client/core.min.js | |
@types/core-js | |
@microsoft/[email protected]/dist/office.helpers.min.js | |
@microsoft/[email protected]/dist/office.helpers.d.ts | |
[email protected] | |
@types/[email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment