import type { AstroIntegrationLogger } from "astro"; import type { LilypondVersion } from "./types/lilypondVersion.js"; export declare const FORMATS: readonly ["png", "svg", "pdf"]; export type Format = (typeof FORMATS)[number]; /** * Defaults passed to each score for rendering. */ export interface LilypondDefaults { /** * LilyPond version to use for every block that * doesn't already declare `\version`. * @default "2.26.0" */ version?: LilypondVersion; /** * Output format. * @default "svg" */ format?: "svg" | "png"; /** * Resolution in DPI (only applies to PNG). * @default 144 */ resolution?: number; /** * Multiplies the `width`/`height` on a cropped score's `` tag. * Helps compensate for LilyPond's internal size units (points/mm) * appearing too small when converted to pixels. Only affects the `` * dimensions on the page; rendered files are not affected. * Has no effect on uncropped (paginated) output. * @default 1.5 */ cropScale?: number; } /** * The subset of `LilypondDefaults` that `render()` itself reads. `version` * and `format` are resolved by the caller before reaching `render()`. */ export type RenderDefaults = Omit; export interface InternalRenderOptions { /** * Output format. * @default "svg" */ format?: Format; /** * Crop the output tightly to the content bounding box, producing one * continuous image instead of paginated output. Disable for full-page, * potentially multi-page output. * @default true */ crop?: boolean; /** * Defaults for rendering each score. `version` and `crop` aren't read * here — see `RenderDefaults`. */ defaults?: RenderDefaults; /** * Path to the `lilypond` binary. * @default "lilypond" */ binaryPath?: string; /** * Extra directories LilyPond should search for `\include`d files. * Typically the directory containing the source `.ly`/Markdown file. */ includePaths?: string[]; /** * Base name to give the temp input file passed to LilyPond, so build * output (e.g. `Processing "bach-schenker.ly"`). Falls back to * `"input.ly"` when omitted or unsafe to use as a filename. */ sourceName?: string; /** * Milliseconds to wait for a single `lilypond` invocation before * aborting it, so a pathological score can't hang the build forever. * @default 60000 */ timeout?: number; /** * Warning and failure logging from LilyPond. */ logger: Pick; } export declare const defaultOptions: Required> & { defaults: Required; }; export declare function render(source: string, options: InternalRenderOptions): Promise;