type Callback = (err: Error | null, data: T) => void; interface PackageJson { name: string; version: string; dependencies?: Record; devDependencies?: Record; } export interface CompiledViewInfo { imports?: Record; template: { type: string; hashKey: string; src: string; }; bundle: { hashKey: string; }; } type OcOptions = { version: string; minOcVersion: string; packaged: boolean; date: number; parameters?: Record; files: { imports?: Record; client?: any; data?: string; dataProvider?: any; env?: string; static?: string | string[]; template: { src: string; type: string; version?: string; minOcVersion?: string; externals?: Array<{ name: string; paths?: string[]; global: string; url: string; }>; }; }; }; export interface CompilerOptions { componentPackage: PackageJson & { oc: OcOptions; }; componentPath: string; minify: boolean; ocPackage: PackageJson; production: boolean; publishPath: string; verbose: boolean; watch: boolean; } export interface CompilerServerOptions extends CompilerOptions { compiledViewInfo: CompiledViewInfo; } export type CompileView = (options: CompilerOptions, cb: Callback) => void; export type CompileServer = (options: CompilerServerOptions, cb: Callback<{ type: string; hashKey: string; src: string; parameters?: Record; }>) => void; export type CompileStatics = (options: CompilerOptions, cb: Callback<'ok'>) => void; export type GetInfo = () => { type: string; minOcVersion?: string; version: string; externals: Array<{ name: string; paths?: string[]; global: string; url: string; }>; }; export type CompileDependencies = { compileView: CompileView; compileServer: CompileServer; compileStatics: CompileStatics; getInfo: GetInfo; }; export declare function createCompile(dependencies: CompileDependencies): (options: CompilerOptions, callback: Callback) => void; export {};