import type { lexer } from 'good-enough-parser';
import type { PackageDependency } from '../types';
export interface GradleManagerData {
    fileReplacePosition?: number;
    packageFile?: string;
}
export interface VariableData extends GradleManagerData {
    key: string;
    value: string;
}
export declare type PackageVariables = Record<string, VariableData>;
export declare type VariableRegistry = Record<string, PackageVariables>;
export interface ParseGradleResult {
    deps: PackageDependency<GradleManagerData>[];
    urls: string[];
    vars: PackageVariables;
}
export interface GradleCatalog {
    versions?: Record<string, GradleVersionPointerTarget>;
    libraries?: Record<string, GradleCatalogModuleDescriptor | GradleCatalogArtifactDescriptor | string>;
    plugins?: Record<string, GradleCatalogPluginDescriptor | string>;
}
export interface GradleCatalogModuleDescriptor {
    module: string;
    version?: GradleVersionCatalogVersion;
}
export interface GradleCatalogArtifactDescriptor {
    name: string;
    group: string;
    version?: GradleVersionCatalogVersion;
}
export interface GradleCatalogPluginDescriptor {
    id: string;
    version: GradleVersionCatalogVersion;
}
export interface VersionPointer {
    ref: string;
}
/**
 * Rich version declarations in Gradle version catalogs
 *
 * @see https://docs.gradle.org/current/userguide/rich_versions.html
 * @see https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
 */
export interface RichVersion {
    require?: string;
    strictly?: string;
    prefer?: string;
    reject?: string[];
    rejectAll?: boolean;
}
export declare type GradleVersionPointerTarget = string | RichVersion;
export declare type GradleVersionCatalogVersion = string | VersionPointer | RichVersion;
export interface Ctx {
    readonly packageFile: string;
    readonly fileContents: Record<string, string | null>;
    recursionDepth: number;
    globalVars: PackageVariables;
    deps: PackageDependency<GradleManagerData>[];
    depRegistryUrls: string[];
    varTokens: lexer.Token[];
    tmpTokenStore: Record<string, lexer.Token[]>;
    tokenMap: Record<string, lexer.Token[]>;
}
export declare type NonEmptyArray<T> = T[] & {
    0: T;
};
