UNPKG

st-bundle

Version:

CLI for watching and bundling SpringType projects.

112 lines (111 loc) 3.08 kB
import { IFastAnalysis } from '../analysis/fastAnalysis'; import { IModuleCacheBasics } from '../cache/cache'; import { ProductionModule } from '../production/ProductionModule'; import { IStylesheetModuleResponse } from '../stylesheet/interfaces'; import { Context } from './Context'; import { Package } from './Package'; export interface IModuleProps { ctx: Context; absPath: string; fuseBoxPath: string; extension: string; } export declare class Module { props: IModuleProps; /** * Meta will be store to cache if set * * @type {{ [key: string]: any }} * @memberof Module */ meta: { [key: string]: any; }; isCached: boolean; errored: boolean; cache: IModuleCacheBasics; assembled: boolean; isEntryPoint?: boolean; fastAnalysis: IFastAnalysis; css: IStylesheetModuleResponse; isCSSModule?: boolean; isCSSText?: boolean; /** * A package that holds this module * * @type {Package} * @memberof Module */ pkg: Package; /** * A list of modules that imported this moudle * * @type {Array<Module>} * @memberof Module */ moduleDependants: Array<Module>; /** * Toggle this from plugins in order to let the watchers to break * all modules cache which imported this module * * @type {boolean} * @memberof Module */ breakDependantsCache: boolean; /** * Current dependency tree * * @type {Array<Module>} * @memberof Module */ moduleDependencies: Array<Module>; /** * Node Modules dependencies of this module * * @type {Array<Package>} * @memberof Module */ externalDependencies: Array<Package>; /** * Used by plugins to identify whether this module has been captured * And prevent other plugins from capturing it * * @type {boolean} * @memberof Module */ captured: boolean; header: Array<string>; contents: string; sourceMap: string; cssSourceMap: string; weakReferences: Array<string>; ast?: any; private _isStylesheet; private _isExecutable; private _isJavascriptModule; productionModule: ProductionModule; constructor(props: IModuleProps, pkg: Package); isEntry(): boolean; isTypescriptModule(): boolean; isJavascriptModule(): boolean; fastAnalyse(): IFastAnalysis; setMeta(key: string, value: any): void; getMeta(key: string): any; addWeakReference(url: string): void; testPath(path: string | RegExp): any; setCache(basics: IModuleCacheBasics): void; getSourceMapPath(): string; read(forceReload?: boolean): string; isExecutable(): boolean; isStylesheet(): boolean; notStylesheet(): void; getShortPath(): string; getHasedPath(): string; isCSSSourceMapRequired(): boolean; isSourceMapRequired(): boolean; generate(): { contents: string; sourceMap: string; }; } export declare function createModule(props: IModuleProps, pkg: Package): Module;