Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DestinationStreamMetadata type to pino.d.ts #1566

Merged
merged 4 commits into from Oct 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions pino.d.ts
Expand Up @@ -273,6 +273,19 @@ declare namespace pino {
interface DestinationStream {
write(msg: string): void;
}

const metadata = Symbol.for("pino.metadata");

interface DestinationStreamHasMetadata {
[metadata]: true;
lastLevel: number;
lastTime: string;
lastMsg: string;
lastObj: object;
lastLogger: pino.Logger;
}

type DestinationStreamMetadata = { [metadata]?: boolean } | DestinationStreamHasMetadata;

interface StreamEntry {
stream: DestinationStream
Expand Down Expand Up @@ -795,6 +808,7 @@ export const version: typeof pino.version;

// Types
export type Bindings = pino.Bindings;
export type DestinationStreamMetadata = pino.DestinationStreamMetadata;
export type Level = pino.Level;
export type LevelWithSilent = pino.LevelWithSilent;
export type LevelChangeEventListener = pino.LevelChangeEventListener;
Expand Down