Skip to content

Commit

Permalink
Add build function export in type define file. (#484)
Browse files Browse the repository at this point in the history
* Add build function export in type define file.

* export build in index.js
  • Loading branch information
jaredhan418 committed Dec 27, 2023
1 parent 88610aa commit 2286bde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,17 @@ interface PrettyOptions_ {
customColors?: string|object;
}

declare function build(options: PrettyOptions_): PinoPretty.PrettyStream;

declare namespace PinoPretty {
type Prettifier = (inputData: string | object) => string;
type MessageFormatFunc = (log: LogDescriptor, messageKey: string, levelLabel: string) => string;
type PrettyOptions = PrettyOptions_;
type PrettyStream = Transform & OnUnknown;
type ColorizerFactory = typeof colorizerFactory;
type PrettyFactory = typeof prettyFactory;
type Build = typeof build;
}

export default PinoPretty;
export { PinoPretty, PrettyOptions_ as PrettyOptions, colorizerFactory, prettyFactory };
export { build, PinoPretty, PrettyOptions_ as PrettyOptions, colorizerFactory, prettyFactory };
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ function build (opts = {}) {
}

module.exports = build
module.exports.build = build
module.exports.prettyFactory = prettyFactory
module.exports.colorizerFactory = colors
module.exports.default = build

0 comments on commit 2286bde

Please sign in to comment.