UNPKG

dt-app

Version:

The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.

88 lines (87 loc) 3.03 kB
export declare enum Colors { green = "green", purple = "purple", blue = "blue", limeGreen = "limeGreen", white = "white", gray = "gray" } /** Palette of colors that are used by layout functions */ export declare const colors: { [key: string]: string; }; /** Prints bold and green string with a trailing new line */ export declare function h1(text: string, noColor?: boolean): void; /** Prints green string with a trailing new line */ export declare function h2(text: string, noColor?: boolean): void; /** Prints frame that indicates end or start of the command with a trailing new line */ export declare function frame(noColor?: boolean): void; /** * Prints string that can be one of the {@link Colors} default without a new line at the end * @param {string} text - The text to print * @param {Colors} color - The color to use for printing */ export declare function span(text: string, color?: Colors, noColor?: boolean): void; /** * Prints string that can be one of the {@link Colors} default without a new line at the end * @param {string} text - The text to print * @param {Colors} color - The color to use for printing */ export declare function p(text: string, color?: Colors, noColor?: boolean): void; /** Returns colored text that will be printed out by span (without a new line at the end) or p (with a trailing new line) */ export declare function coloredText(text: string, color?: Colors): string; /** Prints blue line separator with a trailing new line */ export declare function lineSeparator(noColor?: boolean): void; /** Prints new line */ export declare function newLine(): void; export interface TreeNode { name: string; items?: TreeNode[]; } interface TreeData { items: TreeNode[]; } /** * @param node The tree data to visualize. * @param prefix Internal parameter used for recursion * @returns Prints string showing the tree structure with clickable file paths in the console * @internal prefix parameter is used internally for recursion * @example * const data = { * items: [ * { * name: 'src', * items: [ * { name: 'index.js' }, * { * name: 'utils', * items: [ * { name: span('helper.js', Colors.green) } * ] * } * ] * }, * { * name: 'package.json' * } * ] * }; * * const result = printFileTreeInConsole(data); * // Output: * // ├─ src * // │ ├─ index.js * // │ └─ utils * // │ └─ helper.js <= this will be green * // └─ package.json */ export declare function printFileTreeInConsole(node: TreeData, prefix?: string): void; /** * Prints empty new line */ export declare function emptyNewLine(): void; /** * Takes array of paths and transform it in a treeData structure that can be used by tree output helper */ export declare function buildTreeFromPaths(paths: string[], localUrls: Record<string, string>, fileUrls: Record<string, string>, printEnvUrl?: boolean): TreeData; export {};