diff --git a/types/bunyan-config/index.d.ts b/types/bunyan-config/index.d.ts index 0ff84fd9d2..ebcddcd50d 100644 --- a/types/bunyan-config/index.d.ts +++ b/types/bunyan-config/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/LSEducation/bunyan-config // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/types/bunyan-logentries/index.d.ts b/types/bunyan-logentries/index.d.ts index 9a2a5c3fb9..33057d768b 100644 --- a/types/bunyan-logentries/index.d.ts +++ b/types/bunyan-logentries/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/nemtsov/node-bunyan-logentries // Definitions by: Aymeric Beaumet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/types/bunyan/bunyan-tests.ts b/types/bunyan/bunyan-tests.ts index 657a59c3a8..d4c4f61e1c 100644 --- a/types/bunyan/bunyan-tests.ts +++ b/types/bunyan/bunyan-tests.ts @@ -129,3 +129,8 @@ class MyLogger extends Logger { super(options); } } + +const logLevelString: Logger.LogLevelString = 'warn'; +const nameLevel: number = Logger.levelFromName[logLevelString]; +const nameLevel2: number = Logger.levelFromName['warn']; +const levelName: string = Logger.nameFromLevel[10]; diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index bc1dca298d..a59790ebc9 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/trentm/node-bunyan // Definitions by: Alex Mikhalev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// @@ -210,7 +211,11 @@ declare namespace Logger { const ERROR: number; const FATAL: number; - type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' | number; + type LogLevelString = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'; + type LogLevel = LogLevelString | number; + + const levelFromName: { [name in LogLevelString]: number }; + const nameFromLevel: { [level: number]: string }; const stdSerializers: StdSerializers; diff --git a/types/easy-api-request/index.d.ts b/types/easy-api-request/index.d.ts index f04b68be3a..1b3606ccb1 100644 --- a/types/easy-api-request/index.d.ts +++ b/types/easy-api-request/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/DeadAlready/easy-api-request // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/types/easy-xapi-utils/index.d.ts b/types/easy-xapi-utils/index.d.ts index a4e5f568e6..a4b219bf43 100644 --- a/types/easy-xapi-utils/index.d.ts +++ b/types/easy-xapi-utils/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/DeadAlready/easy-xapi-utils // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.1 /// /// diff --git a/types/easy-xapi/index.d.ts b/types/easy-xapi/index.d.ts index f4a9e09391..aa4c0286cf 100644 --- a/types/easy-xapi/index.d.ts +++ b/types/easy-xapi/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/DeadAlready/easy-xapi // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.1 /// ///