-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(type): Set the exact Logger.create return type, closes #382
- Loading branch information
Showing
5 changed files
with
28 additions
and
19 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,15 @@ | ||
import defaultLog from '../../main'; | ||
import { ConsoleTransport, warn } from '../index'; | ||
|
||
// Default module export | ||
defaultLog.warn('test'); | ||
|
||
// Check whether default logger is MainLogger | ||
defaultLog.create({ logId: 'test '}).transports.file.level = 'error'; | ||
|
||
// CommonJS export | ||
warn('test'); | ||
|
||
// Check named export | ||
const transport: ConsoleTransport = defaultLog.transports.console | ||
transport({ data: [], date: new Date(), level: 'info' }) |
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,11 @@ | ||
import defaultLog from '../../renderer'; | ||
import { warn } from '../index'; | ||
|
||
// Default module export | ||
defaultLog.warn('test'); | ||
|
||
// CommonJS export | ||
warn('test'); | ||
|
||
// Check global variable | ||
__electronLog.info(); |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,6 +5,6 @@ | |
"noImplicitReturns": true | ||
}, | ||
"include": [ | ||
"./src/__specs__/index.d.test.ts" | ||
"./src/__specs__/index.d.*.ts", | ||
] | ||
} |