import { Node } from 'unist'; import unified from 'unified'; import { NoteLinkDefinition, Resource, ResourceParser } from '../model/note'; import { Position } from '../model/position'; import { URI } from '../model/uri'; import { ICache } from '../utils/cache'; export interface ParserPlugin { name?: string; visit?: (node: Node, note: Resource, noteSource: string) => void; onDidInitializeParser?: (parser: unified.Processor) => void; onWillParseMarkdown?: (markdown: string) => string; onWillVisitTree?: (tree: Node, note: Resource) => void; onDidVisitTree?: (tree: Node, note: Resource) => void; onDidFindProperties?: (properties: any, note: Resource, node: Node) => void; } type Checksum = string; export interface ParserCacheEntry { checksum: Checksum; resource: Resource; } /** * This caches the parsed markdown for a given URI. * * The URI identifies the resource that needs to be parsed, * the checksum identifies the text that needs to be parsed. * * If the URI and the Checksum have not changed, the cached resource is returned. */ export type ParserCache = ICache; export declare function getLinkDefinitions(markdown: string): NoteLinkDefinition[]; export declare function createMarkdownParser(extraPlugins?: ParserPlugin[], cache?: ParserCache): ResourceParser; export declare const getBlockFor: (markdown: string, line: number | Position) => { block: string; nLines: number; }; export {}; //# sourceMappingURL=markdown-parser.d.ts.map