import * as i0 from '@angular/core';
import { OnChanges, AfterViewInit, OnDestroy, EventEmitter, SimpleChanges } from '@angular/core';
declare class TdMarkdownComponent implements OnChanges, AfterViewInit, OnDestroy {
private readonly _renderer;
private readonly _elementRef;
private readonly _domSanitizer;
private readonly _ngZone;
private _content;
private _simpleLineBreaks;
private _hostedUrl;
private _anchor;
private _viewInit;
private _fileLinkExtensions;
private _anchorListener?;
/**
* .td-markdown class added to host so ::ng-deep gets scoped.
*/
class: string;
/**
* content?: string
*
* Markdown format content to be parsed as html markup.
*
* e.g. README.md content.
*/
set content(content: string);
/**
* simpleLineBreaks?: string
*
* Sets whether newline characters inside paragraphs and spans are parsed as
.
* Defaults to false.
*/
set simpleLineBreaks(simpleLineBreaks: boolean);
/**
* hostedUrl?: string
*
* If markdown contains relative paths, this is required to generate correct urls.
*
*/
set hostedUrl(hostedUrl: string);
/**
* anchor?: string
*
* Anchor to jump to.
*
*/
set anchor(anchor: string);
/**
* The file extensions to monitor for in anchor tags. If an anchor's `href` ends
* with these extensions, an event will be emitted instead of performing the default click action.
* Example values: [".ipynb", ".zip", ".docx"]
*/
set fileLinkExtensions(extensions: string[] | undefined);
/**
* Event emitted when an anchor tag with an `href` matching the specified
* fileLinkExtensions is clicked. The emitted value is the URL of the clicked anchor.
*/
fileLinkClicked: EventEmitter;
/**
* contentReady?: function
* Event emitted after the markdown content rendering is finished.
*/
contentReady: EventEmitter;
ngOnChanges(changes: SimpleChanges): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
refresh(): void;
/**
* General method to parse a string markdown into HTML Elements and load them into the container
*/
private _loadContent;
private handleAnchorClicks;
private handleFileAnchorClicks;
private _elementFromString;
private _render;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* @deprecated This module is deprecated and will be removed in future versions.
* Please migrate to using standalone components as soon as possible.
*/
declare class CovalentMarkdownModule {
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵmod: i0.ɵɵNgModuleDeclaration;
static ɵinj: i0.ɵɵInjectorDeclaration;
}
declare function removeLeadingHash(str: string): string;
declare function removeTrailingHash(str: string | null): string;
declare function genHeadingId(str: string): string;
declare function scrollToAnchor(scope: HTMLElement, anchor: string, tryParent: boolean): boolean;
declare function isAnchorLink(anchor?: HTMLAnchorElement): boolean;
declare function isFileLink(anchor: HTMLAnchorElement, fileExtensions: string[] | undefined): boolean;
declare function rawGithubHref(githubHref?: string): string;
declare function isGithubHref(href?: string): boolean;
declare function isRawGithubHref(href?: string): boolean;
declare function renderVideoElements(html: string): string;
/**
* Checks whether text contains markdown syntax patterns.
*/
declare function containsMarkdown(text: string): boolean;
/**
* Finds the index of the matching closing tag, handling nested same-name tags.
*/
declare function findClosingTagIndex(str: string, tagName: string, searchFrom: number): number;
declare class TdMarkdownLoaderService {
private _http;
private _sanitizer;
load(url: string, httpOptions?: object): Promise;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵprov: i0.ɵɵInjectableDeclaration;
}
export { CovalentMarkdownModule, TdMarkdownComponent, TdMarkdownLoaderService, containsMarkdown, findClosingTagIndex, genHeadingId, isAnchorLink, isFileLink, isGithubHref, isRawGithubHref, rawGithubHref, removeLeadingHash, removeTrailingHash, renderVideoElements, scrollToAnchor };