UNPKG

2.39 kBTypeScriptView Raw
1import * as log4js from 'log4js';
2import * as ts from 'typescript';
3/**
4 * Name of the logger for diagnostics information
5 */
6export declare const DIAGNOSTICS = "diagnostics";
7/**
8 * Diagnostic code for JSII-generated messages.
9 */
10export declare const JSII_DIAGNOSTICS_CODE = 9999;
11/**
12 * Obtains the relevant logger to be used for a given diagnostic message.
13 *
14 * @param logger the ``log4js.Logger`` to use for emitting the message.
15 * @param diagnostic the message for which a logger is requested.
16 *
17 * @returns a logger method of the ``logger`` for the appropriate level.
18 */
19export declare function diagnosticsLogger(logger: log4js.Logger, diagnostic: ts.Diagnostic): ((message: any, ...args: any[]) => void) | undefined;
20/**
21 * Formats a diagnostic message with color and context, if possible.
22 *
23 * @param diagnostic the diagnostic message ot be formatted.
24 * @param projectRoot the root of the TypeScript project.
25 *
26 * @returns a formatted string.
27 */
28export declare function formatDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string): string;
29/**
30 * Formats a diagnostic message with color and context, if possible. Users
31 * should use `formatDiagnostic` instead, as this implementation is intended for
32 * internal usafe only.
33 *
34 * @param diagnostic the diagnostic message ot be formatted.
35 * @param projectRoot the root of the TypeScript project.
36 *
37 * @returns a formatted string.
38 */
39export declare function _formatDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string): string;
40export declare function logDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string): void;
41/**
42 * Parses a string-formatted person entry from `package.json`.
43 * @param value the string-formatted person entry.
44 *
45 * @example
46 * parsePerson("Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)");
47 * // => { name: "Barney Rubble", email: "b@rubble.com", url: "http://barnyrubble.tumblr.com/" }
48 */
49export declare function parsePerson(value: string): {
50 name: string;
51 email?: string | undefined;
52 url?: string | undefined;
53};
54export declare function parseRepository(value: string): {
55 url: string;
56};
57export declare function stripAnsi(x: string): string;
58/**
59 * Maps the provided type to stip all `readonly` modifiers from its properties.
60 */
61export type Mutable<T> = {
62 -readonly [K in keyof T]: Mutable<T[K]>;
63};
64//# sourceMappingURL=utils.d.ts.map
\No newline at end of file