import type { PostcssNode } from '@vltpkg/dss-parser'; import type { ModifierBreadcrumb, ModifierBreadcrumbItem, ModifierInteractiveBreadcrumb, BreadcrumbSpecificity } from './types.ts'; export * from './types.ts'; /** * The returned pseudo selector parameters object. */ type ParsedPseudoParameters = { semverValue?: string; }; /** * Helper function to remove quotes from a string value. */ export declare const removeQuotes: (value: string) => string; /** * Helper function to extract parameter value from pseudo selector nodes. */ export declare const extractPseudoParameter: (item: any) => ParsedPseudoParameters; /** * Helper function to get the full text representation * of a pseudo selector including parameters */ export declare const getPseudoSelectorFullText: (item: PostcssNode) => string; /** * The Breadcrumb class is used to represent a valid breadcrumb * path that helps you traverse a graph and find a specific node or edge. * * Alongside the traditional analogy, "Breadcrumb" is also being used here * as a term used to describe the subset of the query language that uses * only pseudo selectors, id selectors & combinators. * * The Breadcrumb class implements a doubly-linked list of items * that can be used to navigate through the breadcrumb. * The InteractiveBreadcrumb can also be used to keep track of state * of the current breadcrumb item that should be used for checks. * * It also validates that each element of the provided query string is * valid according to the previous definition of a "Breadcrumb" query * language subset. */ export declare class Breadcrumb implements ModifierBreadcrumb { #private; comment: string | undefined; specificity: BreadcrumbSpecificity; /** * Initializes the interactive breadcrumb with a query string. */ constructor(query: string); /** * Retrieves the first breadcrumb item. */ get first(): ModifierBreadcrumbItem; /** * Retrieves the last breadcrumb item. */ get last(): ModifierBreadcrumbItem; /** * Returns `true` if the breadcrumb is composed of a single item. */ get single(): boolean; [Symbol.iterator](): ArrayIterator; /** * Empties the current breadcrumb list. */ clear(): void; /** * Gets an {@link InteractiveBreadcrumb} instance that can be * used to track state of the current breadcrumb item. */ interactive(): InteractiveBreadcrumb; } /** * The InteractiveBreadcrumb is used to keep track of state * of the current breadcrumb item that should be used for checks. */ export declare class InteractiveBreadcrumb implements ModifierInteractiveBreadcrumb { #private; constructor(breadcrumb: Breadcrumb); /** * The current breadcrumb item. */ get current(): ModifierBreadcrumbItem | undefined; /** * Returns `true` if the current breadcrumb has no more items left. */ get done(): boolean; /** * The next breadcrumb item. */ next(): this; } /** * Returns an {@link Breadcrumb} list of items * for a given query string. */ export declare const parseBreadcrumb: (query: string) => ModifierBreadcrumb; /** * Sorts an array of Breadcrumb objects by specificity. Objects with * higher idCounter values come first, if idCounter values are equal, * then objects with higher commonCounter values come first. Otherwise, * the original order is preserved. */ export declare const specificitySort: (breadcrumbs: ModifierBreadcrumb[]) => ModifierBreadcrumb[];