@formant/ava-react
Version:
React components of AVA.
33 lines (32 loc) • 1.69 kB
TypeScript
import { PluginManager } from '../plugin';
import { ImageExtra } from './helpers/transformHtml';
import type { NarrativeTextSpec, SectionSpec, ParagraphSpec, BulletItemSpec, PhraseSpec } from '@formant/ava';
export declare class TextExporter extends PluginManager {
/**
* Export your text schema as pure text.
* @param {NarrativeTextSpec} spec - the narrative text schema you want to export
* @returns
*/
getNarrativeText(spec: NarrativeTextSpec): string;
getSectionText(spec: SectionSpec): string;
getParagraphText(spec: ParagraphSpec): string;
getBulletsText(spec: BulletItemSpec, level?: number): string;
getPhrasesText(spec: PhraseSpec[]): string;
/**
* Export your text schema as Markdown.
* @param {NarrativeTextSpec} spec - the narrative text schema you want to export
* @returns
*/
getNarrativeMarkdown(spec: NarrativeTextSpec): string;
getSectionMarkdown(spec: SectionSpec): string;
getParagraphMarkdown(spec: ParagraphSpec): string;
getBulletsMarkdown(spec: BulletItemSpec, level?: number): string;
getPhrasesMarkdown(spec: PhraseSpec[]): string;
/**
* get html string of narrative-vis content in container, the svg and canvas elements are converted to image by default
* @param container the container of narrative-vis content
* @param imageExtra the jump link to add to the image element
* @param replaceType replace the svg and canvas elements with image or text, so that they can be copied and pasted into some rich-text editors
*/
getNarrativeHtml(container: HTMLElement, imageExtra?: ImageExtra, replaceType?: 'image' | 'text' | 'none'): Promise<string>;
}