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

Make typings match code better #1158

Merged
merged 1 commit into from Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 2 additions & 7 deletions types/log4js.d.ts
Expand Up @@ -263,14 +263,9 @@ export interface CustomAppender {
}

export interface AppenderModule {
configure: (config: Config, layouts: LayoutsParam) => AppenderGenerator;
configure: (config: Config, layouts: LayoutsParam) => AppenderFunction;
}

export type AppenderGenerator = (
layout: LayoutFunction,
timezoneOffset?: string
) => AppenderFunction;

export type AppenderFunction = (loggingEvent: LoggingEvent) => void;

// TODO: Actually add types here...
Expand Down Expand Up @@ -321,7 +316,7 @@ export interface Levels {
FATAL: Level;
OFF: Level;
levels: Level[];
getLevel(level: Level | string, defaultLevel: Level): Level;
getLevel(level: Level | string, defaultLevel?: Level): Level;
addLevels(customLevels: object): void;
}

Expand Down
2 changes: 1 addition & 1 deletion types/test.ts
Expand Up @@ -133,7 +133,7 @@ log4js.connectLogger(logger2, {

//support for passing in an appender module
log4js.configure({
appenders: { thing: { type: { configure: () => {} }}},
appenders: { thing: { type: { configure: () => () => {} }}},
categories: { default: { appenders: ['thing'], level: 'debug'}}
});

Expand Down