mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
renaming file
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
function ADD10(n: number) {
|
||||
return n + 10;
|
||||
}
|
||||
|
||||
declare const CustomFunctionMappings: {
|
||||
"addTen": ADD10();
|
||||
};
|
||||
|
||||
async function getStockValues(ticker: string, handler: CustomFunctions.StreamingHandler<number>) {
|
||||
const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json();
|
||||
handler.setResult(dollars)
|
||||
}
|
||||
|
||||
async function getStockValuesOneTime(ticker: string, handler: CustomFunctions.CancelableHandler) {
|
||||
var shouldStop = false;
|
||||
handler.onCanceled = () => shouldStop = true;
|
||||
await pause(1000);
|
||||
|
||||
if (shouldStop) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json();
|
||||
return dollars;
|
||||
}
|
||||
|
||||
async function getStockValuesNowWithNoCancelling(ticker: string) {
|
||||
const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json();
|
||||
return dollars;
|
||||
}
|
||||
|
||||
declare function pause(ms: number): Promise<void>
|
||||
Reference in New Issue
Block a user