From 45c4082cf2b4f9256141705fb4f3d608dc03d41f Mon Sep 17 00:00:00 2001 From: mscharlock Date: Thu, 13 Sep 2018 11:14:11 -0700 Subject: [PATCH] adding custom functions mapping test --- .../custom-function-runtime-tests.ts} | 16 +++++++++------- .../index.d.ts | 0 .../tsconfig.json | 0 .../tslint.json | 0 4 files changed, 9 insertions(+), 7 deletions(-) rename types/{custom-function-mapping/custom-function-mappings-tests.ts => custom-function-runtime/custom-function-runtime-tests.ts} (86%) rename types/{custom-function-mapping => custom-function-runtime}/index.d.ts (100%) rename types/{custom-function-mapping => custom-function-runtime}/tsconfig.json (100%) rename types/{custom-function-mapping => custom-function-runtime}/tslint.json (100%) diff --git a/types/custom-function-mapping/custom-function-mappings-tests.ts b/types/custom-function-runtime/custom-function-runtime-tests.ts similarity index 86% rename from types/custom-function-mapping/custom-function-mappings-tests.ts rename to types/custom-function-runtime/custom-function-runtime-tests.ts index 98fe35fd9f..47953776b3 100644 --- a/types/custom-function-mapping/custom-function-mappings-tests.ts +++ b/types/custom-function-runtime/custom-function-runtime-tests.ts @@ -1,3 +1,11 @@ +function ADD10(n: number) { + return n + 10; +} + +declare const CustomFunctionMappings: { + ["addTen"]: ADD10(); +}; + async function getStockValues(ticker: string, handler: CustomFunctions.StreamingHandler) { const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json(); handler.setResult(dollars) @@ -13,7 +21,7 @@ async function getStockValuesOneTime(ticker: string, handler: CustomFunctions.Ca } const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json(); - return dollars; + return dollars; } async function getStockValuesNowWithNoCancelling(ticker: string) { @@ -21,10 +29,4 @@ async function getStockValuesNowWithNoCancelling(ticker: string) { return dollars; } -function add10(n: number) { - return n + 10; -} - - declare function pause(ms: number): Promise - diff --git a/types/custom-function-mapping/index.d.ts b/types/custom-function-runtime/index.d.ts similarity index 100% rename from types/custom-function-mapping/index.d.ts rename to types/custom-function-runtime/index.d.ts diff --git a/types/custom-function-mapping/tsconfig.json b/types/custom-function-runtime/tsconfig.json similarity index 100% rename from types/custom-function-mapping/tsconfig.json rename to types/custom-function-runtime/tsconfig.json diff --git a/types/custom-function-mapping/tslint.json b/types/custom-function-runtime/tslint.json similarity index 100% rename from types/custom-function-mapping/tslint.json rename to types/custom-function-runtime/tslint.json