/** * Navidrome MCP Server - Shared Transformer Utilities * Copyright (C) 2025 * SPDX-License-Identifier: AGPL-3.0-or-later */ interface RawEntityWithGenres { genre?: string; genres?: Array<{ name: string; }>; [key: string]: unknown; } type TransformField = 'addedDate' | 'albumArtist' | 'albumArtistId' | 'biography' | 'bitRate' | 'compilation' | 'duration' | 'genre' | 'genres' | 'path' | 'playCount' | 'playDate' | 'playlistId' | 'rating' | 'releaseYear' | 'starred' | 'trackNumber' | 'year'; /** * Compact mode, the default, emits only identity fields so large array responses stay under the * tool-result token cap. `keep` force-emits a field one caller needs, such as `playCount` for * list_most_played. */ export interface TransformOptions { verbose?: boolean; keep?: readonly TransformField[]; } /** * Identity fields bypass this gate, since each transformer emits them directly. * Dependent fields such as `starredAt` are emitted under their gate field (`starred`). */ export declare function shouldEmit(field: TransformField, options?: TransformOptions): boolean; /** * Navidrome omits `starred` when false, so only `true` marks a star. * `starredAt` outlives an unstar, so it is echoed only with `starred: true`. */ export declare function starredFields(raw: { starred?: boolean | null; starredAt?: string; }, options?: TransformOptions): { starred?: boolean; starredAt?: string; }; /** * Navidrome can return null or non-object rows on some API errors. One such row would crash the * single-item transformer and lose the entire batch, so non-object rows are dropped. */ export declare function transformObjectRows(raw: unknown, transform: (row: T) => R): R[]; /** Inverse of {@link formatDuration}. Any other shape parses as 0. */ export declare function parseDuration(durationFormatted: string): number; export declare function formatDuration(seconds?: number): string; export declare function extractGenre(entity: RawEntityWithGenres): string | undefined; export declare function extractAllGenres(entity: RawEntityWithGenres): string[] | undefined; export {}; //# sourceMappingURL=shared-transformers.d.ts.map