@wrench/roll-typescript
Version:
plugin for bundling TypeScript with support of modular output and declaration bundle
27 lines (22 loc) • 991 B
TypeScript
import { PluginContext } from "rollup";
import { Diagnostic, FormatDiagnosticsHost } from "typescript";
import { TypeScriptHost } from "./typescript-host";
/** Diagnostic reporting host. */
export interface ReportHost {
/**
* Report diagnostic message.
* @param diagnostic - message to report.
*/
reportDiagnostic(diagnostic: Diagnostic): void;
}
/**
* Creates reporting function that reports diagnostics errors to {@link PluginContext}.
* @param plugin - plugin context to report to.
*/
export declare function createReportDiagnosticByPlugin(plugin: PluginContext): (this: TypeScriptHost & FormatDiagnosticsHost, diagnostic: Diagnostic) => void;
/**
* Report multiple diagnostic messages via {@link ReportHost}.
* @param host - host to report into if any diagnostic message.
* @param diagnostics - array of diagnostic messages to report.
*/
export declare function reportDiagnostics(host: ReportHost, diagnostics: readonly Diagnostic[] | undefined): void;