UNPKG

2.78 kBTypeScriptView Raw
1import { FileProcessor, MinimalFS } from './cached-process-file';
2import { Diagnostics } from './diagnostics';
3import { processNamespace, StylableMeta } from './stylable-processor';
4import { StylableResolver } from './stylable-resolver';
5import { StylableResults, StylableTransformer, TransformerOptions, TransformHooks } from './stylable-transformer';
6import { TimedCacheOptions } from './timed-cache';
7import { IStylableOptimizer, ModuleResolver } from './types';
8export interface StylableConfig {
9 projectRoot: string;
10 fileSystem: MinimalFS;
11 requireModule?: (path: string) => any;
12 delimiter?: string;
13 onProcess?: (meta: StylableMeta, path: string) => StylableMeta;
14 diagnostics?: Diagnostics;
15 hooks?: TransformHooks;
16 resolveOptions?: {
17 alias: any;
18 symlinks: boolean;
19 [key: string]: any;
20 };
21 optimizer?: IStylableOptimizer;
22 mode?: 'production' | 'development';
23 resolveNamespace?: typeof processNamespace;
24 timedCacheOptions?: Omit<TimedCacheOptions, 'createKey'>;
25 resolveModule?: ModuleResolver;
26}
27export declare class Stylable {
28 projectRoot: string;
29 protected fileSystem: MinimalFS;
30 protected requireModule: (path: string) => any;
31 delimiter: string;
32 protected onProcess?: ((meta: StylableMeta, path: string) => StylableMeta) | undefined;
33 protected diagnostics: Diagnostics;
34 protected hooks: TransformHooks;
35 protected resolveOptions: any;
36 optimizer?: IStylableOptimizer | undefined;
37 protected mode: 'production' | 'development';
38 resolveNamespace?: typeof processNamespace | undefined;
39 protected timedCacheOptions: Omit<TimedCacheOptions, 'createKey'>;
40 protected resolveModule?: ModuleResolver | undefined;
41 static create(config: StylableConfig): Stylable;
42 fileProcessor: FileProcessor<StylableMeta>;
43 resolver: StylableResolver;
44 resolvePath: (ctx: string | undefined, path: string) => string;
45 constructor(projectRoot: string, fileSystem: MinimalFS, requireModule: (path: string) => any, delimiter?: string, onProcess?: ((meta: StylableMeta, path: string) => StylableMeta) | undefined, diagnostics?: Diagnostics, hooks?: TransformHooks, resolveOptions?: any, optimizer?: IStylableOptimizer | undefined, mode?: 'production' | 'development', resolveNamespace?: typeof processNamespace | undefined, timedCacheOptions?: Omit<TimedCacheOptions, 'createKey'>, resolveModule?: ModuleResolver | undefined);
46 createTransformer(options?: Partial<TransformerOptions>): StylableTransformer;
47 transform(meta: StylableMeta): StylableResults;
48 transform(source: string, resourcePath: string): StylableResults;
49 process(fullpath: string, context?: string, ignoreCache?: boolean): StylableMeta;
50}
51//# sourceMappingURL=stylable.d.ts.map
\No newline at end of file