import type { AstroIntegration } from "astro";
import { type AstroComponentFactory } from "astro/runtime/server/index.js";
import { type AutoInstallOptions } from "./binary/index.js";
import { type PluginOptions } from "./plugins/index.js";
import { type LilypondDefaults } from "./render.js";
import { type LilypondMetadata } from "./utils/index.js";
export declare const LY_EXTENSIONS: readonly [".ly", ".lilypond", ".ily"];
export type { AstroComponentFactory, AutoInstallOptions, LilypondDefaults, LilypondMetadata, PluginOptions as LilypondPluginOptions, };
export interface LilypondPage {
src: string;
width?: number;
height?: number;
}
/**
* The result of a `.ly`/`.ily`/`.lilypond` import
* or `lilypondLoader()` collection entry.
*/
export interface LilypondScore {
source: string;
alt: string;
sourceName?: string;
includePaths: string[];
assetTitle: string;
meta: LilypondMetadata;
}
export interface GetScoreOptions {
/**
* Output format for `Score`.
* @default the `defaults.format` configured on the integration ("svg" unless overridden)
*/
format?: "svg" | "png";
/**
* Crop `Score` to a single tightly-fit image instead of full pages.
* @default false
*/
crop?: boolean;
/**
* Render a downloadable PDF of the same score, returned as `pdf`.
* @default false
*/
pdf?: boolean;
}
export interface LilypondImageResult {
pages: LilypondPage[];
alt?: string;
}
export interface LilypondPdfResult {
src: string;
}
export interface GetScoreResult {
Score: AstroComponentFactory;
pages: LilypondPage[];
pdf?: LilypondPdfResult;
meta: LilypondMetadata;
raw: string;
}
interface ScoreImageProps {
pageLimit?: number;
class?: string;
style?: string;
alt?: string;
}
/**
* Renders a `LilypondScore` (from a `.ly`/`.ily`/`.lilypond` import,
* or a `lilypondLoader()` entry) to a renderable `` component.
*/
export declare function getScore(score: LilypondScore, options?: GetScoreOptions): Promise;
export interface ScoreProps extends ScoreImageProps, Pick {
/**
* A `LilypondScore` from a `.ly`/`.ily`/`.lilypond` import
* or a `lilypondLoader()` entry.
*/
content: LilypondScore;
}
/**
* Renders a `LilypondScore` directly, for the common case where none of
* `getScore()`'s `pages`, `meta`, `raw`, or `pdf` are needed. Use
* `getScore()` instead when you need those.
*/
export declare const Score: AstroComponentFactory;
export interface LilypondOptions extends PluginOptions {
/**
* Defaults passed to each score; can be overridden at render time.
*/
defaults?: LilypondDefaults;
/**
* Ms to wait for a single `lilypond` invocation before aborting.
* @default 60000
*/
timeout?: number;
/**
* When no `lilypond` binary is found on `PATH`, download a matching
* prebuilt release into a local cache and use that instead.
* @default true
*/
autoInstall?: boolean | AutoInstallOptions;
/**
* Extra directories to search for `\include`d files, in addition to each
* score's own directory. Relative paths resolve against the project root.
* @default []
*/
includePaths?: string[];
}
export default function lilypond(options?: LilypondOptions): AstroIntegration;