import type { FileProcessor } from './cached-process-file';
import type { Diagnostics } from './diagnostics';
import type { StylableMeta } from './stylable-meta';
import { ImportSymbol, ClassSymbol, ElementSymbol, Imported, StylableSymbol, STSymbol, VarSymbol, CSSVarSymbol, KeyframesSymbol, LayerSymbol, ContainerSymbol, STStructure } from './features';
import type { ModuleResolver } from './types';
import { CustomValueExtension } from './custom-values';
export type JsModule = {
    default?: unknown;
    [key: string]: unknown;
};
export interface InvalidCachedModule {
    kind: 'js' | 'css';
    value: null;
    error: unknown;
    request: string;
    context: string;
    resolvedPath: string | undefined;
}
export interface CachedStylableMeta {
    resolvedPath: string;
    kind: 'css';
    value: StylableMeta;
}
export interface CachedJsModule {
    resolvedPath: string;
    kind: 'js';
    value: JsModule;
}
export interface ResolveOnly {
    resolvedPath: string;
    kind: 'resolve';
    value: null;
}
export type CachedModuleEntity = InvalidCachedModule | CachedStylableMeta | CachedJsModule | ResolveOnly;
export type StylableResolverCache = Map<string, CachedModuleEntity>;
export interface CSSResolveMaybe<T extends StylableSymbol | STStructure.PartSymbol = StylableSymbol> {
    _kind: 'css';
    symbol: T | undefined;
    meta: StylableMeta;
}
export interface CSSResolve<T extends StylableSymbol | STStructure.PartSymbol = StylableSymbol> {
    _kind: 'css';
    symbol: T;
    meta: StylableMeta;
}
export declare function isValidCSSResolve(resolved: CSSResolveMaybe): resolved is CSSResolve;
export type CSSResolvePath = Array<CSSResolve<ClassSymbol | ElementSymbol>>;
export interface JSResolve {
    _kind: 'js';
    symbol: unknown;
    meta: null;
}
export interface MetaResolvedSymbols {
    mainNamespace: Record<string, StylableSymbol['_kind'] | 'js'>;
    class: Record<string, Array<CSSResolve<ClassSymbol | ElementSymbol>>>;
    element: Record<string, Array<CSSResolve<ClassSymbol | ElementSymbol>>>;
    var: Record<string, CSSResolve<VarSymbol>>;
    js: Record<string, JSResolve>;
    customValues: Record<string, CustomValueExtension<any>>;
    cssVar: Record<string, CSSResolve<CSSVarSymbol>>;
    keyframes: Record<string, CSSResolve<KeyframesSymbol>>;
    layer: Record<string, CSSResolve<LayerSymbol>>;
    container: Record<string, CSSResolve<ContainerSymbol>>;
    import: Record<string, CSSResolve<ImportSymbol>>;
}
export type ReportError = (res: CSSResolveMaybe | JSResolve | null, extend: ImportSymbol | ClassSymbol | ElementSymbol, extendPath: Array<CSSResolve<ClassSymbol | ElementSymbol>>, meta: StylableMeta, name: string, isElement: boolean) => void;
export declare class StylableResolver {
    protected fileProcessor: FileProcessor<StylableMeta>;
    protected requireModule: (resolvedPath: string) => any;
    protected moduleResolver: ModuleResolver;
    protected cache?: StylableResolverCache | undefined;
    constructor(fileProcessor: FileProcessor<StylableMeta>, requireModule: (resolvedPath: string) => any, moduleResolver: ModuleResolver, cache?: StylableResolverCache | undefined);
    getModule({ context, request, }: Pick<Imported, 'context' | 'request'>): CachedModuleEntity;
    analyze(filePath: string): StylableMeta;
    resolvePath(directoryPath: string, request: string): string;
    resolveImported(imported: Imported, name: string, subtype?: 'mappedSymbols' | 'mappedKeyframes' | STSymbol.Namespaces): CSSResolveMaybe | JSResolve | null;
    resolveImport(importSymbol: ImportSymbol): CSSResolveMaybe<StylableSymbol> | JSResolve | null;
    resolve(maybeImport: StylableSymbol | undefined): CSSResolveMaybe | JSResolve | null;
    deepResolve(maybeImport: StylableSymbol | undefined, path?: StylableSymbol[]): CSSResolveMaybe | JSResolve | null;
    resolveSymbolOrigin(symbol: StylableSymbol | undefined, meta: StylableMeta, path?: StylableSymbol[]): CSSResolve | null;
    resolveSymbols(meta: StylableMeta, diagnostics: Diagnostics): MetaResolvedSymbols;
    resolveExtends(meta: StylableMeta, nameOrSymbol: string | ClassSymbol | ElementSymbol, isElement?: boolean, reportError?: ReportError): CSSResolvePath;
}
export declare function createSymbolResolverWithCache(resolver: StylableResolver, diagnostics: Diagnostics): (meta: StylableMeta) => MetaResolvedSymbols;
//# sourceMappingURL=stylable-resolver.d.ts.map