@diplodoc/transform
Version:
A simple transformer of text in YFM (Yandex Flavored Markdown) to HTML
27 lines (26 loc) • 832 B
TypeScript
import type Token from 'markdown-it/lib/token';
import type { Logger } from 'src/transform/log';
import type { CacheContext, StateCore } from '../../typings';
import type { MarkdownItPluginCb, MarkdownItPluginOpts } from '../typings';
declare type Options = {
hash: string | null;
file: string;
state: StateCore;
opts: object;
isEmptyLink: boolean;
tokens: Token[];
idx: number;
nextToken: Token;
href: string;
currentPath: string;
log: Logger;
cache?: CacheContext;
};
interface ProcOpts extends MarkdownItPluginOpts {
transformLink: (v: string) => string;
notFoundCb: (v: string) => void;
needSkipLinkFn: (v: string) => boolean;
getPublicPath: (options: ProcOpts, v?: string) => string;
}
declare const index: MarkdownItPluginCb<ProcOpts & Options>;
export = index;