Skip to content

Commit

Permalink
Merge pull request #1158 from glasser/fix-typings
Browse files Browse the repository at this point in the history
Make typings match code better
  • Loading branch information
nomiddlename committed Jan 21, 2022
2 parents e711239 + 58234af commit cfdb895
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
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

0 comments on commit cfdb895

Please sign in to comment.