From a41d70afe7692e4ef344bc3c599115009f2dad15 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 8 Jan 2023 22:53:09 +0530 Subject: refactor: splits runtime up to use context --- src/types.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/types.ts (limited to 'src/types.ts') diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..a3cf3bb --- /dev/null +++ b/src/types.ts @@ -0,0 +1,17 @@ +import { ExportedDeclarations, Node, SourceFile, Type, TypeChecker } from "ts-morph" + +export interface Ctx { + sourceFile: SourceFile + typeChecker: TypeChecker + entryPoint: ExportedDeclarations + typeToString: (ty: Type | undefined) => string + + createResult: (ty: string) => [string, Node | undefined] + getResultExpr: (key?: string) => string + printResultNode: () => void + + addCustomEffect: (name: string, expr: string) => void + runCustomEffect: (name: string, args: Type[]) => Promise + hasCustomEffect: (name: string) => boolean +} + -- cgit v1.3.1