/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ import ts from 'typescript'; /** * Read and parse a tsconfig.json file, including expanding its file patterns * into a list of files. */ export declare function readTsConfig(tsConfigPath: string): { fileNames: string[]; options: ts.CompilerOptions; }; /** * Create a TypeScript diagnostic object for error reporting. */ export declare function createDiagnostic(file: ts.SourceFile, node: ts.Node, message: string, relatedInformation?: ts.DiagnosticRelatedInformation[]): ts.DiagnosticWithLocation; /** * Create a nice string for the given TypeScript diagnostic objects. */ export declare function stringifyDiagnostics(diagnostics: ts.Diagnostic[]): string; /** * Nicely log an error for the given TypeScript diagnostic objects. */ export declare function printDiagnostics(diagnostics: ts.Diagnostic[]): void; /** * Escape an HTML text content string such that it can be safely embedded in a * JavaScript template literal (backtick string). */ export declare function escapeTextContentToEmbedInTemplateLiteral(unescaped: string): string; /** * Parse the given string as though it were the body of a template literal * (backticks should not be included), and return its TypeScript AST node * representation. */ export declare function parseStringAsTemplateLiteral(templateLiteralBody: string): ts.TemplateLiteral;