1 | import { HttpClient } from '@angular/common/http';
|
2 | import { InjectionToken, SecurityContext, ViewContainerRef } from '@angular/core';
|
3 | import { DomSanitizer } from '@angular/platform-browser';
|
4 | import { MarkedExtension, Renderer } from 'marked';
|
5 | import { Observable } from 'rxjs';
|
6 | import { ClipboardOptions, ClipboardRenderOptions } from './clipboard-options';
|
7 | import { KatexOptions } from './katex-options';
|
8 | import { MarkedOptions } from './marked-options';
|
9 | import { MarkedRenderer } from './marked-renderer';
|
10 | import { MermaidAPI } from './mermaid-options';
|
11 | import * as i0 from "@angular/core";
|
12 | export declare const errorJoyPixelsNotLoaded = "[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information";
|
13 | export declare const errorKatexNotLoaded = "[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information";
|
14 | export declare const errorMermaidNotLoaded = "[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information";
|
15 | export declare const errorClipboardNotLoaded = "[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information";
|
16 | export declare const errorClipboardViewContainerRequired = "[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function";
|
17 | export declare const errorSrcWithoutHttpClient = "[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information";
|
18 | export declare const SECURITY_CONTEXT: InjectionToken<SecurityContext>;
|
19 | export interface ParseOptions {
|
20 | decodeHtml?: boolean;
|
21 | inline?: boolean;
|
22 | emoji?: boolean;
|
23 | mermaid?: boolean;
|
24 | markedOptions?: MarkedOptions;
|
25 | disableSanitizer?: boolean;
|
26 | }
|
27 | export interface RenderOptions {
|
28 | clipboard?: boolean;
|
29 | clipboardOptions?: ClipboardRenderOptions;
|
30 | katex?: boolean;
|
31 | katexOptions?: KatexOptions;
|
32 | mermaid?: boolean;
|
33 | mermaidOptions?: MermaidAPI.Config;
|
34 | }
|
35 | export declare class ExtendedRenderer extends Renderer {
|
36 | ɵNgxMarkdownRendererExtendedForExtensions: boolean;
|
37 | ɵNgxMarkdownRendererExtendedForMermaid: boolean;
|
38 | }
|
39 | export declare class MarkdownService {
|
40 | private clipboardOptions;
|
41 | private extensions;
|
42 | private platform;
|
43 | private securityContext;
|
44 | private http;
|
45 | private sanitizer;
|
46 | private readonly DEFAULT_MARKED_OPTIONS;
|
47 | private readonly DEFAULT_KATEX_OPTIONS;
|
48 | private readonly DEFAULT_MERMAID_OPTIONS;
|
49 | private readonly DEFAULT_CLIPBOARD_OPTIONS;
|
50 | private readonly DEFAULT_PARSE_OPTIONS;
|
51 | private readonly DEFAULT_RENDER_OPTIONS;
|
52 | private _options;
|
53 | get options(): MarkedOptions;
|
54 | set options(value: MarkedOptions | undefined);
|
55 | get renderer(): MarkedRenderer;
|
56 | set renderer(value: MarkedRenderer);
|
57 | private readonly _reload$;
|
58 | readonly reload$: Observable<void>;
|
59 | constructor(clipboardOptions: ClipboardOptions, extensions: MarkedExtension[], options: MarkedOptions, platform: Object, securityContext: SecurityContext, http: HttpClient, sanitizer: DomSanitizer);
|
60 | parse(markdown: string, parseOptions?: ParseOptions): string | Promise<string>;
|
61 | render(element: HTMLElement, options?: RenderOptions, viewContainerRef?: ViewContainerRef): void;
|
62 | reload(): void;
|
63 | getSource(src: string): Observable<string>;
|
64 | highlight(element?: Element | Document): void;
|
65 | private decodeHtml;
|
66 | private extendsRendererForExtensions;
|
67 | private extendsRendererForMermaid;
|
68 | private handleExtension;
|
69 | private parseMarked;
|
70 | private parseEmoji;
|
71 | private renderKatex;
|
72 | private renderClipboard;
|
73 | private renderMermaid;
|
74 | private trimIndentation;
|
75 | static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownService, [{ optional: true; }, { optional: true; }, { optional: true; }, null, null, { optional: true; }, null]>;
|
76 | static ɵprov: i0.ɵɵInjectableDeclaration<MarkdownService>;
|
77 | }
|