diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-13 19:21:41 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-13 19:21:41 +0530 |
| commit | 8ba316461d2dc0a1372af16836ce14ceabc2bf4f (patch) | |
| tree | afcd80654b1e83fe78fcb4bf69a71f730ee3e299 /stdlib | |
| parent | fe710f58a982e31e64c02d887567bcd9a4108b24 (diff) | |
| download | ts-types-lang-8ba316461d2dc0a1372af16836ce14ceabc2bf4f.tar.gz ts-types-lang-8ba316461d2dc0a1372af16836ce14ceabc2bf4f.zip | |
feat: adds test to stdlib + refactors runtime environment
Diffstat (limited to 'stdlib')
| -rw-r--r-- | stdlib/sys.ts | 2 | ||||
| -rw-r--r-- | stdlib/test.ts | 10 | ||||
| -rw-r--r-- | stdlib/util.ts | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/stdlib/sys.ts b/stdlib/sys.ts index 68f713d..9fff7a9 100644 --- a/stdlib/sys.ts +++ b/stdlib/sys.ts @@ -11,3 +11,5 @@ export interface DefineEffect<_Name extends string, _Func extends string> export interface Exit<_ extends number | undefined = undefined> extends Effect {} +export interface SetEvalEnvironment<_Env extends 'test.node' | 'node'> extends Effect {} + diff --git a/stdlib/test.ts b/stdlib/test.ts new file mode 100644 index 0000000..49c6e0e --- /dev/null +++ b/stdlib/test.ts @@ -0,0 +1,10 @@ +import { Effect } from "./effect"; + +export interface Config { + compileTimeTestFailures: false +} + +type Assertion = Config['compileTimeTestFailures'] extends true ? true : boolean + +export interface Assert<_B extends Assertion> extends Effect { } +export interface Test<_m extends string, _effs extends Effect[]> extends Effect { } diff --git a/stdlib/util.ts b/stdlib/util.ts index cf19589..4851392 100644 --- a/stdlib/util.ts +++ b/stdlib/util.ts @@ -20,3 +20,9 @@ export type ADT<D extends Record<string, any>> = { } extends infer Rec extends Pat ? { t: Rec[keyof Rec] } & { [k in keyof Rec]: ADTConstructor<Rec[k]> } : never + +export type Equals<Left, Right> = + [Left] extends [Right] ? ([Right] extends [Left] ? true : false) : false + +export type Not<B extends boolean> = B extends true ? false : true + |
