fix typescript errors

This commit is contained in:
Bruno Windels 2022-05-09 14:23:57 +02:00
parent 814cee214c
commit 8140e4f2c3

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import {LogLevel} from "./LogFilter"; import {LogLevel} from "./LogFilter";
import type {ILogger, ILogItem, LabelOrValues, LogCallback, LogItemValues} from "./types"; import type {ILogger, ILogItem, ILogReporter, LabelOrValues, LogCallback, LogItemValues} from "./types";
function noop (): void {} function noop (): void {}
@ -25,6 +25,10 @@ export class NullLogger implements ILogger {
addReporter() {} addReporter() {}
get reporters(): ReadonlyArray<ILogReporter> {
return [];
}
getOpenRootItems(): Iterable<ILogItem> { getOpenRootItems(): Iterable<ILogItem> {
return []; return [];
} }
@ -58,13 +62,13 @@ export class NullLogger implements ILogger {
} }
export class NullLogItem implements ILogItem { export class NullLogItem implements ILogItem {
public readonly logger: ILogger; public readonly logger: NullLogger;
public readonly logLevel: LogLevel; public readonly logLevel: LogLevel;
public children?: Array<ILogItem>; public children?: Array<ILogItem>;
public values: LogItemValues; public values: LogItemValues;
public error?: Error; public error?: Error;
constructor(logger: ILogger) { constructor(logger: NullLogger) {
this.logger = logger; this.logger = logger;
} }