Skip to content

Commit a229366

Browse files
🤖 Merge PR DefinitelyTyped#72493 Add isInValuePreview type to custom-functions-runtime package's invocation object by @adityaprasadmsft
1 parent 5c3d676 commit a229366

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎types/custom-functions-runtime/custom-functions-runtime-tests.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ function callerAddress(invocation: CustomFunctions.Invocation) {
1414
return invocation.address;
1515
}
1616

17+
function isInValuePreview(invocation: CustomFunctions.Invocation) {
18+
return invocation.isInValuePreview;
19+
}
20+
1721
async function getStockValues(ticker: string): Promise<number> {
1822
const response = await fetch(`myService.com/prices/${ticker}`);
1923
return (await response.json())["price"];

‎types/custom-functions-runtime/index.d.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ declare namespace CustomFunctions {
7575
* [Api set: CustomFunctionsRuntime 1.3]
7676
*/
7777
parameterAddresses?: string[];
78+
79+
/**
80+
* Indicates whether the function is invoked as part of the formula value preview.
81+
* `isInValuePreview` is read-only and can't be set by a custom functions add-in.
82+
* This value is `true` if the function is invoked to preview the formula value; otherwise it is `false`.
83+
*
84+
* @remarks
85+
* [Api set: CustomFunctionsRuntime 1.5]
86+
*/
87+
isInValuePreview?: string;
7888
}
7989

8090
/**

0 commit comments

Comments
 (0)