diff --git a/bin/env-cmd.js b/bin/env-cmd.js
index 67e901c..426bc39 100755
--- a/bin/env-cmd.js
+++ b/bin/env-cmd.js
@@ -1,2 +1,2 @@
#! /usr/bin/env node
-require('../lib').CLI(process.argv.slice(2))
+require('../dist').CLI(process.argv.slice(2))
diff --git a/dist/env-cmd.d.ts b/dist/env-cmd.d.ts
new file mode 100644
index 0000000..859a7da
--- /dev/null
+++ b/dist/env-cmd.d.ts
@@ -0,0 +1,21 @@
+import { EnvCmdOptions } from './types';
+/**
+ * Executes env - cmd using command line arguments
+ * @export
+ * @param {string[]} args Command line argument to pass in ['-f', './.env']
+ * @returns {Promise<{ [key: string]: any }>}
+ */
+export declare function CLI(args: string[]): Promise<{
+ [key: string]: any;
+}>;
+/**
+ * The main env-cmd program. This will spawn a new process and run the given command using
+ * various environment file solutions.
+ *
+ * @export
+ * @param {EnvCmdOptions} { command, commandArgs, envFile, rc, options }
+ * @returns {Promise<{ [key: string]: any }>} Returns an object containing [environment variable name]: value
+ */
+export declare function EnvCmd({ command, commandArgs, envFile, rc, options }: EnvCmdOptions): Promise<{
+ [key: string]: any;
+}>;
diff --git a/lib/env-cmd.js b/dist/env-cmd.js
similarity index 100%
rename from lib/env-cmd.js
rename to dist/env-cmd.js
diff --git a/dist/get-env-vars.d.ts b/dist/get-env-vars.d.ts
new file mode 100644
index 0000000..d076d89
--- /dev/null
+++ b/dist/get-env-vars.d.ts
@@ -0,0 +1,16 @@
+import { GetEnvVarOptions } from './types';
+export declare function getEnvVars(options?: GetEnvVarOptions): Promise<{
+ [key: string]: any;
+}>;
+export declare function getEnvFile({ filePath, fallback }: {
+ filePath?: string;
+ fallback?: boolean;
+}): Promise<{
+ [key: string]: any;
+}>;
+export declare function getRCFile({ environments, filePath }: {
+ environments: string[];
+ filePath?: string;
+}): Promise<{
+ [key: string]: any;
+}>;
diff --git a/lib/get-env-vars.js b/dist/get-env-vars.js
similarity index 100%
rename from lib/get-env-vars.js
rename to dist/get-env-vars.js
diff --git a/lib/help.js b/dist/help.js
similarity index 100%
rename from lib/help.js
rename to dist/help.js
diff --git a/dist/index.d.ts b/dist/index.d.ts
new file mode 100644
index 0000000..39037f2
--- /dev/null
+++ b/dist/index.d.ts
@@ -0,0 +1,4 @@
+import { getEnvVars } from './get-env-vars';
+export * from './types';
+export * from './env-cmd';
+export declare const GetEnvVars: typeof getEnvVars;
diff --git a/lib/index.js b/dist/index.js
similarity index 100%
rename from lib/index.js
rename to dist/index.js
diff --git a/dist/parse-args.d.ts b/dist/parse-args.d.ts
new file mode 100644
index 0000000..fdad8c0
--- /dev/null
+++ b/dist/parse-args.d.ts
@@ -0,0 +1,5 @@
+import { EnvCmdOptions } from './types';
+/**
+* Parses the arguments passed into the cli
+*/
+export declare function parseArgs(args: string[]): EnvCmdOptions;
diff --git a/lib/parse-args.js b/dist/parse-args.js
similarity index 100%
rename from lib/parse-args.js
rename to dist/parse-args.js
diff --git a/dist/parse-env-file.d.ts b/dist/parse-env-file.d.ts
new file mode 100644
index 0000000..530f487
--- /dev/null
+++ b/dist/parse-env-file.d.ts
@@ -0,0 +1,26 @@
+/**
+ * Gets the environment vars from an env file
+ */
+export declare function getEnvFileVars(envFilePath: string): Promise<{
+ [key: string]: any;
+}>;
+/**
+ * Parse out all env vars from a given env file string and return an object
+ */
+export declare function parseEnvString(envFileString: string): {
+ [key: string]: string;
+};
+/**
+ * Parse out all env vars from an env file string
+ */
+export declare function parseEnvVars(envString: string): {
+ [key: string]: string;
+};
+/**
+ * Strips out comments from env file string
+ */
+export declare function stripComments(envString: string): string;
+/**
+ * Strips out newlines from env file string
+ */
+export declare function stripEmptyLines(envString: string): string;
diff --git a/lib/parse-env-file.js b/dist/parse-env-file.js
similarity index 100%
rename from lib/parse-env-file.js
rename to dist/parse-env-file.js
diff --git a/dist/parse-rc-file.d.ts b/dist/parse-rc-file.d.ts
new file mode 100644
index 0000000..1be55bd
--- /dev/null
+++ b/dist/parse-rc-file.d.ts
@@ -0,0 +1,15 @@
+/**
+ * Gets the env vars from the rc file and rc environments
+ */
+export declare function getRCFileVars({ environments, filePath }: {
+ environments: string[];
+ filePath: string;
+}): Promise<{
+ [key: string]: any;
+}>;
+/**
+ * Reads and parses the .rc file
+ */
+export declare function parseRCFile(fileData: string): {
+ [key: string]: any;
+};
diff --git a/lib/parse-rc-file.js b/dist/parse-rc-file.js
similarity index 100%
rename from lib/parse-rc-file.js
rename to dist/parse-rc-file.js
diff --git a/dist/signal-termination.d.ts b/dist/signal-termination.d.ts
new file mode 100644
index 0000000..e7d97fd
--- /dev/null
+++ b/dist/signal-termination.d.ts
@@ -0,0 +1,23 @@
+///
+import { ChildProcess } from 'child_process';
+export declare class TermSignals {
+ private terminateSpawnedProcessFuncHandlers;
+ _exitCalled: boolean;
+ handleTermSignals(proc: ChildProcess): void;
+ /**
+ * Enables catching of unhandled exceptions
+ */
+ handleUncaughtExceptions(): void;
+ /**
+ * Terminate parent process helper
+ */
+ _terminateProcess(code?: number, signal?: string): void;
+ /**
+ * Exit event listener clean up helper
+ */
+ _removeProcessListeners(): void;
+ /**
+ * General exception handler
+ */
+ _uncaughtExceptionHandler(e: Error): void;
+}
diff --git a/lib/signal-termination.js b/dist/signal-termination.js
similarity index 100%
rename from lib/signal-termination.js
rename to dist/signal-termination.js
diff --git a/dist/spawn.d.ts b/dist/spawn.d.ts
new file mode 100644
index 0000000..cabd0a7
--- /dev/null
+++ b/dist/spawn.d.ts
@@ -0,0 +1,2 @@
+import * as spawn from 'cross-spawn';
+export { spawn };
diff --git a/lib/spawn.js b/dist/spawn.js
similarity index 100%
rename from lib/spawn.js
rename to dist/spawn.js
diff --git a/dist/types.d.ts b/dist/types.d.ts
new file mode 100644
index 0000000..ca1e952
--- /dev/null
+++ b/dist/types.d.ts
@@ -0,0 +1,18 @@
+export interface GetEnvVarOptions {
+ envFile?: {
+ filePath?: string;
+ fallback?: boolean;
+ };
+ rc?: {
+ environments: string[];
+ filePath?: string;
+ };
+}
+export interface EnvCmdOptions extends GetEnvVarOptions {
+ command: string;
+ commandArgs: string[];
+ options?: {
+ noOverride?: boolean;
+ useShell?: boolean;
+ };
+}
diff --git a/lib/types.js b/dist/types.js
similarity index 100%
rename from lib/types.js
rename to dist/types.js
diff --git a/dist/utils.d.ts b/dist/utils.d.ts
new file mode 100644
index 0000000..13e3d81
--- /dev/null
+++ b/dist/utils.d.ts
@@ -0,0 +1,12 @@
+/**
+ * A simple function for resolving the path the user entered
+ */
+export declare function resolveEnvFilePath(userPath: string): string;
+/**
+ * A simple function that parses a comma separated string into an array of strings
+ */
+export declare function parseArgList(list: string): string[];
+/**
+ * A simple function to test if the value is a promise
+ */
+export declare function isPromise(value: any | PromiseLike