Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
- Loading branch information
1 parent
b4b7dea
commit bec9ece
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export interface EnvironmentVariables { | ||
readonly [key: string]: string; | ||
} | ||
|
||
/** | ||
* Get the environment variables defined in your dotfiles. | ||
* | ||
* @param shell - The shell to read the environment variables from. Default: User default shell. | ||
* @returns The environment variables. | ||
*/ | ||
export function sync(shell?: string): EnvironmentVariables; | ||
|
||
/** | ||
* Get the environment variables defined in your dotfiles. | ||
* | ||
* @param shell - The shell to read the environment variables from. Default: User default shell. | ||
* @returns The environment variables. | ||
*/ | ||
export default function shellEnv(shell?: string): Promise<EnvironmentVariables>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {expectType} from 'tsd-check'; | ||
import shellEnv, {sync, EnvironmentVariables} from '.'; | ||
|
||
expectType<EnvironmentVariables>(sync()); | ||
expectType<EnvironmentVariables>(await shellEnv()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters