more work on wrapping formulas

This commit is contained in:
Olivier Gagnon
2022-05-24 17:51:48 -04:00
parent 324f752d8a
commit 0da2e74d12
4 changed files with 53 additions and 7 deletions

View File

@@ -9,11 +9,12 @@ import { Settings } from "../Settings/Settings";
import { CONSTANTS } from "../Constants";
type ExternalFunction = (...args: any[]) => any;
type ExternalAPI = {
export type ExternalAPI = {
[string: string]: ExternalAPI | ExternalFunction;
};
type InternalFunction<F extends (...args: unknown[]) => unknown> = (ctx: NetscriptContext) => F;
export type InternalAPI<API> = {
[Property in keyof API]: API[Property] extends ExternalFunction
? InternalFunction<API[Property]>