@cisstech/nge
Version:
NG Essentials is a collection of libraries for Angular developers.
67 lines (66 loc) • 1.81 kB
TypeScript
import { NgeMonacoLoaderService } from './monaco-loader.service';
import { NgeMonacoThemeService } from './monaco-theme.service';
import * as i0 from "@angular/core";
export declare class NgeMonacoColorizerService {
private readonly loader;
private readonly theming;
constructor(loader: NgeMonacoLoaderService, theming: NgeMonacoThemeService);
colorizeElement(options: NgeMonacoColorizeOptions): Promise<void>;
private escapeHtml;
private highlightLines;
private showLineNumbers;
private lineNumbersFromString;
private addFileTab;
static ɵfac: i0.ɵɵFactoryDeclaration<NgeMonacoColorizerService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<NgeMonacoColorizerService>;
}
export interface NgeMonacoColorizeOptions {
/** Element to colorize (<code> element). */
element: HTMLElement;
/** Code to highlight */
code: string;
/** Theme to use for the syntax highlighting */
theme?: string;
/** Target language (default plaintext). */
language?: string;
/**
* Start line number or a space separated list of line numbers to show.
*
* Example:
*
* *Show all line numbers starting 1*
*
* `"1"`
*
* *Show all line numbers from 1 to 4*
*
* `"1-4"`
*
* *Show lines 2 4 5 6 7 9*
*
* `"2 4-7 9"`
*/
lines?: string | number;
/**
* A space separated list of line numbers to highlight.
*
* Example:
*
* *Highlight line 1*
*
* `"1"`
*
* *Highlight all lines from 1 to 4*
*
* `"1-4"`
*
* *Highlight lines 2 4 5 6 7 9*
*
* `"2 4-7 9"`
*/
highlights?: string | number;
/**
* Optional filename to display in the tab header.
*/
filename?: string;
}