import ts from "typescript"; import { InjectDIToken, Injector } from "@bonbons/di"; import { Path } from "./path/path.contract"; import { HtmlBundle } from "./html-bundle"; import { GlobalMap } from "./global-map"; import { IChildRefPluginOptions } from "./entity-parser"; import { IWebpackOptions, WebpackBuild, WebpackConfig, WebpackPlugins } from "./webpack"; import { Prettier } from "./prettier/prettier.contract"; export interface IDirectiveDefine { module: string; name: string; id: string; input?: { [name: string]: any; }; } export interface IComponentDefine extends IDirectiveDefine { } export interface IChildDefine { ref: string; id: string; props?: { [name: string]: any; }; } export interface IPageDefine extends IComponentDefine { attach?: { [name: string]: any; }; directives?: IDirectiveDefine[]; children?: IChildDefine[]; } export interface IPageCreateOptions { components?: IComponentDefine[]; page: IPageDefine; } export interface ISourceCreateTranspileOptions { enabled: boolean; beforeTransformer: any[]; afterTransformer: any[]; jsx: "react" | "preserve" | false; module: "commonjs" | "es2015"; target: "es5" | "es2015" | "es2016"; } export interface ISourceCreateOptions { prettier?: boolean; transpile?: Partial; configs: IPageCreateOptions; } export interface IDirectiveCreateOptions { moduleName: string; templateName: string; componentName: string; input: { [prop: string]: any; }; } export interface IComponentCreateOptions extends IDirectiveCreateOptions { } export declare type IChildCreateOptions = IChildRefPluginOptions; export interface IRootComponentCreateOptions extends IComponentCreateOptions { components?: IComponentCreateOptions[]; directives?: IDirectiveCreateOptions[]; children?: IChildCreateOptions[]; attach: { [prop: string]: any; }; } export interface ISourceCreateResult { sourceCode: string; depsJSON: string; } export interface ICompileResult { sourceFile: ts.SourceFile; dependencies: { [name: string]: string; }; } export declare class Builder { protected readonly injector: Injector; protected readonly path: Path; protected readonly prettier: Prettier; protected readonly globalMap: GlobalMap; protected readonly webpackBuild: WebpackBuild; readonly webpackConfig: WebpackConfig; readonly webpackPlugins: WebpackPlugins; readonly htmlBundle: HtmlBundle; constructor(injector: Injector, path: Path, prettier: Prettier, globalMap: GlobalMap, webpackBuild: WebpackBuild, webpackConfig: WebpackConfig, webpackPlugins: WebpackPlugins, htmlBundle: HtmlBundle); get(contract: InjectDIToken): T; createSource(options: ISourceCreateOptions): Promise; buildSource(options: IWebpackOptions): Promise; private _resolveType; private _resolveCreateOptions; private _resolveRootDepts; private _createComponentSource; }