import { BehaviorSubject, Observable } from 'rxjs'; import { ChildrenLike, VirtualDOM } from '@youwol/rx-vdom'; export type CodeLanguage = 'python' | 'javascript' | 'markdown' | 'html' | 'css' | 'yaml' | 'unknown'; /** * The widget for code snippet. */ export declare class CodeSnippetView implements VirtualDOM<'div'> { static readonly cmDependencies$: Record | undefined>; static fetchCmDependencies$(language: CodeLanguage): Observable; /** * Class appended to the line DOM for highlighted lines. */ static readonly hlLineClass = "mkdocs-ts-bg-highlight"; /** * The tag of the associated HTML element. */ readonly tag = "div"; /** * The code mirror configuration. */ readonly codeMirrorConfiguration: { lineNumbers: boolean; lineWrapping: boolean; indentUnit: number; readOnly: boolean; }; /** * The class list of the associated HTML element. */ readonly class = "mkdocs-ts CodeSnippetView w-100 overflow-auto mb-3"; /** * The style of the associated HTML element. */ readonly style: { fontSize: string; }; /** * The children of the associated HTML element. */ readonly children: ChildrenLike; readonly content$: BehaviorSubject; readonly editor$: BehaviorSubject; /** * Initialize the widget. * * @param _args arguments * @param _args.language The target language. Supported languages are: * * python * * javascript * * markdown * * html * * yaml * * css * * xml * @param _args.content The snippet's content. * @param _args.highlightedLines Highlighted lines, *e.g.* `[5 10 20-25 28 30]` * @param _args.cmConfig The code mirror editor configuration, it is merged with the * {@link CodeSnippetView.codeMirrorConfiguration | default configuration} (eventually overriding attributes). */ constructor({ language, content, highlightedLines, cmConfig, }: { language: CodeLanguage; highlightedLines?: string; content: string; cmConfig?: { [k: string]: unknown; }; }); }