import type { Resolver } from '../resolver/index.js'; import { type Transformer } from '../transformer/index.js'; import { type Location } from './postcss.js'; export { collectNodes, type Location } from './postcss.js'; /** The exported token. */ export type Token = { /** The token name. */ name: string; /** The name of the imported token. */ importedName?: string; /** The original location of the token in the source file. */ originalLocation: Location; }; /** The result of `Locator#load`. */ export type LoadResult = { /** The path of the file imported from the source file with `@import`. */ dependencies: string[]; /** The tokens exported by the source file. */ tokens: Token[]; }; export type LocatorOptions = { /** The function to transform source code. */ transformer?: Transformer | undefined; /** The function to resolve the path of the imported file. */ resolver?: Resolver | undefined; }; /** The resolver that throws an exception if resolving fails. */ export type StrictlyResolver = (...args: Parameters) => Promise; /** This class collects information on tokens exported from CSS Modules files. */ export declare class Locator { private readonly cache; private readonly transformer; private readonly resolver; private loading; constructor(options?: LocatorOptions); /** Returns `true` if the cache is outdated. */ private isCacheOutdated; /** * Reads the source file and returns the code. * If transformer is specified, the code is transformed before returning. */ private readCSS; /** Returns information about the tokens exported from the CSS Modules file. */ load(filePath: string): Promise; private _load; }