UNPKG

2.58 kBTypeScriptView Raw
1import { FileProcessor } from './cached-process-file';
2import { Diagnostics } from './diagnostics';
3import { ClassSymbol, ElementSymbol, Imported } from './stylable-meta';
4import { ImportSymbol, StylableMeta, StylableSymbol } from './stylable-processor';
5import { StylableTransformer } from './stylable-transformer';
6export declare const resolverWarnings: {
7 UNKNOWN_IMPORTED_FILE(path: string): string;
8 UNKNOWN_IMPORTED_SYMBOL(name: string, path: string): string;
9};
10export interface CSSResolve<T extends StylableSymbol = StylableSymbol> {
11 _kind: 'css';
12 symbol: T;
13 meta: StylableMeta;
14}
15export interface JSResolve {
16 _kind: 'js';
17 symbol: any;
18 meta: null;
19}
20export declare function isInPath(extendPath: Array<CSSResolve<ClassSymbol | ElementSymbol>>, { symbol: { name: name1 }, meta: { source: source1 } }: CSSResolve<ClassSymbol | ElementSymbol>): CSSResolve<ClassSymbol | ElementSymbol> | undefined;
21export declare class StylableResolver {
22 protected fileProcessor: FileProcessor<StylableMeta>;
23 protected requireModule: (modulePath: string) => any;
24 constructor(fileProcessor: FileProcessor<StylableMeta>, requireModule: (modulePath: string) => any);
25 resolveImported(imported: Imported, name: string): CSSResolve<StylableSymbol> | JSResolve | null;
26 resolveImport(importSymbol: ImportSymbol): CSSResolve<StylableSymbol> | JSResolve | null;
27 resolve(maybeImport: StylableSymbol | undefined): CSSResolve | JSResolve | null;
28 deepResolve(maybeImport: StylableSymbol | undefined, path?: StylableSymbol[]): CSSResolve | JSResolve | null;
29 resolveSymbolOrigin(symbol: StylableSymbol | undefined, meta: StylableMeta, path?: StylableSymbol[]): CSSResolve | null;
30 resolveClass(meta: StylableMeta, symbol: StylableSymbol): CSSResolve<ClassSymbol | ElementSymbol> | null;
31 resolveName(meta: StylableMeta, symbol: StylableSymbol, isElement: boolean): CSSResolve<ClassSymbol | ElementSymbol> | null;
32 resolveElement(meta: StylableMeta, symbol: StylableSymbol): CSSResolve<ClassSymbol | ElementSymbol> | null;
33 resolveExtends(meta: StylableMeta, className: string, isElement?: boolean, transformer?: StylableTransformer, reportError?: (res: CSSResolve | JSResolve | null, extend: ImportSymbol | ClassSymbol | ElementSymbol, extendPath: Array<CSSResolve<ClassSymbol | ElementSymbol>>, meta: StylableMeta, className: string, isElement: boolean) => void): Array<CSSResolve<ClassSymbol | ElementSymbol>>;
34 validateImports(meta: StylableMeta, diagnostics: Diagnostics): void;
35}
36//# sourceMappingURL=stylable-resolver.d.ts.map
\No newline at end of file