|
| 1 | +import { HLJSApi, HighlightOptions } from 'highlight.js'; |
| 2 | +export default class HTMLCodeBlockElement extends HTMLElement { |
| 3 | + #private; |
| 4 | + /** |
| 5 | + * A library for performing syntax highlighting. |
| 6 | + * Before running `customElements.define()`, |
| 7 | + * you need to assign it directly to `HTMLCodeBlockElement.endgine`. |
| 8 | + * Currently, only highlight.js is assumed. |
| 9 | + */ |
| 10 | + static endgine: HLJSApi; |
| 11 | + /** |
| 12 | + * Returns the result of highlighting the received source code string. |
| 13 | + * @param src - Source code string for highlight |
| 14 | + * @param options - Option for library of highlight |
| 15 | + * @returns - Object of the highlight result |
| 16 | + */ |
| 17 | + static highlight(src: string, options: HighlightOptions): import("highlight.js").HighlightResult; |
| 18 | + /** @returns - Syntax Highlighted Source Code */ |
| 19 | + get value(): string; |
| 20 | + set value(src: string); |
| 21 | + /** |
| 22 | + * The name of code block |
| 23 | + * @returns - The value of the label attribute |
| 24 | + */ |
| 25 | + get label(): string; |
| 26 | + set label(name: string); |
| 27 | + /** |
| 28 | + * Language Mode |
| 29 | + * @returns - The value of the language attribute |
| 30 | + */ |
| 31 | + get language(): string; |
| 32 | + set language(name: string); |
| 33 | + /** |
| 34 | + * Flag to display the UI |
| 35 | + * @returns - With or without controls attribute |
| 36 | + * */ |
| 37 | + get controls(): boolean; |
| 38 | + set controls(flag: boolean); |
| 39 | + static get observedAttributes(): string[]; |
| 40 | + attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void; |
| 41 | + connectedCallback(): void; |
| 42 | + constructor(); |
| 43 | +} |
0 commit comments