import type { RedactOptions, Rules } from "@visulima/redact"; import type { Meta, Processor } from "../types.d.ts"; /** * Redact Processor. * * A processor that redacts sensitive information from log messages and metadata. * Uses the {@link https://www.visulima.com/docs/package/redact|@visulima/redact} library to identify and mask sensitive data like * passwords, API keys, credit card numbers, and other PII. * @template L - The log level type * @example * ```typescript * import { createPail } from "@visulima/pail"; * import RedactProcessor from "@visulima/pail/processor/redact"; * * const logger = createPail({ * processors: [new RedactProcessor()] * }); * * logger.info("User login", { * username: "john", * password: "secret123", // Will be redacted * apiKey: "sk-123456" // Will be redacted * }); * ``` */ declare class RedactProcessor implements Processor { #private; /** * Creates a new RedactProcessor instance. * @param rules Custom redaction rules (uses standardRules if not provided) * @param options Additional redaction options */ constructor(rules?: Rules, options?: RedactOptions); /** * Processes log metadata to redact sensitive information. * * Applies redaction rules to the message, context, and error properties * in the log metadata to prevent sensitive data from being logged. * @param meta The log metadata to process * @returns The processed metadata with sensitive data redacted */ process(meta: Meta): Meta; } export default RedactProcessor;