import MarkdownIt from 'markdown-it'; import { SectionDimension } from './editor/sectionUtils'; import { VanillaMirror } from './editor/vanilla-mirror'; import { EventEmittingClass } from './editor/utils'; import { StackEditorComponent } from './editor.component'; import { Section } from './editor/highlighter'; export declare class SectionDesc { section: Section; previewElt: HTMLElement; tocElt: HTMLElement; html: string; editorElt: HTMLElement; editorDimension: SectionDimension; previewDimension: SectionDimension; tocDimension: SectionDimension; previewText: string; textToPreviewDiffs: [0 | 1 | -1, string][]; ulid: string; constructor(section: Section, previewElt: HTMLElement, tocElt: HTMLElement, html: string); } export declare class Editor extends EventEmittingClass { private ngEditor; editorElt: HTMLElement; previewElt: HTMLElement; tocElt: HTMLElement; clEditor: VanillaMirror; diffMatchPatch: any; instantPreview: boolean; tokens: any; parsingCtx: any; conversionCtx: any; previewCtx: { sectionDescList: SectionDesc[]; }; previewCtxMeasured: any; previewCtxWithDiffs: any; sectionList: Section[]; selectionRange: any; converter: MarkdownIt; getOptionsListeners: any[]; initConverterListeners: any[]; sectionPreviewListeners: any[]; imageElementCache: { [key: string]: HTMLElement; }; overlay1: HTMLElement; overlay2: HTMLElement; underlay: HTMLElement; focus: "editorContentEditable" | "monaco"; /** * Pass the elements to the store and initialize the editor. */ constructor(ngEditor: StackEditorComponent, editorElt: HTMLElement, previewElt: HTMLElement, tocElt: HTMLElement); destroy(): void; onGetOptions(listener: Function): void; onInitConverter(priority: number, listener: Function): void; onSectionPreview(listener: Function): void; getOptions(properties: any, isCurrentFile?: any): any; initConverter(markdown: MarkdownIt, options: any): void; sectionPreview(elt: any, options: any, isEditor: any): void; onEditorRenderSection(s: Section): void; /** * Get an object describing the position of the scroll bar in the file. */ getScrollPosition(elt: HTMLElement): any; /** * Restore the scroll position from the current file content state. */ restoreScrollPosition(scrollPosition?: any): void; /** * Get the offset in the preview corresponding to the offset of the markdown in the editor * @unused */ getPreviewOffset(editorOffset: any, sectionDescList?: any): number; /** * Get the offset of the markdown in the editor corresponding to the offset in the preview * @unused */ getEditorOffset(previewOffset: any, sectionDescList?: any): number; /** * Get the coordinates of an offset in the preview * @unused * * ! Was used by discussions */ getPreviewOffsetCoordinates(offset?: number): { top: number; height: number; left: number; }; /** * Scroll the preview (or the editor if preview is hidden) to the specified anchor * @unused */ scrollToAnchor(anchor: string): void; /** * Initialize the cledit editor with markdown-it section parser and Prism highlighter */ initClEditor(): void; /** * Finish the conversion initiated by the section parser */ convert(): void; /** * Refresh the preview with the result of `convert()` */ refreshPreview(): Promise; /** * Refresh the stored heights of the preview * and editor elements */ refreshScrollSync: () => void; /** * Measure the height of each section in editor, preview and toc. */ measureSectionDimensions: (doDebounce?: boolean, ...params: any[]) => void; /** * Compute the diffs between editor's markdown and preview's html * asynchronously unless there is only one section to compute. */ makeTextToPreviewDiffs(): void; } //# sourceMappingURL=editor.d.ts.map