/** * Navidrome MCP Server - settings.json schema walks (coercion, unknown keys, salvage, prune) * Copyright (C) 2025 * SPDX-License-Identifier: AGPL-3.0-or-later */ import { z } from 'zod'; export type JsonObject = Record; export declare function isJsonObject(value: unknown): value is JsonObject; /** * Turns an unambiguous slip into the type the schema wants, such as the text "8808" where a number * belongs, and names each coerced key. A value the schema accepts is never touched, so a file that * parsed before parses the same way. */ export declare function coerceSlips(schema: z.ZodObject, value: unknown): { value: unknown; notices: string[]; }; /** * Names each key the schema does not know, with the nearest known sibling as a suggestion. A newer * build may have written the key, so the notice does not call it wrong. */ export declare function findUnknownKeys(schema: z.ZodObject, value: unknown): string[]; /** * Keeps each known value that passes its own schema, so the settings page can still show the good * values of a file that fails as a whole. An unknown key is kept unchanged, since a newer build may * have written it. An object such as `playback.audioDevice` that fails after its bad fields are * dropped is left out entirely. */ export declare function salvageValidLeaves(schema: z.ZodObject, value: unknown): JsonObject; /** * Drops each known key whose value is null, "", [] or an object left empty, when the schema lets the * key be absent. An unknown key is kept unchanged, since a newer build may give its empty value a meaning. */ export declare function pruneEmptyValues(schema: z.ZodObject, value: JsonObject): JsonObject; //# sourceMappingURL=settings-file-checks.d.ts.map