aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-01-05 18:10:44 +0530
committerAkshay Nair <phenax5@gmail.com>2023-01-05 18:10:44 +0530
commitfccd7917e62a3fbe3b0637ee630d09a9bdbf0678 (patch)
tree0488afc6f8b53972872bb7054ebc4ccea8c5151d /src/index.ts
parent9a1274b41515fd2ad096818c83f34c98cc9c7656 (diff)
downloadts-types-lang-fccd7917e62a3fbe3b0637ee630d09a9bdbf0678.tar.gz
ts-types-lang-fccd7917e62a3fbe3b0637ee630d09a9bdbf0678.zip
feat: adds get env type func
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index 87eea0b..f7e00b7 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -8,6 +8,8 @@ export interface Print<_ extends any> extends EffectAtom { }
export interface WriteFile<_Path extends string, _Content extends string> extends EffectAtom { }
export interface ReadFile<_Path extends string> extends EffectAtom<string> { }
+export interface GetEnv<_Name extends string> extends EffectAtom<string> { }
+
export interface Program<Effs extends Effect, ExitCode extends number = 0> {
effects: Effs,
exitCode: ExitCode,
@@ -23,12 +25,13 @@ export interface ChainIO<Eff extends EffectAtom, Fn extends Kind1> extends Effec
chainTo: Fn
}
-export interface PrintK extends Kind1<string> {
+export interface PrintK extends Kind1<string | undefined> {
return: Print<this['input']>
}
export type main = Program<[
[1, 2, 3] extends infer Res ? Print<Res> : never,
Print<`wow: ${string} -> ${'helo'}`>,
+ ChainIO<GetEnv<"NODE_ENV">, PrintK>,
ChainIO<ReadFile<"./default.nix">, PrintK>,
]>