Skip to content

Commit

Permalink
export the LoggerExtras interface (#1813)
Browse files Browse the repository at this point in the history
* export the LoggerExtras interface

* add LoggerExtras test
  • Loading branch information
ethanniser committed Sep 28, 2023
1 parent 713c3c4 commit 28819c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pino.d.ts
Expand Up @@ -45,7 +45,7 @@ interface redactOptions {
remove?: boolean;
}

interface LoggerExtras<Options = LoggerOptions> extends EventEmitter {
export interface LoggerExtras<Options = LoggerOptions> extends EventEmitter {
/**
* Exposes the Pino package version. Also available on the exported pino function.
*/
Expand Down
3 changes: 2 additions & 1 deletion test/types/pino-type-only.test-d.ts
@@ -1,11 +1,12 @@
import { expectAssignable, expectType } from "tsd";

import pino from "../../";
import type {LevelWithSilent, Logger, LogFn, P, DestinationStreamWithMetadata } from "../../pino";
import type {LevelWithSilent, Logger, LogFn, P, DestinationStreamWithMetadata, LoggerExtras } from "../../pino";

// NB: can also use `import * as pino`, but that form is callable as `pino()`
// under `esModuleInterop: false` or `pino.default()` under `esModuleInterop: true`.
const log = pino();
expectAssignable<LoggerExtras>(log);
expectType<Logger>(log);
expectType<LogFn>(log.info);

Expand Down

0 comments on commit 28819c3

Please sign in to comment.