import type { Log } from "./log.js";
import * as slog from "../../internal/compat/slog.js";
declare class Mutex {
    lock(): void;
    unlock(): void;
}
export type BatchOptions = {
    WriteFunc: (ctx: slog.Context, logs: Log[]) => Error | null | Promise<Error | null>;
    BeforeAddFunc?: (ctx: slog.Context, log: Log) => boolean;
    Level?: slog.Leveler;
    BatchSize?: number;
};
type ResolvedBatchOptions = {
    WriteFunc: (ctx: slog.Context, logs: Log[]) => Error | null | Promise<Error | null>;
    BeforeAddFunc?: (ctx: slog.Context, log: Log) => boolean;
    Level: slog.Leveler;
    BatchSize: number;
};
export declare function NewBatchHandler(options: BatchOptions): BatchHandler;
export declare class BatchHandler implements slog.Handler {
    mux: Mutex;
    parent?: BatchHandler;
    options: ResolvedBatchOptions;
    group: string;
    attrs: slog.Attr[];
    logs: Log[];
    constructor(params: {
        mux: Mutex;
        options: ResolvedBatchOptions;
        parent?: BatchHandler;
        group?: string;
        attrs?: slog.Attr[];
    });
    Enabled(_ctx: slog.Context, level: slog.Level): boolean;
    WithGroup(name: string): slog.Handler;
    WithAttrs(attrs: slog.Attr[]): slog.Handler;
    Handle(ctx: slog.Context, record: slog.Record): Error | null;
    SetLevel(level: slog.Level): void;
    WriteAll(ctx: slog.Context): Promise<Error | null>;
    resolveAttr(data: Record<string, unknown>, attr: slog.Attr): boolean;
}
export {};
