import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { EventEmitter, OnChanges } from '@angular/core'; import { ShowdownComponent } from './showdown.component'; /** * A angular directive to `ShowdownComponent` for make http request of markdown content. * * ### Example * * Setup as standalone * ```typescript * import { NgModule } from '@angular/core'; * import { HttpClientModule } from '@angular/common/http'; * import { ShowdownComponent, SourceDirective } from 'ngx-showdown'; * * @NgModule({ * declarations: [ ShowdownComponent, SourceDirective ], * imports: [ HttpClientModule ] * }) * export class AppModule {} * ``` * * Bind url `src` directive * ```typescript * import { Component } from '@angular/core'; * * @Component({ * selector: 'some', * template: '**Loading...** * }) * class SomeComponent { * url: string = 'https://unpkg.com/ngx-showdown/README.md'; * // ... * } * ``` * * Set static url * ```html * * ``` * * Set template reference variable * ```html * * ``` * * Listening to `error` events. * ```html * * ``` */ export declare class SourceDirective implements OnChanges { private _showdownComponent; private _http; /** * The source url of the markdown content. * * __Example :__ * * Set static url to `src` directive. * ```html * * ``` * * Bind url to `src` directive. * ```html * * * **Loading...** * ``` */ src: string; /** * On error occur. * * __Example :__ * * ```html * * **Loading...** * ``` */ error: EventEmitter; constructor(_showdownComponent: ShowdownComponent, _http: HttpClient); /** * A angular lifecycle method, Use to call to `load` method on src init/changes * @internal */ ngOnChanges(): void; /** * Load the markdown content of {@link SourceDirective#src} url to {@link ShowdownComponent#value}. * * __Example :__ * * ```html * * * * ``` * @param url - A url of markdown content to load (it will override the current url of `SourceDirective#src`) */ load(url?: string): void; }