/** * CSL Style Management * * Handles resolution and loading of CSL (Citation Style Language) style files. * * Style Resolution Order: * 1. --csl-file (exact file path) * 2. Built-in style matching --style * 3. Search in csl_directory paths (in array order) * 4. Default style from config (default_style) * 5. "apa" (hardcoded default) */ /** * Built-in styles available in @citation-js/plugin-csl * These can be used directly without loading external files */ export declare const BUILTIN_STYLES: readonly ["apa", "vancouver", "harvard"]; export type BuiltinStyleName = (typeof BUILTIN_STYLES)[number]; /** * Check if a style name is a built-in style */ export declare function isBuiltinStyle(styleName: string): styleName is BuiltinStyleName; export interface StyleResolutionOptions { /** * Exact path to CSL file (from --csl-file option) * Takes highest priority */ cslFile?: string; /** * Style name to resolve (from --style option) */ style?: string; /** * Directory or directories to search for custom CSL files * (from csl_directory config) * Can be a single string or array of strings */ cslDirectory?: string | string[]; /** * Default style to use if specified style not found * (from default_style config) */ defaultStyle?: string; } export interface StyleResolution { /** * Type of resolution: "builtin" for citation-js built-in styles, * "custom" for external CSL files */ type: "builtin" | "custom"; /** * The resolved style name (for built-in) or identifier (for custom) */ styleName: string; /** * CSL XML content (only for custom styles) */ styleXml?: string; } /** * Load CSL style file content from the given path * * @param stylePath - Path to the CSL style file * @returns Content of the CSL style file (XML string) * @throws Error if file cannot be read */ export declare function loadCSLStyleFile(stylePath: string): string; /** * Resolve the style based on resolution options * * Resolution order: * 1. cslFile (exact path) - throws if doesn't exist * 2. Built-in style matching style name * 3. Search in csl_directory paths (in order) * 4. Default style (defaultStyle) - if built-in * 5. "apa" (hardcoded fallback) * * @param options - Style resolution options * @returns StyleResolution with type, styleName, and optional styleXml * @throws Error if cslFile is specified but doesn't exist */ export declare function resolveStyle(options: StyleResolutionOptions): StyleResolution; //# sourceMappingURL=csl-styles.d.ts.map