import type { ArtifactProtection, AudioAnalysis, NoiseAnalysis, NoiseBandReport, NoiseProfileMode, NoiseTypeMode, PresetName, RestorationPlan } from "../types/audio.js"; export interface RestorationPlanOptions { preset: PresetName; strength: number; normalize: boolean; noiseProfile: NoiseProfileMode; noiseType: NoiseTypeMode; artifactProtection: ArtifactProtection; /** Reduction multiplier for candidate variants: 0.8 / 1 / 1.2 */ intensityScale?: number; /** * Shifts the denoise threshold for candidate variants, in dB. Threshold * placement — not the amount of reduction — is what decides how much quiet * musical detail survives, so it is the axis the candidates explore. */ nfOffsetDeltaDb?: number; allowTonalCorrection?: boolean; } /** * Place the denoise threshold relative to the *measured* noise floor. * * afftdn's `nf` is an absolute dBFS threshold: everything below it is treated as * noise. Fixed preset values therefore make the result depend on how loud the * transfer happens to be — the same recording at -6 dB gets a different * restoration. Anchoring to the measurement removes that coupling, and keeping * the threshold under the floor is what protects reverb tails and quiet detail. */ export declare function resolveDenoiseThresholdDb(options: { measuredFloorDb: number | null; confidence: number; offsetDb: number; }): number | null; /** * How much reduction to ask for, in dB. * * Once the threshold sits at the measured floor, reduction is the safe knob: * raising it removes more of the floor without reaching further into the music. * Scale it to how much audible noise was actually measured. */ export declare function resolveDenoiseReductionDb(options: { range: { min: number; max: number; }; strength: number; noiseScore: number | null; scale: number; }): number; /** Lowest frequency that still carries performance, Hz. */ export declare function lowestSignalHz(bands: NoiseBandReport[]): number | null; /** * How much noise sits above the content, in dB relative to the music core. * This is what a content ceiling can remove for free. */ export declare function noiseAboveContentDb(bands: NoiseBandReport[], bandwidthHz: number | null, musicReferenceDb: number | null): number | null; /** * Loudest band that reads as a standing noise floor *inside* the content range. * Hiss there cannot be removed with a ceiling, so it needs a shelf instead. */ export declare function inBandHiss(bands: NoiseBandReport[], bandwidthHz: number | null): NoiseBandReport | null; export declare function buildRestorationPlan(analysis: AudioAnalysis, noise: NoiseAnalysis, options: RestorationPlanOptions): RestorationPlan; /** Soften plan for artifact-protection fallback. */ export declare function softenRestorationPlan(plan: RestorationPlan, step: "soften_primary" | "lower_threshold"): RestorationPlan;