@diplodoc/transform
Version:
A simple transformer of text in YFM (Yandex Flavored Markdown) to HTML
27 lines (26 loc) • 838 B
TypeScript
import type Token from 'markdown-it/lib/token';
import type { VideoService } from './const';
export declare type VideoToken = Token & {
service: string;
videoID: string;
};
export declare type VideoServicesOptions = {
[service in VideoService]: {
width: number | string;
height: number | string;
};
} & {
vine: {
embed: 'simple' | (string & {});
};
};
export declare type Service = {
csp?: Record<string, string[]>;
extract(url: string): string;
};
export declare type Services = Record<VideoService, Service>;
export declare type VideoFullOptions = VideoServicesOptions & {
videoUrl: VideoUrlFn;
};
export declare type VideoPluginOptions = Partial<VideoFullOptions>;
export declare type VideoUrlFn = (service: string, videoID: string, options: VideoServicesOptions) => string;