/**
 * Utility functions for handling SQL parameter references
 */
import type { CompiledTable, Explore, Table } from '../types/explore';
import type { LightdashProjectParameter } from '../types/lightdashProjectConfig';
import type { ParameterDefinitions, ParametersValuesMap } from '../types/parameters';
export declare const parameterRegex: RegExp;
export declare enum LightdashParameters {
    PREFIX = "lightdash.parameters",
    PREFIX_SHORT = "ld.parameters"
}
/**
 * Single source of truth for extracting parameter references from a templated SQL or
 * format string. Detects both `${ld.parameters.X}` substitution sites and bare
 * `ld.parameters.X` references inside Liquid template blocks (only when `{%` is present,
 * to avoid false positives in plain SQL).
 *
 * @param sources - One or more strings to scan (e.g. compiled SQL, sql_from, format string).
 * @returns A deduplicated array of parameter names.
 */
export declare const getParameterReferences: (...sources: (string | undefined)[]) => string[];
export declare const validateParameterReferences: (tableName: string, parameterReferences: string[], availableParameters: string[]) => void;
/**
 * Get all available parameter names for a project and explore
 * @param projectParameters - The project parameters
 * @param exploreParameters - The explore parameters
 * @returns An array of available parameter names
 */
export declare const getAvailableParameterNames: (projectParameters: Record<string, LightdashProjectParameter> | undefined, exploreParameters: Record<string, LightdashProjectParameter> | undefined) => string[];
/** Whether any reference is a reserved (system-owned) parameter. */
export declare const hasReservedParameterReference: (parameterReferences: string[]) => boolean;
/**
 * Which referenced parameters still need a value (no value and no default). Both checks
 * use key presence, so an explicit falsy value or default (`0`, `''`, `[]`) counts as
 * supplied, matching the backend's `default !== undefined`. Reserved params never count.
 */
export declare const getMissingRequiredParameters: (parameterReferences: string[], parameterValues: ParametersValuesMap | undefined, parameterDefinitions: ParameterDefinitions | undefined) => string[];
/**
 * Get all available parameter names for a project and explore
 * @param exploreParameters - The explore parameters
 * @param includedTables - The included tables
 * @returns An array of available parameter names
 */
export declare const getAvailableParametersFromTables: (includedTables: (Table | CompiledTable)[]) => Record<string, LightdashProjectParameter>;
/** Table-scoped plus explore-level parameter definitions for an explore (empty when absent). */
export declare const getExploreParameterDefinitions: (explore: Explore | undefined) => Record<string, LightdashProjectParameter>;
/**
 * The subset of user parameter definitions that are actually referenced. A referenced
 * name with no user definition (e.g. a reserved system variable referenced on its own)
 * is excluded, so callers only surface user-editable parameters.
 */
export declare const getReferencedParameterDefinitions: (definitions: Record<string, LightdashProjectParameter>, references: string[] | undefined) => Record<string, LightdashProjectParameter>;
/**
 * Validate parameter names. Only bad-pattern names are invalid; names colliding with a
 * reserved parameter are returned separately so callers can warn (the user param wins).
 */
export declare const validateParameterNames: (parameters: Record<string, LightdashProjectParameter> | undefined) => {
    isInvalid: boolean;
    invalidParameters: string[];
    reservedParameters: string[];
};
/**
 * Validate parameter configuration using AJV against the JSON schema.
 */
export declare const validateParameterConfiguration: (parameters: Record<string, LightdashProjectParameter> | undefined) => {
    isValid: boolean;
    error: string | null;
};
//# sourceMappingURL=parameters.d.ts.map