forked from DefinitelyTyped/DefinitelyTyped
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(karma): update constants export details
- move Constatns to separate file - export as named re-export from main module - add missing type for 'PORT' - should be `number` OR `string` depending on the source of this contant. If read from ENV it will be a string always. - add missing documentation - move LOG types to use string literal types to use in the values in typechecks and intelllisense - tests updated https://github.com/karma-runner/karma/blob/master/lib/constants.js Thanks!
- Loading branch information
1 parent
f377d05
commit ddfca42
Showing
3 changed files
with
64 additions
and
28 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
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
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,42 @@ | ||
declare const constants: Constants; | ||
|
||
interface Constants { | ||
/** The current version of karma */ | ||
VERSION: string; | ||
/** The default port used for the karma server */ | ||
DEFAULT_PORT: string | number; | ||
/** The default hostname used for the karma server */ | ||
DEFAULT_HOSTNAME: string; | ||
/** The default listen address used for the karma server */ | ||
DEFAULT_LISTEN_ADDR: string; | ||
/** The value for disabling logs */ | ||
LOG_DISABLE: 'OFF'; | ||
/** The value for the log `error` level */ | ||
LOG_ERROR: 'ERROR'; | ||
/** The value for the log `warn` level */ | ||
LOG_WARN: 'WARN'; | ||
/** The value for the log `info` level */ | ||
LOG_INFO: 'INFO'; | ||
/** The value for the log `debug` level */ | ||
LOG_DEBUG: 'DEBUG'; | ||
LOG_LOG: 'LOG'; | ||
/** An array of log levels in descending order, i.e. LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_LOG, LOG_INFO, and LOG_DEBUG */ | ||
LOG_PRIORITIES: ['OFF', 'ERROR', 'WARN', 'LOG', 'INFO', 'DEBUG']; | ||
|
||
/** The default color pattern for log output */ | ||
COLOR_PATTERN: string; | ||
/** The default pattern for log output without color */ | ||
NO_COLOR_PATTERN: string; | ||
/** The default console appender */ | ||
CONSOLE_APPENDER: { | ||
type: string; | ||
layout: { | ||
type: string; | ||
pattern: string; | ||
}; | ||
}; | ||
/** The exit code */ | ||
EXIT_CODE: string; | ||
} | ||
|
||
export = constants; |